efficient-web-builder 66.0.0 → 67.0.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 +16 -0
- package/dist/editor/components/MediaUploadField.js +1 -1
- package/dist/editor/components/PartSettingsPanel.js +1 -1
- package/dist/editor/components/PartTextBox.js +1 -1
- package/dist/editor/components/PreviewPartAnchors.js +1 -1
- package/dist/editor/components/SectionWidthRows.d.ts +3 -1
- package/dist/editor/components/SectionWidthRows.js +1 -1
- package/dist/editor/components/SiteTextStylesField.js +1 -1
- package/dist/editor/lib/animation/hover-fields.d.ts +1 -1
- package/dist/editor/lib/animation/hover-fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Divider/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/HeroGroup/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/ImageBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/IntroBleed/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/PostCard/fields.js +1 -1
- package/dist/editor/lib/document/blocks/hero-shared-fields.js +1 -1
- package/dist/editor/lib/document/box-fields.d.ts +1 -1
- package/dist/editor/lib/document/controls.d.ts +20 -2
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/section-own-width-fields.js +1 -1
- package/dist/format/lib/animation/views.js +1 -1
- package/dist/format/lib/content/borders.d.ts +12 -2
- package/dist/format/lib/content/borders.js +1 -1
- package/dist/format/lib/content/card-corners.d.ts +3 -1
- package/dist/format/lib/content/card-corners.js +1 -1
- package/dist/format/lib/content/css-length.d.ts +6 -0
- package/dist/format/lib/content/css-length.js +1 -1
- package/dist/format/lib/content/image-corners.d.ts +3 -1
- package/dist/format/lib/content/image-corners.js +1 -1
- package/dist/format/lib/content/section-corners.d.ts +3 -1
- package/dist/format/lib/content/section-corners.js +1 -1
- package/dist/format/lib/content/section-sticky.d.ts +5 -0
- package/dist/format/lib/content/section-sticky.js +1 -1
- package/dist/format/lib/content/section-type-size.d.ts +12 -1
- package/dist/format/lib/content/section-type-size.js +1 -1
- package/dist/format/lib/content/section-width.d.ts +8 -0
- package/dist/format/lib/content/section-width.js +1 -1
- package/dist/format/lib/content/view-tier.d.ts +10 -0
- package/dist/format/lib/content/view-tier.js +1 -0
- package/dist/format/lib/post-card-layout.d.ts +3 -0
- package/dist/format/lib/post-card-layout.js +1 -1
- package/dist/format/lib/sections/divider-style.d.ts +9 -0
- package/dist/format/lib/sections/divider-style.js +1 -1
- package/dist/format/lib/sections/hero-single-to-hero.js +1 -1
- package/dist/format/lib/source-rules/one-length-control.js +3 -3
- package/dist/format/lib/theme.d.ts +1 -1
- package/dist/format/lib/theme.js +4 -4
- package/dist/render/components/Divider.d.ts +3 -1
- package/dist/render/components/Divider.js +1 -1
- package/dist/render/components/Flex.d.ts +3 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/HeroGroup.d.ts +3 -1
- package/dist/render/components/HeroGroup.js +1 -1
- package/dist/render/components/ImageBlock.d.ts +2 -1
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/components/IntroBleed.d.ts +3 -2
- package/dist/render/components/IntroBleed.js +1 -1
- package/dist/render/components/PictureHoverMove.d.ts +18 -0
- package/dist/render/components/PictureHoverMove.js +1 -0
- package/dist/render/components/PictureWash.d.ts +2 -1
- package/dist/render/components/PictureWash.js +1 -1
- package/dist/render/lib/content/block-size.js +1 -1
- package/dist/render/lib/content/button-look.js +1 -1
- package/dist/render/lib/content/section-padding.js +1 -1
- package/dist/render/lib/document/blocks/general/Divider/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
- package/dist/render/lib/document/blocks/general/HeroGroup/render.js +1 -1
- package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/general/IntroBleed/render.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-editorial.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-head.js +1 -1
- package/dist/render/lib/document/part-styles.d.ts +13 -0
- package/dist/render/lib/document/part-styles.js +2 -2
- package/dist/render/lib/document/passes/borders.js +1 -1
- package/dist/render/lib/document/passes/corners.js +1 -1
- package/dist/render/lib/document/passes/section-width.js +1 -1
- package/dist/render/lib/sections/section-to-box.js +1 -1
- package/dist/render/lib/text-styles/site-text-styles.js +2 -2
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 67.0.0 - 2026-11-10
|
|
4
|
+
|
|
5
|
+
From main at `25036624`: #689, #691, #675, #692, #690. A MAJOR: #690 has `!` (narrowed peers). Peers move: `efficient-easel` `^33.0.0` -> `^34.1.0`, `efficient-shell` `^12.30.0` -> `^12.33.0` (#690). No export is removed. No stored key changes; no stored page needs a data move.
|
|
6
|
+
|
|
7
|
+
**BREAKING (#690):** the peers `efficient-easel` `^34.1.0` (was `^33.0.0`) and `efficient-shell` `^12.33.0` (was `^12.30.0`). A setting's key in one view is now spelled by easel's `viewKeyAt(key, tier)` everywhere in web-builder (28 lines that chose the key by hand or called the deprecated `unitKeyAt`). The `ALIGN_KEY_OF_TIER` table in `PartSettingsPanel` is gone (it was not exported). Stored key strings do not change.
|
|
8
|
+
|
|
9
|
+
- **#689:** Collections is a host-row press type. It leaves `HEAD_ONLY_TYPES` and joins `HOST_ROW_HEAD_TYPES` and `HOST_PRESS_TYPES`; the builder registers no row for it, the host does. With no host row, a press is today's insert, node for node.
|
|
10
|
+
- **#691:** a Box that draws a picture takes the picture hover that an Image part has: Zoom and Darken on hover. New module `components/PictureHoverMove` (`PictureHoverMoveDrawn`, `pictureHoverMoveOf`, `PictureHoverMoveSheet`, `PictureHoverZoom`), now the one drawing of the hover for `ImageBlock` and the Box. `pictureHoverFields` gets an optional third parameter `moves`; `PictureWash` gets an optional `restClassName`. A Box with no hover key draws the same bytes as before.
|
|
11
|
+
- **#675:** more web-builder length rows take their kind from easel's one unit table: a unit menu inside the number box where the kind has more than one unit (Divider Thickness and Length, HeroGroup Width and Nudge, Corners, Section Border, Stick to top distance, Section Content width, Scroll-Over Text font sizes, Part text box Font size, Paragraph spacing and Padding). Each stores `<key>Unit` per view; a number with no unit key draws the same CSS as before. New exports and optional parameters only.
|
|
12
|
+
- **#692:** the Gallery (`GalleryB`) is a host-row press type, the same move as #689. Stored Gallery nodes keep today's tile.
|
|
13
|
+
|
|
14
|
+
### For hosts
|
|
15
|
+
|
|
16
|
+
1. Raise `efficient-easel` to `^34.1.0` and `efficient-shell` to `^12.33.0` (#690). Nothing else changes in web-builder imports.
|
|
17
|
+
2. storefront-blocks: register the Collections row (#689) and the GalleryB row (#692) when it takes the host-row presses; until then a press inserts as today.
|
|
18
|
+
|
|
3
19
|
## 66.0.0 - 2026-11-10
|
|
4
20
|
|
|
5
21
|
From main at `a7a035c9`: #668, #673, #674, #676, #669, #678, #677, #679, #680, #681, #682, #432, #683, #685, #684, #687, #686. A MAJOR: #668, #674, #677, #679, #682, #684, #685 and #686 have `!` (removed exports, removed props, narrowed peers). Peers move: `efficient-easel` `^30.1.0` -> `^33.0.0` (#668 to `^31.3.0`, then #682), `efficient-shell` `^12.22.0` -> `^12.30.0` (#682). One stored key is moved on read: the Locations Map's `source` (#679). No stored page needs a data move.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import{SettingsDefaultReset as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import{SettingsDefaultReset as O,SettingsField as v}from"efficient-easel/panel";import{useSelectedHost as A}from"efficient-easel/easel";import{FOCAL_DEFAULT as B}from"efficient-shell/format";import{ImageIcon as b,PlayIcon as C}from"efficient-easel/icons";import{ImageFocusPoint as H,MediaUploadField as M}from"efficient-shell/ui";import{useContext as T}from"react";import{ScreenDocumentContext as L}from"efficient-easel/screen/components/ScreenDocumentContext";import{editorEaselWords as R,say as m}from"../../format/lib/editor-words.js";import{tabletKey as _,viewKeyAt as j}from"efficient-easel/draw";import{PHONE_CLEAR as N}from"../../format/lib/document/phone-override.js";import{usePreviewDevice as W}from"efficient-easel/draw/client";import{focusPoint as P}from"../../format/lib/content/phone-focus.js";import{shownTier as S}from"efficient-easel/screen/lib/document/device-fields";import{onDesktopWords as q}from"efficient-easel/screen/lib/document/box-fields";import{requestMediaPick as z}from"efficient-easel/screen/lib/media-picker";import{useEaselHost as G}from"efficient-easel/screen/lib/host";import{mediaValueSrc as J}from"../../format/lib/media-value.js";import{useSelectedPatch as Q}from"../lib/document/controls.js";import{backendOf as X}from"../lib/website-session.js";import{useEaselSession as Y}from"efficient-easel/screen/lib/session-context";function Z(i,o,r,l=!0){const n=S(r),s=typeof i[o]=="string"&&i[o]?String(i[o]):B;if(n==="desktop")return{ownView:!1,followed:s,followsView:"desktop",own:void 0,focus:s,key:o};const a=j(o,n),d=P(i[a])??void 0,p=n==="mobile"&&l?P(i[_(o)])??void 0:void 0,w=p??s;return{ownView:!0,followed:w,followsView:p?"tablet":"desktop",own:d,focus:d??w,key:a}}function $(i,o,r){const l=A();if(!o||!l)return null;const n=l.values??{};if(r&&!r(n,S(i)))return null;const s=Z(n,o,i,r?r(n,"tablet"):!0),a=l.onChange;return{...s,set:d=>a(s.key,d),clear:()=>a(s.key,N)}}function K({value:i,onChange:o,label:r,accept:l,placeholder:n,focusKey:s,focusWhen:a,frameKey:d,fieldKey:p}){const w=G(),y=Y(),h=m(r),E=W(),f=l.startsWith("video"),t=$(E,f?void 0:s,a),F=!!s&&S(E)!=="desktop",x=T(L),V=Q(),u=d&&p?{video:p,frame:d}:null,D=c=>z(w,{accept:l,title:h,...c?{file:c}:{}}).then(k=>!k||!u?k?.url??null:(V({[u.video]:k.url,[u.frame]:k.posterUrl??""}),null)),I=u?c=>c?o(c):V({[u.video]:"",[u.frame]:""}):o,g=J(i);if(F&&(!t||!g))return null;if(x&&!x.capabilities.mediaEditing)return e(v,{label:h,icon:f?e(C,{}):e(b,{}),children:e("div",{className:"sf-image-slot-inert",children:f?m("Templates don’t store videos — this slot stays a placeholder. Each website picks its own after it’s created."):m("Templates don’t store images — this slot stays a placeholder. Each website picks its own after it’s created.")})});const U=t?.ownView&&g?e(O,{words:R()?.panel,label:m("Image focus"),changed:!!t.own,detail:q(c=>m(c),t.followed,t.followsView),onReset:t.clear}):void 0;return F&&t?e(v,{label:h,icon:e(b,{}),action:U,children:e("div",{style:{flex:"1 1 auto",minWidth:0},children:e(H,{value:t.focus,onChange:t.set,label:m("Image focus"),image:g,hint:null})})}):e(v,{label:h,icon:f?e(C,{}):e(b,{}),children:e("div",{style:{flex:"1 1 auto",minWidth:0},children:e(M,{value:g,onChange:I,onPick:D,accept:f?"video/*":"image/*",kind:f?"video":"image",placeholder:n===void 0?void 0:m(n),maxSizeBytes:X(y).media.maxUploadBytes,...t?{focus:t.focus,onFocusChange:t.set}:{}})})})}export{K as default,Z as viewFocusOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as o,Fragment as W,jsxs as h}from"react/jsx-runtime";import{useContext as wt,useEffect as pe,useRef as Pt,useState as Ve}from"react";import{FieldSelect as vt,InspectorField as Tt,fieldShownInView as Nt}from"efficient-easel/fields";import{InertHint as Be,SettingsField as Ot}from"efficient-easel/panel";import{InspectorUpLevel as X}from"efficient-easel/chrome";import{StylesIcon as Rt,TypeIcon as kt}from"efficient-easel/icons";import{useEasel as Ct}from"efficient-easel/easel";import{TextPartPanel as He}from"efficient-easel/copy";import{Button as Et,IconButton as It,Tooltip as Ft}from"efficient-shell/ui";import{PartTextBox as zt,partTextCells as Ue}from"./PartTextBox.js";import{SiteFields as me}from"./SiteFields.js";import{usePartMotion as _t}from"./usePartMotion.js";import{UiIcon as We}from"efficient-easel/draw/client";import{usePreviewHeader as At}from"../../render/components/PreviewHeaderContext.js";import{UpdateStyleDialog as Lt}from"./UpdateStyleDialog.js";import{ScreenDocumentContext as Vt}from"efficient-easel/screen/components/ScreenDocumentContext";import{hasStyleChange as Bt,partStyleToTextStyleValues as Ht,pushIntoStyle as Ut,resolveTextStyles as je,styleIdOfRole as Wt}from"../../render/lib/text-styles/site-text-styles.js";import{useSiteTextStylesWriter as jt}from"../lib/site-text-styles-writer.js";import{useThemeRowPersist as Dt}from"../lib/theme-row-persist.js";import{usePreviewDevice as Gt}from"efficient-easel/draw/client";import{shownTier as q}from"efficient-easel/screen/lib/document/device-fields";import{PART_PANEL_ROWS as De,partRowHasTabletValue as Kt}from"../lib/document/part-panel-rows.js";import{usePartStyle as Mt}from"./PreviewPartStyleContext.js";import{say as l}from"../../format/lib/editor-words.js";import{readHidable as J,textFieldOffPage as $t,textFieldPanelOnly as Yt}from"../lib/document/controls.js";import{TEXT_FIELD_MARKER as Xt}from"efficient-easel/draw";import{useSectionOps as qt}from"efficient-easel/screen/lib/document/use-section-ops";import{FONT_OPTIONS as Jt,FONT_ROLES as Qt,FONT_ROLE_LABELS as Ge,fontOption as ye,fontRoleOf as Zt}from"../../format/lib/fonts.js";import{isMultilineKind as en,partPlaceholder as tn,typeInPlaceKind as nn}from"../../render/lib/document/part-text.js";import{partRowField as on}from"../lib/document/part-row-field.js";import{decodePartKey as ln,partPropsWithRowValue as sn,partRowValue as rn}from"../../render/lib/document/part-rows.js";import{followedStyleOf as Ke,partAlignFollowed as an,propsWithPartStyleValue as B,propsWithoutPartStyle as cn,readPartStyle as he,regionHasOwnLook as dn}from"../../render/lib/document/part-styles.js";import{partThemeColors as un}from"../../format/lib/document/part-inks.js";import{styleKeyForPart as Me}from"../../format/lib/sections/section-text-kinds.js";import{commitPartText as fn}from"../lib/document/part-typing.js";import{keysOnCanvas as pn,useCanvasTypingPart as mn}from"../lib/document/canvas-typing.js";import{useEaselHost as yn}from"efficient-easel/screen/lib/host";import{SOURCE_LINES as hn,SOURCE_ACTIONS as Sn,SOURCE_ACTION_LABEL as gn,partSourceNoteFor as xn,partSourceOf as bn,sourceMenuIdOf as wn,sourceSlugOf as Se}from"../../format/lib/document/source-bound-parts.js";import{encodePartId as Pn,holdsAuthoredText as vn}from"../../render/lib/document/text-parts.js";import{regionsForSection as Tn}from"../../format/lib/sections/section-text-regions.js";import{regionTakesSize as Nn,textRegionOfPartKey as On}from"../../format/lib/sections/text-regions.js";import{SameInEveryViewNote as $e}from"./SameInEveryViewNote.js";function ge(t){return t?l(t):null}function Ye(t){return t.kind==="role"?Ge[t.role]:t.kind==="custom"?"Custom":null}function Rn(t){const n=Zt(t.role);return n?{kind:"role",role:n}:null}function kn(t,n){if(!t)return{kind:"unread"};const{faceRole:r,base:i}=t;if(n[r]===i.fontKey)return{kind:"role",role:r};const a=Object.keys(n).filter(s=>n[s]===i.fontKey);return a.length===1?{kind:"role",role:a[0]}:{kind:"custom"}}function Q(t,n,r,i){return Rn(he(t,n))??kn(r,i)}function Cn(t,n){if(!t.length)return null;const r=n(t[0]);return t.every(i=>n(i)===r)?r:null}function Xe(t){return[{value:j,label:l("No style"),description:l("Section’s own")},...t.map(n=>({value:n.id,label:n.name,description:n.values.font?ye(n.values.font)?.label:void 0}))]}const j="";function En({face:t,base:n,onPick:r}){const i=t.kind==="role"?t.role:j,a=[{label:l("No style"),value:j},...Qt.map(s=>({label:l(Ge[s]),value:s}))];return o(vt,{ariaLabel:l("Style"),value:i,options:a,inline:!0,onChange:s=>r(s===j?null:s),renderOption:s=>s.value===j?h(W,{children:[o("span",{className:"es-fsel-label sf-part-style-keep",children:s.label}),o("span",{className:"sf-part-style-aside","aria-hidden":"true",children:l("Section’s own")})]}):o("span",{className:"es-fsel-label",style:{fontFamily:`var(--font-role-${s.value})`},children:s.label}),renderValue:()=>o("span",{style:{fontFamily:n?.fontKey?`var(${ye(n.fontKey)?.cssVar})`:void 0,fontWeight:n?.weight},children:ge(Ye(t))}),valueText:s=>ge(Ye(t))??s?.label??""})}const qe=["regionNote","regionStyle"],In=Object.keys(De).filter(t=>!qe.includes(t));function Je(t,n){return!t.some(n)}function Fn({sectionName:t,onBack:n,textEditor:r,styleRow:i,children:a,tabs:s}){const g=h(W,{children:[r,i,a]});return h("div",{className:"sf-part-panel",children:[o(X,{inline:!0,name:l(t),onSelect:n}),s?s(g):g]})}function Qe({source:t,slug:n,menuId:r}){const i=yn(),a=Sn[t],s=!a.needsSlug||!!n;return o("div",{className:"sf-note sf-note--source",children:h(Be,{children:[l(hn[t]),s?h(W,{children:[" ",o(Et,{type:"button",variant:"link",size:"sm",onClick:()=>{a.type==="storefront-editor:open-menus"?i.send(a.type,{menuId:r??null}):n&&i.send(a.type,{slug:n})},children:l(gn)})]}):null]})})}const Ze=4,zn=120;function et(t){return l("Every {part} in this section follows it. The face and the size change; the letter case is the section’s own and stays as it is.",{part:l(t.label).toLowerCase()})}function tt({region:t,sizePx:n,face:r,base:i,onFollowStyle:a,source:s,slug:g,onBack:N,shows:x,sizedStyle:b,ownLook:I}){const D=t.follows;return h("div",{className:"sf-note",children:[o("p",{children:o("strong",{children:l(t.label)})}),x("regionNote")&&!I&&o("p",{children:n?l("Its size follows Styles ▸ {follows} — {px}px right now.",{follows:l(D),px:Math.round(n)}):l("Its size follows Styles ▸ {follows}.",{follows:l(D)})}),b?h(W,{children:[b,x("regionStyle")&&o("p",{className:"es-field-hint",children:et(t)})]}):a?x("regionStyle")?o(W,{children:o(Ot,{label:l("Style"),icon:o(Rt,{}),hint:et(t),children:o(En,{face:r,base:i,onPick:a})})}):null:x("regionNote")&&o("p",{className:"es-field-hint",children:l("Only the size follows a site style. This section sets its own font, weight and letter case.")}),s&&x("sourceNote")?o(Qe,{source:s,slug:g}):null,Je([...qe,"sourceNote",...b?["fontSize"]:[]],F=>x(F)&&(F!=="sourceNote"||!!s))&&o($e,{}),o(X,{inline:!0,name:l("Page"),onSelect:N})]})}function _n({onBack:t}){return h("div",{className:"sf-note",children:[o("p",{children:o("strong",{children:l("This part is no longer here.")})}),o("p",{children:l("The section it belonged to has been changed or removed.")}),o(X,{inline:!0,name:l("Page"),onSelect:t})]})}function An({onBack:t,partId:n,why:r}){return h("div",{className:"sf-note",children:[o("p",{children:o("strong",{children:l("This part's settings did not open.")})}),o("p",{children:l("The words are still on your page and nothing has been lost. The editor could not work out which control belongs to them, which is a fault on our side. Go back and click the section to open its settings instead.")}),o("p",{className:"sf-note-detail",children:h("code",{children:[n," — ",r]})}),o(X,{inline:!0,name:l("Page"),onSelect:t})]})}function Ln({nodeId:t,propKey:n,onBack:r,onEditStyle:i}){const{getItemById:a,getSelectorForId:s,config:g}=Ct(e=>e),N=qt(),x=mn(),{partStyle:b}=Mt(),{fonts:I,textStyles:D}=At(),F=wt(Vt),xe=!F?.capabilities?.hasSiteTheme,{persist:ot}=Dt({themeFromDocument:xe,tokenRef:F?.tokenRef,siteId:F?.siteId??null}),O=jt({themeFromDocument:xe,persist:ot}),[lt,Z]=Ve(!1),H=Gt(),f=e=>(q(H)!=="tablet"||Kt(e))&&Nt(De[e],H),be=Pt(null),d=a(t),p=s(t),we=d?g.components[d.type]:void 0,{key:w,row:P}=ln(n),Pe=we?.fields?.[w],S=P?on(Pe,P):Pe,z=Pn(t,n),u=d?.props??{},v=nn(S),ve=$t(S),Te=vn(S),Ne=d?bn(d.type):null,ee=d?xn(d.type,w):null,te=P?rn(u[w],P):u[w],Oe=!!P&&!(Array.isArray(u[w])&&P.index<u[w].length);pe(()=>{if(pn(document))return;be.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[z]);const[ne,Re]=Ve(0);pe(()=>Re(0),[z]);const oe=!!d&&!Oe&&(!p||!S);pe(()=>{if(!oe||ne>=Ze)return;const e=setTimeout(()=>Re(c=>c+1),zn);return()=>clearTimeout(e)},[oe,ne]);const st=oe&&ne<Ze,le=_t(t,Me(d?.type,n),"textPart");if(!d||Oe)return o(_n,{onBack:r});const G=Tn(d.type),ke=G?On(G,n):null;if(G&&ke){const e=b?.partId===z?b:null,c=G[ke],m=c.writable===!0&&!!p,T=C=>{p&&N.replaceComponent(p.zone,p.index,{...d,props:B(u,n,"role",C)})};if(m&&Nn(c)){const C=he(u,n),Le=E=>{if(!p)return;let fe=u;for(const[xt,bt]of Object.entries(E))fe=B(fe,n,xt,bt??null);N.replaceComponent(p.zone,p.index,{...d,props:fe})},ht=je(O.saved,O.old),St=Ke(C)??"",gt=Ue(C,e?.base??nt,Le,q(H)).filter(E=>E.key==="fontSize"&&f(E.key));return o(me,{motion:le,body:o(tt,{region:c,sizePx:e?.base.sizePx??null,face:Q(u,n,e,I),base:e?.base??null,source:Ne,slug:Se(u),onBack:r,shows:f,ownLook:dn(C),sizedStyle:o(He,{style:f("style")?{value:St,options:Xe(ht),onChange:E=>Le(E?{textStyle:E}:{textStyle:null,role:null}),onEditStyles:i}:void 0,cells:gt})})})}return o(me,{motion:le,body:o(tt,{region:c,sizePx:e?.base.sizePx??null,face:Q(u,n,e,I),base:e?.base??null,onFollowStyle:m?T:void 0,source:Ne,slug:Se(u),onBack:r,shows:f})})}if(!p||!S)return st?o("div",{className:"sf-note","aria-busy":"true"}):o(An,{onBack:r,partId:z,why:p?"no field":"no selector"});const Ce=e=>{N.replaceComponent(p.zone,p.index,{...d,props:e})},se=e=>{if(J(e).hidden!==J(te).hidden||!v){const m=P?sn(u,w,P,e):{...u,[w]:e};m&&Ce(m);return}fn({node:d,propKey:n,kind:v,zone:p.zone,index:p.index},J(e).text,N.replaceComponent)},rt=te,_=b?.partId===z?b:null,A=_?.styleOwner,K=A?a(A.owner):null,re=A&&K?s(A.owner):null,ie=!!(A&&K&&re),L=ie?K.props??{}:u,ae=ie?e=>N.replaceComponent(re.zone,re.index,{...K,props:e}):Ce,M=ie?A.kind:Me(d?.type,n),R=he(L,M),y=[{partKey:M,face:Q(L,M,_,I),sizeGroup:_?.sizeGroup??null,base:_?.base??nt,style:R}],Ee=Cn(y,e=>e.sizeGroup),it=un(_?.inks),U=(e,c)=>{let m=L;for(const T of y)m=B(m,T.partKey,e,c);ae(m)},at=e=>e?U("textStyle",e):ce({textStyle:null,role:null}),ce=e=>{let c=L;for(const m of y)for(const[T,C]of Object.entries(e))c=B(c,m.partKey,T,C??null);ae(c)},de=v==="text"||v==="textarea",{text:Ie,hidden:V}=J(te),$=S?.[Xt]?.label??n,Fe=V?l("Show {label} on the slide",{label:l($)}):l("Hide {label} on the slide",{label:l($)}),ze=h("div",{className:"sf-field-head",children:[o(kt,{}),o("span",{className:"sf-field-label sf-field-label--inline",children:l($)}),de&&o(Ft,{content:Fe,children:o(It,{"aria-pressed":V,"aria-label":Fe,onClick:()=>se({text:Ie,hidden:!V}),children:V?o(We,{name:"eye-off",size:14}):o(We,{name:"eye",size:14})})})]}),Y=!ve&&Te,ct=!!v&&(Yt(S)||ve||V||!Te),_e=Q(L,M,_,I),dt=_e.kind==="role"?_e.role:null,ue=Ke(R)??Wt(dt),Ae=je(O.saved,O.old),ut=Object.entries(R).filter(([e,c])=>e!=="role"&&e!=="textStyle"&&c!==void 0).length,ft=()=>{let e=L;for(const c of y){const{role:m,textStyle:T}=c.style;e=cn(e,c.partKey),m&&(e=B(e,c.partKey,"role",m)),T&&(e=B(e,c.partKey,"textStyle",T))}ae(e)},k=ue,pt=Bt(y[0].style),mt=k?Ae.find(e=>e.id===k)?.name??k:"",yt=()=>{Z(!1),k&&(O.write(Ut({saved:O.saved,old:O.old,styleId:k,values:Ht(y[0].style)}),!0),ft())};return h(Fn,{sectionName:we?.label??d.type,onBack:r,tabs:e=>o(me,{motion:le,body:e}),textEditor:f("words")?o("div",{ref:be,className:"sf-part-text",children:ct?o(zt,{text:Ie,onTextChange:e=>se(de?{text:e,hidden:V}:e),multiline:en(v),markup:v!=="plainText",styled:!1,style:y[0].style,base:y[0].base,setValue:ce,colors:it,placeholder:ge(tn(S))??void 0,ariaLabel:l($),head:ze,typedOnCanvas:x===z}):v?de?ze:null:o(Tt,{field:S,name:n,value:rt,onChange:se,id:`sf-part-${t}-${n}`})}):void 0,children:[ee&&f("sourceNote")&&o(Qe,{source:ee,slug:Se(u),menuId:wn(u)}),Y&&o(He,{style:f("style")?{value:ue??"",options:Xe(Ae),onChange:e=>at(e||null),changed:ut>0,onEditStyles:i,onUpdateStyle:k&&pt?()=>Z(!0):void 0}:void 0,font:f("font")?{value:R.font??"",styleValue:ye(y[0].base.fontKey)?.label,options:Jt.map(e=>({label:e.label,value:e.key})),onChange:e=>U("font",e||null)}:void 0,italic:f("italic")?{value:R.italic,styleValue:Hn(D,ue),onChange:e=>U("italic",e??null)}:void 0,cells:Ue(y[0].style,y[0].base,ce,q(H)).filter(e=>f(e.key)),align:f("align")?Bn(R,y[0].base.align,q(H),U):void 0,letterCase:f("letterCase")?{value:R.case??"",styleValue:y[0].base.case,onChange:e=>U("case",e||null)}:void 0}),lt&&k&&o(Lt,{styleName:mt,onCancel:()=>Z(!1),onConfirm:yt}),Y&&Ee===null&&f("fixedSizeHint")&&o(Be,{children:l("Fixed size — the site’s Text setting doesn’t resize this.")}),Je(In,e=>f(e)&&(e==="words"||(e==="sourceNote"?!!ee:e==="fixedSizeHint"?Y&&Ee===null:Y)))&&o($e,{})]})}const Vn={desktop:"align",tablet:"alignTablet",mobile:"alignPhone"};function Bn(t,n,r,i){const a=Vn[r],s=an(t,r);return{value:t[a]??"",styleValue:s??n,onChange:g=>i(a,g||null)}}function Hn(t,n){return!n||!Array.isArray(t)?!1:t.find(i=>i?.id===n)?.values?.italic===!0}const nt={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0};export{Fn as PartPanelBody,Qe as PartSourceNote,En as PartStyleSelect,Ln as default,Q as partFace};
|
|
1
|
+
"use client";import{jsx as o,Fragment as W,jsxs as h}from"react/jsx-runtime";import{useContext as wt,useEffect as pe,useRef as Pt,useState as Le}from"react";import{FieldSelect as vt,InspectorField as Tt,fieldShownInView as Nt}from"efficient-easel/fields";import{InertHint as Be,SettingsField as Ot}from"efficient-easel/panel";import{InspectorUpLevel as Y}from"efficient-easel/chrome";import{StylesIcon as Rt,TypeIcon as kt}from"efficient-easel/icons";import{useEasel as Ct}from"efficient-easel/easel";import{TextPartPanel as He}from"efficient-easel/copy";import{Button as Et,IconButton as It,Tooltip as zt}from"efficient-shell/ui";import{PartTextBox as Ft,partTextCells as Ue}from"./PartTextBox.js";import{SiteFields as me}from"./SiteFields.js";import{usePartMotion as _t}from"./usePartMotion.js";import{UiIcon as We}from"efficient-easel/draw/client";import{usePreviewHeader as At}from"../../render/components/PreviewHeaderContext.js";import{UpdateStyleDialog as Vt}from"./UpdateStyleDialog.js";import{ScreenDocumentContext as Lt}from"efficient-easel/screen/components/ScreenDocumentContext";import{hasStyleChange as Bt,partStyleToTextStyleValues as Ht,pushIntoStyle as Ut,resolveTextStyles as je,styleIdOfRole as Wt}from"../../render/lib/text-styles/site-text-styles.js";import{useSiteTextStylesWriter as jt}from"../lib/site-text-styles-writer.js";import{useThemeRowPersist as Dt}from"../lib/theme-row-persist.js";import{usePreviewDevice as Kt}from"efficient-easel/draw/client";import{shownTier as q}from"efficient-easel/screen/lib/document/device-fields";import{PART_PANEL_ROWS as De,partRowHasTabletValue as Gt}from"../lib/document/part-panel-rows.js";import{usePartStyle as Mt}from"./PreviewPartStyleContext.js";import{say as l}from"../../format/lib/editor-words.js";import{readHidable as J,textFieldOffPage as $t,textFieldPanelOnly as Xt}from"../lib/document/controls.js";import{TEXT_FIELD_MARKER as Yt,viewKeyAt as qt}from"efficient-easel/draw";import{useSectionOps as Jt}from"efficient-easel/screen/lib/document/use-section-ops";import{FONT_OPTIONS as Qt,FONT_ROLES as Zt,FONT_ROLE_LABELS as Ke,fontOption as ye,fontRoleOf as en}from"../../format/lib/fonts.js";import{isMultilineKind as tn,partPlaceholder as nn,typeInPlaceKind as on}from"../../render/lib/document/part-text.js";import{partRowField as ln}from"../lib/document/part-row-field.js";import{decodePartKey as sn,partPropsWithRowValue as rn,partRowValue as an}from"../../render/lib/document/part-rows.js";import{followedStyleOf as Ge,partAlignFollowed as cn,propsWithPartStyleValue as B,propsWithoutPartStyle as dn,readPartStyle as he,regionHasOwnLook as un}from"../../render/lib/document/part-styles.js";import{partThemeColors as fn}from"../../format/lib/document/part-inks.js";import{styleKeyForPart as Me}from"../../format/lib/sections/section-text-kinds.js";import{commitPartText as pn}from"../lib/document/part-typing.js";import{keysOnCanvas as mn,useCanvasTypingPart as yn}from"../lib/document/canvas-typing.js";import{useEaselHost as hn}from"efficient-easel/screen/lib/host";import{SOURCE_LINES as Sn,SOURCE_ACTIONS as gn,SOURCE_ACTION_LABEL as xn,partSourceNoteFor as bn,partSourceOf as wn,sourceMenuIdOf as Pn,sourceSlugOf as Se}from"../../format/lib/document/source-bound-parts.js";import{encodePartId as vn,holdsAuthoredText as Tn}from"../../render/lib/document/text-parts.js";import{regionsForSection as Nn}from"../../format/lib/sections/section-text-regions.js";import{regionTakesSize as On,textRegionOfPartKey as Rn}from"../../format/lib/sections/text-regions.js";import{SameInEveryViewNote as $e}from"./SameInEveryViewNote.js";function ge(t){return t?l(t):null}function Xe(t){return t.kind==="role"?Ke[t.role]:t.kind==="custom"?"Custom":null}function kn(t){const n=en(t.role);return n?{kind:"role",role:n}:null}function Cn(t,n){if(!t)return{kind:"unread"};const{faceRole:r,base:i}=t;if(n[r]===i.fontKey)return{kind:"role",role:r};const a=Object.keys(n).filter(s=>n[s]===i.fontKey);return a.length===1?{kind:"role",role:a[0]}:{kind:"custom"}}function Q(t,n,r,i){return kn(he(t,n))??Cn(r,i)}function En(t,n){if(!t.length)return null;const r=n(t[0]);return t.every(i=>n(i)===r)?r:null}function Ye(t){return[{value:j,label:l("No style"),description:l("Section’s own")},...t.map(n=>({value:n.id,label:n.name,description:n.values.font?ye(n.values.font)?.label:void 0}))]}const j="";function In({face:t,base:n,onPick:r}){const i=t.kind==="role"?t.role:j,a=[{label:l("No style"),value:j},...Zt.map(s=>({label:l(Ke[s]),value:s}))];return o(vt,{ariaLabel:l("Style"),value:i,options:a,inline:!0,onChange:s=>r(s===j?null:s),renderOption:s=>s.value===j?h(W,{children:[o("span",{className:"es-fsel-label sf-part-style-keep",children:s.label}),o("span",{className:"sf-part-style-aside","aria-hidden":"true",children:l("Section’s own")})]}):o("span",{className:"es-fsel-label",style:{fontFamily:`var(--font-role-${s.value})`},children:s.label}),renderValue:()=>o("span",{style:{fontFamily:n?.fontKey?`var(${ye(n.fontKey)?.cssVar})`:void 0,fontWeight:n?.weight},children:ge(Xe(t))}),valueText:s=>ge(Xe(t))??s?.label??""})}const qe=["regionNote","regionStyle"],zn=Object.keys(De).filter(t=>!qe.includes(t));function Je(t,n){return!t.some(n)}function Fn({sectionName:t,onBack:n,textEditor:r,styleRow:i,children:a,tabs:s}){const g=h(W,{children:[r,i,a]});return h("div",{className:"sf-part-panel",children:[o(Y,{inline:!0,name:l(t),onSelect:n}),s?s(g):g]})}function Qe({source:t,slug:n,menuId:r}){const i=hn(),a=gn[t],s=!a.needsSlug||!!n;return o("div",{className:"sf-note sf-note--source",children:h(Be,{children:[l(Sn[t]),s?h(W,{children:[" ",o(Et,{type:"button",variant:"link",size:"sm",onClick:()=>{a.type==="storefront-editor:open-menus"?i.send(a.type,{menuId:r??null}):n&&i.send(a.type,{slug:n})},children:l(xn)})]}):null]})})}const Ze=4,_n=120;function et(t){return l("Every {part} in this section follows it. The face and the size change; the letter case is the section’s own and stays as it is.",{part:l(t.label).toLowerCase()})}function tt({region:t,sizePx:n,face:r,base:i,onFollowStyle:a,source:s,slug:g,onBack:N,shows:x,sizedStyle:b,ownLook:I}){const D=t.follows;return h("div",{className:"sf-note",children:[o("p",{children:o("strong",{children:l(t.label)})}),x("regionNote")&&!I&&o("p",{children:n?l("Its size follows Styles ▸ {follows} — {px}px right now.",{follows:l(D),px:Math.round(n)}):l("Its size follows Styles ▸ {follows}.",{follows:l(D)})}),b?h(W,{children:[b,x("regionStyle")&&o("p",{className:"es-field-hint",children:et(t)})]}):a?x("regionStyle")?o(W,{children:o(Ot,{label:l("Style"),icon:o(Rt,{}),hint:et(t),children:o(In,{face:r,base:i,onPick:a})})}):null:x("regionNote")&&o("p",{className:"es-field-hint",children:l("Only the size follows a site style. This section sets its own font, weight and letter case.")}),s&&x("sourceNote")?o(Qe,{source:s,slug:g}):null,Je([...qe,"sourceNote",...b?["fontSize"]:[]],z=>x(z)&&(z!=="sourceNote"||!!s))&&o($e,{}),o(Y,{inline:!0,name:l("Page"),onSelect:N})]})}function An({onBack:t}){return h("div",{className:"sf-note",children:[o("p",{children:o("strong",{children:l("This part is no longer here.")})}),o("p",{children:l("The section it belonged to has been changed or removed.")}),o(Y,{inline:!0,name:l("Page"),onSelect:t})]})}function Vn({onBack:t,partId:n,why:r}){return h("div",{className:"sf-note",children:[o("p",{children:o("strong",{children:l("This part's settings did not open.")})}),o("p",{children:l("The words are still on your page and nothing has been lost. The editor could not work out which control belongs to them, which is a fault on our side. Go back and click the section to open its settings instead.")}),o("p",{className:"sf-note-detail",children:h("code",{children:[n," — ",r]})}),o(Y,{inline:!0,name:l("Page"),onSelect:t})]})}function Ln({nodeId:t,propKey:n,onBack:r,onEditStyle:i}){const{getItemById:a,getSelectorForId:s,config:g}=Ct(e=>e),N=Jt(),x=yn(),{partStyle:b}=Mt(),{fonts:I,textStyles:D}=At(),z=wt(Lt),xe=!z?.capabilities?.hasSiteTheme,{persist:ot}=Dt({themeFromDocument:xe,tokenRef:z?.tokenRef,siteId:z?.siteId??null}),O=jt({themeFromDocument:xe,persist:ot}),[lt,Z]=Le(!1),H=Kt(),f=e=>(q(H)!=="tablet"||Gt(e))&&Nt(De[e],H),be=Pt(null),d=a(t),p=s(t),we=d?g.components[d.type]:void 0,{key:w,row:P}=sn(n),Pe=we?.fields?.[w],S=P?ln(Pe,P):Pe,F=vn(t,n),u=d?.props??{},v=on(S),ve=$t(S),Te=Tn(S),Ne=d?wn(d.type):null,ee=d?bn(d.type,w):null,te=P?an(u[w],P):u[w],Oe=!!P&&!(Array.isArray(u[w])&&P.index<u[w].length);pe(()=>{if(mn(document))return;be.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[F]);const[ne,Re]=Le(0);pe(()=>Re(0),[F]);const oe=!!d&&!Oe&&(!p||!S);pe(()=>{if(!oe||ne>=Ze)return;const e=setTimeout(()=>Re(c=>c+1),_n);return()=>clearTimeout(e)},[oe,ne]);const st=oe&&ne<Ze,le=_t(t,Me(d?.type,n),"textPart");if(!d||Oe)return o(An,{onBack:r});const K=Nn(d.type),ke=K?Rn(K,n):null;if(K&&ke){const e=b?.partId===F?b:null,c=K[ke],m=c.writable===!0&&!!p,T=C=>{p&&N.replaceComponent(p.zone,p.index,{...d,props:B(u,n,"role",C)})};if(m&&On(c)){const C=he(u,n),Ve=E=>{if(!p)return;let fe=u;for(const[xt,bt]of Object.entries(E))fe=B(fe,n,xt,bt??null);N.replaceComponent(p.zone,p.index,{...d,props:fe})},ht=je(O.saved,O.old),St=Ge(C)??"",gt=Ue(C,e?.base??nt,Ve,q(H)).filter(E=>E.key==="fontSize"&&f(E.key));return o(me,{motion:le,body:o(tt,{region:c,sizePx:e?.base.sizePx??null,face:Q(u,n,e,I),base:e?.base??null,source:Ne,slug:Se(u),onBack:r,shows:f,ownLook:un(C),sizedStyle:o(He,{style:f("style")?{value:St,options:Ye(ht),onChange:E=>Ve(E?{textStyle:E}:{textStyle:null,role:null}),onEditStyles:i}:void 0,cells:gt})})})}return o(me,{motion:le,body:o(tt,{region:c,sizePx:e?.base.sizePx??null,face:Q(u,n,e,I),base:e?.base??null,onFollowStyle:m?T:void 0,source:Ne,slug:Se(u),onBack:r,shows:f})})}if(!p||!S)return st?o("div",{className:"sf-note","aria-busy":"true"}):o(Vn,{onBack:r,partId:F,why:p?"no field":"no selector"});const Ce=e=>{N.replaceComponent(p.zone,p.index,{...d,props:e})},se=e=>{if(J(e).hidden!==J(te).hidden||!v){const m=P?rn(u,w,P,e):{...u,[w]:e};m&&Ce(m);return}pn({node:d,propKey:n,kind:v,zone:p.zone,index:p.index},J(e).text,N.replaceComponent)},rt=te,_=b?.partId===F?b:null,A=_?.styleOwner,G=A?a(A.owner):null,re=A&&G?s(A.owner):null,ie=!!(A&&G&&re),V=ie?G.props??{}:u,ae=ie?e=>N.replaceComponent(re.zone,re.index,{...G,props:e}):Ce,M=ie?A.kind:Me(d?.type,n),R=he(V,M),y=[{partKey:M,face:Q(V,M,_,I),sizeGroup:_?.sizeGroup??null,base:_?.base??nt,style:R}],Ee=En(y,e=>e.sizeGroup),it=fn(_?.inks),U=(e,c)=>{let m=V;for(const T of y)m=B(m,T.partKey,e,c);ae(m)},at=e=>e?U("textStyle",e):ce({textStyle:null,role:null}),ce=e=>{let c=V;for(const m of y)for(const[T,C]of Object.entries(e))c=B(c,m.partKey,T,C??null);ae(c)},de=v==="text"||v==="textarea",{text:Ie,hidden:L}=J(te),$=S?.[Yt]?.label??n,ze=L?l("Show {label} on the slide",{label:l($)}):l("Hide {label} on the slide",{label:l($)}),Fe=h("div",{className:"sf-field-head",children:[o(kt,{}),o("span",{className:"sf-field-label sf-field-label--inline",children:l($)}),de&&o(zt,{content:ze,children:o(It,{"aria-pressed":L,"aria-label":ze,onClick:()=>se({text:Ie,hidden:!L}),children:L?o(We,{name:"eye-off",size:14}):o(We,{name:"eye",size:14})})})]}),X=!ve&&Te,ct=!!v&&(Xt(S)||ve||L||!Te),_e=Q(V,M,_,I),dt=_e.kind==="role"?_e.role:null,ue=Ge(R)??Wt(dt),Ae=je(O.saved,O.old),ut=Object.entries(R).filter(([e,c])=>e!=="role"&&e!=="textStyle"&&c!==void 0).length,ft=()=>{let e=V;for(const c of y){const{role:m,textStyle:T}=c.style;e=dn(e,c.partKey),m&&(e=B(e,c.partKey,"role",m)),T&&(e=B(e,c.partKey,"textStyle",T))}ae(e)},k=ue,pt=Bt(y[0].style),mt=k?Ae.find(e=>e.id===k)?.name??k:"",yt=()=>{Z(!1),k&&(O.write(Ut({saved:O.saved,old:O.old,styleId:k,values:Ht(y[0].style)}),!0),ft())};return h(Fn,{sectionName:we?.label??d.type,onBack:r,tabs:e=>o(me,{motion:le,body:e}),textEditor:f("words")?o("div",{ref:be,className:"sf-part-text",children:ct?o(Ft,{text:Ie,onTextChange:e=>se(de?{text:e,hidden:L}:e),multiline:tn(v),markup:v!=="plainText",styled:!1,style:y[0].style,base:y[0].base,setValue:ce,colors:it,placeholder:ge(nn(S))??void 0,ariaLabel:l($),head:Fe,typedOnCanvas:x===F}):v?de?Fe:null:o(Tt,{field:S,name:n,value:rt,onChange:se,id:`sf-part-${t}-${n}`})}):void 0,children:[ee&&f("sourceNote")&&o(Qe,{source:ee,slug:Se(u),menuId:Pn(u)}),X&&o(He,{style:f("style")?{value:ue??"",options:Ye(Ae),onChange:e=>at(e||null),changed:ut>0,onEditStyles:i,onUpdateStyle:k&&pt?()=>Z(!0):void 0}:void 0,font:f("font")?{value:R.font??"",styleValue:ye(y[0].base.fontKey)?.label,options:Qt.map(e=>({label:e.label,value:e.key})),onChange:e=>U("font",e||null)}:void 0,italic:f("italic")?{value:R.italic,styleValue:Hn(D,ue),onChange:e=>U("italic",e??null)}:void 0,cells:Ue(y[0].style,y[0].base,ce,q(H)).filter(e=>f(e.key)),align:f("align")?Bn(R,y[0].base.align,q(H),U):void 0,letterCase:f("letterCase")?{value:R.case??"",styleValue:y[0].base.case,onChange:e=>U("case",e||null)}:void 0}),lt&&k&&o(Vt,{styleName:mt,onCancel:()=>Z(!1),onConfirm:yt}),X&&Ee===null&&f("fixedSizeHint")&&o(Be,{children:l("Fixed size — the site’s Text setting doesn’t resize this.")}),Je(zn,e=>f(e)&&(e==="words"||(e==="sourceNote"?!!ee:e==="fixedSizeHint"?X&&Ee===null:X)))&&o($e,{})]})}function Bn(t,n,r,i){const a=qt("align",r),s=cn(t,r);return{value:t[a]??"",styleValue:s??n,onChange:g=>i(a,g||null)}}function Hn(t,n){return!n||!Array.isArray(t)?!1:t.find(i=>i?.id===n)?.values?.italic===!0}const nt={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0};export{Fn as PartPanelBody,Qe as PartSourceNote,In as PartStyleSelect,Ln as default,Q as partFace};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as x,jsxs as A}from"react/jsx-runtime";import{DEFAULT_EASEL_STRINGS as z}from"efficient-easel/strings";import{COPY_CELLS as c,COPY_CELL_LENGTHS as T,CopyBox as L,lengthCellUnits as N}from"efficient-easel/copy";import{LENGTH_UNITS_TABLE as E}from"../lib/document/box-fields.js";import{partColourName as D}from"../../format/lib/document/part-inks.js";import{PaddingYIcon as O}from"efficient-easel/icons";import{say as _}from"../../format/lib/editor-words.js";import{SHOP_MARKUP as R}from"../../format/lib/markup.js";import{partTextTools as I}from"../lib/document/canvas-typing.js";import{PART_PADDING_MAX as v,PART_PADDING_MIN as G,PART_PADDING_STEP as H,PART_UNIT_KEY_OF as w,partSizeBoxOf as j,partSizeFollowed as k,partSpacingOf as B}from"../../render/lib/document/part-styles.js";import{onDesktopWords as M}from"efficient-easel/screen/lib/document/box-fields";const C=z.copy.cells,U={kind:"spacing"},K=["left","center","right","justify"];function Y(a,o,e,r="desktop"){const p=B(a),i=j(r),u=a[i]??a.size??o.sizePx,t=k(a,r),d=(n,S,g,h,m)=>{const l=w[g];return N({preset:n,row:S,table:E,unit:a[l],value:a[g],tier:r,styleValue:h,label:_(m),onPick:(P,f)=>e({[l]:P??null,[g]:f??null}),onChange:(P,f)=>e({...f?{[l]:f.unit??null}:{},[g]:P??null})})},s={key:"padding",name:_("Padding"),icon:x(O,{}),unit:"px",step:H,shiftStep:10,min:G,max:v};return[{...c.fontSize,key:"fontSize",value:a[i],styleValue:Math.round(o.sizePx),onChange:n=>e({[i]:n??null}),...d(c.fontSize,T.fontSize,i,Math.round(o.sizePx),C.fontSize),...i==="size"?{}:{reset:{detail:t?M(n=>_(n),`${t.px}px`,t.view):void 0}}},{...c.lineHeight,key:"lineHeight",value:p.lineHeight,styleValue:o.lineRatio,onChange:n=>e(n===void 0?{lineHeight:null,line:null}:{lineHeight:n})},{...c.letterSpacing,key:"letterSpacing",scale:u,value:p.letterSpacingEm,styleValue:o.letterEm,onChange:n=>e(n===void 0?{letterSpacing:null,letter:null}:{letterSpacing:n})},{...c.paragraphSpacing,key:"paragraphSpacing",value:a.paragraphSpacing,styleValue:0,onChange:n=>e({paragraphSpacing:n??null}),...d(c.paragraphSpacing,T.paragraphSpacing,"paragraphSpacing",0,C.paragraphSpacing)},{...s,value:a.padding,styleValue:o.paddingPx,onChange:n=>e({padding:n??null}),...d(s,U,"padding",o.paddingPx,"Padding")}]}function nn({text:a,onTextChange:o,multiline:e,markup:r=!0,styled:p=!0,style:i,base:u,setValue:t,colors:d,placeholder:s,ariaLabel:n,head:S,typedOnCanvas:g=!1}){const h=Y(i,u,t),m=I(r,e);return A("div",{className:"sf-part-textbox",children:[S,x(L,{value:a,onChange:o,multiline:e,placeholder:s,ariaLabel:n,rules:R,tools:m,barShows:g?"focus":"always",colors:r?d:[],colorNameOf:D,align:p?{value:i.align??u.align,allow:K,onChange:l=>t({align:l})}:void 0,letterCase:p?{value:i.case==="capitalize"?"":i.case??"",onChange:l=>t({case:l||null})}:void 0,cells:p?h:void 0})]})}export{nn as PartTextBox,Y as partTextCells};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as Y}from"react/jsx-runtime";import{readInks as $}from"../../format/lib/document/part-inks.js";import{useEffect as j,useRef as x}from"react";import{markOverlayPortal as G}from"../../format/lib/document/overlay-portal.js";import{usePreviewParts as q}from"efficient-easel/draw/client";import{usePartStyle as U}from"./PreviewPartStyleContext.js";import{usePreviewDevice as V}from"efficient-easel/draw/client";import{shownTier as Q}from"efficient-easel/screen/lib/document/device-fields";import{decodePartId as I,encodePartId as X}from"efficient-easel/draw";import{BLOCK_ATTRIBUTE as Z}from"efficient-easel/canvas";import{engagePartAnchors as tt}from"../lib/document/part-anchors.js";import{PART_ATTR as P,PART_STYLE_KIND_ATTR as b,PART_STYLE_OWNER_ATTR as et,partStyleOwnerOf as g}from"../../render/lib/document/text-parts.js";import{PART_STYLE_PROPERTIES as D,applyPartStyles as C,blockDrawsTextStyle as F,partFontKeyOf as rt,partShownDeclarations as ot,partStyleBase as nt,partStyleSource as st,storedPartStyle as it}from"../../render/lib/document/part-styles.js";import{fontRoleOfClassName as lt,styleRoleOfClassName as at}from"../../format/lib/fonts.js";import{typeScaleGroupOfClassName as k}from"../../format/lib/theme.js";import{styleKeyForPart as
|
|
1
|
+
"use client";import{jsx as Y}from"react/jsx-runtime";import{readInks as $}from"../../format/lib/document/part-inks.js";import{useEffect as j,useRef as x}from"react";import{markOverlayPortal as G}from"../../format/lib/document/overlay-portal.js";import{usePreviewParts as q}from"efficient-easel/draw/client";import{usePartStyle as U}from"./PreviewPartStyleContext.js";import{usePreviewDevice as V}from"efficient-easel/draw/client";import{shownTier as Q}from"efficient-easel/screen/lib/document/device-fields";import{decodePartId as I,encodePartId as X}from"efficient-easel/draw";import{BLOCK_ATTRIBUTE as Z}from"efficient-easel/canvas";import{engagePartAnchors as tt}from"../lib/document/part-anchors.js";import{PART_ATTR as P,PART_STYLE_KIND_ATTR as b,PART_STYLE_OWNER_ATTR as et,partStyleOwnerOf as g}from"../../render/lib/document/text-parts.js";import{PART_STYLE_PROPERTIES as D,applyPartStyles as C,blockDrawsTextStyle as F,partFontKeyOf as rt,partShownDeclarations as ot,partStyleBase as nt,partStyleSource as st,storedPartStyle as it}from"../../render/lib/document/part-styles.js";import{fontRoleOfClassName as lt,styleRoleOfClassName as at}from"../../format/lib/fonts.js";import{typeScaleGroupOfClassName as k}from"../../format/lib/theme.js";import{styleKeyForPart as A}from"../../format/lib/sections/section-text-kinds.js";import{NO_MOTIONS as pt,PART_HOST_ATTR as ct}from"../../render/lib/animation/part-motion.js";import{paintPartMotion as ft}from"../lib/document/part-motion-canvas.js";import{viewOfTier as ut}from"../../format/lib/content/view-tier.js";function mt(c){let s=null,o=null;for(let e=c;e&&(s===null||o===null);e=e.parentElement){const r=e.getAttribute("class");s??=at(r),o??=k(r)}return{faceRole:s??"body",sizeGroup:o}}function z(c,s={}){const o=c.style,e={};for(const n of D)e[n]=o[n]??"",o[n]="";s.fontFamily&&(o.fontFamily=s.fontFamily),s.fontSize&&(o.fontSize=s.fontSize);const r=getComputedStyle(c),S=getComputedStyle(c.ownerDocument.documentElement),a=nt({fontSize:r.fontSize,fontWeight:r.fontWeight,lineHeight:r.lineHeight,letterSpacing:r.letterSpacing,textAlign:r.textAlign,textTransform:r.textTransform,paddingTop:r.paddingTop},rt(r.fontFamily,n=>S.getPropertyValue(n)));for(const n of D)o[n]=e[n];return a}function yt({needles:c,styles:s,motions:o=pt,type:e,children:r}){const S=x(null),{selectedPartId:a}=q(),{setPartStyle:n}=U(),y=Q(V()),h=JSON.stringify(c),R=JSON.stringify(s),w=JSON.stringify(o),J=x(new Map);return j(()=>{const d=S.current;if(!d)return;const E=[],v=()=>d.parentElement,M=p=>{const i=v();if(!i)return null;const u=new MutationObserver(p);return u.observe(i,{attributes:!0,attributeFilter:[Z]}),()=>u.disconnect()},L=p=>{const i=new MutationObserver(p);return i.observe(d,{childList:!0,subtree:!0,characterData:!0}),()=>i.disconnect()};let f=[];E.push(()=>{for(const p of f)p();f=[]});const W=JSON.parse(h),T=JSON.parse(R),B=JSON.parse(w),H=tt(d,W,v,M,(p,i,u)=>{for(const t of f)t();f=[];const _=[];for(const t of u){const l=t,m=G(l);m&&f.push(m),l.getAttribute(P)===a&&_.push(l)}const K=st(i,a,_,t=>lt(t)!==null||k(t)!==null);if(K&&a){const t=K,l=I(a)?.propKey??"",m=g(t)?{}:ot(it(T,A(e,l)),y,{blockDrawsStyle:F(e,l)});n({partId:a,...mt(t),base:z(t,m),inks:$(t),...(()=>{const N=g(t);return N?{styleOwner:N}:{}})()})}C(u.filter(t=>!g(t)).map(t=>({element:t,partId:t.getAttribute(P)??""})),T,t=>z(t),t=>A(e,t),void 0,y,t=>F(e,t));const O=[...d.querySelectorAll(`[${et}="${CSS.escape(i)}"][${b}]`)];O.length&&C(O.map(t=>({element:t,partId:X(i,t.getAttribute(b)??"")})),T,void 0,t=>t,void 0,y),f.push(ft([...u.filter(t=>!g(t)).map(t=>{const l=t,m=I(l.getAttribute(P)??"")?.propKey??"";return{element:l,partKey:A(e,m)}}),...O.map(t=>({element:t,partKey:t.getAttribute(b)??""}))],t=>B[t],ut(y),J.current))},L);return()=>{H();for(const p of E)p()}},[h,R,w,a,n,y,e]),Y("div",{ref:S,[ct]:"",style:{display:"contents"},children:r})}export{yt as default,z as measureStyleBase,mt as styleTagsOf};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type WidthAnswer } from "../../format/lib/content/section-width.js";
|
|
2
|
+
import type { LengthUnitState } from "efficient-easel/screen/lib/document/box-fields";
|
|
2
3
|
export declare const BACKGROUND_LABEL = "Background width";
|
|
3
4
|
export declare const CONTENT_LABEL = "Content width";
|
|
4
5
|
export declare const WIDTH_CHOICES: readonly WidthAnswer[];
|
|
@@ -13,7 +14,7 @@ export declare function BackgroundWidthRow({ value, changed, detail, onChange, o
|
|
|
13
14
|
hint?: string;
|
|
14
15
|
labelId?: string;
|
|
15
16
|
}): import("react").JSX.Element;
|
|
16
|
-
export declare function ContentWidthRow({ mode, px, max, min, changed, detail, fullClosed, onMode, onPx, onReset, hint, labelId, }: {
|
|
17
|
+
export declare function ContentWidthRow({ mode, px, max, min, changed, detail, fullClosed, onMode, onPx, onReset, hint, labelId, length, }: {
|
|
17
18
|
mode: WidthAnswer;
|
|
18
19
|
px: number;
|
|
19
20
|
max?: number;
|
|
@@ -26,4 +27,5 @@ export declare function ContentWidthRow({ mode, px, max, min, changed, detail, f
|
|
|
26
27
|
onReset: () => void;
|
|
27
28
|
hint?: string;
|
|
28
29
|
labelId?: string;
|
|
30
|
+
length?: Pick<LengthUnitState, "grid" | "unit" | "units">;
|
|
29
31
|
}): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as c}from"react/jsx-runtime";import{BACKGROUND_WIDTHS as W,SettingsBackgroundWidth as b,SettingsContentWidth as g}from"efficient-easel/panel";import{PAGE_WIDTH as u}from"../../format/lib/content/page-width.js";import{WIDTH_CHOICE_LABEL as B}from"../../format/lib/content/section-width.js";import{say as o,editorEaselWords as C}from"../../format/lib/editor-words.js";import{Slider as N}from"../lib/document/controls.js";const w="Background width",H="Content width",k=W,r=t=>o(B[t==="content"?"page":"full"]),v="The width of every section's background.",G="The width of every section's content.";function y({value:t,changed:i,detail:s,onChange:d,onReset:a,hint:n,labelId:l}){return c(b,{value:t,changed:i,detail:s,onChange:d,onReset:a,hint:n?o(n):void 0,labelId:l,words:{label:o(w),full:r("full"),content:r("content")},resetWords:C()?.panel})}function K({mode:t,px:i,max:s=u.max,min:d=u.min,changed:a,detail:n,fullClosed:l,onMode:T,onPx:h,onReset:I,hint:f,labelId:_,length:e}){const m=o(H),p=e?.grid.min??d,x=e?.grid.max??s,E=t!=="full"?c(N,{min:p,max:x,step:e?.grid.step??u.step,value:Math.min(Math.max(i,p),x),onChange:h,...e?{suffix:e.unit,units:e.units}:{suffix:"px"},ariaLabel:m}):null;return c(g,{mode:t,onMode:T,number:E,changed:a,detail:n,fullClosed:l,onReset:I,hint:f?o(f):void 0,labelId:_,words:{label:m,full:r("full"),content:r("content")},resetWords:C()?.panel})}export{w as BACKGROUND_LABEL,y as BackgroundWidthRow,H as CONTENT_LABEL,K as ContentWidthRow,v as SITE_BACKGROUND_HINT,G as SITE_CONTENT_HINT,k as WIDTH_CHOICES};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as y}from"react/jsx-runtime";import{useState as w}from"react";import{TextStylesList as x}from"efficient-easel/text-styles";import{FONT_OPTIONS as I}from"../../format/lib/fonts.js";import{viewOfTier as _}from"../../format/lib/content/view-tier.js";import{usePreviewDevice as C}from"efficient-easel/draw/client";import{applyListChange as E,resolveTextStyles as N,toPanelStyles as L}from"../../render/lib/text-styles/site-text-styles.js";const f=["font","color","size","weight","emphasis","lineSpacing","letterSpacing","paragraphSpacing","letterCase","largestSize"],b=["size","lineSpacing","letterSpacing","letterCase"],k=500,A=I.map(e=>({value:e.key,label:e.label,family:`var(${e.cssVar})`,italic:e.italicLoaded}));function F({saved:e,old:s,colours:p,colourNameOf:S,sizeOf:a,onChange:m,openId:l,onOpenChange:d,readOnly:u=!1,withoutSize:g=!1}){const T=C(),[O,h]=w(null),r=N(e,s),i=_(T),c=L(r,a,i);return y(x,{styles:c,onChange:t=>m(E({saved:e,old:s,cur:c,next:t,sizeOf:a,panelView:i})),fonts:A,colours:p,colourNameOf:S,settings:g?f.filter(t=>t!=="size"):f,auto:b,openId:l===void 0?O:l,onOpenChange:d??h,readOnly:u,device:i,fallback:t=>{const n=r.find(v=>v.id===(t.kind==="heading"?"heading-1":"body-1")),o={};return n?.values.font&&t.id!==n.id&&(o.font=n.values.font),t.kind==="heading"&&(o.weight=k),o}})}export{A as SITE_FONTS,F as default};
|
|
@@ -3,7 +3,7 @@ import type { ShowWhenRule } from "../../../render/lib/document/show-when.js";
|
|
|
3
3
|
import { type BoxHover, type CardHover, type PictureHover } from "../../../format/lib/animation/hover.js";
|
|
4
4
|
export declare function hoverFields(): Record<string, unknown>;
|
|
5
5
|
export declare function cardHoverFields(resting: CardHover): Record<string, unknown>;
|
|
6
|
-
export declare function pictureHoverFields(resting: PictureHover, blockKey?: string): Record<string, unknown>;
|
|
6
|
+
export declare function pictureHoverFields(resting: PictureHover, blockKey?: string, moves?: boolean): Record<string, unknown>;
|
|
7
7
|
export declare function offerNextPicture<Fields extends Record<string, unknown>>(fields: Fields, data: {
|
|
8
8
|
props?: Record<string, unknown>;
|
|
9
9
|
}, params: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i}from"react/jsx-runtime";import{AccentIcon as G,ContrastIcon as W,ExpandIcon as X,FinishIcon as z,ImagesIcon as Y,NoSymbolIcon as f,HoverLiftIcon as j,HoverNextImageIcon as Z,HoverRotateIcon as q,HoverZoomIcon as O,OpacityIcon as J}from"efficient-easel/icons";import{customize as Q,describedAs as w,group as $}from"efficient-easel/screen/lib/document/box-fields";import{effectTiles as v}from"efficient-easel/screen/lib/document/effect-tiles";import{deviceField as n}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as ee,noControlField as oe}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{BOX_DARKEN as p}from"../../../format/lib/content/box-background.js";import{cardTemplateOwner as te}from"../../../format/lib/content/card-template.js";import{angleRow as re,segmented as V,select as ne,slider as N}from"../document/box-fields.js";import{say as u}from"../../../format/lib/editor-words.js";import{withShowWhen as a}from"../../../format/lib/document/show-when-attach.js";import{animationDelayField as T,animationDurationField as D,showsWhatRuns as H}from"./AnimationDurationRow.js";import{BOX_HIGHLIGHT as S,BOX_HOVER_KINDS as A,BOX_HOVER_LABELS as C,CARD_HOVER_KEYS as c,CARD_HOVER_KINDS as se,CARD_HOVER_SECTIONS as ie,CARD_HOVER_TURN as ce,HOVER_KEY as h,HOVER_MEDIA_COVERS as ae,HOVER_MEDIA_COVER_LABELS as pe,HOVER_MEDIA_DEFAULTS as m,HOVER_MEDIA_GROUPS as he,HOVER_MEDIA_GROUP_LABELS as de,HOVER_MEDIA_KINDS as _e,HOVER_MEDIA_KIND_LABELS as le,HOVER_KIND_LABELS as k,NEXT_PICTURE_BLOCKS as x,NEXT_PICTURE_HOVER_KINDS as ue,OLD_SPIN_KEY as Ee,PART_HOVER_KINDS as g,PICTURE_HOVER_KEYS as K,PICTURE_HOVER_KINDS as Re,PICTURE_HOVER_ZOOM as d,cardHoverAngleOf as He,cardHoverKindOf as me,cardRotatesRule as Ie,cardShowsNextRule as P,HOVER_GROUP_KEY as E,pictureHoverKindOf as fe,pictureHoverMoveRule as Oe,pictureHoverRunsRule as b,pictureHoverTimedRule as we}from"../../../format/lib/animation/hover.js";const R=e=>n("desktop",$("Hover",{dot:e})),L=()=>n("desktop",Q()),ve="What this does when a shopper points at it, or taps it on a phone.",Ve="What this picture does when a shopper points at it. Black and white shows it in grey until then. A phone shows its colour.",Ne="What this picture does when a shopper points at the card. Show next image covers the card or the picture with this product's photos, with arrows; a phone shows the picture as it is. Black and white shows it in grey until then.",Te="What each card does when a shopper points at it. Show next image covers the card with this product's photos, with arrows; a phone shows the card as it is. Rotate turns the wheel picture.",De="Which of the product's pictures the card shows.",Se="Same finish shows the photos of the finish the card shows, else the first group.",Ae="Whole card hides the words under the photo. Picture keeps the words and swatches in view.",Ce={none:()=>i(f,{}),nextImage:()=>i(Z,{}),rotate:()=>i(q,{}),zoom:()=>i(O,{}),lift:()=>i(j,{}),mono:()=>i(W,{})};function I(e,o){const s=v({label:u("Hover effect"),options:e.map(
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{AccentIcon as G,ContrastIcon as W,ExpandIcon as X,FinishIcon as z,ImagesIcon as Y,NoSymbolIcon as f,HoverLiftIcon as j,HoverNextImageIcon as Z,HoverRotateIcon as q,HoverZoomIcon as O,OpacityIcon as J}from"efficient-easel/icons";import{customize as Q,describedAs as w,group as $}from"efficient-easel/screen/lib/document/box-fields";import{effectTiles as v}from"efficient-easel/screen/lib/document/effect-tiles";import{deviceField as n}from"efficient-easel/screen/lib/document/device-fields";import{NoControlMark as ee,noControlField as oe}from"efficient-easel/screen/lib/document/panel-no-control-mark";import{BOX_DARKEN as p}from"../../../format/lib/content/box-background.js";import{cardTemplateOwner as te}from"../../../format/lib/content/card-template.js";import{angleRow as re,segmented as V,select as ne,slider as N}from"../document/box-fields.js";import{say as u}from"../../../format/lib/editor-words.js";import{withShowWhen as a}from"../../../format/lib/document/show-when-attach.js";import{animationDelayField as T,animationDurationField as D,showsWhatRuns as H}from"./AnimationDurationRow.js";import{BOX_HIGHLIGHT as S,BOX_HOVER_KINDS as A,BOX_HOVER_LABELS as C,CARD_HOVER_KEYS as c,CARD_HOVER_KINDS as se,CARD_HOVER_SECTIONS as ie,CARD_HOVER_TURN as ce,HOVER_KEY as h,HOVER_MEDIA_COVERS as ae,HOVER_MEDIA_COVER_LABELS as pe,HOVER_MEDIA_DEFAULTS as m,HOVER_MEDIA_GROUPS as he,HOVER_MEDIA_GROUP_LABELS as de,HOVER_MEDIA_KINDS as _e,HOVER_MEDIA_KIND_LABELS as le,HOVER_KIND_LABELS as k,NEXT_PICTURE_BLOCKS as x,NEXT_PICTURE_HOVER_KINDS as ue,OLD_SPIN_KEY as Ee,PART_HOVER_KINDS as g,PICTURE_HOVER_KEYS as K,PICTURE_HOVER_KINDS as Re,PICTURE_HOVER_ZOOM as d,cardHoverAngleOf as He,cardHoverKindOf as me,cardRotatesRule as Ie,cardShowsNextRule as P,HOVER_GROUP_KEY as E,pictureHoverKindOf as fe,pictureHoverMoveRule as Oe,pictureHoverRunsRule as b,pictureHoverTimedRule as we}from"../../../format/lib/animation/hover.js";const R=e=>n("desktop",$("Hover",{dot:e})),L=()=>n("desktop",Q()),ve="What this does when a shopper points at it, or taps it on a phone.",Ve="What this picture does when a shopper points at it. Black and white shows it in grey until then. A phone shows its colour.",Ne="What this picture does when a shopper points at the card. Show next image covers the card or the picture with this product's photos, with arrows; a phone shows the picture as it is. Black and white shows it in grey until then.",Te="What each card does when a shopper points at it. Show next image covers the card with this product's photos, with arrows; a phone shows the card as it is. Rotate turns the wheel picture.",De="Which of the product's pictures the card shows.",Se="Same finish shows the photos of the finish the card shows, else the first group.",Ae="Whole card hides the words under the photo. Picture keeps the words and swatches in view.",Ce={none:()=>i(f,{}),nextImage:()=>i(Z,{}),rotate:()=>i(q,{}),zoom:()=>i(O,{}),lift:()=>i(j,{}),mono:()=>i(W,{})};function I(e,o){const s=v({label:u("Hover effect"),options:e.map(r=>({value:r,label:u(k[r]),picture:Ce[r]()})),fallback:o});return w(s,{type:"select",label:"Hover effect",options:e.map(r=>({value:r,label:k[r]}))})}function je(){return{[E]:R({field:h,in:g.filter(e=>e!=="none")}),[h]:n("desktop",{...I(g,"none"),description:ve})}}function Ze(e){const o=Ie(e),s=P(),r=re(ce);return{[E]:R({any:[o,s]}),[c.kind]:n("desktop",{...H(I(se,e),(t,_)=>me(_??{},e)),description:Te}),...U(s),[Ee]:oe({type:"custom",render:()=>i(ee,{})},"always"),_cHover:L(),[c.angle]:n("desktop",a(H(r,t=>He(t)),o)),[c.duration]:n("desktop",a(D("hover"),o)),[c.delay]:n("desktop",a(T("hover"),o))}}function U(e){const o=ne("Type",i(Y,{}),_e.map(t=>({value:t,label:le[t]})),m.kind),s=V("Group",i(z,{}),he.map(t=>({value:t,label:de[t]})),m.group),r=V("Covers",i(X,{}),ae.map(t=>({value:t,label:pe[t]})),m.cover);return{[c.mediaKind]:n("desktop",a({...o,description:De},e)),[c.mediaGroup]:n("desktop",a({...s,description:Se},e)),[c.cover]:n("desktop",a({...r,description:Ae},e))}}function ke(e,o="",s=x.includes(o)){const r=b(e),t=we(e);return{[E]:R(r),[c.kind]:y(Re,e,Ve),...x.includes(o)?U(P()):{},_cHover:L(),...s?xe():{},[c.duration]:n("desktop",a(D("hover"),t)),[c.delay]:n("desktop",a(T("hover"),t))}}function xe(){const e=Oe(),o=N("Zoom",i(O,{}),d.min,d.max,d.step,d.min,d.unit),s=N("Darken on hover",i(J,{}),p.min,p.max,p.step,p.fallback,p.unit);return{[K.zoom]:n("desktop",a(o,e)),[K.darken]:n("desktop",a(s,e))}}function y(e,o,s){const r=n("desktop",{...H(I(e,o),t=>fe({[h]:t},o,e)),description:s});return Object.assign(r,{[B]:o})}const B="sfPictureResting",M=new WeakMap;function qe(e,o,s){const r=e[c.kind],t=r?.[B];if(!r||!t)return e;const _=o.props?.[h]==="nextImage",F=_?null:te(s.appState,o.props?.id);if(!_&&!ie.includes(String(F?.type??"")))return e;let l=M.get(e);return l||(l={...e,[c.kind]:y(ue,t,Ne)},M.set(e,l)),l}const ge="What this card does when a shopper points at it, or taps it on a phone. Highlight fills it with the surface color and turns its text the main color.",Ke={none:()=>i(f,{}),[S]:()=>i(G,{})},Je=n("desktop",{...w(v({label:u("Hover effect"),options:A.map(e=>({value:e,label:u(C[e]),picture:Ke[e]()})),fallback:"none"}),{type:"select",label:"Hover effect",options:A.map(e=>({value:e,label:C[e]}))}),description:ge});function Qe(){const e={any:[b("none"),{field:h,is:S}]};return{...ke("none","",!0),[E]:R(e)}}export{Je as BOX_HIGHLIGHT_ROW,Qe as boxHoverFields,Ze as cardHoverFields,je as hoverFields,qe as offerNextPicture,ke as pictureHoverFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{StylesIcon as p,WeightIcon as m,WidthIcon as a}from"efficient-easel/icons";import{swapPadding as I}from"../../../controls.js";import{keptByRow as _}from"efficient-easel/screen/lib/document/style-fields";import{iconPickerRow as D,lengthUnitFields as s,sidesPaddingFields as E,slider as o}from"../../../box-fields.js";import{LAYOUT_CELL as f,dividerPicture as g}from"../../../choice-pictures.js";import{DEFAULT_DIVIDER_STYLE as n,DIVIDER_LENGTH_ROW as r,DIVIDER_SPACE_PX as R,DIVIDER_STYLE_OPTIONS as h,DIVIDER_THICKNESS_ROW as l,parseDividerSpacing as S}from"../../../../../../format/lib/sections/divider-style.js";import{withRowRules as P}from"../../../../../../render/lib/document/show-when.js";const L={any:[{field:"style",set:!1},{field:"style",is:n}]},T={not:{field:"style",is:"none"}},N={fields:P({style:D("Style",t(p,{}),h.map(e=>({...e,picture:g(e.value)})),n,{columns:3,cell:f}),spacing:_("sectionPaddingTop"),thickness:o("Thickness",t(m,{}),1,8,1,1,l),...s(l,"thickness"),lengthPct:o("Length",t(a,{}),10,100,1,100,r),...s(r,"lengthPct")},[[["thickness"],L],[["lengthPct"],T]]),resolveFields:(e,{fields:c})=>{const i=R[S(e.props.spacing)],d=E({fallback:{top:i,bottom:i},tablet:!0,siteSide:!0});return I(c,d)}};export{N as DividerFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{phoneKey as r,tabletKey as i}from"efficient-easel/draw";import{BOX_CARD_PAD as E,BOX_SWATCH_PROP as bo,boxCardProps as Po,boxIsCard as B}from"../../../../../../format/lib/content/box-background.js";import{BOX_IS_CARD_RULE as Fo,BOX_IS_NOT_CARD_RULE as Ho,BOX_ROW_IMAGE_PROP as ko}from"../../../../../../format/lib/content/box-card-rule.js";import{CARD_ROW_FACTS as Wo,cardRowField as y,cardRowFields as xo,cardRowLinkField as Bo,typedLinkField as yo}from"../../../card-row-fields.js";import{CARD_ROW_LINK_PROP as Mo,cardCopyPlace as Uo}from"../../../../../../format/lib/content/card-template.js";import{HOVER_KEY as M}from"../../../../../../format/lib/animation/hover.js";import{BOX_HIGHLIGHT_ROW as Ko}from"../../../../animation/hover-fields.js";import{darkenFields as Xo}from"../../../darken-fields.js";import{BOX_TAB_SHAPES as Go,REEL_SHAPE_LABELS as Yo}from"../../../../../../format/lib/reel.js";import{LAYOUT_CELL as U,CARD_LIST_STYLE_PICTURES as vo,TAB_SHAPE_PICTURES as jo}from"../../../choice-pictures.js";import{CARD_STYLE_KEY as C,CARD_STYLE_POINTS as Vo,applyCardStyle as Jo,isCardStyle as zo}from"../../../../../../render/lib/sections/card-list-style.js";import{deviceField as a}from"efficient-easel/screen/lib/document/device-fields";import{ChevronDownIcon as qo,ClockIcon as Qo,CropIcon as K,GapIcon as Zo,MediaLayoutStackedIcon as X,LineBetweenIcon as $o,LineSolidIcon as oe,ListIcon as ee,NumberedListIcon as G,ShadowIcon as ne,StylesIcon as Y,TableIcon as v,TargetIcon as te,WrapIcon as j}from"efficient-easel/icons";import{boxBlockSpacingField as re,boxFillField as ie,boxColumnsFields as le,boxShareField as ae,boxSharePhoneField as se,boxShareTabletField as de,containerDirectionField as ce,containerGapRows as _e,linkField as pe,plainText as Se,swapPadding as V,toggle as c,upload as J,withPanelOnly as Oe}from"../../../controls.js";import{BOX_STACK_LINE as L,BOX_STACK_RANGE as f,STACK_BELOW_PROP as T}from"../../../../../../render/lib/content/box-stack-line.js";import{BOX_SHAPES as z,boxShapeOf as me}from"../../../../../../format/lib/content/box-shape.js";import{BOX_ANGLE_PROP as fe}from"../../../../../../format/lib/content/box-angle.js";import{shapeLines as q}from"../../../../../../format/lib/content/gallery-card-layout.js";import{shapePickerRow as Q}from"../../../shape-picker.js";import{ACCORDION_COLUMN_COUNTS as Re,ACCORDION_PHONE_COLUMN_COUNTS as he,BOX_COLUMNS_MAX as D,BOX_COLUMNS_MIN as I,boxPhoneRowOneLine as ue,boxWrapWordOf as Z}from"../../../../../../format/lib/content/box-layout.js";import{BOX_SEPARATOR_POINTS as $}from"../../../../../../format/lib/content/box-separator.js";import{BOX_WRAP_LABEL as oo,VIEW_KEY_ACCESS as s,group as R,phoneTwinFields as d}from"efficient-easel/screen/lib/document/box-fields";import{angleRow as Ae,boxAlignField as Ce,boxJustifyField as we,boxWrapField as N,iconPickerRow as g,placementField as Ee,select as b,sidesPaddingFields as eo,slider as no}from"../../../box-fields.js";import{withRowRules as Te,withShowWhen as to}from"../../../../../../render/lib/document/show-when.js";import{separatorField as Ne}from"../../../separator-field.js";import{LOOP_SCROLLS as Le}from"../../../../../../format/lib/animation/index.js";import{DEFAULT_TICKER_JOIN as De,TICKER_JOIN_OPTIONS as Ie}from"../../../../../../format/lib/sections/ticker-join.js";import{NOT_HELD_BY_A_NODE as ro}from"../../../../../../format/lib/document/passes/document-position.js";import{BOX_SIDE_SPACE_PROP as io}from"../../../../../../format/lib/content/box-side-space.js";import{boxSideSpaceField as ge}from"../../../box-side-space-field.js";import{accordionOnSet as be}from"../../../box-accordion-seed.js";import{ACCORDION_ROW_STYLE_POINTS as Pe,ACCORDION_ROW_STYLE_PROP as P}from"../../../../../../format/lib/content/accordion-row-style.js";import{FlexSlots as lo}from"../../../../../../format/lib/document/blocks/general/Flex/meta.js";import{BOX_TYPE as Fe,CONTAINER_BLOCKS_SLOT as He}from"../../../../../../format/lib/document/container-blocks.js";import{boxPhoneOrderField as ke}from"../../../box-phone-order-field.js";import{CARD_BOX_FACTS as We,ON_A_CARD as ao,cardDisplayField as F}from"../../../card-display-chips.js";import{MIRROR_CARDS_FACTS as xe,MIRROR_CARDS_MIRRORS as Be,mirrorCardsField as ye}from"../../../mirror-cards-field.js";import{handedRowOf as so}from"../../../../../../format/lib/document/row-hand.js";import{SHOW_FOR_FACTS as Me,showForField as Ue,showForFields as Ke}from"../../../show-for-field.js";import{SHARED_COLUMNS_KEY as h,SHARED_COLUMNS_LABEL as co,SHARED_COLUMNS_OFF as _o,sharedColumnsDrawn as po,sharedColumnsFits as So,SHARED_COLUMNS_PHONE_POINTS as Xe,SHARED_COLUMNS_POINTS as Ge,sharedRowsDrawn as Ye}from"../../../../../../render/lib/content/box-shared-columns.js";const Oo=Fo,mo={all:[{field:"phoneRow",in:[2,3]},{not:{field:"direction",is:"accordion"}}]},ve={field:"direction",is:"tabs"},je={field:"line",in:[!0,!1]},Ve={field:"anchor",set:!0},H=["fixed","screen"],Je={not:{any:[{field:"sectionHeightMode",in:H},{field:"sectionHeightModeTablet",in:H},{field:"sectionHeightModePhone",in:H}]}},ze={context:"parent.line",is:!0},_={not:{field:"direction",is:"accordion"}},fo={field:"direction",is:"accordion"},Ro={any:[_,{not:{field:P,is:"numbered"}},{field:"columns",in:[...Re]},{field:"phoneRow",in:[...he]}]},ho="notAccordionRow",qe={not:{context:ho,is:!0}},Qe={[ho]:(o,e)=>e.parent?.props?.direction!=="accordion"},k={field:"direction",is:"row",default:"row"},p={not:Le},S={all:[k,p,{not:{field:"separator",in:$.map(o=>o.value)}},{not:{field:"line",is:!0}}]},Ze={field:"direction",is:"column"},uo={all:[S,...["columns",i("columns")].map(o=>({not:{field:o,in:Array.from({length:D},(e,n)=>n+I)}}))]},$e={all:[p,{not:{all:[k,{field:"separator",in:$.map(o=>o.value)}]}}]},W={not:{all:[S,{field:"columns",in:Array.from({length:D},(o,e)=>e+I)}]}},on="sharedColumnsFits",Ao="sharedColumnsMisfit",Co="sharedColumnsDraws",wo="sharedColumnsPhoneDraws";function O(o,e){return Po(o.props??{},Uo(e.appState,o.props?.id)?.inCopy!==!1)}const en={[on]:(o,e)=>So(O(o,e)),[Ao]:(o,e)=>!So(O(o,e)),[Co]:(o,e)=>po(O(o,e)).desktop,[wo]:(o,e)=>po(O(o,e)).phone};function Eo(o){return{all:[{not:{context:Ao,is:!0}},{any:[ao,{field:o,set:!0}]}]}}const m={not:{context:Co,is:!0}},u={not:{context:wo,is:!0}},To="sharedRowsDraws",nn={[To]:(o,e)=>Ye(O(o,e))&&so(e.appState,o.props?.id)?.row===void 0},w={not:{context:To,is:!0}},tn={any:[m,u]},x=Ho,rn={not:{context:Be,is:!0}},No="rowHanded",ln={not:{context:No,is:!0}},an={[No]:(o,e)=>{const n=so(e.appState,o.props?.id);return n===void 0?void 0:n?.row!==void 0}},Lo={all:[_,x,m,u,rn]},sn={field:"direction",is:"row"},dn={field:"align",in:["start","center","end"]},cn={all:[{field:"darken",set:!0},{not:{field:"darken",in:[0,"0"]}}]};function _n(){const{darken:o,darkenStyle:e}=Xo();return{...d("darken",o,s),...d("darkenStyle",e,s)}}const Do={not:{all:[S,{field:i("columns"),in:Array.from({length:D},(o,e)=>e+I)}]}};function pn(){const o=c(oo,!1,t(j,{})),e=n=>{const l=Z(n);return l===void 0?void 0:l==="wrap"};return{...N(),render:n=>o.render({...n,value:e(n.value),follows:e(n.follows)??!1,onChange:l=>n.onChange(l===void 0?void 0:l?"wrap":"nowrap")})}}function Sn(){const o=c(oo,!0,t(j,{})),e=n=>{const l=Z(n);return l===void 0?void 0:l==="wrap"};return{...N(),render:n=>{const l=n.followsView==="tablet";return o.render({...n,value:e(n.value),follows:!ue(void 0,l?n.follows:void 0),followsNoView:!l,onChange:A=>n.onChange(A===void 0?void 0:A?"wrap":"nowrap")})}}}const Io={hint:L},go={all:[x,{any:[Ze,{all:[S,Do,{not:{all:[uo,{field:i("share"),set:!0}]}}]}]}]},On=to(a("desktop",no("Narrows below",t(X,{}),f.min,f.max,f.step,L,"px",{clear:Io,hint:"Under this screen width the side space narrows and the Phone Padding is used."})),go);function mn(o,e){const n=o;return!(T in n)||e.direction!=="column"?o:{...n,[T]:On}}const lt={fields:Te({_gContent:R("Content"),rowTitle:lo.rowTitle,content:lo.content,_gCardDisplay:R("Display"),cardDisplay:F("desktop"),cardDisplayTablet:F("tablet"),cardDisplayPhone:F("mobile"),showFor:Ue(),_gLayout:R("Layout"),direction:ce("Flex"),tabShape:g("Tab shape",t(Y,{}),Go.map(o=>({label:Yo[o],value:o,picture:jo[o]})),"tabs",{columns:2,cell:U}),mirrorCards:ye(),[T]:a("desktop",no("Stacks below",t(X,{}),f.min,f.max,f.step,L,"px",{clear:Io,hint:"Under this screen width the blocks stand one under another, with the Phone Gap and Padding."})),[io]:ge(),startsOpen:a("desktop",c("Starts open",!1,t(qo,{}))),[P]:a("desktop",g("Row style",t(G,{}),Pe.map(o=>({...o,picture:o.value==="numbered"?t(G,{}):t(ee,{})})),"plain",{columns:2})),label:Oe(Se("Tab name")),..._e("Flex"),...d("justify",we(),s),...d("align",Ce(),s),...(()=>{const o=d("wrap",N(),s,{phoneRow:Sn()}),e=d("wrap",N(),s,{phoneRow:pn()});return{wrap:e.wrap,[i("wrap")]:e[i("wrap")],[r("wrap")]:o[r("wrap")]}})(),[r("order")]:ke(),...d("boxShape",Q("Box shape",t(K,{}),q(z),"shape","auto"),s,{phoneRow:Q("Box shape",t(K,{}),q(z),"shape","auto",{phoneRest:o=>me(o)})}),[fe]:a("desktop",Ae(0,{clear:{hint:0},hint:"Turns the box. 0° is straight."})),separator:Ne(t($o,{size:18}),"none"),[C]:a("desktop",g("Card style",t(Y,{}),Vo.map(o=>({...o,picture:vo[o.value]})),"table",{columns:2,cell:U})),share:a("desktop",ae()),[i("share")]:de(),[r("share")]:se(),[h]:a("desktop",b(co,t(v,{}),[...Ge],_o)),[r(h)]:a("mobile",b(co,t(v,{}),[...Xe],_o)),...le(),...d("blockSpacing",re(),s),line:c("Line",!1,t(oe,{}),"A line across the blocks, with a dot on each."),upcoming:c("Upcoming",!1,t(Qo,{}),"Still to come: a hollow dot, and the gold line stops before it."),join:b("Join",t(Zo,{}),Ie,De),_gShadow:R("Shadow"),...d("shadow",c("Shadow",!1,t(ne,{})),s),...d("fillColor",ie(),s),[bo]:y("Fill content","colour"),_gBackground:R("Background image"),bgImage:a("desktop",J("Image","image/*")),bgImagePhone:a("mobile",J("Image","image/*")),[ko]:y("Image content","image",{content:!0}),..._n(),placement:Ee("Content position"),_gLink:R("Link"),link:yo(pe("Link to")),[Mo]:Bo(),jumpHighlight:c("Highlight when a link jumps here",!1,t(te,{}),"When a link lands on this Box's anchor, the Box gets a main color outline and its first block turns the main color.")},[[["darken","darkenStyle","placement"],Oo],[[r("share")],{all:[mo,u]}],[[h],Eo(h)],[[r(h)],Eo(r(h))],[[r("wrap")],{all:[mo,p,u,w]}],[[r("order")],{all:[S,u,m]}],[["phoneRow"],u],[[P],fo],[["tabShape"],ve],[["rowTitle","startsOpen"],qe],[["align","blockSpacing",i("blockSpacing"),r("blockSpacing")],_],[[i("justify"),r("justify")],{all:[p,Lo,w]}],[[i("align"),r("align")],{all:[sn,dn,Lo]}],[[i("wrap")],{all:[p,W,Do,m,_,w]}],[[i("shadow"),r("shadow")],x],[[i("darken"),r("darken"),i("darkenStyle"),r("darkenStyle")],{all:[Oo,cn]}],[["separator"],k],[[C],{field:C,set:!0}],[["columns"],{any:[S,fo]}],[[i("columns")],S],[[T],go],[[i("gap")],{all:[$e,Ro]}],[["gap",r("gap")],Ro],[["justify"],{all:[p,tn,_,w]}],[["wrap"],{all:[p,W,m,_,w]}],[["share"],{all:[W,m,_]}],[[i("share")],{all:[uo,m]}],[["line"],je],[["upcoming"],ze],[["jumpHighlight"],Ve],[["boxShape",i("boxShape"),r("boxShape")],Je],[["direction","share",r("order")],ln],[["join"],ro],[[io],ro]]),resolveData:(o,e)=>{const n=o.props,l=n[C];return e.changed?.[C]===!0&&zo(l)?{...o,props:Jo(n,l,Fe,He)}:n.direction==="accordion"&&(e.trigger==="insert"||e.changed?.direction===!0)?{...o,props:be(n)}:o},resolveFields:(o,e)=>mn(Rn(Ke(hn(o,{...e,fields:xo(e.fields,o,e)}),o.props),O(o,e)),o.props),showWhenFacts:{...Wo,...We,...xe,...an,...en,...nn,...Me,...Qe}},fn=to(Ko,ao);function Rn(o,e){const n=o;return!(M in n)||B(e)?o:{...n,[M]:fn}}function hn(...[o,e]){const{fields:n}=e;{if(B(O(o,e))){const A=eo({fallback:{top:E.desktop,bottom:E.desktop,left:E.side,right:E.side},tablet:!0,siteSide:!0});return V(n,A)}return o.props.padV2!==!0?V(n,eo({fallback:{top:24,bottom:24},tablet:!0,siteSide:!0})):n}}export{lt as FlexFields};
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{phoneKey as r,tabletKey as i}from"efficient-easel/draw";import{BOX_CARD_PAD as E,BOX_SWATCH_PROP as bo,boxCardProps as Po,boxIsCard as x}from"../../../../../../format/lib/content/box-background.js";import{BOX_IS_CARD_RULE as ko,BOX_IS_NOT_CARD_RULE as Fo,BOX_ROW_IMAGE_PROP as Ho}from"../../../../../../format/lib/content/box-card-rule.js";import{CARD_ROW_FACTS as Wo,cardRowField as y,cardRowFields as Bo,cardRowLinkField as xo,typedLinkField as yo}from"../../../card-row-fields.js";import{CARD_ROW_LINK_PROP as Mo,cardCopyPlace as Uo}from"../../../../../../format/lib/content/card-template.js";import{HOVER_KEY as M}from"../../../../../../format/lib/animation/hover.js";import{BOX_HIGHLIGHT_ROW as Ko}from"../../../../animation/hover-fields.js";import{darkenFields as Xo}from"../../../darken-fields.js";import{BOX_TAB_SHAPES as Go,REEL_SHAPE_LABELS as Yo}from"../../../../../../format/lib/reel.js";import{LAYOUT_CELL as U,CARD_LIST_STYLE_PICTURES as vo,TAB_SHAPE_PICTURES as jo}from"../../../choice-pictures.js";import{CARD_STYLE_KEY as C,CARD_STYLE_POINTS as Vo,applyCardStyle as Jo,isCardStyle as zo}from"../../../../../../render/lib/sections/card-list-style.js";import{deviceField as a}from"efficient-easel/screen/lib/document/device-fields";import{ChevronDownIcon as qo,ClockIcon as Qo,CropIcon as K,GapIcon as Zo,MediaLayoutStackedIcon as X,LineBetweenIcon as $o,LineSolidIcon as oe,ListIcon as ee,NumberedListIcon as G,ShadowIcon as ne,StylesIcon as Y,TableIcon as v,TargetIcon as te,WrapIcon as j}from"efficient-easel/icons";import{boxBlockSpacingField as re,boxFillField as ie,boxColumnsFields as le,boxShareField as ae,boxSharePhoneField as se,boxShareTabletField as de,containerDirectionField as ce,containerGapRows as _e,linkField as pe,plainText as Se,swapPadding as V,toggle as c,upload as J,withPanelOnly as Oe}from"../../../controls.js";import{BOX_STACK_LINE as L,BOX_STACK_RANGE as f,STACK_BELOW_PROP as T}from"../../../../../../render/lib/content/box-stack-line.js";import{BOX_SHAPES as z,boxShapeOf as me}from"../../../../../../format/lib/content/box-shape.js";import{BOX_ANGLE_PROP as fe}from"../../../../../../format/lib/content/box-angle.js";import{shapeLines as q}from"../../../../../../format/lib/content/gallery-card-layout.js";import{shapePickerRow as Q}from"../../../shape-picker.js";import{ACCORDION_COLUMN_COUNTS as Re,ACCORDION_PHONE_COLUMN_COUNTS as he,BOX_COLUMNS_MAX as D,BOX_COLUMNS_MIN as I,boxPhoneRowOneLine as ue,boxWrapWordOf as Z}from"../../../../../../format/lib/content/box-layout.js";import{BOX_SEPARATOR_POINTS as $}from"../../../../../../format/lib/content/box-separator.js";import{BOX_WRAP_LABEL as oo,VIEW_KEY_ACCESS as s,group as R,phoneTwinFields as d}from"efficient-easel/screen/lib/document/box-fields";import{angleRow as Ae,boxAlignField as Ce,boxJustifyField as we,boxWrapField as N,iconPickerRow as g,placementField as Ee,select as b,sidesPaddingFields as eo,slider as no}from"../../../box-fields.js";import{withRowRules as Te,withShowWhen as to}from"../../../../../../render/lib/document/show-when.js";import{separatorField as Ne}from"../../../separator-field.js";import{LOOP_SCROLLS as Le}from"../../../../../../format/lib/animation/index.js";import{DEFAULT_TICKER_JOIN as De,TICKER_JOIN_OPTIONS as Ie}from"../../../../../../format/lib/sections/ticker-join.js";import{NOT_HELD_BY_A_NODE as ro}from"../../../../../../format/lib/document/passes/document-position.js";import{BOX_SIDE_SPACE_PROP as io}from"../../../../../../format/lib/content/box-side-space.js";import{boxSideSpaceField as ge}from"../../../box-side-space-field.js";import{accordionOnSet as be}from"../../../box-accordion-seed.js";import{ACCORDION_ROW_STYLE_POINTS as Pe,ACCORDION_ROW_STYLE_PROP as P}from"../../../../../../format/lib/content/accordion-row-style.js";import{FlexSlots as lo}from"../../../../../../format/lib/document/blocks/general/Flex/meta.js";import{BOX_TYPE as ke,CONTAINER_BLOCKS_SLOT as Fe}from"../../../../../../format/lib/document/container-blocks.js";import{boxPhoneOrderField as He}from"../../../box-phone-order-field.js";import{CARD_BOX_FACTS as We,ON_A_CARD as ao,cardDisplayField as k}from"../../../card-display-chips.js";import{MIRROR_CARDS_FACTS as Be,MIRROR_CARDS_MIRRORS as xe,mirrorCardsField as ye}from"../../../mirror-cards-field.js";import{handedRowOf as so}from"../../../../../../format/lib/document/row-hand.js";import{SHOW_FOR_FACTS as Me,showForField as Ue,showForFields as Ke}from"../../../show-for-field.js";import{SHARED_COLUMNS_KEY as h,SHARED_COLUMNS_LABEL as co,SHARED_COLUMNS_OFF as _o,sharedColumnsDrawn as po,sharedColumnsFits as So,SHARED_COLUMNS_PHONE_POINTS as Xe,SHARED_COLUMNS_POINTS as Ge,sharedRowsDrawn as Ye}from"../../../../../../render/lib/content/box-shared-columns.js";const Oo=ko,mo={all:[{field:"phoneRow",in:[2,3]},{not:{field:"direction",is:"accordion"}}]},ve={field:"direction",is:"tabs"},je={field:"line",in:[!0,!1]},Ve={field:"anchor",set:!0},F=["fixed","screen"],Je={not:{any:[{field:"sectionHeightMode",in:F},{field:"sectionHeightModeTablet",in:F},{field:"sectionHeightModePhone",in:F}]}},ze={context:"parent.line",is:!0},_={not:{field:"direction",is:"accordion"}},fo={field:"direction",is:"accordion"},Ro={any:[_,{not:{field:P,is:"numbered"}},{field:"columns",in:[...Re]},{field:"phoneRow",in:[...he]}]},ho="notAccordionRow",qe={not:{context:ho,is:!0}},Qe={[ho]:(o,e)=>e.parent?.props?.direction!=="accordion"},H={field:"direction",is:"row",default:"row"},p={not:Le},S={all:[H,p,{not:{field:"separator",in:$.map(o=>o.value)}},{not:{field:"line",is:!0}}]},Ze={field:"direction",is:"column"},uo={all:[S,...["columns",i("columns")].map(o=>({not:{field:o,in:Array.from({length:D},(e,n)=>n+I)}}))]},$e={all:[p,{not:{all:[H,{field:"separator",in:$.map(o=>o.value)}]}}]},W={not:{all:[S,{field:"columns",in:Array.from({length:D},(o,e)=>e+I)}]}},on="sharedColumnsFits",Ao="sharedColumnsMisfit",Co="sharedColumnsDraws",wo="sharedColumnsPhoneDraws";function O(o,e){return Po(o.props??{},Uo(e.appState,o.props?.id)?.inCopy!==!1)}const en={[on]:(o,e)=>So(O(o,e)),[Ao]:(o,e)=>!So(O(o,e)),[Co]:(o,e)=>po(O(o,e)).desktop,[wo]:(o,e)=>po(O(o,e)).phone};function Eo(o){return{all:[{not:{context:Ao,is:!0}},{any:[ao,{field:o,set:!0}]}]}}const m={not:{context:Co,is:!0}},u={not:{context:wo,is:!0}},To="sharedRowsDraws",nn={[To]:(o,e)=>Ye(O(o,e))&&so(e.appState,o.props?.id)?.row===void 0},w={not:{context:To,is:!0}},tn={any:[m,u]},B=Fo,rn={not:{context:xe,is:!0}},No="rowHanded",ln={not:{context:No,is:!0}},an={[No]:(o,e)=>{const n=so(e.appState,o.props?.id);return n===void 0?void 0:n?.row!==void 0}},Lo={all:[_,B,m,u,rn]},sn={field:"direction",is:"row"},dn={field:"align",in:["start","center","end"]},cn={all:[{field:"darken",set:!0},{not:{field:"darken",in:[0,"0"]}}]};function _n(){const{darken:o,darkenStyle:e}=Xo();return{...d("darken",o,s),...d("darkenStyle",e,s)}}const Do={not:{all:[S,{field:i("columns"),in:Array.from({length:D},(o,e)=>e+I)}]}};function pn(){const o=c(oo,!1,t(j,{})),e=n=>{const l=Z(n);return l===void 0?void 0:l==="wrap"};return{...N(),render:n=>o.render({...n,value:e(n.value),follows:e(n.follows)??!1,onChange:l=>n.onChange(l===void 0?void 0:l?"wrap":"nowrap")})}}function Sn(){const o=c(oo,!0,t(j,{})),e=n=>{const l=Z(n);return l===void 0?void 0:l==="wrap"};return{...N(),render:n=>{const l=n.followsView==="tablet";return o.render({...n,value:e(n.value),follows:!ue(void 0,l?n.follows:void 0),followsNoView:!l,onChange:A=>n.onChange(A===void 0?void 0:A?"wrap":"nowrap")})}}}const Io={hint:L},go={all:[B,{any:[Ze,{all:[S,Do,{not:{all:[uo,{field:i("share"),set:!0}]}}]}]}]},On=to(a("desktop",no("Narrows below",t(X,{}),f.min,f.max,f.step,L,{kind:"breakpoint"},{clear:Io,hint:"Under this screen width the side space narrows and the Phone Padding is used."})),go);function mn(o,e){const n=o;return!(T in n)||e.direction!=="column"?o:{...n,[T]:On}}const lt={fields:Te({_gContent:R("Content"),rowTitle:lo.rowTitle,content:lo.content,_gCardDisplay:R("Display"),cardDisplay:k("desktop"),cardDisplayTablet:k("tablet"),cardDisplayPhone:k("mobile"),showFor:Ue(),_gLayout:R("Layout"),direction:ce("Flex"),tabShape:g("Tab shape",t(Y,{}),Go.map(o=>({label:Yo[o],value:o,picture:jo[o]})),"tabs",{columns:2,cell:U}),mirrorCards:ye(),[T]:a("desktop",no("Stacks below",t(X,{}),f.min,f.max,f.step,L,{kind:"breakpoint"},{clear:Io,hint:"Under this screen width the blocks stand one under another, with the Phone Gap and Padding."})),[io]:ge(),startsOpen:a("desktop",c("Starts open",!1,t(qo,{}))),[P]:a("desktop",g("Row style",t(G,{}),Pe.map(o=>({...o,picture:o.value==="numbered"?t(G,{}):t(ee,{})})),"plain",{columns:2})),label:Oe(Se("Tab name")),..._e("Flex"),...d("justify",we(),s),...d("align",Ce(),s),...(()=>{const o=d("wrap",N(),s,{phoneRow:Sn()}),e=d("wrap",N(),s,{phoneRow:pn()});return{wrap:e.wrap,[i("wrap")]:e[i("wrap")],[r("wrap")]:o[r("wrap")]}})(),[r("order")]:He(),...d("boxShape",Q("Box shape",t(K,{}),q(z),"shape","auto"),s,{phoneRow:Q("Box shape",t(K,{}),q(z),"shape","auto",{phoneRest:o=>me(o)})}),[fe]:a("desktop",Ae(0,{clear:{hint:0},hint:"Turns the box. 0° is straight."})),separator:Ne(t($o,{size:18}),"none"),[C]:a("desktop",g("Card style",t(Y,{}),Vo.map(o=>({...o,picture:vo[o.value]})),"table",{columns:2,cell:U})),share:a("desktop",ae()),[i("share")]:de(),[r("share")]:se(),[h]:a("desktop",b(co,t(v,{}),[...Ge],_o)),[r(h)]:a("mobile",b(co,t(v,{}),[...Xe],_o)),...le(),...d("blockSpacing",re(),s),line:c("Line",!1,t(oe,{}),"A line across the blocks, with a dot on each."),upcoming:c("Upcoming",!1,t(Qo,{}),"Still to come: a hollow dot, and the gold line stops before it."),join:b("Join",t(Zo,{}),Ie,De),_gShadow:R("Shadow"),...d("shadow",c("Shadow",!1,t(ne,{})),s),...d("fillColor",ie(),s),[bo]:y("Fill content","colour"),_gBackground:R("Background image"),bgImage:a("desktop",J("Image","image/*")),bgImagePhone:a("mobile",J("Image","image/*")),[Ho]:y("Image content","image",{content:!0}),..._n(),placement:Ee("Content position"),_gLink:R("Link"),link:yo(pe("Link to")),[Mo]:xo(),jumpHighlight:c("Highlight when a link jumps here",!1,t(te,{}),"When a link lands on this Box's anchor, the Box gets a main color outline and its first block turns the main color.")},[[["darken","darkenStyle","placement"],Oo],[[r("share")],{all:[mo,u]}],[[h],Eo(h)],[[r(h)],Eo(r(h))],[[r("wrap")],{all:[mo,p,u,w]}],[[r("order")],{all:[S,u,m]}],[["phoneRow"],u],[[P],fo],[["tabShape"],ve],[["rowTitle","startsOpen"],qe],[["align","blockSpacing",i("blockSpacing"),r("blockSpacing")],_],[[i("justify"),r("justify")],{all:[p,Lo,w]}],[[i("align"),r("align")],{all:[sn,dn,Lo]}],[[i("wrap")],{all:[p,W,Do,m,_,w]}],[[i("shadow"),r("shadow")],B],[[i("darken"),r("darken"),i("darkenStyle"),r("darkenStyle")],{all:[Oo,cn]}],[["separator"],H],[[C],{field:C,set:!0}],[["columns"],{any:[S,fo]}],[[i("columns")],S],[[T],go],[[i("gap")],{all:[$e,Ro]}],[["gap",r("gap")],Ro],[["justify"],{all:[p,tn,_,w]}],[["wrap"],{all:[p,W,m,_,w]}],[["share"],{all:[W,m,_]}],[[i("share")],{all:[uo,m]}],[["line"],je],[["upcoming"],ze],[["jumpHighlight"],Ve],[["boxShape",i("boxShape"),r("boxShape")],Je],[["direction","share",r("order")],ln],[["join"],ro],[[io],ro]]),resolveData:(o,e)=>{const n=o.props,l=n[C];return e.changed?.[C]===!0&&zo(l)?{...o,props:Jo(n,l,ke,Fe)}:n.direction==="accordion"&&(e.trigger==="insert"||e.changed?.direction===!0)?{...o,props:be(n)}:o},resolveFields:(o,e)=>mn(Rn(Ke(hn(o,{...e,fields:Bo(e.fields,o,e)}),o.props),O(o,e)),o.props),showWhenFacts:{...Wo,...We,...Be,...an,...en,...nn,...Me,...Qe}},fn=to(Ko,ao);function Rn(o,e){const n=o;return!(M in n)||x(e)?o:{...n,[M]:fn}}function hn(...[o,e]){const{fields:n}=e;{if(x(O(o,e))){const A=eo({fallback:{top:E.desktop,bottom:E.desktop,left:E.side,right:E.side},tablet:!0,siteSide:!0});return V(n,A)}return o.props.padV2!==!0?V(n,eo({fallback:{top:24,bottom:24},tablet:!0,siteSide:!0})):n}}export{lt as FlexFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import{HERO_GROUP_NUDGE_LIMIT as p,HERO_GROUP_WIDTH_DEFAULT as h,HERO_GROUP_WIDTH_MAX as d,HERO_GROUP_WIDTH_MIN as l,HERO_GROUP_WIDTH_NESTED_DEFAULT as c,heroGroupNestDepth as g}from"../../../../../../format/lib/hero-group-placement.js";import{WidthIcon as s}from"efficient-easel/icons";import{containerDirectionField as O,containerGapRows as G,heroGroupPlacementPoints as H,plainText as R,withIdentifier as D,withOffPage as F,withPanelOnly as x}from"../../../controls.js";import{BOX_NUDGE_ROW as m,BOX_WIDTH_ROW as e,group as t}from"efficient-easel/screen/lib/document/box-fields";import{boxAlignField as P,boxJustifyField as E,boxWrapField as W,lengthUnitFields as a,placementField as w,positionFields as I,sidesPaddingFields as T,slider as u}from"../../../box-fields.js";import{PH as U}from"../../../../../../format/lib/document/blocks/placeholders.js";import{withRowRules as y}from"../../../../../../render/lib/document/show-when.js";import{HeroGroupSlots as N}from"../../../../../../format/lib/document/blocks/general/HeroGroup/meta.js";const k={fields:y({_gContent:t("Content"),name:x(D(F(R("Box name",U.boxName)))),content:N.content,_gLayout:t("Layout"),placement:w("Placement",{pointsFor:H}),width:u("Width",n(s,{}),l,d,5,h,e),...a(e,"width"),direction:O("HeroGroup"),...G("HeroGroup"),justify:E(),align:P(),wrap:W(),_gNudge:t("Nudge"),...I({keys:{x:"nudgeX",y:"nudgeY"},min:-p,max:p,label:null,length:m}),...a(m,"nudgeX"),...T({tablet:!0,siteSide:!0})},[[["placement"],{context:"heroGroupDepth",is:0,default:0}]]),resolveFields:(o,{fields:i,appState:_})=>{const f=typeof o.props.id=="string"?o.props.id:"";if(g(_?.data,f)===0)return i;const r={...i};return r.width=u("Width",n(s,{}),l,d,5,c,e),r}};export{k as HeroGroupFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i}from"react/jsx-runtime";import{IMAGE_FIT_ROW_LABEL as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{IMAGE_FIT_ROW_LABEL as n,imageFitOptions as p}from"../../../../../../format/lib/content/image-fit.js";import{FILL_ROW_OPTION as c,imageFocalPointActsIn as f,imageAspectPhoneRest as d}from"../../../../../../format/lib/content/image-aspect.js";import{phoneKey as g}from"efficient-easel/draw";import{CropIcon as m,ImageIcon as F}from"efficient-easel/icons";import{BOX_SHAPES as l}from"../../../../../../format/lib/content/box-shape.js";import{shapeLines as s}from"../../../../../../format/lib/content/gallery-card-layout.js";import{fillRowCell as h,shapePickerRow as a}from"../../../shape-picker.js";import{cornersUnitFields as R,focusKeptField as r,imageCornersField as _,linkField as I,plainText as A,cornerSidesField as O,upload as w,withPanelOnly as S}from"../../../controls.js";import{group as t,phoneTwinFields as P}from"efficient-easel/screen/lib/document/box-fields";import{select as L}from"../../../box-fields.js";import{photographyToggle as u}from"../../shared-fields.js";import{CARD_ROW_FACTS as k,cardRowField as y,cardRowFields as C,cardRowLinkField as T,typedLinkField as W}from"../../../card-row-fields.js";import{CARD_ROW_LINK_PROP as x}from"../../../../../../format/lib/content/card-template.js";import{IMAGE_CORNERS_ROW as E}from"../../../../../../format/lib/content/image-corners.js";import{offerNextPicture as N}from"../../../../animation/hover-fields.js";import{darkenFields as B}from"../../../darken-fields.js";const $={fields:{_gImage:t("Image"),src:w("Image","image/*",void 0,{focus:"focal",focusWhen:(e,o)=>f(o,e.fit,e.aspect,e[g("aspect")])}),alt:S(A("Alt text")),rowField:y("Shows","image"),[x]:T(),...P("aspect",a("Aspect ratio",i(m,{}),s(l),"image","16/9",{more:[h(c)]}),void 0,{phoneRow:a("Aspect ratio",i(m,{}),s(l),"image","16/9",{phoneRest:d})}),fit:L(n,i(F,{}),p(),"cover"),focal:r(),focalTablet:r(),focalPhone:r(),href:W(I("Link")),_gStyle:t("Style"),grayscale:u(),...B(),_gShape:t("Shape"),corners:_(),...R(E,"corners"),cornerSides:O()},resolveFields:(e,o)=>N(C(o.fields,e,o),e,o),showWhenFacts:k};export{$ as ImageBlockFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i}from"react/jsx-runtime";import{keptByRow as
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import{keptByRow as u}from"efficient-easel/screen/lib/document/style-fields";import{CaseIcon as k,OpacityIcon as T,PlacementIcon as y,TextLinesIcon as a}from"efficient-easel/icons";import{colorInput as d,sizeField as r,text as h,textarea as g,toggle as O,upload as c}from"../../../controls.js";import{group as t}from"efficient-easel/screen/lib/document/box-fields";import{iconPickerRow as f,lengthUnitFields as b,slider as p}from"../../../box-fields.js";import{INTRO_BLEED_PICTURES as I,LONG_WORD_CELL as S}from"../../../choice-pictures.js";import{deviceField as e,deviceNote as x}from"efficient-easel/screen/lib/document/device-fields";import{DEFAULT_INTRO_BLEED_LAYOUT as E,INTRO_BLEED_COPY_SHARE as o,INTRO_BLEED_LAYOUT_OPTIONS as B}from"../../../../../../format/lib/sections/intro-bleed-layout.js";import{INTRO_BODY_SIZE_ROW as l,INTRO_TITLE_SIZE_ROW as m}from"../../../../../../format/lib/content/section-type-size.js";import{heightField as _,ctaField as D}from"../../shared-fields.js";import{INTRO_PH as n}from"../../../../../../format/lib/document/blocks/general/IntroBleed/meta.js";const H={fields:{_dDevice:x(),_gContent:t("Content"),eyebrow:h("Eyebrow",n.eyebrow),title:g("Heading",n.title),body:g("Subtitle",n.body),uppercase:O("Uppercase heading",!1,i(k,{})),_gBackground:t("Background images"),imageSrc:e("desktop",c("Background image","image/*")),imageSrcMobile:e("mobile",c("Background image","image/*")),_gLayout:t("Layout"),layout:f("Text position",i(y,{}),B.map(s=>({...s,picture:I[s.value]})),E,{columns:2,cell:S}),heightDesktop:_("desktop"),heightMobile:_("mobile"),copyShareDesktop:e("desktop",p("Text height",i(a,{}),o.min,o.max,o.step,o.desktop,"%")),copyShareMobile:e("mobile",p("Text height",i(a,{}),o.min,o.max,o.step,o.mobile,"%")),sticky:u("stickTop"),overlay:p("Overlay",i(T,{}),0,100,5,60,"%"),_gTextDesktop:e("desktop",t("Text style")),titleSizeDesktop:e("desktop",r("Heading font size",32,120,1,96,"heading",{row:m,view:"desktop"})),bodySizeDesktop:e("desktop",r("Subtitle font size",12,28,1,17,"body",{row:l,view:"desktop"})),_gTextMobile:e("mobile",t("Text style")),titleSizeMobile:e("mobile",r("Heading font size",24,72,1,44,"heading",{row:m,view:"phone"})),bodySizeMobile:e("mobile",r("Subtitle font size",12,22,1,16,"body",{row:l,view:"phone"})),...b(m,"titleSizeDesktop",{phone:!0}),...b(l,"bodySizeDesktop",{phone:!0}),_gButton:t("Button"),...D,buttonColor:d("Button color","#C9A461"),buttonTextColor:d("Button text color","#000000")}};export{H as IntroBleedFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import{darkenFields as l}from"../../../darken-fields.js";import{POST_CARD_HEIGHT as e,POST_CARD_LAYOUT_FALLBACK as c,POST_CARD_LAYOUTS as n}from"../../../../../../format/lib/post-card-layout.js";import p from"../../../../../components/BlogPostSource.js";import{HeightIcon as s,ImageIcon as _,LayoutIcon as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{darkenFields as l}from"../../../darken-fields.js";import{POST_CARD_HEIGHT as e,POST_CARD_LAYOUT_FALLBACK as c,POST_CARD_LAYOUTS as n}from"../../../../../../format/lib/post-card-layout.js";import p from"../../../../../components/BlogPostSource.js";import{HeightIcon as s,ImageIcon as _,LayoutIcon as g}from"efficient-easel/icons";import{NOT_BOUND_TO_POST as O,linkField as d,sourceField as C,text as r,textarea as a,toggle as T,upload as f}from"../../../controls.js";import{group as R}from"efficient-easel/screen/lib/document/box-fields";import{iconPickerRow as u,placementField as h,slider as L}from"../../../box-fields.js";import{LONG_WORD_CELL as S,POST_CARD_PICTURES as x}from"../../../choice-pictures.js";import{withRowRules as P}from"../../../../../../render/lib/document/show-when.js";import{POSTCARD_PH as t}from"../../../../../../format/lib/document/blocks/general/PostCard/meta.js";const m={field:"layout",is:"cover"},D={not:m},A=["placement","darken","darkenStyle","minHeight","_gTint"],E=["showCover"],y=["image","title","excerpt","href"],Y={fields:P({source:C(p),image:f("Cover image","image/*"),title:a("Heading",t.title),excerpt:a("Excerpt",t.excerpt),href:d("Link"),category:r("Category",t.category),date:r("Date",t.date),readLabel:r("Read time",t.readLabel),layout:u("Card layout",o(g,{}),n.map(i=>({...i,picture:x[i.value]})),c,{columns:2,cell:S}),showCover:T("Show cover image",!0,o(_,{})),placement:h("Text position"),minHeight:L("Card height",o(s,{}),e.min,e.max,e.step,e.fallback,e.length),_gTint:R("Image tint"),...l()},[[A,m],[E,D],[y,O]])};export{Y as PostCardFields};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n,jsxs as M,Fragment as Y}from"react/jsx-runtime";import{HeightIcon as K,PlacementIcon as R,PlayIcon as N,UploadIcon as $}from"efficient-easel/icons";import{useEasel as j,useSelectedHost as X}from"efficient-easel/easel";import{SettingsDefaultReset as G,SettingsField as q,SettingsSegmented as z}from"efficient-easel/panel";import{describedAs as J,FLAT_ACCESS as Q,iconOf as Z,onDesktopWords as ee,phoneTwinFields as C,useAccessPatch as te}from"efficient-easel/screen/lib/document/box-fields";import{keptByRow as v}from"efficient-easel/screen/lib/document/style-fields";import{colorInput as oe,edgePad as H,plainText as ne,Slider as w,useSelectedSibling as O}from"../controls.js";import{ColourRow as ie,InheritedColourRow as le}from"../ColourControl.js";import{rowSay as re,segmented as A}from"../box-fields.js";import{SHAPE_TABLE as ae}from"../../../../format/lib/content/gallery-card-layout.js";import{ShapePicker as de}from"../shape-picker.js";import{HERO_FIXED_DEFAULT as se,HERO_HEIGHT_PX as x,readHeroFixedHeight as he,SECTION_HEIGHT as u}from"../../../../format/lib/content/section-height.js";import{DEFAULT_TINT as F}from"../../../../format/lib/content/tint.js";import{editorEaselWords as ue,say as a}from"../../../../format/lib/editor-words.js";import{nonEmptyString as E}from"../../../../format/lib/non-empty-string.js";import{findParentNode as ce}from"../../../../format/lib/document/passes/document-position.js";import{DEFAULT_OVERLAY_POSITION as L,OVERLAY_POSITION_OPTIONS as I,slideOverlayState as D}from"../../../../format/lib/sections/hero-overlay.js";import{VIDEO_PLAYBACK_DEFAULT as pe,VIDEO_PLAYBACK_LABELS as fe,VIDEO_PLAYBACKS as ge,VIDEO_SOURCE_DEFAULT as be,VIDEO_SOURCE_LABELS as me,VIDEO_SOURCES as ve}from"../../../../format/lib/hero-video.js";function Oe(){return ae.filter(e=>e.ratio!==null)}const _={desktop:{number:"heightDesktop",fixed:"heightFixed"},tablet:{number:"heightTablet",fixed:"heightFixedTablet"},mobile:{number:"heightMobile",fixed:"heightFixedMobile"}},P={read:e=>e.heightMobile,write:(e,t,o)=>({heightMobile:o}),fieldKey:()=>"heightMobile",ownField:!0,tablet:{read:e=>e.heightTablet,write:(e,t,o)=>({heightTablet:o}),fieldKey:()=>"heightTablet",ownField:!0}};function k(e,{number:t,fixed:o}){const l=t===void 0?void 0:e[t];return he(e[o])??(typeof l=="number"?{unit:"vh",vh:l}:null)}const xe="On Tablet, this hero uses the Desktop vh. Set vh in the Desktop view.";function Ee({view:e,keys:t,props:o}){const l=X(),d=te(Q),{number:s}=t,p={...l?.values??{},...s?{[s]:o.value}:{}},b=k(p,t),i=e==="tablet"?k(p,_.desktop):null,h=b??i??{unit:"vh",vh:u.fallback},c=o.readOnly===!0,T=Oe(),W=r=>{if(r===h.unit)return;if(r!=="vh"){d([[t.fixed,i?.unit===r?i.value:se[r]]]);return}const B=s!==void 0&&typeof p[s]!="number"&&i!==null&&i.unit!=="vh";d([[t.fixed,void 0],...B?[[s,u.fallback]]:[]])},f=b===null&&e!=="desktop",m=s===void 0,S=m&&i!==null&&i.unit!=="vh",y=i===null?`${u.fallback} ${u.unit}`:i.unit==="vh"?`${i.vh} ${u.unit}`:i.unit==="px"?i.value:T.find(r=>r.image===i.value)?.label??i.value;return n(q,{label:a("Height"),icon:Z(n(K,{})),hint:m&&(h.unit==="vh"||S)?a(xe):void 0,action:e==="desktop"?void 0:n(G,{words:ue()?.panel,label:a("Height"),changed:b!==null||!!p[t.fixed],detail:e==="tablet"?ee(re,y):y,disabled:c,onReset:()=>d([...s?[[s,void 0]]:[],[t.fixed,void 0]])}),children:M("div",{style:{display:"flex",flexDirection:"column",gap:"var(--space-8)",flex:"1 1 auto",minWidth:0},children:[n(z,{options:[{id:"vh",label:a("vh"),disabled:S},{id:"ratio",label:a("Ratio")},{id:"px",label:a("px")}],value:h.unit,onChange:W,ariaLabel:a("Unit"),disabled:c}),h.unit==="ratio"?n(de,{label:"Height",lines:T,column:"image",value:h.value,disabled:c,onChange:r=>d([[t.fixed,r]])}):h.unit==="px"?w({...x,value:f?null:h.px,...f?{placeholder:h.px}:{},suffix:x.unit,ariaLabel:"Height",disabled:c,onChange:r=>d([[t.fixed,`${r}${x.unit}`]])}):w({min:u.min,max:u.max,step:u.step,value:f?null:h.vh,...f?{placeholder:h.vh}:{},suffix:u.unit,ariaLabel:"Height",disabled:c||m,onChange:r=>o.onChange(r)})]})})}const g=(e,t=_[e])=>({type:"custom",...J({},{type:"number",label:"Height"}),render:o=>n(Ee,{view:e,keys:t,props:o})}),_e={read:e=>e.heightFixedTablet,write:(e,t,o)=>({heightFixedTablet:o}),fieldKey:()=>"heightFixedTablet",ownField:!0};function qe({tabletNumber:e=!0}={}){const t=e?P:{...P,tablet:_e},o=g("tablet",e?void 0:{fixed:_.tablet.fixed}),l=C("heightDesktop",g("desktop"),t,{phoneRow:o}),d=C("heightDesktop",g("desktop"),t,{phoneRow:g("mobile")});return{heightDesktop:l.heightDesktop,...e?{heightTablet:l.heightTablet,heightFixedTablet:v("heightTablet")}:{heightFixedTablet:l.heightFixedTablet},heightMobile:d.heightMobile,heightFixed:v("heightDesktop"),heightFixedMobile:v("heightMobile")}}const ze={overlayColor:oe("Overlay color",F),overlayPosition:H("Overlay position",I,L,"A corner would need a diagonal ramp, which this overlay does not draw.",n(R,{}))},U="Texture",V=e=>H("Overlay position",I,e,"A corner would need a diagonal ramp, which this overlay does not draw.",n(R,{}),void 0,U);function Te(){try{const{appState:e,selectedItem:t}=j(o=>o);return Se(e,t?.props?.id)}catch{return}}function Se(e,t){return E(ce(e,t)?.props?.textureColor)}function ye({value:e,onChange:t}){const[o]=O("overlayPosition"),l=Te(),d=E(e)??"",s=D({overlayColor:d,overlayPosition:o},l);return n(le,{label:a("Overlay color"),value:d,inherited:s.color,resetTo:a(U),onChange:t,onReset:()=>t("")})}const Re=V(L),Ce=V("");function He(e){const[t]=O("overlayColor"),o=D({overlayColor:t,overlayPosition:e.value}).own?Re:Ce;return n(Y,{children:o.render(e)})}function we(e){if(!Array.isArray(e))return;const t=e.flatMap((o,l)=>E(o?.props?.overlayColor)?[l+1]:[]);if(t.length!==0)return t.length===1?a("Slide {n}: own Overlay color.",{n:t[0]}):a("Slides {n}: own Overlay color.",{n:t.join(", ")})}function Ae({value:e,onChange:t}){const[o]=O("slides");return n(ie,{label:a("Texture color"),value:e||F,onChange:t,hint:we(o)})}const Je={type:"custom",render:({value:e,onChange:t})=>n(Ae,{value:e,onChange:t})},Qe={overlayColor:{type:"custom",render:({value:e,onChange:t})=>n(ye,{value:e,onChange:t})},overlayPosition:{type:"custom",render:({value:e,onChange:t})=>n(He,{value:e,onChange:t})}},Ze={videoSource:A("Source",n($,{}),ve.map(e=>({label:me[e],value:e})),be),youtubeUrl:ne("YouTube link","https://youtu.be/…"),videoPlayback:A("Playback",n(N,{}),ge.map(e=>({label:fe[e],value:e})),pe)};export{ze as HERO_OVERLAY_ROWS,Qe as HERO_SLIDE_OVERLAY_ROWS,xe as HERO_TABLET_VH_HINT,Je as HERO_TEXTURE_COLOR_ROW,Ze as HERO_VIDEO_ROWS,qe as heroHeightFields,Oe as heroRatioLines,we as textureColorHint,Se as textureColorOfSlide};
|
|
@@ -3,7 +3,7 @@ import { boxFieldBuilders, type BoxFieldSay } from "efficient-easel/screen/lib/d
|
|
|
3
3
|
import type { ShowWhenRule } from "efficient-shell/format";
|
|
4
4
|
type Rows = ReturnType<typeof boxFieldBuilders>;
|
|
5
5
|
export declare const rowSay: BoxFieldSay;
|
|
6
|
-
export declare const LENGTH_UNITS_TABLE: Readonly<Record<"size" | "spacing" | "gap" | "letterSpacing" | "fontSize" | "border" | "height" | "position" | "radius" | "breakpoint", readonly ("
|
|
6
|
+
export declare const LENGTH_UNITS_TABLE: Readonly<Record<"size" | "spacing" | "gap" | "letterSpacing" | "fontSize" | "border" | "height" | "position" | "radius" | "breakpoint", readonly ("px" | "%" | "vw")[]>>;
|
|
7
7
|
export declare const slider: Rows["slider"];
|
|
8
8
|
export declare const select: Rows["select"];
|
|
9
9
|
export declare const Segmented: Rows["Segmented"];
|
|
@@ -8,6 +8,7 @@ import { type ShowWhenRule } from "../../../render/lib/document/show-when.js";
|
|
|
8
8
|
import { CARD_IMAGE_RADIUS_ROW } from "../../../format/lib/content/card-image-shape.js";
|
|
9
9
|
import { type AlignmentPoint, FOCAL_DEFAULT, type UnitChoice as ShellUnitChoice } from "efficient-shell/ui";
|
|
10
10
|
import { type ColourChoice } from "./ColourControl.js";
|
|
11
|
+
import { type DeviceTier } from "efficient-easel/screen/lib/document/device-fields";
|
|
11
12
|
import type { GeocodeState } from "../../../format/lib/content/contact.js";
|
|
12
13
|
import { SECTION_PIN_SCREENS_KEY } from "../../../format/lib/content/section-sticky.js";
|
|
13
14
|
import { type SectionHeightMode, type SectionHeightUnit } from "../../../format/lib/content/section-min-height.js";
|
|
@@ -19,6 +20,9 @@ import { type TypeRole, type TypeSizeValue } from "../../../format/lib/content/s
|
|
|
19
20
|
import { type WidthMode } from "../../../format/lib/content/section-width.js";
|
|
20
21
|
import type { Bucket, DesignGroup } from "./field-groups.js";
|
|
21
22
|
import { type SelectField, type SelectOption } from "efficient-easel/screen/lib/document/box-fields";
|
|
23
|
+
import { type LengthUnitState } from "efficient-easel/screen/lib/document/box-fields";
|
|
24
|
+
import { type LengthGrid, type LengthRow } from "efficient-easel/screen/lib/content/length-units";
|
|
25
|
+
import { type PanelView } from "../../../format/lib/content/view-tier.js";
|
|
22
26
|
type SelectData = {
|
|
23
27
|
options: readonly SelectOption[];
|
|
24
28
|
fallback: string;
|
|
@@ -142,6 +146,16 @@ export declare function backgroundField(label: string, builtIn: SectionBackgroun
|
|
|
142
146
|
export declare function sectionBandChoices(stored: SectionBackground, builtIn: SectionBackground, colors: ReturnType<typeof normalizeThemeColors>, n: number, band: SectionBandColours, onChange: (next: SectionBackground) => void): ColourChoice[];
|
|
143
147
|
export declare function cardImageBackgroundField(label: string, builtIn: string): CustomField<unknown>;
|
|
144
148
|
export declare function sectionThemeFields(readValue?: (v: unknown) => unknown, followLabel?: string): Record<string, CustomField<unknown>>;
|
|
149
|
+
export declare function useLengthRow(o: {
|
|
150
|
+
row: LengthRow;
|
|
151
|
+
label: string;
|
|
152
|
+
grid: LengthGrid;
|
|
153
|
+
valueKey: string;
|
|
154
|
+
view: PanelView;
|
|
155
|
+
numbersIn?: (tier: DeviceTier) => boolean;
|
|
156
|
+
convertTo?: (convert: (value: number) => number) => Record<string, unknown>;
|
|
157
|
+
followsView?: DeviceTier;
|
|
158
|
+
}): LengthUnitState | undefined;
|
|
145
159
|
export declare function Slider({ min, max, step, value, onChange, suffix, readout, notch, ariaLabel, disabled, placeholder, placeholderWord, onClear, units, }: {
|
|
146
160
|
min: number;
|
|
147
161
|
max: number;
|
|
@@ -178,6 +192,7 @@ export declare function pxField(label: string, opts: {
|
|
|
178
192
|
}): CustomField<number | null>;
|
|
179
193
|
interface CornersRowTier {
|
|
180
194
|
sidesKey: string;
|
|
195
|
+
row?: LengthRow;
|
|
181
196
|
step?: number;
|
|
182
197
|
useFollowed: () => number;
|
|
183
198
|
mark: ReactElement<MarkProps>;
|
|
@@ -187,10 +202,10 @@ export declare function cornersRowField(tier: CornersRowTier): CustomField<numbe
|
|
|
187
202
|
export declare function useSelectedSibling(key: string): [unknown, (next: unknown) => void];
|
|
188
203
|
export declare function keptBy<T = unknown>(): CustomField<T>;
|
|
189
204
|
export declare function useSelectedPatch(): (patch: FieldsPatch) => void;
|
|
205
|
+
export declare function cornersUnitFields(row: LengthRow, reachedBy: string): Record<string, CustomField<unknown>>;
|
|
190
206
|
export declare function cornerSidesField(): CustomField<string[] | null>;
|
|
191
207
|
export declare function sectionCornersField(): CustomField<number | null>;
|
|
192
208
|
export declare function sectionShapeFields(): Record<string, unknown>;
|
|
193
|
-
type PanelView = "desktop" | "tablet" | "phone";
|
|
194
209
|
export declare function buttonWordsEntryField(partKey: string): CustomField<undefined>;
|
|
195
210
|
export declare function cardCornersField(): CustomField<number | null>;
|
|
196
211
|
export declare function cardShapeFields(): Record<string, unknown>;
|
|
@@ -217,7 +232,10 @@ export declare function boxPhoneRowField(): import("efficient-easel/screen/lib/d
|
|
|
217
232
|
export declare function boxColumnsFields(): {
|
|
218
233
|
phoneRow: import("efficient-easel/screen/lib/document/box-fields").BoxField<number>;
|
|
219
234
|
};
|
|
220
|
-
export declare function sizeField(label: string, min: number, max: number, step: number, fallback: number, role: TypeRole
|
|
235
|
+
export declare function sizeField(label: string, min: number, max: number, step: number, fallback: number, role: TypeRole, length?: {
|
|
236
|
+
row: LengthRow;
|
|
237
|
+
view: PanelView;
|
|
238
|
+
}): CustomField<TypeSizeValue>;
|
|
221
239
|
export declare function cellWidthFields(): Record<string, unknown>;
|
|
222
240
|
export declare function useSelectedProps(): Record<string, unknown>;
|
|
223
241
|
export declare const RowPropsContext: import("react").Context<Record<string, unknown> | null>;
|