efficient-web-builder 38.0.0 → 38.1.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 +19 -0
- package/dist/editor/lib/geocode.d.ts +3 -5
- package/dist/editor/lib/geocode.js +1 -1
- package/dist/editor/lib/puck/controls.js +1 -1
- package/dist/format/lib/links/link-picker-setup.js +1 -1
- package/dist/format/lib/links/page-link-rules.d.ts +1 -0
- package/dist/format/lib/links/page-link-rules.js +1 -1
- package/dist/format/lib/source-rules/one-map-module.d.ts +6 -0
- package/dist/format/lib/source-rules/one-map-module.js +5 -0
- package/dist/format/lib/web-backend.d.ts +11 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 38.1.0 - 2026-10-23
|
|
6
|
+
|
|
7
|
+
A MINOR: `WebsiteBackend.geocode`, the optional backend group behind "Find coordinates" (#271), and the tree-wide `one-map-module` rule. A host whose backend has no `geocode` draws no "Find coordinates" button. EFFICIENT's client (efficient-storefront-blocks `createEfficientBackend`) implements it in the release that takes this one.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **"Find coordinates" asks the session's backend** (`WebsiteBackend.geocode`, a new optional `WebsiteGeocoder` group: `locate(query) → { lat, lng, label } | null`, rejecting when the geocoder cannot answer now). `lib/geocode` no longer fetches the storefront's `/geocode.json`, a second geocoder that called OpenStreetMap directly with neither the ERP's cache nor its shared one-request-a-second turn (Victor Mau, 2026-10-23: one map API, none duplicated). EFFICIENT's client (efficient-storefront-blocks `createEfficientBackend`) implements it over `GET /api/storefront/geocode/` (efficient-backend#3749). A backend without the group draws no "Find coordinates" button, and coordinates are typed in the manual panel; before, the button showed and always failed with "Lookup busy" under a host's own backend. `GeocodeResult` is declared in `lib/web-backend` and still exported from `lib/geocode`; `canGeocode()` is new.
|
|
12
|
+
|
|
13
|
+
### Guards
|
|
14
|
+
|
|
15
|
+
- New rule `lib/source-rules/one-map-module` (`oneMapModule`), run here by `scripts/test-one-map-module.ts` and by the storefront over its own files: no map SDK import (Google Maps, Leaflet, Mapbox, OpenLayers, MapLibre itself), no Google Maps global, and no geocoder or map-vendor API host in source. A repository names its exemptions with a reason, and an exemption whose file is gone fails. Red check: a file naming the OpenStreetMap geocoder's host fails it.
|
|
16
|
+
- `scripts/test-one-site-map.tsx` drops its own Google Maps SDK sweep, which the rule now holds for every map SDK; it still checks that the two Google modules are gone.
|
|
17
|
+
|
|
18
|
+
## 38.0.1 - 2026-10-23
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- **Only a wheel's own page reads back as a Product link.** A saved link is a Product only when it is `/wheels/<slug>` (one segment, `isProductPath` in `lib/links/page-link-rules`). Every path under `/wheels/` used to count, so a menu link onto a collection page (`/wheels/collections/precision-forged`) re-opened in the Product box as "(unavailable)", and picking from that list swapped the link for a wheel and renamed the item after it (Hartes US header, 2026-10-23). A deeper `/wheels/…` path now reads as a Custom URL. `inferLinkKind` and the older `inferKind` share the one rule.
|
|
23
|
+
|
|
5
24
|
## 38.0.0 - 2026-10-23
|
|
6
25
|
|
|
7
26
|
**MAJOR for hosts:** the left-panel media view is gone (easel 19 media popup); peers efficient-easel ^19.0.0 and efficient-shell ^8.39.0 (#266). Each general block is meta.ts + render.tsx with GENERAL_METAS (#264; three constants moved, no host imports them). Also the Page / Popup add menu and popup links (#265).
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
label: string;
|
|
5
|
-
}
|
|
1
|
+
import type { GeocodeResult } from "../../format/lib/web-backend.js";
|
|
2
|
+
export type { GeocodeResult };
|
|
3
|
+
export declare function canGeocode(): boolean;
|
|
6
4
|
export declare function geocodeAddress(query: string): Promise<GeocodeResult | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{backendOf as r}from"./website-session.js";function t(){return!!r().geocode}async function d(n){const o=n.trim();if(!o)return null;const e=r().geocode;if(!e)throw new Error("geocode_unavailable");return e.locate(o)}export{t as canGeocode,d as geocodeAddress};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r,jsxs as w,Fragment as T}from"react/jsx-runtime";import{cloneElement as fe,useId as mt,useRef as oe,useState as V}from"react";import{useEasel as W,useSelectedFields as re}from"efficient-easel/easel";import{say as l,editorEaselWords as x}from"../../../format/lib/editor-words.js";import{readHidable as he,hidableText as me}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as Y,LINK_FIELD_MARKER as ge,MEDIA_FIELD_MARKER as be,SCAFFOLD_FIELD_MARKER as xe,TEXT_FIELD_MARKER as I,foldMetaOf as q,textFieldIdentifier as gt}from"efficient-easel/draw";import bt from"../../components/ApplyCornersToSiblings.js";import xt from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as yt,CORNER_RADIUS_MAX as ye,CORNER_RADIUS_MIN as D}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as St,IMAGE_CORNERS_LABEL as Ct}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as _t}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as It,GALLERY_LAYOUTS as U,GALLERY_LAYOUT_KEYS as Se}from"../../../format/lib/content/gallery-layout.js";import{anchorSiblingsOf as Et,HERO_GROUP_PLACEMENTS as Tt,HERO_GROUP_PLACEMENT_DEFAULT as Rt,normalisePlacement as Ot,placementPoints as Ce}from"../../../format/lib/hero-group-placement.js";import wt from"../../components/KeepHint.js";import Pt from"../../components/AnchorField.js";import{AdjustIcon as kt,AlignLeftIcon as Nt,EyeIcon as Lt,AlignSeparateIcon as vt,AnimationIcon as _e,BackgroundIcon as At,BorderAllIcon as Ft,BlockSectionIcon as Dt,CartIcon as Bt,ColumnWidthsIcon as Ie,ColumnsIcon as Ht,CornerIcon as Gt,DirectionDownIcon as Mt,DirectionLeftIcon as Kt,DirectionRightIcon as Wt,DirectionUpIcon as Ut,DollarIcon as Xt,FinishIcon as $t,GapIcon as Ee,GridIcon as jt,GroundIcon as zt,HashIcon as Te,HeightIcon as Vt,ImageIcon as Yt,ListIcon as qt,LocationIcon as ie,NudgeIcon as Jt,PaddingAllIcon as Zt,PaddingBottomIcon as Re,PaddingLeftIcon as Oe,PaddingRightIcon as we,PaddingTopIcon as Pe,PageIcon as ke,PhoneIcon as Qt,PlacementIcon as en,ProductSizeIcon as tn,StickyIcon as nn,RotateIcon as on,SquareIcon as rn,TypeIcon as ln,WidthIcon as an,WrapIcon as sn}from"efficient-easel/icons";import{FieldGlyph as Ne}from"../../components/FieldGlyph.js";import{resolvePageBackground as cn}from"../../../format/lib/content/page-background.js";import{CORNER_SIDES as Le,CORNER_SIDE_POINTS as dn,hasOwnSectionCorners as un,normalizeCornerSides as ve}from"../../../format/lib/content/section-corners.js";import{SECTION_MOTION_NONE as pn,SECTION_MOTION_OPTIONS as fn}from"../../../format/lib/content/section-animation.js";import{enclosingSectionProps as Ae}from"./enclosing-section.js";import{SettingsDefaultReset as y,SettingsField as h,SettingsGroupHead as hn,SettingsGroupSub as mn,SettingsBorder as gn,SettingsSegmented as bn,SettingsSides as xn,SettingsSidesEach as Fe,sidesStartEach as yn,SettingsSwitch as De,borderSides as Sn,borderStartEach as Cn}from"efficient-easel/panel";import{FieldSelect as _n,ListField as In}from"efficient-easel/fields";import{DisplayChips as En}from"efficient-shell/ui";import{desktopDisplayChanged as Tn,partShownOnDesktop as Rn,partShownOnPhone as On,phoneDisplayChanged as wn,withDesktopPart as Pn,withPhonePart as kn}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as Nn,Checkbox as Ln,CornersInput as vn,DateTimePicker as An,FOCAL_DEFAULT as Fn,PictureTiles as Be,PositionInput as Dn,Slider as Bn,Tooltip as He}from"efficient-shell/ui";import{ColourControl as Ge,InheritedColourRow as Hn}from"./ColourControl.js";import Me from"./MarkupToolbar.js";import{deviceField as g}from"efficient-easel/screen/lib/puck/device-fields";import{NO_CONTROL_FIELD as Gn,NoControlMark as J,noControlField as X}from"efficient-easel/screen/lib/puck/panel-no-control-mark";import{OWN_BOX_FIELD as Mn}from"../../../format/lib/puck/own-box.js";import{PHONE_CLEAR as Kn,phoneKey as B,resolvePhoneValue as le}from"../../../format/lib/puck/phone-override.js";import{SuppressibleText as Wn}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Un,CARD_OUTLINE_OPTIONS as Xn,DEFAULT_CARD_INDEX_FORMAT as $n,DEFAULT_CARD_OUTLINE as jn}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as zn,DEFAULT_COVER_INDEX as Vn}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Yn}from"efficient-easel/draw";import qn from"../../components/MediaUploadField.js";import Jn from"../../components/MultiSelectField.js";import Zn from"../../components/SectionThemePicker.js";import Qn from"../../components/SearchSelectField.js";import eo from"../../components/StorefrontLinkField.js";import{UiIcon as Ke}from"efficient-easel/draw/client";import{SECTION_PADDING as E}from"../../../format/lib/content/section-padding.js";import{hasPhoneHeight as to,resolveSectionMinHeight as no}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as Z,SECTION_STICK_LABEL as ae,hasPhoneStick as oo,resolveSectionStick as ro}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as io,SECTION_MIN_HEIGHT_GROUP_LABEL as $,SECTION_SCREEN_PCT as lo}from"../../../format/lib/content/section-min-height.js";import{CONTAINER_DIRECTION_LABEL as ao,containerDirectionPoints as so,resolveContainerDirection as We}from"../../../format/lib/content/container-direction.js";import{BOX_ALIGN_POINTS as co,BOX_BLOCK_SPACING_LABEL as uo,BOX_BLOCK_SPACING_POINTS as Ue,BOX_JUSTIFY_POINTS as Xe,BOX_PHONE_ROW_LABEL as po,BOX_PHONE_ROW_MAX as fo,BOX_PHONE_ROW_MIN as $e,BOX_SHARE_LABEL as je,BOX_SHARE_POINTS as se,BOX_WRAP_LABEL as ho,BOX_WRAP_POINTS as ze}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as H}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as mo}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as go,normalizeTheme as bo,siteButtonPaint as xo}from"../../../format/lib/theme.js";import{CONTAINER_GAP as ce,CONTAINER_GAP_BUILT_IN as yo,GAP_FIELD_CONTAINER as So,hasOwnContainerGap as Co,resolveContainerGap as _o}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as Io,CARD_IMAGE_BG_OFF as Eo,CARD_IMAGE_BG_SWATCH_NAMES as To,CARD_IMAGE_BG_SWATCHES as Ro,isCardImageBackgroundInheriting as Oo,cardImageBackgroundChoice as wo,THEME_CARD_IMAGE_BG as Po}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as ko,SECTION_BG_SWATCHES as No,SECTION_BG_SWATCH_NAMES as Lo,THEME_SECTION_BG as vo,isSectionBackgroundInheriting as Ao}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Fo}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Do,TYPE_SIZE_INHERIT as Bo,isTypeSizeInheriting as Ho}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Go,WIDTH_CHOICE_LABEL as Mo,WIDTH_INHERIT as Ko,resolveWidth as Wo,sectionRunsFullWidth as Ve}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as Ye}from"./panel-heading-scope.js";import{withStyleKind as Uo}from"efficient-easel/style-clipboard";function G(e){for(const[t,n]of Object.entries(e))n&&typeof n=="object"&&!q(n)&&Uo(n,`section:${t}`);return e}function tl({children:e}){return r("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function qe(){return null}function Xo(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");return r(qe,{},e)}function $o(e){return e.type===qe}function P(e){return $o(e)?void 0:e}function N(e,t){return l("{value} from {from}",{value:e,from:t})}function jo(){const{appState:e}=W(i=>i),t=e.data.root?.props??{},{mode:n,pageWidth:o}=Wo(t,"full");return n==="page"?N(`${o}px`,l("the page")):n==="contained"?N(l("Contained"),l("the page")):N(l("Full"),l("the page"))}function zo(){const{blockGap:e}=H();return e===null?l("this container's own spacing"):N(`${e}px`,l("Styles"))}function Vo({inherited:e,onReset:t,label:n}){return r(y,{words:x()?.panel,label:l(n),changed:!e,detail:zo(),onReset:t})}function Yo({inherited:e,onReset:t,label:n}){return r(y,{words:x()?.panel,label:l(n),changed:!e,detail:jo(),onReset:t})}function L({value:e,onChange:t,label:n,placeholder:o,hint:i,multiline:a,hideable:c=!0,markup:s=!0}){const{text:d,hidden:u}=he(e),f=oe(null),p=oe(null),m=O=>t(c?{text:O,hidden:u}:O),b=()=>t({text:d,hidden:!u}),C=c&&u,R=mt(),_=i?er(i)?r("span",{className:"sf-hint-keep sf-hint-while-typing",children:l(i)}):r(wt,{children:l(i)}):void 0,z=u?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return r(h,{label:l(n),icon:r(ln,{}),htmlFor:R,className:C?"is-hidden":void 0,hint:_,action:c?r(He,{content:z,children:r("button",{type:"button",className:"sf-field-eye","aria-pressed":u,"aria-label":z,onClick:b,children:u?r(Ke,{name:"eye-off",size:14}):r(Ke,{name:"eye",size:14})})}):void 0,children:w("div",{className:"sf-copybox",children:[s&&r(Me,{target:a?p:f,value:d,onChange:m}),a?r("textarea",{id:R,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:O=>m(O.target.value)}):r("input",{id:R,ref:f,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:O=>m(O.target.value)})]})})}function nl(e,t){return{...e,[xe]:t}}function ol(e){const t=e[I];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[I]:{...t,offPage:!0}}}function rl(e){return!e||typeof e!="object"?!1:e[I]?.offPage===!0}const Je="sfPanelOnly";function il(e){if(!e[I])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Je]:!0}}function ll(e){return!!e&&typeof e=="object"&&e[Je]===!0}function al(e){const t=e[I];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[I]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as Ra,SCALAR_TEXT_CONTROLS as Oa}from"efficient-easel/draw";function sl(e,t){if(!e[I])throw new Error("inOwnBox: the field holds no authored text");const{[Gn]:o,...i}=e;return{...i,[Mn]:!0,render:t}}const qo=new Set(Yn),v=(e,t)=>{const n={...t,[I]:e};if(!qo.has(e.control))return n;const o=t.render;return{...X(n,"authored-copy"),render:i=>r(Wn,{name:i.name,children:o(i)})}},cl="Everything else on this block comes from the linked post. Unlink it to edit by hand.",Jo={field:"source.slug",set:!0},dl={not:Jo},Zo="Select a word, then press the highlighter.",Qo=new Set([Zo]),er=e=>Qo.has(e);function ul(e,t,n){return v({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(L,{value:o,onChange:i,label:e,placeholder:t,hint:n})})}function pl(e,t,n){return v({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(L,{value:o,onChange:i,label:e,placeholder:t,hint:n,multiline:!0})})}function fl(e,t,n){return v({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(L,{value:o,onChange:i,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function hl(e,t,n){return v({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(L,{value:o,onChange:i,label:e,placeholder:t,hint:n,hideable:!1})})}function ml(e){return{type:"custom",[ge]:{label:e},render:({value:t,onChange:n})=>r(eo,{value:me(t),onChange:n,label:e})}}function gl(e,t,n){return v({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(L,{value:o,onChange:i,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const bl={Design:kt,Animation:_e};function xl(e,t){return e.includes("Design")?t!=="Design":null}function tr({label:e}){return r(hn,{title:l(e),level:Ye(1)})}function nr({level:e,label:t}){return e===1?r(tr,{label:t}):r(ir,{label:t})}function Ze(e,t){return{type:"custom",[Y]:{label:e,level:t},render:()=>r(nr,{level:t,label:e})}}function S(e){return Ze(e,2)}function yl(e){return{type:"custom",render:()=>r(or,{text:e})}}function or({text:e}){return r("p",{className:"sf-note",children:l(e)})}function Sl(e){return Ze(e,1)}function Cl(e){return q(e)!==null&&e?.tabs!==void 0}const Qe=new Map;function _l(e,t){const n=`${e}\0${t?t.join(""):""}`,o=Qe.get(n)??{type:"custom",tabs:t,[Y]:{label:e,level:1},bucket:e,marker:!0,render:()=>r(T,{})};return Qe.set(n,o),o}function Il(e){return q(e)!==null&&e?.designGroup!==void 0}const et=new Map;function El(e){const t=et.get(e)??{type:"custom",[Y]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>r(T,{})};return et.set(e,t),t}function rr(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function Tl(e,t){return rr(e)===t?e:{...e,marker:!0,fold:t,render:()=>r(T,{})}}function Rl(e){const t=e;if(t.marker===!0&&t.fold===void 0)return e;const{fold:n,...o}=e;return{...o,marker:!0,render:()=>r(T,{})}}function ir({label:e}){return r(mn,{title:l(e),level:Ye(2)})}function tt({swatches:e,current:t,onPick:n,names:o}){const i=e.find(s=>s.toLowerCase()===t.toLowerCase()),a=i?o?.[i]:void 0,c=a?l(a):t;return w("div",{className:"sf-swatches",children:[e.map(s=>{const d=o?.[s]?l(o[s]):s;return r(He,{content:d,children:r("button",{type:"button","aria-pressed":t.toLowerCase()===s.toLowerCase(),className:`sf-swatch ${t.toLowerCase()===s.toLowerCase()?"is-active":""}`,style:{background:s},onClick:()=>n(s),"aria-label":d})},s)}),r("span",{className:"sf-swatch-hex",children:c})]})}function Ol(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=Ao(n,t);return r(h,{label:l(e),icon:r(At,{}),changed:!i,action:r(y,{words:x()?.panel,label:l(e),changed:!i,detail:l("the theme's section background"),onReset:()=>o(ko)}),children:tt({swatches:No,current:i?vo:n??t??"",onPick:o,names:Lo})})}}}function lr(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=n,a=Oo(i,t);return r(h,{label:l(e),icon:r(zt,{}),changed:!a,action:r(y,{words:x()?.panel,label:l(e),changed:!a,detail:l("the theme's image stage"),onReset:()=>o(Io)}),children:tt({swatches:Ro,current:a?Po:wo(i,t),onPick:o,names:To})})}}}function wl(e=n=>n,t){return G({_gSectionTheme:S(Fo),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>r(Zn,{value:e(n),onChange:o,followLabel:t})}})}function M({min:e,max:t,step:n,value:o,onChange:i,suffix:a="",readout:c=!0,notch:s,ariaLabel:d,disabled:u=!1}){const f=s!==void 0&&Number.isFinite(s)&&s>=e&&s<=t;return r("div",{className:f?"sf-slider has-notch":"sf-slider",style:f?{"--sf-notch":(s-e)/(t-e)}:void 0,children:r(Bn,{min:e,max:t,step:n,value:o,suffix:a||void 0,showInput:c,label:d===void 0?void 0:l(d),disabled:u,size:"sm",className:"sf-slider-track",onChange:p=>{p!==null&&p!==o&&i(p)}})})}function K(e,t,n,o,i,a,c="",s){return{type:"custom",render:d=>r(h,{label:l(e),icon:P(t),action:s?s("storedValue"in d?d.storedValue:d.value,d.onChange):void 0,children:M({min:n,max:o,step:i,value:typeof d.value=="number"?d.value:a,suffix:c,ariaLabel:e,onChange:d.onChange})})}}function nt(e,t){const{min:n,max:o,step:i=1,unsetLabel:a,hint:c,restTrack:s,unsetMark:d,icon:u}=t;return{type:"custom",render:({value:f,onChange:p})=>{const m=typeof f=="number"?f:null,b=m===null;return r(h,{label:l(e),icon:u?P(u):void 0,value:b?d||a===void 0?void 0:l(a):`${m}px`,changed:!b,action:d?fe(d,{changed:!b,onReset:()=>p(null)}):r(y,{words:x()?.panel,label:l(e),changed:!b,onReset:()=>p(null)}),hint:typeof c=="string"?l(c):c,children:s?s({min:n,max:o,step:i,px:m,label:e,onChange:p}):M({min:n,max:o,step:i,value:m??n,readout:!1,ariaLabel:e,onChange:p})})}}}function Pl(e){const t=K("Gap",r(Ee,{}),ce.min,ce.max,ce.step,yo[e],"px",(n,o)=>r(Vo,{inherited:!Co(e,n),onReset:()=>o(void 0),label:"Gap"}));return{type:"custom",[So]:e,render:n=>t.render({...n,value:_o(e,n.value,n.field?.siteGap),storedValue:n.value,onChange:o=>n.onChange(o)})}}const Q="Corners";function de(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,i=o!==null;return r(h,{label:l(Q),icon:r(Gt,{}),changed:i,action:fe(e.mark,{changed:i,onReset:()=>n(null)}),hint:e.hint,children:r(ar,{tier:e,px:o,onRadius:n})})}}}function ot(e){let t=null;try{t=re()}catch{t=null}return[t?.values?.[e],n=>t?.onChange(e,n)]}function ar({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),i=e.useClosedReason?e.useClosedReason():null,[a,c]=ot(e.sidesKey),s=ve(a)??[...Le];return r(vn,{label:l(Q),value:s,corners:dn,onChange:d=>{const u=ve(d)??[];c(u.length===Le.length?null:u)},radius:t,onRadiusChange:n,radiusMin:D,radiusMax:ye,radiusStep:e.step??1,radiusPlaceholder:String(o),disabled:i!==null,disabledReason:i??void 0})}function rt(){return X({type:"custom",render:()=>r(J,{})},"always")}function sr({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=H(),i=typeof o=="number"?`${o}px`:l("not set");return r(y,{words:x()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):N(i,l("Styles")),onReset:n})}function cr(){const{cornerRadiusPx:e}=H();return typeof e=="number"?e:D}function dr(){return de({sidesKey:"sectionCornerSides",useFollowed:cr,useClosedReason:()=>lt()?l(it):null,mark:r(sr,{label:Q}),hint:r(ur,{})})}const it="This section runs edge to edge, so its corners sit off the page. Set Width to Content width to use them.";function lt(){return Ve(A())}function ur(){return r(T,{children:lt()?it:"Follows Styles ▸ Basics ▸ Corners until you set a number here."})}function kl(){return G({_gShape:S("Shape"),sectionCorners:dr(),sectionCornerSides:rt(),sectionBorder:at("desktop"),sectionBorderPhone:at("mobile")})}const pr=()=>({width:l("Border width"),sides:{top:l("Border top"),right:l("Border right"),bottom:l("Border bottom"),left:l("Border left")},style:l("Border style"),styles:{solid:l("Solid"),dashed:l("Dashed"),dotted:l("Dotted")},color:l("Border color"),unit:"px"});function fr(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function hr(){let e;try{const t=bo(H().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||go.line}function mr({value:e,onChange:t,tier:n}){const[o]=ot("sectionBorder"),i=hr(),a=e&&typeof e=="object"?e:{},c=n==="mobile"?o&&typeof o=="object"?o:{}:{},[s,d]=V(()=>Cn(a,c)),u=pr();return r(h,{label:l("Border"),icon:r(Ft,{}),action:r(Fe,{each:s,label:l("Each side"),onChange:d}),children:r(gn,{label:l("Border"),value:a,each:s,onChange:f=>t(fr(f)),placeholder:{sides:Sn(c),style:c.style??"solid",color:c.color||i},presets:[i],words:u,max:mo})})}function at(e){return g(e,{type:"custom",render:({value:t,onChange:n})=>r(mr,{value:t,onChange:n,tier:e})})}function Nl(){return{_gMotion:S("Motion"),sectionAnimation:pe("Entrance",r(_e,{}),[...fn],pn)}}function ue(){let e=null;try{const{appState:t,selectedItem:n}=W(i=>i),o=n?.props?.id?String(n.props.id):void 0;e=o?Ae(t?.data,o):null}catch{e=null}return e!==null&&Ve(e)}function st(e){const{cornerRadiusPx:t}=H(),n=ue(),o=typeof t=="number"?t:e;let i=null;try{const{appState:c,selectedItem:s}=W(u=>u),d=s?.props?.id?String(s.props.id):void 0;i=d?Ae(c?.data,d):null}catch{i=null}if(n||!i)return o;const a=i.sectionCorners;return un(a)?a:o}function gr({label:e,changed:t=!1,onReset:n=()=>{}}){const o=ue(),i=st(D),a=o?"Site":"Section";return r(y,{words:x()?.panel,label:l(e),changed:t,detail:N(`${i}px`,o?l("Styles"):l("the section")),onReset:n})}function br(){return r(T,{children:ue()?l("The section is full width, so this card follows Styles ▸ Basics ▸ Corners."):l("Follows the section's Corners until you set a number here.")})}function xr(){return de({sidesKey:"cardCornerSides",useFollowed:()=>st(D),mark:r(gr,{label:Q}),hint:r(br,{})})}function yr(){return{type:"custom",render:()=>r(bt,{})}}function Ll(e){return{...e,render:t=>r(xt,{render:e.render,props:t})}}function vl(){return{_gShape:S("Shape"),cardCorners:xr(),cardCornerSides:rt(),cardCornersApplyAll:yr()}}function Al(){return k("Justify",r(vt,{}),Xe,Xe[0].value)}function Fl(){return k("Item alignment",r(Nt,{}),co,"stretch")}function Dl(){return k(ho,r(sn,{}),ze,ze[0].value)}function Bl(){return{type:"custom",render:({value:e,onChange:t})=>{const n=se.find(o=>o.value===e)??se[0];return r(h,{label:l(je),icon:r(Ie,{}),value:l(n.label),children:r(Be,{className:"sf-gallery-layouts",label:l(je),value:n.value,onChange:t,options:se.map(o=>({value:o.value,label:l(o.label),picture:r("span",{className:"sf-gallery-pic",children:Sr(o.weights).map((i,a)=>r("i",{style:{gridColumn:`span ${i}`}},a))})}))})})}}}function Sr(e){if(!e)return[3,4];const t=e.reduce((n,o)=>n+o,0);return e.map(n=>Math.round(n/t*12))}function Hl(){return k(uo,r(Ee,{}),Ue,Ue[0].value)}function Gl(){return K(po,r(Qt,{}),$e,fo,1,$e)}function Ml(e){const t=pe(ao,Xo("`Direction` names how a container's children run — a MODIFIER, not a thing. doc/naming.md N10.1 gives the idea a dash in its Glyph column; editor-shell's own `direction` meaning says the bare row is CORRECT and not an omission (SS seat, 2026-09-11)."),so(e),We(e,void 0));return{type:"custom",render:n=>t.render({...n,value:We(e,n.value),onChange:o=>n.onChange(o)})}}function Kl(e,t,n,o,i,a){return{type:"custom",render:({value:c,onChange:s})=>r(h,{label:l(e),icon:r(Ne,{noun:a}),action:r(y,{words:x()?.panel,label:l(e),changed:!Ho(c),detail:l("the Text style in Styles"),onReset:()=>s(Bo),defaultAction:{onPress:()=>s(Do),title:l("Keep this section's own built-in size"),icon:r(Dt,{})}}),children:M({min:t,max:n,step:o,value:typeof c=="number"?c:i,suffix:"px",ariaLabel:e,onChange:s})})}}function Wl(){return{_gCellWidth:S("Cell width"),gridSpan:k("Positions",r(Ie,{}),[{label:"Auto",value:""},...Array.from({length:_t},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function A(){let e=null;try{e=W(t=>t).selectedItem}catch{e=null}return e?.props??{}}function Cr({min:e,max:t,step:n,px:o,label:i,onChange:a,desktopKey:c,fallback:s}){const d=A()[c],u=le(void 0,d,s);return r(T,{children:M({min:e,max:t,step:n,value:le(o,d,s),readout:!1,ariaLabel:i,notch:u,onChange:a})})}function _r({label:e,desktopKey:t,fallback:n,changed:o=!1,onReset:i=()=>{}}){const a=A()[t],c=le(void 0,a,n);return r(y,{words:x()?.panel,label:l(e),changed:o,detail:l("{value} on desktop",{value:`${c}px`}),onReset:i})}function Ir(e){return nt(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unsetLabel:"Follows Desktop",unsetMark:r(_r,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback}),restTrack:t=>r(Cr,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}function Ul(e){return{type:"custom",render:({value:t,onChange:n})=>r(Tr,{...e,value:t,onChange:n})}}function Er({label:e,icon:t,options:n,value:o,resolved:i,restWord:a,onChange:c}){const s=n.some(d=>d.value===o);return r(h,{label:l(e),icon:P(t),action:r(y,{words:x()?.panel,label:l(e),changed:s,detail:l("{value} on desktop",{value:l(a)}),onReset:()=>c(void 0)}),children:te({options:n,value:s?o:i,onChange:d=>c(d),ariaLabel:e})})}function Tr({label:e,icon:t,options:n,desktopKey:o,resolve:i,value:a,onChange:c}){const s=A()[o],d=i(void 0,s),u=n.find(f=>f.value===d)?.label??"";return r(Er,{label:e,icon:t,options:n,value:a,resolved:d,restWord:u,onChange:c})}const Rr={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Or={Top:Pe,Bottom:Re,Left:Oe,Right:we},wr=e=>{const t=Or[e];return r(t,{})};function Xl(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,i=_=>Rr[_],a=_=>K(i("Top"),r(Pe,{}),E.min,E.max,E.step,_,"px"),c=(_,z,O,ne=E)=>g("mobile",Ir({label:i(_),icon:wr(_),desktopKey:z,min:ne.min,max:ne.max,step:ne.step,fallback:O})),s=e.top??E.min,d=e.bottom??E.min,u="sectionPaddingLeft",f="sectionPaddingRight",p=e.sideBounds??E,m=e.side??p.min,b=e.sidePhone??m,C=e.phone===!0,R=_=>C?g("desktop",_):_;return G({...o?{_gSpacing:S("Padding")}:{},[t]:R(a(s)),...C?{[B(t)]:c("Top",t,s)}:{},...e.only==="top"?{}:{[n]:R(K(i("Bottom"),r(Re,{}),E.min,E.max,E.step,d,"px")),...C?{[B(n)]:c("Bottom",n,d)}:{}},...e.sides?{[u]:R(K(i("Left"),r(Oe,{}),p.min,p.max,p.step,m,"px")),...C?{[B(u)]:c("Left",u,b,p)}:{},[f]:R(K(i("Right"),r(we,{}),p.min,p.max,p.step,m,"px")),...C?{[B(f)]:c("Right",f,b,p)}:{}}:{}})}const j=["top","right","bottom","left"],Pr={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},ct=e=>typeof e=="number"?e:null;function kr(e,t,n){const o={};for(const i of j)n[i]!==t[i]&&(o[e[i]]=n[i]??void 0);return o}function Nr({tier:e,o:t}){let n=null;try{n=re()}catch{n=null}const o=n?.values??{},i=e==="mobile"?t.phoneKeys:t.keys,a=Object.fromEntries(j.map(u=>[u,ct(o[i[u]])])),c=Object.fromEntries(j.map(u=>[u,String(e==="mobile"?ct(o[t.keys[u]])??t.fallback[u]:t.fallback[u])])),[s,d]=V(()=>yn(a,c));return r(h,{label:l("Padding"),icon:r(Zt,{}),action:r(Fe,{each:s,label:l("Each side"),onChange:d}),children:r(xn,{label:l("Padding"),each:s,value:a,placeholder:c,min:t.min,max:t.max,step:t.step,onChange:u=>{const f=kr(i,a,u);Object.keys(f).length&&n?.onChangeMany(f)},words:{sides:{top:l("Padding top"),right:l("Padding right"),bottom:l("Padding bottom"),left:l("Padding left")},vertical:l("Top and bottom"),horizontal:l("Left and right"),unit:"px"}})})}function $l(e={}){const t={...Pr,...e.keys},n={keys:t,phoneKeys:Object.fromEntries(j.map(s=>[s,B(t[s])])),fallback:{top:0,right:0,bottom:0,left:0,...e.fallback},min:e.min??0,max:e.max??200,step:e.step??4},o=e.phone!==!1,i=s=>{const d={type:"custom",render:()=>r(Nr,{tier:s,o:n})};return o?g(s,d):d},a=()=>X({type:"custom",render:()=>r(J,{})},"always"),c=j.filter(s=>s!=="top");return G({...e.group===!1?{}:{_gSpacing:S("Padding")},[n.keys.top]:i("desktop"),...o?{[n.phoneKeys.top]:i("mobile")}:{},...Object.fromEntries(c.map(s=>[n.keys[s],{...a(),reachedBy:n.keys.top}])),...o?Object.fromEntries(c.map(s=>[n.phoneKeys[s],g("mobile",a())])):{}})}const dt=e=>typeof e=="number"?e:null;function Lr(e,t,n){const o={};for(const i of["x","y"])n[i]!==t[i]&&(o[e[i]]=n[i]??void 0);return o}function vr({o:e}){let t=null;try{t=re()}catch{t=null}const n=t?.values??{},o={x:dt(n[e.keys.x]),y:dt(n[e.keys.y])},i=l(e.label??"Position"),a=!!(o.x||o.y),c=u=>{const f=Lr(e.keys,o,u);Object.keys(f).length&&t?.onChangeMany(f)},s=r(Dn,{label:i,value:o,onChange:c,words:{x:l("Left and right"),y:l("Up and down"),unit:"px"},placeholder:{x:"0",y:"0"},min:e.min,max:e.max,step:e.step??1}),d=r(y,{words:x()?.panel,label:i,changed:a,detail:"0 px, 0 px",onReset:()=>c({x:null,y:null})});return e.label===null?w("div",{className:"sf-position-line",children:[s,d]}):r(h,{label:i,icon:r(Jt,{}),changed:a,action:d,children:s})}function jl(e){return{[e.keys.x]:{type:"custom",render:()=>r(vr,{o:e})},[e.keys.y]:{...X({type:"custom",render:()=>r(J,{})},"always"),reachedBy:e.keys.x}}}const Ar={contained:"Contained",page:"Page",full:"Full"},ee="Width";function zl(e,t=Go,n=!0){const o=t.map(i=>({label:Mo[i]??Ar[i],value:i}));return G({...n?{_gWidth:S(ee)}:{},widthMode:{type:"custom",render:({onChange:i,field:a})=>r(h,{label:l(ee),icon:r(an,{}),action:n?r(Yo,{inherited:a?.inherited??!1,onReset:()=>i(Ko),label:ee}):void 0,children:te({options:o,value:a?.currentValue||e,onChange:i,ariaLabel:ee})})}})}function Vl(){const e=o=>({type:"custom",render:({value:i,onChange:a})=>r(h,{label:$,icon:P(r(Vt,{})),action:o?o(a):void 0,children:te({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:["auto","fixed","screen"].includes(i)?i:"auto",onChange:a,ariaLabel:$})})}),t=()=>({type:"custom",render:({value:o,onChange:i,field:a})=>{const c=a?.unit==="%"?"%":"px",s=c==="%"?lo:io;return r("div",{className:"sf-field",children:M({min:s.min,max:s.max,step:s.step,value:typeof o=="number"?o:s.fallback,suffix:c,ariaLabel:$,onChange:i})})}}),n=()=>pe("Unit",r(Te,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return G({_gHeight:S($),sectionHeightMode:g("desktop",e()),sectionHeightValue:g("desktop",t()),sectionHeightUnit:g("desktop",n()),sectionHeightModePhone:g("mobile",e(o=>r(Fr,{onClear:()=>o(void 0)}))),sectionHeightValuePhone:g("mobile",t()),sectionHeightUnitPhone:g("mobile",n())})}function Fr({onClear:e}){const t=A(),n=to(t),o=no(t),i=l("{value} on desktop",{value:o.mode==="auto"?l("Auto"):`${o.value}${o.unit}`});return r(y,{words:x()?.panel,label:l($),changed:n,detail:i,onReset:e})}function Yl(){const e=n=>({type:"custom",render:({value:o,onChange:i,id:a,name:c})=>r(Dr,{value:o,onChange:i,labelId:`${a??c??"stickTop"}-label`,phone:n})}),t=()=>({type:"custom",render:({value:n,onChange:o})=>r("div",{className:"sf-field",children:M({min:Z.min,max:Z.max,step:Z.step,value:typeof n=="number"?n:Z.fallback,suffix:"px",ariaLabel:l("Distance from top"),onChange:o})})});return{_gStick:S(ae),stickTop:g("desktop",e(!1)),stickTopDistance:g("desktop",t()),stickTopPhone:g("mobile",e(!0)),stickTopDistancePhone:g("mobile",t())}}function Dr({value:e,onChange:t,labelId:n,phone:o}){const i=A(),a=ro(i),c=o?a.phone:e===!0;return r(h,{label:l(ae),labelId:n,icon:P(r(nn,{})),action:w(T,{children:[o?r(y,{words:x()?.panel,label:l(ae),changed:oo(i),detail:l("{value} on desktop",{value:a.desktop?`${a.desktopDistance}px`:l("Off")}),onReset:()=>t(void 0)}):null,r(De,{checked:c,onChange:t,ariaLabelledBy:n})]})})}const ut="e.g. about";function ql(){return{_gAnchor:S("Anchor"),anchor:v({control:"plainText",label:"Name",placeholder:ut},{type:"custom",render:({value:e,onChange:t})=>r(Pt,{value:e,onChange:t,nameBox:(n,o)=>r(L,{value:n,onChange:o,label:"Name",placeholder:ut,hideable:!1,markup:!1})})})}}function Jl(e,t,n){return{type:"custom",render:({value:o,onChange:i,id:a,name:c})=>{const s=`${a??c??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return r(h,{label:l(e),icon:t,htmlFor:s,hint:n===void 0?void 0:l(n),children:r(An,{id:s,value:Number.isFinite(d)?new Date(d):null,onChange:u=>i(u?u.toISOString():"")})})}}}function F(e,t,n){return{type:"custom",render:({value:o,onChange:i,id:a,name:c})=>{const s=typeof o=="boolean"?o:t,d=`${a??c??e}-label`;return r(h,{label:l(e),labelId:d,icon:n,action:r(De,{checked:s,onChange:i,ariaLabelledBy:d})})}}}function Zl(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const i=`${String(n??o??"pageBackground")}-colour`;return r(h,{label:l("Background"),icon:r(ke,{}),htmlFor:i,action:r(Ge,{id:i,label:"Background",value:cn(e),onChange:t})})}}}function Ql(e,t){return{type:"custom",render:({value:n,onChange:o,id:i})=>{const a=typeof n=="boolean"?n:t,c=`${i??e}-checkbox`;return r(h,{label:l(e),htmlFor:c,className:"sf-checkbox",action:r(Ln,{id:c,checked:a,onChange:o})})}}}const ea={follows:"fill"},ta={follows:"ink"};function na(e,t,n){if(typeof t!="string"){const o=t.follows;return{type:"custom",render:({value:i,onChange:a})=>r(Br,{label:e,part:o,icon:n,value:i,onChange:a})}}return{type:"custom",render:({value:o,onChange:i})=>r(h,{label:l(e),icon:n,action:Ge({value:o||t,onChange:i,label:e})})}}function Br({label:e,part:t,icon:n,value:o,onChange:i}){const a=xo(H().theme),c=t==="fill"?a.fill:a.ink;return r(Hn,{label:l(e),icon:n,value:o||"",inherited:c,resetTo:N(c.toUpperCase(),l("Styles")),onChange:i,onReset:()=>i("")})}const Hr=[{value:"0% 0%",label:"Top left"},{value:"50% 0%",label:"Top"},{value:"100% 0%",label:"Top right"},{value:"0% 50%",label:"Left"},{value:"50% 50%",label:"Center"},{value:"100% 50%",label:"Right"},{value:"0% 100%",label:"Bottom left"},{value:"50% 100%",label:"Bottom"},{value:"100% 100%",label:"Bottom right"}];function pt({label:e,value:t,onChange:n,points:o=Hr}){const i=o.map(a=>({...a,label:l(a.label),...a.title?{title:l(a.title)}:null}));return r(Nn,{label:l(e),value:t,points:i,onChange:n})}function oa(){return X({type:"custom",render:()=>r(J,{})},"always")}const Gr=Ce([]);function ra(e,{stacking:t,fallback:n=Rt}){return{type:"custom",render:({value:o,onChange:i})=>{const a=Tt.includes(o)?o:n;return t?r(Mr,{label:e,value:a,onChange:i}):ft({label:e,value:a,onChange:i,points:Gr})}}}function Mr({label:e,value:t,onChange:n}){const{appState:o,selectedItem:i}=W(s=>s),a=i?.props?.id?String(i.props.id):void 0,c=a?Et(o?.data,a):[];return ft({label:e,value:t,onChange:n,points:Ce(c,a)})}function ft({label:e,value:t,onChange:n,points:o}){const i=o.find(a=>a.disabled);return r(h,{label:l(e),icon:r(en,{}),hint:i?.title?l(i.title):void 0,children:pt({label:e,value:Ot(t),onChange:n,points:o})})}const ia={top:r(Ut,{}),right:r(Wt,{}),bottom:r(Mt,{}),left:r(Kt,{})};function la(e,t,n,o,i,a){const c=f=>t.find(p=>p.value===f),s=f=>({value:f,label:"",disabled:!0,title:o}),d=f=>{const p=t.find(b=>b.cell===f);if(!p)return s(`missing-${f}`);const m=a?.[f];return m?{value:p.value,label:p.label,icon:m}:{value:p.value,label:p.label}},u=[s("corner-top-left"),d("top"),s("corner-top-right"),d("left"),s("centre"),d("right"),s("corner-bottom-left"),d("bottom"),s("corner-bottom-right")];return{type:"custom",render:({value:f,onChange:p})=>{const m=t.some(b=>b.value===f)?f:n;return r(h,{label:l(e),icon:i,value:c(m)?.label?l(c(m).label):"",children:pt({label:e,value:m,onChange:p,points:u})})}}}const Kr="\0note";function k(e,t,n,o,i){return{type:"custom",options:n,fallback:o,...i?{note:i}:{},render:({value:a,onChange:c,field:s})=>{const d=s.options??n,u=s.fallback??o,f=d.some(p=>p.value===a)?a:u;return r(h,{label:l(e),icon:P(t),children:r(_n,{value:f,ariaLabel:l(e),onChange:c,options:[...i?[{label:l(i),value:Kr,disabled:!0}]:[],...d.map(p=>({label:l(p.label),value:p.value}))]})})}}}function aa(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:i,field:a})=>r(Jn,{label:e,options:(a.options??t).map(c=>({...c,label:l(c.label)})),value:Array.isArray(o)?o:[],onChange:i,...n?{emptyLabel:l(n)}:{}})}}function sa(e,t,n,o){return{type:"custom",options:t,fallback:n,render:({value:i,onChange:a,field:c})=>r(Qn,{label:e,options:(c.options??t).map(s=>({...s,label:l(s.label)})),fallback:c.fallback??n,value:i,onChange:a,placeholder:o===void 0?void 0:l(o)})}}function ca(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const i={value:n,onChange:o,...t};return r(e,{...i})}}}function te({options:e,value:t,onChange:n,ariaLabel:o,disabled:i=!1}){return r(bn,{options:e.map(a=>a.picture?{id:a.value,label:a.picture,title:l(a.title??a.label)}:{id:a.value,label:l(a.label),title:a.title===void 0?void 0:l(a.title)}),value:t,onChange:n,ariaLabel:l(o),disabled:i})}const da=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function pe(e,t,n,o){const i=n.map(a=>typeof a=="string"?{label:a,value:a}:a);return{type:"custom",render:({value:a,onChange:c,field:s})=>r(h,{label:l(e),icon:P(t),children:te({options:i,value:i.some(d=>d.value===a)?a:a||s?.currentValue||o,onChange:c,ariaLabel:e})})}}function ua(e,t,n,o={}){return{type:"custom",[be]:!0,render:({value:i,onChange:a})=>r(qn,{value:i||"",onChange:a,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen})}}const pa={HeroSingle:["imageFocal"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function fa({value:e,onChange:t,label:n}){const o=e||{},i=!!o.pending,a=i?"var(--fg-dim, #888)":o.ok?"#1d9e75":"#d85a30",c=(s,d)=>t({...o,[s]:d===""?void 0:Number(d)});return w(h,{label:l(n),icon:r(ie,{}),children:[r("button",{type:"button",disabled:i,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"8px 10px",fontSize:13,cursor:i?"default":"pointer",opacity:i?.6:1,border:"1px solid var(--border-strong, #ccc)",borderRadius:6,background:"transparent",color:"inherit"},children:i?l("Finding…"):l("Find coordinates")}),o.status&&r("div",{style:{marginTop:6,fontSize:12,lineHeight:1.4,color:a},children:l(o.status)}),r("div",{style:{marginTop:6,fontSize:11,color:"var(--fg-dim, #999)"},children:l("Coordinates from OpenStreetMap")}),r("button",{type:"button",onClick:()=>t({...o,manual:!o.manual}),style:{marginTop:8,padding:0,border:"none",background:"none",font:"inherit",fontSize:12,color:"var(--sf-accent, #2563eb)",cursor:"pointer",textDecoration:"underline"},children:o.manual?l("Hide manual coordinates"):l("Enter coordinates manually")}),o.manual&&w("div",{style:{marginTop:8,display:"grid",gap:8},children:[r(h,{label:l("Latitude"),icon:r(ie,{}),children:r("input",{type:"number",step:"any",placeholder:l("e.g. {example}",{example:"34.0990198"}),value:typeof o.lat=="number"?o.lat:"",onChange:s=>c("lat",s.target.value)})}),r(h,{label:l("Longitude"),icon:r(ie,{}),children:r("input",{type:"number",step:"any",placeholder:l("e.g. {example}",{example:"-117.9842833"}),value:typeof o.lng=="number"?o.lng:"",onChange:s=>c("lng",s.target.value)})})]})]})}function Wr(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function Ur(e,t,n){const o=e.map(i=>({text:i?.text??""}));return t===null||t<0||t>=e.length?o:o.map((i,a)=>a===t?{text:n}:i)}function ha(e,t){return e===null?null:t>e?e:null}function Xr(e,t,n){if(n===null||n>=t.length)return null;for(let o=0;o<n;o+=1)if(e[o]!==t[o])return null;return e[n]!==t[n]&&t.includes(e[n])||e[n]!==t[n]&&t.length!==e.length?null:n}const ma={label:"Ticker items",icon:r(qt,{})};function ga(e,t,n,o){return{type:"custom",[I]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},render:({value:i,onChange:a})=>r($r,{label:e,icon:P(t),items:Array.isArray(i)?i:[],placeholder:n,onChange:a,markup:o==="markup"})}}function $r({label:e,icon:t,items:n,placeholder:o,onChange:i,markup:a=!1}){const c=oe(null),[s,d]=V(null),u=p=>p.map(m=>({text:m?.text??""})),f=p=>{const m=Xr(n,p,s);m===null&&(c.current=null),d(m),i(u(p))};return r(In,{label:l(e),icon:t,noun:l("item"),items:n,onChange:f,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:a?r(Me,{target:c,value:Wr(n,s),onChange:p=>i(Ur(n,s??-1,p)),disabled:s===null,label:s===null?l("Formatting — click a row first"):l("Formatting — row {n}",{n:s+1})}):void 0,renderRow:(p,m,b)=>r("input",{type:"text",className:a&&s===m?"sf-list-marking":void 0,value:p?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:m+1}),onChange:C=>b({text:C.target.value}),onFocus:C=>{c.current=C.currentTarget,d(m)}})})}function ba(e,t){const n=`${e.label} — row ${t+1}`;return v({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:i})=>r(L,{value:o,onChange:i,label:l("{label} — row {n}",{label:l(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function xa(e){return{_gCards:S("Cards"),coverIndex:k("Cover image",r(Yt,{}),zn,String(Vn),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:lr("Image background",Eo),cardImage:zr(),spinOnHover:F("Rotate on hover",e?.spinDefault??!0,r(on,{}))}}function ya(){return{outline:k("Card outline",r(rn,{}),Xn,jn),indexBadge:k("Card number",r(Te,{}),Un,$n),showBadge:F("Product badge",!0,r(Ne,{noun:"tag"}))}}function Sa(e){const t=e&&"bottomDefault"in e?e.bottomDefault:!0,n=e&&"defaults"in e?e.defaults:{showCardSizes:t,showCardBuy:t,showCardPage:t};return{_gShowOnCard:S("Show on a card"),showCardPrice:F("Price",!0,r(Xt,{})),showCardFinishes:F("Finish swatches",!0,r($t,{})),showCardSizes:F("Sizes",n.showCardSizes,r(tn,{})),showCardBuy:F("Buy button",n.showCardBuy,r(Bt,{})),showCardPage:F("Page button",n.showCardPage,r(ke,{}))}}function Ca(e,t="display"){const n=B(t);return{[t]:g("desktop",{type:"custom",render:({value:o,onChange:i})=>r(ht,{parts:e,changed:Tn(o),shown:a=>Rn(o,a),onPress:(a,c)=>i(Pn(o,a,c)),onReset:()=>i(void 0)})}),[n]:g("mobile",{type:"custom",render:({value:o,onChange:i})=>r(jr,{parts:e,desktopKey:t,value:o,onChange:i})})}}function ht({parts:e,changed:t,shown:n,onPress:o,onReset:i,detail:a}){const c=l("Display");return r(h,{label:c,icon:r(Lt,{}),changed:t,action:r(y,{words:x()?.panel,label:c,changed:t,detail:a,onReset:i}),children:r(En,{label:c,items:e.map(s=>({id:s.id,label:l(s.label),shown:n(s.id)})),onChange:o})})}function jr({parts:e,desktopKey:t,value:n,onChange:o}){const i=A()[t];return r(ht,{parts:e,changed:wn(n),shown:a=>On(i,n,a),onPress:(a,c)=>o(kn(n,a,c)),onReset:()=>o(Kn),detail:l("the same as Desktop")})}function zr(){return nt("Card image",{min:D,max:ye,step:yt,hint:"Rounds the picture. The card's own corner is in Styles."})}function _a(){return de({sidesKey:"cornerSides",step:St,useFollowed:()=>D,mark:r(Vr,{label:Ct}),hint:l("Rounds the picture. Left alone it stays square.")})}function Vr({label:e,changed:t=!1,onReset:n=()=>{}}){return r(y,{words:x()?.panel,label:l(e),changed:t,onReset:n})}function Ia(){return{type:"custom",render:({value:e,onChange:t})=>r(Yr,{value:typeof e=="string"?e:"",onChange:t})}}function Yr({value:e,onChange:t}){const[n,o]=V(null),i=Se.filter(c=>n===null||U[c].across===n),a=e&&e in U?U[e]:null;return w(T,{children:[r(h,{label:l("Photos in a row"),icon:r(Ht,{}),children:w("div",{className:"sf-gallery-filter",children:[r("button",{type:"button","aria-pressed":n===null,onClick:()=>o(null),children:l("All")}),It.map(c=>r("button",{type:"button","aria-pressed":n===c,onClick:()=>o(c),children:c},c))]})}),r(h,{label:l("Layout"),icon:r(jt,{}),value:a?l(a.label):l("Not chosen"),hint:l("{n} of {total} layouts",{n:i.length,total:Se.length}),children:r(Be,{className:"sf-gallery-layouts",label:l("Layout"),value:e,onChange:t,onClear:()=>t(""),options:i.map(c=>({value:c,label:l(U[c].label),picture:r("span",{className:"sf-gallery-pic",children:U[c].desktop.map(([s,d],u)=>r("i",{style:{gridColumn:`span ${s}`,gridRow:`span ${d}`}},u))})}))})})]})}export{Jo as BOUND_TO_POST,cl as BOUND_TO_POST_NOTE,bl as BUCKET_ICONS,pa as CUSTOM_FIELD_MEDIA,fa as CoordsField,ia as EDGE_ARROWS,Fn as FOCAL_DEFAULT,Hr as FOCAL_POINTS,Y as FOLD_FIELD_MARKER,ea as FOLLOWS_SITE_BUTTON,ta as FOLLOWS_SITE_BUTTON_INK,pt as FocalPicker,ir as GroupLabel,Zo as HIGHLIGHT_HINT,L as HidableTextField,ge as LINK_FIELD_MARKER,tl as Label,be as MEDIA_FIELD_MARKER,da as MEDIA_TYPE_OPTIONS,dl as NOT_BOUND_TO_POST,or as PanelNoteLine,Tr as PhoneChoiceRow,Er as PhoneChoiceStrip,ft as PlacementGridView,xe as SCAFFOLD_FIELD_MARKER,Oa as SCALAR_TEXT_CONTROLS,it as SECTION_BLEEDS_HINT,Pr as SIDE_PAD_KEYS,tr as SectionHeading,te as Segmented,Vo as SiteGapDefaultReset,M as Slider,tt as Swatches,Ra as TEXT_CONTROL_KINDS,I as TEXT_FIELD_MARKER,ma as TICKER_ITEMS_ROW,$r as TextListField,Yo as WidthDefaultReset,Xr as aimAfterListChange,ql as anchorFields,N as backTo,Ol as backgroundField,Fl as boxAlignField,Hl as boxBlockSpacingField,Al as boxJustifyField,Gl as boxPhoneRowField,Bl as boxShareField,Dl as boxWrapField,_l as bucketHeader,xr as cardCornersField,lr as cardImageBackgroundField,zr as cardImageField,xa as cardMediaFields,vl as cardShapeFields,Sa as cardShowFields,ya as cardStyleFields,Wl as cellWidthFields,Ql as checkbox,na as colorInput,hl as copyText,rt as cornerSidesField,de as cornersRowField,Jl as dateTime,El as designGroupHeader,Ml as directionField,Ca as displayFields,la as edgePad,xl as entriesHiddenForTab,ha as focusAfterRemove,oa as focusKeptField,Tl as foldMarker,q as foldMetaOf,rr as foldTitleOf,Ia as galleryLayoutField,Pl as gapField,S as group,Vl as heightFields,me as hidableText,er as hintIsWhileTyping,P as iconOf,_a as imageCornersField,sl as inOwnBox,Cl as isBucketHeader,Il as isDesignGroupHeader,$o as isNoGlyph,ml as linkField,aa as multiSelect,Xo as noGlyph,Zl as pageBackgroundField,yl as panelNote,Ul as phoneChoiceField,Ir as phoneOverrideField,ra as placementField,fl as plainText,gl as plainTextarea,jl as positionFields,Lr as positionPatch,nt as pxField,Rl as quietMarker,he as readHidable,Wr as rowText,sa as searchSelect,Sl as section,Nl as sectionAnimationFields,at as sectionBorderField,dr as sectionCornersField,kl as sectionShapeFields,wl as sectionThemeFields,pe as segmented,k as select,Ur as setRowText,G as sharedStyleKinds,$l as sidesPaddingFields,kr as sidesPaddingPatch,Kl as sizeField,K as slider,ca as sourceField,Xl as spacingFields,Yl as stickFields,Ll as templateField,ul as text,gt as textFieldIdentifier,rl as textFieldOffPage,ll as textFieldPanelOnly,ga as textList,ba as textListRowField,pl as textarea,F as toggle,ua as upload,jo as usePageWidthDetail,A as useSelectedProps,ot as useSelectedSibling,zo as useSiteGapDetail,zl as widthField,al as withIdentifier,ol as withOffPage,il as withPanelOnly,nl as withScaffold};
|
|
1
|
+
"use client";import{jsx as r,jsxs as R,Fragment as I}from"react/jsx-runtime";import{cloneElement as fe,useId as mt,useRef as oe,useState as V}from"react";import{useEasel as W,useSelectedFields as re}from"efficient-easel/easel";import{say as l,editorEaselWords as x}from"../../../format/lib/editor-words.js";import{readHidable as he,hidableText as me}from"efficient-easel/draw";import{FOLD_FIELD_MARKER as Y,LINK_FIELD_MARKER as ge,MEDIA_FIELD_MARKER as be,SCAFFOLD_FIELD_MARKER as xe,TEXT_FIELD_MARKER as E,foldMetaOf as q,textFieldIdentifier as gt}from"efficient-easel/draw";import bt from"../../components/ApplyCornersToSiblings.js";import xt from"../../components/TemplateFieldRow.js";import{CARD_IMAGE_RADIUS_STEP as yt,CORNER_RADIUS_MAX as ye,CORNER_RADIUS_MIN as D}from"../../../format/lib/content/card-image-shape.js";import{IMAGE_CORNER_STEP as St,IMAGE_CORNERS_LABEL as Ct}from"../../../format/lib/content/image-corners.js";import{GRID_MAX_COLUMNS as _t}from"../../../format/lib/content/grid-span.js";import{GALLERY_ACROSS_BUCKETS as It,GALLERY_LAYOUTS as U,GALLERY_LAYOUT_KEYS as Se}from"../../../format/lib/content/gallery-layout.js";import{anchorSiblingsOf as Et,HERO_GROUP_PLACEMENTS as Tt,HERO_GROUP_PLACEMENT_DEFAULT as Rt,normalisePlacement as Ot,placementPoints as Ce}from"../../../format/lib/hero-group-placement.js";import wt from"../../components/KeepHint.js";import Pt from"../../components/AnchorField.js";import{AdjustIcon as kt,AlignLeftIcon as Nt,EyeIcon as Lt,AlignSeparateIcon as vt,AnimationIcon as _e,BackgroundIcon as At,BorderAllIcon as Ft,BlockSectionIcon as Dt,CartIcon as Bt,ColumnWidthsIcon as Ie,ColumnsIcon as Ht,CornerIcon as Gt,DirectionDownIcon as Mt,DirectionLeftIcon as Kt,DirectionRightIcon as Wt,DirectionUpIcon as Ut,DollarIcon as Xt,FinishIcon as $t,GapIcon as Ee,GridIcon as jt,GroundIcon as zt,HashIcon as Te,HeightIcon as Vt,ImageIcon as Yt,ListIcon as qt,LocationIcon as ie,NudgeIcon as Jt,PaddingAllIcon as Zt,PaddingBottomIcon as Re,PaddingLeftIcon as Oe,PaddingRightIcon as we,PaddingTopIcon as Pe,PageIcon as ke,PhoneIcon as Qt,PlacementIcon as en,ProductSizeIcon as tn,StickyIcon as nn,RotateIcon as on,SquareIcon as rn,TypeIcon as ln,WidthIcon as an,WrapIcon as sn}from"efficient-easel/icons";import{FieldGlyph as Ne}from"../../components/FieldGlyph.js";import{resolvePageBackground as cn}from"../../../format/lib/content/page-background.js";import{CORNER_SIDES as Le,CORNER_SIDE_POINTS as dn,hasOwnSectionCorners as un,normalizeCornerSides as ve}from"../../../format/lib/content/section-corners.js";import{SECTION_MOTION_NONE as pn,SECTION_MOTION_OPTIONS as fn}from"../../../format/lib/content/section-animation.js";import{enclosingSectionProps as Ae}from"./enclosing-section.js";import{SettingsDefaultReset as y,SettingsField as h,SettingsGroupHead as hn,SettingsGroupSub as mn,SettingsBorder as gn,SettingsSegmented as bn,SettingsSides as xn,SettingsSidesEach as Fe,sidesStartEach as yn,SettingsSwitch as De,borderSides as Sn,borderStartEach as Cn}from"efficient-easel/panel";import{FieldSelect as _n,ListField as In}from"efficient-easel/fields";import{DisplayChips as En}from"efficient-shell/ui";import{desktopDisplayChanged as Tn,partShownOnDesktop as Rn,partShownOnPhone as On,phoneDisplayChanged as wn,withDesktopPart as Pn,withPhonePart as kn}from"../../../format/lib/content/part-display.js";import{AlignmentGrid as Nn,Checkbox as Ln,CornersInput as vn,DateTimePicker as An,FOCAL_DEFAULT as Fn,PictureTiles as Be,PositionInput as Dn,Slider as Bn,Tooltip as He}from"efficient-shell/ui";import{ColourControl as Ge,InheritedColourRow as Hn}from"./ColourControl.js";import Me from"./MarkupToolbar.js";import{deviceField as g}from"efficient-easel/screen/lib/puck/device-fields";import{NO_CONTROL_FIELD as Gn,NoControlMark as J,noControlField as X}from"efficient-easel/screen/lib/puck/panel-no-control-mark";import{OWN_BOX_FIELD as Mn}from"../../../format/lib/puck/own-box.js";import{PHONE_CLEAR as Kn,phoneKey as B,resolvePhoneValue as le}from"../../../format/lib/puck/phone-override.js";import{SuppressibleText as Wn}from"./section-text-suppress.js";import{CARD_INDEX_OPTIONS as Un,CARD_OUTLINE_OPTIONS as Xn,DEFAULT_CARD_INDEX_FORMAT as $n,DEFAULT_CARD_OUTLINE as jn}from"../../../format/lib/sections/product-card-style.js";import{COVER_INDEX_OPTIONS as zn,DEFAULT_COVER_INDEX as Vn}from"../../../format/lib/sections/card-cover-index.js";import{SCALAR_TEXT_CONTROLS as Yn}from"efficient-easel/draw";import qn from"../../components/MediaUploadField.js";import Jn from"../../components/MultiSelectField.js";import Zn from"../../components/SectionThemePicker.js";import Qn from"../../components/SearchSelectField.js";import eo from"../../components/StorefrontLinkField.js";import{UiIcon as Ke}from"efficient-easel/draw/client";import{SECTION_PADDING as T}from"../../../format/lib/content/section-padding.js";import{hasPhoneHeight as to,resolveSectionMinHeight as no}from"../../../format/lib/content/section-min-height.js";import{SECTION_STICK_DISTANCE as Z,SECTION_STICK_LABEL as ae,hasPhoneStick as oo,resolveSectionStick as ro}from"../../../format/lib/content/section-sticky.js";import{SECTION_MIN_HEIGHT as io,SECTION_MIN_HEIGHT_GROUP_LABEL as $,SECTION_SCREEN_PCT as lo}from"../../../format/lib/content/section-min-height.js";import{CONTAINER_DIRECTION_LABEL as ao,containerDirectionPoints as so,resolveContainerDirection as We}from"../../../format/lib/content/container-direction.js";import{BOX_ALIGN_POINTS as co,BOX_BLOCK_SPACING_LABEL as uo,BOX_BLOCK_SPACING_POINTS as Ue,BOX_JUSTIFY_POINTS as Xe,BOX_PHONE_ROW_LABEL as po,BOX_PHONE_ROW_MAX as fo,BOX_PHONE_ROW_MIN as $e,BOX_SHARE_LABEL as je,BOX_SHARE_POINTS as se,BOX_WRAP_LABEL as ho,BOX_WRAP_POINTS as ze}from"../../../format/lib/content/box-layout.js";import{usePreviewHeader as H}from"../../../render/components/PreviewHeaderContext.js";import{BORDER_MAX as mo}from"../../../format/lib/content/borders.js";import{DEFAULT_SURFACES as go,normalizeTheme as bo,siteButtonPaint as xo}from"../../../format/lib/theme.js";import{CONTAINER_GAP as ce,CONTAINER_GAP_BUILT_IN as yo,GAP_FIELD_CONTAINER as So,hasOwnContainerGap as Co,resolveContainerGap as _o}from"../../../format/lib/content/container-gap.js";import{CARD_IMAGE_BG_INHERIT as Io,CARD_IMAGE_BG_OFF as Eo,CARD_IMAGE_BG_SWATCH_NAMES as To,CARD_IMAGE_BG_SWATCHES as Ro,isCardImageBackgroundInheriting as Oo,cardImageBackgroundChoice as wo,THEME_CARD_IMAGE_BG as Po}from"../../../format/lib/content/card-image-background.js";import{SECTION_BG_INHERIT as ko,SECTION_BG_SWATCHES as No,SECTION_BG_SWATCH_NAMES as Lo,THEME_SECTION_BG as vo,isSectionBackgroundInheriting as Ao}from"../../../format/lib/content/section-background.js";import{SECTION_THEME_GROUP_LABEL as Fo}from"../../../format/lib/content/section-surface.js";import{TYPE_SIZE_FIXED as Do,TYPE_SIZE_INHERIT as Bo,isTypeSizeInheriting as Ho}from"../../../format/lib/content/section-type-size.js";import{SECTION_WIDTH_CHOICES as Go,WIDTH_CHOICE_LABEL as Mo,WIDTH_INHERIT as Ko,resolveWidth as Wo,sectionRunsFullWidth as Ve}from"../../../format/lib/content/section-width.js";import{useFoldHeadingLevel as Ye}from"./panel-heading-scope.js";import{withStyleKind as Uo}from"efficient-easel/style-clipboard";import{useEaselSession as Xo}from"efficient-easel/screen/lib/session-context";import{backendOf as $o}from"../website-session.js";function G(e){for(const[t,n]of Object.entries(e))n&&typeof n=="object"&&!q(n)&&Uo(n,`section:${t}`);return e}function il({children:e}){return r("div",{className:"sf-field-label",children:typeof e=="string"?l(e):e})}function qe(){return null}function jo(e){if(!e.trim())throw new Error("noGlyph() needs a reason naming the ruling that decided it.");return r(qe,{},e)}function zo(e){return e.type===qe}function P(e){return zo(e)?void 0:e}function N(e,t){return l("{value} from {from}",{value:e,from:t})}function Vo(){const{appState:e}=W(i=>i),t=e.data.root?.props??{},{mode:n,pageWidth:o}=Wo(t,"full");return n==="page"?N(`${o}px`,l("the page")):n==="contained"?N(l("Contained"),l("the page")):N(l("Full"),l("the page"))}function Yo(){const{blockGap:e}=H();return e===null?l("this container's own spacing"):N(`${e}px`,l("Styles"))}function qo({inherited:e,onReset:t,label:n}){return r(y,{words:x()?.panel,label:l(n),changed:!e,detail:Yo(),onReset:t})}function Jo({inherited:e,onReset:t,label:n}){return r(y,{words:x()?.panel,label:l(n),changed:!e,detail:Vo(),onReset:t})}function L({value:e,onChange:t,label:n,placeholder:o,hint:i,multiline:a,hideable:c=!0,markup:s=!0}){const{text:d,hidden:u}=he(e),f=oe(null),p=oe(null),m=w=>t(c?{text:w,hidden:u}:w),b=()=>t({text:d,hidden:!u}),C=c&&u,O=mt(),_=i?nr(i)?r("span",{className:"sf-hint-keep sf-hint-while-typing",children:l(i)}):r(wt,{children:l(i)}):void 0,z=u?l("Show {label} on the slide",{label:l(n)}):l("Hide {label} on the slide",{label:l(n)});return r(h,{label:l(n),icon:r(ln,{}),htmlFor:O,className:C?"is-hidden":void 0,hint:_,action:c?r(He,{content:z,children:r("button",{type:"button",className:"sf-field-eye","aria-pressed":u,"aria-label":z,onClick:b,children:u?r(Ke,{name:"eye-off",size:14}):r(Ke,{name:"eye",size:14})})}):void 0,children:R("div",{className:"sf-copybox",children:[s&&r(Me,{target:a?p:f,value:d,onChange:m}),a?r("textarea",{id:O,ref:p,value:d,placeholder:o===void 0?void 0:l(o),onChange:w=>m(w.target.value)}):r("input",{id:O,ref:f,type:"text",value:d,placeholder:o===void 0?void 0:l(o),onChange:w=>m(w.target.value)})]})})}function ll(e,t){return{...e,[xe]:t}}function al(e){const t=e[E];if(!t)throw new Error("withOffPage: the field holds no authored text");return{...e,[E]:{...t,offPage:!0}}}function sl(e){return!e||typeof e!="object"?!1:e[E]?.offPage===!0}const Je="sfPanelOnly";function cl(e){if(!e[E])throw new Error("withPanelOnly: the field holds no authored text");return{...e,[Je]:!0}}function dl(e){return!!e&&typeof e=="object"&&e[Je]===!0}function ul(e){const t=e[E];if(!t)throw new Error("withIdentifier: the field holds no authored text");return{...e,[E]:{...t,identifier:!0}}}import{TEXT_CONTROL_KINDS as ka,SCALAR_TEXT_CONTROLS as Na}from"efficient-easel/draw";function pl(e,t){if(!e[E])throw new Error("inOwnBox: the field holds no authored text");const{[Gn]:o,...i}=e;return{...i,[Mn]:!0,render:t}}const Zo=new Set(Yn),v=(e,t)=>{const n={...t,[E]:e};if(!Zo.has(e.control))return n;const o=t.render;return{...X(n,"authored-copy"),render:i=>r(Wn,{name:i.name,children:o(i)})}},fl="Everything else on this block comes from the linked post. Unlink it to edit by hand.",Qo={field:"source.slug",set:!0},hl={not:Qo},er="Select a word, then press the highlighter.",tr=new Set([er]),nr=e=>tr.has(e);function ml(e,t,n){return v({control:"text",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(L,{value:o,onChange:i,label:e,placeholder:t,hint:n})})}function gl(e,t,n){return v({control:"textarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(L,{value:o,onChange:i,label:e,placeholder:t,hint:n,multiline:!0})})}function bl(e,t,n){return v({control:"plainText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(L,{value:o,onChange:i,label:e,placeholder:t,hint:n,hideable:!1,markup:!1})})}function xl(e,t,n){return v({control:"copyText",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(L,{value:o,onChange:i,label:e,placeholder:t,hint:n,hideable:!1})})}function yl(e){return{type:"custom",[ge]:{label:e},render:({value:t,onChange:n})=>r(eo,{value:me(t),onChange:n,label:e})}}function Sl(e,t,n){return v({control:"plainTextarea",label:e,placeholder:t,hint:n},{type:"custom",render:({value:o,onChange:i})=>r(L,{value:o,onChange:i,label:e,placeholder:t,hint:n,multiline:!0,hideable:!1})})}const Cl={Design:kt,Animation:_e};function _l(e,t){return e.includes("Design")?t!=="Design":null}function or({label:e}){return r(hn,{title:l(e),level:Ye(1)})}function rr({level:e,label:t}){return e===1?r(or,{label:t}):r(ar,{label:t})}function Ze(e,t){return{type:"custom",[Y]:{label:e,level:t},render:()=>r(rr,{level:t,label:e})}}function S(e){return Ze(e,2)}function Il(e){return{type:"custom",render:()=>r(ir,{text:e})}}function ir({text:e}){return r("p",{className:"sf-note",children:l(e)})}function El(e){return Ze(e,1)}function Tl(e){return q(e)!==null&&e?.tabs!==void 0}const Qe=new Map;function Rl(e,t){const n=`${e}\0${t?t.join(""):""}`,o=Qe.get(n)??{type:"custom",tabs:t,[Y]:{label:e,level:1},bucket:e,marker:!0,render:()=>r(I,{})};return Qe.set(n,o),o}function Ol(e){return q(e)!==null&&e?.designGroup!==void 0}const et=new Map;function wl(e){const t=et.get(e)??{type:"custom",[Y]:{label:e,level:1},designGroup:e,marker:!0,...e==="Content"?{}:{fold:e},render:()=>r(I,{})};return et.set(e,t),t}function lr(e){const t=e;return t?.marker===!0&&typeof t.fold=="string"?t.fold:null}function Pl(e,t){return lr(e)===t?e:{...e,marker:!0,fold:t,render:()=>r(I,{})}}function kl(e){const t=e;if(t.marker===!0&&t.fold===void 0)return e;const{fold:n,...o}=e;return{...o,marker:!0,render:()=>r(I,{})}}function ar({label:e}){return r(mn,{title:l(e),level:Ye(2)})}function tt({swatches:e,current:t,onPick:n,names:o}){const i=e.find(s=>s.toLowerCase()===t.toLowerCase()),a=i?o?.[i]:void 0,c=a?l(a):t;return R("div",{className:"sf-swatches",children:[e.map(s=>{const d=o?.[s]?l(o[s]):s;return r(He,{content:d,children:r("button",{type:"button","aria-pressed":t.toLowerCase()===s.toLowerCase(),className:`sf-swatch ${t.toLowerCase()===s.toLowerCase()?"is-active":""}`,style:{background:s},onClick:()=>n(s),"aria-label":d})},s)}),r("span",{className:"sf-swatch-hex",children:c})]})}function Nl(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=Ao(n,t);return r(h,{label:l(e),icon:r(At,{}),changed:!i,action:r(y,{words:x()?.panel,label:l(e),changed:!i,detail:l("the theme's section background"),onReset:()=>o(ko)}),children:tt({swatches:No,current:i?vo:n??t??"",onPick:o,names:Lo})})}}}function sr(e,t){return{type:"custom",render:({value:n,onChange:o})=>{const i=n,a=Oo(i,t);return r(h,{label:l(e),icon:r(zt,{}),changed:!a,action:r(y,{words:x()?.panel,label:l(e),changed:!a,detail:l("the theme's image stage"),onReset:()=>o(Io)}),children:tt({swatches:Ro,current:a?Po:wo(i,t),onPick:o,names:To})})}}}function Ll(e=n=>n,t){return G({_gSectionTheme:S(Fo),sectionAccent:{type:"custom",render:({value:n,onChange:o})=>r(Zn,{value:e(n),onChange:o,followLabel:t})}})}function M({min:e,max:t,step:n,value:o,onChange:i,suffix:a="",readout:c=!0,notch:s,ariaLabel:d,disabled:u=!1}){const f=s!==void 0&&Number.isFinite(s)&&s>=e&&s<=t;return r("div",{className:f?"sf-slider has-notch":"sf-slider",style:f?{"--sf-notch":(s-e)/(t-e)}:void 0,children:r(Bn,{min:e,max:t,step:n,value:o,suffix:a||void 0,showInput:c,label:d===void 0?void 0:l(d),disabled:u,size:"sm",className:"sf-slider-track",onChange:p=>{p!==null&&p!==o&&i(p)}})})}function K(e,t,n,o,i,a,c="",s){return{type:"custom",render:d=>r(h,{label:l(e),icon:P(t),action:s?s("storedValue"in d?d.storedValue:d.value,d.onChange):void 0,children:M({min:n,max:o,step:i,value:typeof d.value=="number"?d.value:a,suffix:c,ariaLabel:e,onChange:d.onChange})})}}function nt(e,t){const{min:n,max:o,step:i=1,unsetLabel:a,hint:c,restTrack:s,unsetMark:d,icon:u}=t;return{type:"custom",render:({value:f,onChange:p})=>{const m=typeof f=="number"?f:null,b=m===null;return r(h,{label:l(e),icon:u?P(u):void 0,value:b?d||a===void 0?void 0:l(a):`${m}px`,changed:!b,action:d?fe(d,{changed:!b,onReset:()=>p(null)}):r(y,{words:x()?.panel,label:l(e),changed:!b,onReset:()=>p(null)}),hint:typeof c=="string"?l(c):c,children:s?s({min:n,max:o,step:i,px:m,label:e,onChange:p}):M({min:n,max:o,step:i,value:m??n,readout:!1,ariaLabel:e,onChange:p})})}}}function vl(e){const t=K("Gap",r(Ee,{}),ce.min,ce.max,ce.step,yo[e],"px",(n,o)=>r(qo,{inherited:!Co(e,n),onReset:()=>o(void 0),label:"Gap"}));return{type:"custom",[So]:e,render:n=>t.render({...n,value:_o(e,n.value,n.field?.siteGap),storedValue:n.value,onChange:o=>n.onChange(o)})}}const Q="Corners";function de(e){return{type:"custom",render:({value:t,onChange:n})=>{const o=typeof t=="number"&&Number.isFinite(t)?t:null,i=o!==null;return r(h,{label:l(Q),icon:r(Gt,{}),changed:i,action:fe(e.mark,{changed:i,onReset:()=>n(null)}),hint:e.hint,children:r(cr,{tier:e,px:o,onRadius:n})})}}}function ot(e){let t=null;try{t=re()}catch{t=null}return[t?.values?.[e],n=>t?.onChange(e,n)]}function cr({tier:e,px:t,onRadius:n}){const o=e.useFollowed(),i=e.useClosedReason?e.useClosedReason():null,[a,c]=ot(e.sidesKey),s=ve(a)??[...Le];return r(vn,{label:l(Q),value:s,corners:dn,onChange:d=>{const u=ve(d)??[];c(u.length===Le.length?null:u)},radius:t,onRadiusChange:n,radiusMin:D,radiusMax:ye,radiusStep:e.step??1,radiusPlaceholder:String(o),disabled:i!==null,disabledReason:i??void 0})}function rt(){return X({type:"custom",render:()=>r(J,{})},"always")}function dr({label:e,changed:t=!1,onReset:n=()=>{}}){const{cornerRadiusPx:o}=H(),i=typeof o=="number"?`${o}px`:l("not set");return r(y,{words:x()?.panel,label:l(e),changed:t,detail:o==null?l("the built-in corners"):N(i,l("Styles")),onReset:n})}function ur(){const{cornerRadiusPx:e}=H();return typeof e=="number"?e:D}function pr(){return de({sidesKey:"sectionCornerSides",useFollowed:ur,useClosedReason:()=>lt()?l(it):null,mark:r(dr,{label:Q}),hint:r(fr,{})})}const it="This section runs edge to edge, so its corners sit off the page. Set Width to Content width to use them.";function lt(){return Ve(A())}function fr(){return r(I,{children:lt()?it:"Follows Styles ▸ Basics ▸ Corners until you set a number here."})}function Al(){return G({_gShape:S("Shape"),sectionCorners:pr(),sectionCornerSides:rt(),sectionBorder:at("desktop"),sectionBorderPhone:at("mobile")})}const hr=()=>({width:l("Border width"),sides:{top:l("Border top"),right:l("Border right"),bottom:l("Border bottom"),left:l("Border left")},style:l("Border style"),styles:{solid:l("Solid"),dashed:l("Dashed"),dotted:l("Dotted")},color:l("Border color"),unit:"px"});function mr(e){const t=Object.fromEntries(Object.entries(e).filter(([,n])=>n!=null&&n!==""));return Object.keys(t).length?t:void 0}function gr(){let e;try{const t=bo(H().theme);e=t.themes[t.selected]?.line}catch{e=void 0}return e||go.line}function br({value:e,onChange:t,tier:n}){const[o]=ot("sectionBorder"),i=gr(),a=e&&typeof e=="object"?e:{},c=n==="mobile"?o&&typeof o=="object"?o:{}:{},[s,d]=V(()=>Cn(a,c)),u=hr();return r(h,{label:l("Border"),icon:r(Ft,{}),action:r(Fe,{each:s,label:l("Each side"),onChange:d}),children:r(gn,{label:l("Border"),value:a,each:s,onChange:f=>t(mr(f)),placeholder:{sides:Sn(c),style:c.style??"solid",color:c.color||i},presets:[i],words:u,max:mo})})}function at(e){return g(e,{type:"custom",render:({value:t,onChange:n})=>r(br,{value:t,onChange:n,tier:e})})}function Fl(){return{_gMotion:S("Motion"),sectionAnimation:pe("Entrance",r(_e,{}),[...fn],pn)}}function ue(){let e=null;try{const{appState:t,selectedItem:n}=W(i=>i),o=n?.props?.id?String(n.props.id):void 0;e=o?Ae(t?.data,o):null}catch{e=null}return e!==null&&Ve(e)}function st(e){const{cornerRadiusPx:t}=H(),n=ue(),o=typeof t=="number"?t:e;let i=null;try{const{appState:c,selectedItem:s}=W(u=>u),d=s?.props?.id?String(s.props.id):void 0;i=d?Ae(c?.data,d):null}catch{i=null}if(n||!i)return o;const a=i.sectionCorners;return un(a)?a:o}function xr({label:e,changed:t=!1,onReset:n=()=>{}}){const o=ue(),i=st(D),a=o?"Site":"Section";return r(y,{words:x()?.panel,label:l(e),changed:t,detail:N(`${i}px`,o?l("Styles"):l("the section")),onReset:n})}function yr(){return r(I,{children:ue()?l("The section is full width, so this card follows Styles ▸ Basics ▸ Corners."):l("Follows the section's Corners until you set a number here.")})}function Sr(){return de({sidesKey:"cardCornerSides",useFollowed:()=>st(D),mark:r(xr,{label:Q}),hint:r(yr,{})})}function Cr(){return{type:"custom",render:()=>r(bt,{})}}function Dl(e){return{...e,render:t=>r(xt,{render:e.render,props:t})}}function Bl(){return{_gShape:S("Shape"),cardCorners:Sr(),cardCornerSides:rt(),cardCornersApplyAll:Cr()}}function Hl(){return k("Justify",r(vt,{}),Xe,Xe[0].value)}function Gl(){return k("Item alignment",r(Nt,{}),co,"stretch")}function Ml(){return k(ho,r(sn,{}),ze,ze[0].value)}function Kl(){return{type:"custom",render:({value:e,onChange:t})=>{const n=se.find(o=>o.value===e)??se[0];return r(h,{label:l(je),icon:r(Ie,{}),value:l(n.label),children:r(Be,{className:"sf-gallery-layouts",label:l(je),value:n.value,onChange:t,options:se.map(o=>({value:o.value,label:l(o.label),picture:r("span",{className:"sf-gallery-pic",children:_r(o.weights).map((i,a)=>r("i",{style:{gridColumn:`span ${i}`}},a))})}))})})}}}function _r(e){if(!e)return[3,4];const t=e.reduce((n,o)=>n+o,0);return e.map(n=>Math.round(n/t*12))}function Wl(){return k(uo,r(Ee,{}),Ue,Ue[0].value)}function Ul(){return K(po,r(Qt,{}),$e,fo,1,$e)}function Xl(e){const t=pe(ao,jo("`Direction` names how a container's children run — a MODIFIER, not a thing. doc/naming.md N10.1 gives the idea a dash in its Glyph column; editor-shell's own `direction` meaning says the bare row is CORRECT and not an omission (SS seat, 2026-09-11)."),so(e),We(e,void 0));return{type:"custom",render:n=>t.render({...n,value:We(e,n.value),onChange:o=>n.onChange(o)})}}function $l(e,t,n,o,i,a){return{type:"custom",render:({value:c,onChange:s})=>r(h,{label:l(e),icon:r(Ne,{noun:a}),action:r(y,{words:x()?.panel,label:l(e),changed:!Ho(c),detail:l("the Text style in Styles"),onReset:()=>s(Bo),defaultAction:{onPress:()=>s(Do),title:l("Keep this section's own built-in size"),icon:r(Dt,{})}}),children:M({min:t,max:n,step:o,value:typeof c=="number"?c:i,suffix:"px",ariaLabel:e,onChange:s})})}}function jl(){return{_gCellWidth:S("Cell width"),gridSpan:k("Positions",r(Ie,{}),[{label:"Auto",value:""},...Array.from({length:_t},(e,t)=>({label:t===0?"1 position":`${t+1} positions`,value:String(t+1)}))],"")}}function A(){let e=null;try{e=W(t=>t).selectedItem}catch{e=null}return e?.props??{}}function Ir({min:e,max:t,step:n,px:o,label:i,onChange:a,desktopKey:c,fallback:s}){const d=A()[c],u=le(void 0,d,s);return r(I,{children:M({min:e,max:t,step:n,value:le(o,d,s),readout:!1,ariaLabel:i,notch:u,onChange:a})})}function Er({label:e,desktopKey:t,fallback:n,changed:o=!1,onReset:i=()=>{}}){const a=A()[t],c=le(void 0,a,n);return r(y,{words:x()?.panel,label:l(e),changed:o,detail:l("{value} on desktop",{value:`${c}px`}),onReset:i})}function Tr(e){return nt(e.label,{icon:e.icon,min:e.min,max:e.max,step:e.step,unsetLabel:"Follows Desktop",unsetMark:r(Er,{label:e.label,desktopKey:e.desktopKey,fallback:e.fallback}),restTrack:t=>r(Ir,{...t,desktopKey:e.desktopKey,fallback:e.fallback})})}function zl(e){return{type:"custom",render:({value:t,onChange:n})=>r(Or,{...e,value:t,onChange:n})}}function Rr({label:e,icon:t,options:n,value:o,resolved:i,restWord:a,onChange:c}){const s=n.some(d=>d.value===o);return r(h,{label:l(e),icon:P(t),action:r(y,{words:x()?.panel,label:l(e),changed:s,detail:l("{value} on desktop",{value:l(a)}),onReset:()=>c(void 0)}),children:te({options:n,value:s?o:i,onChange:d=>c(d),ariaLabel:e})})}function Or({label:e,icon:t,options:n,desktopKey:o,resolve:i,value:a,onChange:c}){const s=A()[o],d=i(void 0,s),u=n.find(f=>f.value===d)?.label??"";return r(Rr,{label:e,icon:t,options:n,value:a,resolved:d,restWord:u,onChange:c})}const wr={Top:"Padding top",Bottom:"Padding bottom",Left:"Padding left",Right:"Padding right"},Pr={Top:Pe,Bottom:Re,Left:Oe,Right:we},kr=e=>{const t=Pr[e];return r(t,{})};function Vl(e={}){const t=e.keys?.top??"sectionPaddingTop",n=e.keys?.bottom??"sectionPaddingBottom",o=e.group!==!1,i=_=>wr[_],a=_=>K(i("Top"),r(Pe,{}),T.min,T.max,T.step,_,"px"),c=(_,z,w,ne=T)=>g("mobile",Tr({label:i(_),icon:kr(_),desktopKey:z,min:ne.min,max:ne.max,step:ne.step,fallback:w})),s=e.top??T.min,d=e.bottom??T.min,u="sectionPaddingLeft",f="sectionPaddingRight",p=e.sideBounds??T,m=e.side??p.min,b=e.sidePhone??m,C=e.phone===!0,O=_=>C?g("desktop",_):_;return G({...o?{_gSpacing:S("Padding")}:{},[t]:O(a(s)),...C?{[B(t)]:c("Top",t,s)}:{},...e.only==="top"?{}:{[n]:O(K(i("Bottom"),r(Re,{}),T.min,T.max,T.step,d,"px")),...C?{[B(n)]:c("Bottom",n,d)}:{}},...e.sides?{[u]:O(K(i("Left"),r(Oe,{}),p.min,p.max,p.step,m,"px")),...C?{[B(u)]:c("Left",u,b,p)}:{},[f]:O(K(i("Right"),r(we,{}),p.min,p.max,p.step,m,"px")),...C?{[B(f)]:c("Right",f,b,p)}:{}}:{}})}const j=["top","right","bottom","left"],Nr={top:"sectionPaddingTop",right:"sectionPaddingRight",bottom:"sectionPaddingBottom",left:"sectionPaddingLeft"},ct=e=>typeof e=="number"?e:null;function Lr(e,t,n){const o={};for(const i of j)n[i]!==t[i]&&(o[e[i]]=n[i]??void 0);return o}function vr({tier:e,o:t}){let n=null;try{n=re()}catch{n=null}const o=n?.values??{},i=e==="mobile"?t.phoneKeys:t.keys,a=Object.fromEntries(j.map(u=>[u,ct(o[i[u]])])),c=Object.fromEntries(j.map(u=>[u,String(e==="mobile"?ct(o[t.keys[u]])??t.fallback[u]:t.fallback[u])])),[s,d]=V(()=>yn(a,c));return r(h,{label:l("Padding"),icon:r(Zt,{}),action:r(Fe,{each:s,label:l("Each side"),onChange:d}),children:r(xn,{label:l("Padding"),each:s,value:a,placeholder:c,min:t.min,max:t.max,step:t.step,onChange:u=>{const f=Lr(i,a,u);Object.keys(f).length&&n?.onChangeMany(f)},words:{sides:{top:l("Padding top"),right:l("Padding right"),bottom:l("Padding bottom"),left:l("Padding left")},vertical:l("Top and bottom"),horizontal:l("Left and right"),unit:"px"}})})}function Yl(e={}){const t={...Nr,...e.keys},n={keys:t,phoneKeys:Object.fromEntries(j.map(s=>[s,B(t[s])])),fallback:{top:0,right:0,bottom:0,left:0,...e.fallback},min:e.min??0,max:e.max??200,step:e.step??4},o=e.phone!==!1,i=s=>{const d={type:"custom",render:()=>r(vr,{tier:s,o:n})};return o?g(s,d):d},a=()=>X({type:"custom",render:()=>r(J,{})},"always"),c=j.filter(s=>s!=="top");return G({...e.group===!1?{}:{_gSpacing:S("Padding")},[n.keys.top]:i("desktop"),...o?{[n.phoneKeys.top]:i("mobile")}:{},...Object.fromEntries(c.map(s=>[n.keys[s],{...a(),reachedBy:n.keys.top}])),...o?Object.fromEntries(c.map(s=>[n.phoneKeys[s],g("mobile",a())])):{}})}const dt=e=>typeof e=="number"?e:null;function Ar(e,t,n){const o={};for(const i of["x","y"])n[i]!==t[i]&&(o[e[i]]=n[i]??void 0);return o}function Fr({o:e}){let t=null;try{t=re()}catch{t=null}const n=t?.values??{},o={x:dt(n[e.keys.x]),y:dt(n[e.keys.y])},i=l(e.label??"Position"),a=!!(o.x||o.y),c=u=>{const f=Ar(e.keys,o,u);Object.keys(f).length&&t?.onChangeMany(f)},s=r(Dn,{label:i,value:o,onChange:c,words:{x:l("Left and right"),y:l("Up and down"),unit:"px"},placeholder:{x:"0",y:"0"},min:e.min,max:e.max,step:e.step??1}),d=r(y,{words:x()?.panel,label:i,changed:a,detail:"0 px, 0 px",onReset:()=>c({x:null,y:null})});return e.label===null?R("div",{className:"sf-position-line",children:[s,d]}):r(h,{label:i,icon:r(Jt,{}),changed:a,action:d,children:s})}function ql(e){return{[e.keys.x]:{type:"custom",render:()=>r(Fr,{o:e})},[e.keys.y]:{...X({type:"custom",render:()=>r(J,{})},"always"),reachedBy:e.keys.x}}}const Dr={contained:"Contained",page:"Page",full:"Full"},ee="Width";function Jl(e,t=Go,n=!0){const o=t.map(i=>({label:Mo[i]??Dr[i],value:i}));return G({...n?{_gWidth:S(ee)}:{},widthMode:{type:"custom",render:({onChange:i,field:a})=>r(h,{label:l(ee),icon:r(an,{}),action:n?r(Jo,{inherited:a?.inherited??!1,onReset:()=>i(Ko),label:ee}):void 0,children:te({options:o,value:a?.currentValue||e,onChange:i,ariaLabel:ee})})}})}function Zl(){const e=o=>({type:"custom",render:({value:i,onChange:a})=>r(h,{label:$,icon:P(r(Vt,{})),action:o?o(a):void 0,children:te({options:[{label:"Auto",value:"auto"},{label:"Fixed",value:"fixed"},{label:"Screen",value:"screen"}],value:["auto","fixed","screen"].includes(i)?i:"auto",onChange:a,ariaLabel:$})})}),t=()=>({type:"custom",render:({value:o,onChange:i,field:a})=>{const c=a?.unit==="%"?"%":"px",s=c==="%"?lo:io;return r("div",{className:"sf-field",children:M({min:s.min,max:s.max,step:s.step,value:typeof o=="number"?o:s.fallback,suffix:c,ariaLabel:$,onChange:i})})}}),n=()=>pe("Unit",r(Te,{}),[{label:"px",value:"px"},{label:"%",value:"%"}],"px");return G({_gHeight:S($),sectionHeightMode:g("desktop",e()),sectionHeightValue:g("desktop",t()),sectionHeightUnit:g("desktop",n()),sectionHeightModePhone:g("mobile",e(o=>r(Br,{onClear:()=>o(void 0)}))),sectionHeightValuePhone:g("mobile",t()),sectionHeightUnitPhone:g("mobile",n())})}function Br({onClear:e}){const t=A(),n=to(t),o=no(t),i=l("{value} on desktop",{value:o.mode==="auto"?l("Auto"):`${o.value}${o.unit}`});return r(y,{words:x()?.panel,label:l($),changed:n,detail:i,onReset:e})}function Ql(){const e=n=>({type:"custom",render:({value:o,onChange:i,id:a,name:c})=>r(Hr,{value:o,onChange:i,labelId:`${a??c??"stickTop"}-label`,phone:n})}),t=()=>({type:"custom",render:({value:n,onChange:o})=>r("div",{className:"sf-field",children:M({min:Z.min,max:Z.max,step:Z.step,value:typeof n=="number"?n:Z.fallback,suffix:"px",ariaLabel:l("Distance from top"),onChange:o})})});return{_gStick:S(ae),stickTop:g("desktop",e(!1)),stickTopDistance:g("desktop",t()),stickTopPhone:g("mobile",e(!0)),stickTopDistancePhone:g("mobile",t())}}function Hr({value:e,onChange:t,labelId:n,phone:o}){const i=A(),a=ro(i),c=o?a.phone:e===!0;return r(h,{label:l(ae),labelId:n,icon:P(r(nn,{})),action:R(I,{children:[o?r(y,{words:x()?.panel,label:l(ae),changed:oo(i),detail:l("{value} on desktop",{value:a.desktop?`${a.desktopDistance}px`:l("Off")}),onReset:()=>t(void 0)}):null,r(De,{checked:c,onChange:t,ariaLabelledBy:n})]})})}const ut="e.g. about";function ea(){return{_gAnchor:S("Anchor"),anchor:v({control:"plainText",label:"Name",placeholder:ut},{type:"custom",render:({value:e,onChange:t})=>r(Pt,{value:e,onChange:t,nameBox:(n,o)=>r(L,{value:n,onChange:o,label:"Name",placeholder:ut,hideable:!1,markup:!1})})})}}function ta(e,t,n){return{type:"custom",render:({value:o,onChange:i,id:a,name:c})=>{const s=`${a??c??e}-datetime`,d=Date.parse(typeof o=="string"?o:"");return r(h,{label:l(e),icon:t,htmlFor:s,hint:n===void 0?void 0:l(n),children:r(An,{id:s,value:Number.isFinite(d)?new Date(d):null,onChange:u=>i(u?u.toISOString():"")})})}}}function F(e,t,n){return{type:"custom",render:({value:o,onChange:i,id:a,name:c})=>{const s=typeof o=="boolean"?o:t,d=`${a??c??e}-label`;return r(h,{label:l(e),labelId:d,icon:n,action:r(De,{checked:s,onChange:i,ariaLabelledBy:d})})}}}function na(){return{type:"custom",render:({value:e,onChange:t,id:n,name:o})=>{const i=`${String(n??o??"pageBackground")}-colour`;return r(h,{label:l("Background"),icon:r(ke,{}),htmlFor:i,action:r(Ge,{id:i,label:"Background",value:cn(e),onChange:t})})}}}function oa(e,t){return{type:"custom",render:({value:n,onChange:o,id:i})=>{const a=typeof n=="boolean"?n:t,c=`${i??e}-checkbox`;return r(h,{label:l(e),htmlFor:c,className:"sf-checkbox",action:r(Ln,{id:c,checked:a,onChange:o})})}}}const ra={follows:"fill"},ia={follows:"ink"};function la(e,t,n){if(typeof t!="string"){const o=t.follows;return{type:"custom",render:({value:i,onChange:a})=>r(Gr,{label:e,part:o,icon:n,value:i,onChange:a})}}return{type:"custom",render:({value:o,onChange:i})=>r(h,{label:l(e),icon:n,action:Ge({value:o||t,onChange:i,label:e})})}}function Gr({label:e,part:t,icon:n,value:o,onChange:i}){const a=xo(H().theme),c=t==="fill"?a.fill:a.ink;return r(Hn,{label:l(e),icon:n,value:o||"",inherited:c,resetTo:N(c.toUpperCase(),l("Styles")),onChange:i,onReset:()=>i("")})}const Mr=[{value:"0% 0%",label:"Top left"},{value:"50% 0%",label:"Top"},{value:"100% 0%",label:"Top right"},{value:"0% 50%",label:"Left"},{value:"50% 50%",label:"Center"},{value:"100% 50%",label:"Right"},{value:"0% 100%",label:"Bottom left"},{value:"50% 100%",label:"Bottom"},{value:"100% 100%",label:"Bottom right"}];function pt({label:e,value:t,onChange:n,points:o=Mr}){const i=o.map(a=>({...a,label:l(a.label),...a.title?{title:l(a.title)}:null}));return r(Nn,{label:l(e),value:t,points:i,onChange:n})}function aa(){return X({type:"custom",render:()=>r(J,{})},"always")}const Kr=Ce([]);function sa(e,{stacking:t,fallback:n=Rt}){return{type:"custom",render:({value:o,onChange:i})=>{const a=Tt.includes(o)?o:n;return t?r(Wr,{label:e,value:a,onChange:i}):ft({label:e,value:a,onChange:i,points:Kr})}}}function Wr({label:e,value:t,onChange:n}){const{appState:o,selectedItem:i}=W(s=>s),a=i?.props?.id?String(i.props.id):void 0,c=a?Et(o?.data,a):[];return ft({label:e,value:t,onChange:n,points:Ce(c,a)})}function ft({label:e,value:t,onChange:n,points:o}){const i=o.find(a=>a.disabled);return r(h,{label:l(e),icon:r(en,{}),hint:i?.title?l(i.title):void 0,children:pt({label:e,value:Ot(t),onChange:n,points:o})})}const ca={top:r(Ut,{}),right:r(Wt,{}),bottom:r(Mt,{}),left:r(Kt,{})};function da(e,t,n,o,i,a){const c=f=>t.find(p=>p.value===f),s=f=>({value:f,label:"",disabled:!0,title:o}),d=f=>{const p=t.find(b=>b.cell===f);if(!p)return s(`missing-${f}`);const m=a?.[f];return m?{value:p.value,label:p.label,icon:m}:{value:p.value,label:p.label}},u=[s("corner-top-left"),d("top"),s("corner-top-right"),d("left"),s("centre"),d("right"),s("corner-bottom-left"),d("bottom"),s("corner-bottom-right")];return{type:"custom",render:({value:f,onChange:p})=>{const m=t.some(b=>b.value===f)?f:n;return r(h,{label:l(e),icon:i,value:c(m)?.label?l(c(m).label):"",children:pt({label:e,value:m,onChange:p,points:u})})}}}const Ur="\0note";function k(e,t,n,o,i){return{type:"custom",options:n,fallback:o,...i?{note:i}:{},render:({value:a,onChange:c,field:s})=>{const d=s.options??n,u=s.fallback??o,f=d.some(p=>p.value===a)?a:u;return r(h,{label:l(e),icon:P(t),children:r(_n,{value:f,ariaLabel:l(e),onChange:c,options:[...i?[{label:l(i),value:Ur,disabled:!0}]:[],...d.map(p=>({label:l(p.label),value:p.value}))]})})}}}function ua(e,t,n){return{type:"custom",options:t,render:({value:o,onChange:i,field:a})=>r(Jn,{label:e,options:(a.options??t).map(c=>({...c,label:l(c.label)})),value:Array.isArray(o)?o:[],onChange:i,...n?{emptyLabel:l(n)}:{}})}}function pa(e,t,n,o){return{type:"custom",options:t,fallback:n,render:({value:i,onChange:a,field:c})=>r(Qn,{label:e,options:(c.options??t).map(s=>({...s,label:l(s.label)})),fallback:c.fallback??n,value:i,onChange:a,placeholder:o===void 0?void 0:l(o)})}}function fa(e,t={}){return{type:"custom",render:({value:n,onChange:o})=>{const i={value:n,onChange:o,...t};return r(e,{...i})}}}function te({options:e,value:t,onChange:n,ariaLabel:o,disabled:i=!1}){return r(bn,{options:e.map(a=>a.picture?{id:a.value,label:a.picture,title:l(a.title??a.label)}:{id:a.value,label:l(a.label),title:a.title===void 0?void 0:l(a.title)}),value:t,onChange:n,ariaLabel:l(o),disabled:i})}const ha=[{label:"Image",value:"image"},{label:"Video",value:"video"}];function pe(e,t,n,o){const i=n.map(a=>typeof a=="string"?{label:a,value:a}:a);return{type:"custom",render:({value:a,onChange:c,field:s})=>r(h,{label:l(e),icon:P(t),children:te({options:i,value:i.some(d=>d.value===a)?a:a||s?.currentValue||o,onChange:c,ariaLabel:e})})}}function ma(e,t,n,o={}){return{type:"custom",[be]:!0,render:({value:i,onChange:a})=>r(qn,{value:i||"",onChange:a,label:e,accept:t,placeholder:n,focusKey:o.focus,focusWhen:o.focusWhen})}}const ga={HeroSingle:["imageFocal"],ContactLocations:["locations[].photo"],ProcessSteps:["steps[].image"]};function ba({value:e,onChange:t,label:n}){const o=e||{},i=!!o.pending,a=i?"var(--fg-dim, #888)":o.ok?"#1d9e75":"#d85a30",c=!!$o(Xo()).geocode,s=(d,u)=>t({...o,[d]:u===""?void 0:Number(u)});return R(h,{label:l(n),icon:r(ie,{}),children:[c&&R(I,{children:[r("button",{type:"button",disabled:i,onClick:()=>t({...o,pending:!0,ok:!1,status:"Finding…"}),style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,padding:"8px 10px",fontSize:13,cursor:i?"default":"pointer",opacity:i?.6:1,border:"1px solid var(--border-strong, #ccc)",borderRadius:6,background:"transparent",color:"inherit"},children:i?l("Finding…"):l("Find coordinates")}),o.status&&r("div",{style:{marginTop:6,fontSize:12,lineHeight:1.4,color:a},children:l(o.status)}),r("div",{style:{marginTop:6,fontSize:11,color:"var(--fg-dim, #999)"},children:l("Coordinates from OpenStreetMap")})]}),r("button",{type:"button",onClick:()=>t({...o,manual:!o.manual}),style:{marginTop:8,padding:0,border:"none",background:"none",font:"inherit",fontSize:12,color:"var(--sf-accent, #2563eb)",cursor:"pointer",textDecoration:"underline"},children:o.manual?l("Hide manual coordinates"):l("Enter coordinates manually")}),o.manual&&R("div",{style:{marginTop:8,display:"grid",gap:8},children:[r(h,{label:l("Latitude"),icon:r(ie,{}),children:r("input",{type:"number",step:"any",placeholder:l("e.g. {example}",{example:"34.0990198"}),value:typeof o.lat=="number"?o.lat:"",onChange:d=>s("lat",d.target.value)})}),r(h,{label:l("Longitude"),icon:r(ie,{}),children:r("input",{type:"number",step:"any",placeholder:l("e.g. {example}",{example:"-117.9842833"}),value:typeof o.lng=="number"?o.lng:"",onChange:d=>s("lng",d.target.value)})})]})]})}function Xr(e,t){return t===null||t<0||t>=e.length?"":e[t]?.text??""}function $r(e,t,n){const o=e.map(i=>({text:i?.text??""}));return t===null||t<0||t>=e.length?o:o.map((i,a)=>a===t?{text:n}:i)}function xa(e,t){return e===null?null:t>e?e:null}function jr(e,t,n){if(n===null||n>=t.length)return null;for(let o=0;o<n;o+=1)if(e[o]!==t[o])return null;return e[n]!==t[n]&&t.includes(e[n])||e[n]!==t[n]&&t.length!==e.length?null:n}const ya={label:"Ticker items",icon:r(qt,{})};function Sa(e,t,n,o){return{type:"custom",[E]:{control:"textList",label:e,placeholder:n,itemKey:"text",rendering:o},render:({value:i,onChange:a})=>r(zr,{label:e,icon:P(t),items:Array.isArray(i)?i:[],placeholder:n,onChange:a,markup:o==="markup"})}}function zr({label:e,icon:t,items:n,placeholder:o,onChange:i,markup:a=!1}){const c=oe(null),[s,d]=V(null),u=p=>p.map(m=>({text:m?.text??""})),f=p=>{const m=jr(n,p,s);m===null&&(c.current=null),d(m),i(u(p))};return r(In,{label:l(e),icon:t,noun:l("item"),items:n,onChange:f,newItem:()=>({text:""}),open:null,onOpen:()=>{},renderItem:()=>null,above:a?r(Me,{target:c,value:Xr(n,s),onChange:p=>i($r(n,s??-1,p)),disabled:s===null,label:s===null?l("Formatting — click a row first"):l("Formatting — row {n}",{n:s+1})}):void 0,renderRow:(p,m,b)=>r("input",{type:"text",className:a&&s===m?"sf-list-marking":void 0,value:p?.text??"",placeholder:l(o),"aria-label":l("{label} {n}",{label:l(e),n:m+1}),onChange:C=>b({text:C.target.value}),onFocus:C=>{c.current=C.currentTarget,d(m)}})})}function Ca(e,t){const n=`${e.label} — row ${t+1}`;return v({control:"plainText",label:n,placeholder:e.placeholder,offPage:e.offPage},{type:"custom",render:({value:o,onChange:i})=>r(L,{value:o,onChange:i,label:l("{label} — row {n}",{label:l(e.label),n:t+1}),placeholder:e.placeholder,hideable:!1,markup:e.rendering==="markup"})})}function _a(e){return{_gCards:S("Cards"),coverIndex:k("Cover image",r(Yt,{}),zn,String(Vn),e?.coverHint??"A card's opening picture — a card pinned to a finish keeps its own."),imageBackground:sr("Image background",Eo),cardImage:Yr(),spinOnHover:F("Rotate on hover",e?.spinDefault??!0,r(on,{}))}}function Ia(){return{outline:k("Card outline",r(rn,{}),Xn,jn),indexBadge:k("Card number",r(Te,{}),Un,$n),showBadge:F("Product badge",!0,r(Ne,{noun:"tag"}))}}function Ea(e){const t=e&&"bottomDefault"in e?e.bottomDefault:!0,n=e&&"defaults"in e?e.defaults:{showCardSizes:t,showCardBuy:t,showCardPage:t};return{_gShowOnCard:S("Show on a card"),showCardPrice:F("Price",!0,r(Xt,{})),showCardFinishes:F("Finish swatches",!0,r($t,{})),showCardSizes:F("Sizes",n.showCardSizes,r(tn,{})),showCardBuy:F("Buy button",n.showCardBuy,r(Bt,{})),showCardPage:F("Page button",n.showCardPage,r(ke,{}))}}function Ta(e,t="display"){const n=B(t);return{[t]:g("desktop",{type:"custom",render:({value:o,onChange:i})=>r(ht,{parts:e,changed:Tn(o),shown:a=>Rn(o,a),onPress:(a,c)=>i(Pn(o,a,c)),onReset:()=>i(void 0)})}),[n]:g("mobile",{type:"custom",render:({value:o,onChange:i})=>r(Vr,{parts:e,desktopKey:t,value:o,onChange:i})})}}function ht({parts:e,changed:t,shown:n,onPress:o,onReset:i,detail:a}){const c=l("Display");return r(h,{label:c,icon:r(Lt,{}),changed:t,action:r(y,{words:x()?.panel,label:c,changed:t,detail:a,onReset:i}),children:r(En,{label:c,items:e.map(s=>({id:s.id,label:l(s.label),shown:n(s.id)})),onChange:o})})}function Vr({parts:e,desktopKey:t,value:n,onChange:o}){const i=A()[t];return r(ht,{parts:e,changed:wn(n),shown:a=>On(i,n,a),onPress:(a,c)=>o(kn(n,a,c)),onReset:()=>o(Kn),detail:l("the same as Desktop")})}function Yr(){return nt("Card image",{min:D,max:ye,step:yt,hint:"Rounds the picture. The card's own corner is in Styles."})}function Ra(){return de({sidesKey:"cornerSides",step:St,useFollowed:()=>D,mark:r(qr,{label:Ct}),hint:l("Rounds the picture. Left alone it stays square.")})}function qr({label:e,changed:t=!1,onReset:n=()=>{}}){return r(y,{words:x()?.panel,label:l(e),changed:t,onReset:n})}function Oa(){return{type:"custom",render:({value:e,onChange:t})=>r(Jr,{value:typeof e=="string"?e:"",onChange:t})}}function Jr({value:e,onChange:t}){const[n,o]=V(null),i=Se.filter(c=>n===null||U[c].across===n),a=e&&e in U?U[e]:null;return R(I,{children:[r(h,{label:l("Photos in a row"),icon:r(Ht,{}),children:R("div",{className:"sf-gallery-filter",children:[r("button",{type:"button","aria-pressed":n===null,onClick:()=>o(null),children:l("All")}),It.map(c=>r("button",{type:"button","aria-pressed":n===c,onClick:()=>o(c),children:c},c))]})}),r(h,{label:l("Layout"),icon:r(jt,{}),value:a?l(a.label):l("Not chosen"),hint:l("{n} of {total} layouts",{n:i.length,total:Se.length}),children:r(Be,{className:"sf-gallery-layouts",label:l("Layout"),value:e,onChange:t,onClear:()=>t(""),options:i.map(c=>({value:c,label:l(U[c].label),picture:r("span",{className:"sf-gallery-pic",children:U[c].desktop.map(([s,d],u)=>r("i",{style:{gridColumn:`span ${s}`,gridRow:`span ${d}`}},u))})}))})})]})}export{Qo as BOUND_TO_POST,fl as BOUND_TO_POST_NOTE,Cl as BUCKET_ICONS,ga as CUSTOM_FIELD_MEDIA,ba as CoordsField,ca as EDGE_ARROWS,Fn as FOCAL_DEFAULT,Mr as FOCAL_POINTS,Y as FOLD_FIELD_MARKER,ra as FOLLOWS_SITE_BUTTON,ia as FOLLOWS_SITE_BUTTON_INK,pt as FocalPicker,ar as GroupLabel,er as HIGHLIGHT_HINT,L as HidableTextField,ge as LINK_FIELD_MARKER,il as Label,be as MEDIA_FIELD_MARKER,ha as MEDIA_TYPE_OPTIONS,hl as NOT_BOUND_TO_POST,ir as PanelNoteLine,Or as PhoneChoiceRow,Rr as PhoneChoiceStrip,ft as PlacementGridView,xe as SCAFFOLD_FIELD_MARKER,Na as SCALAR_TEXT_CONTROLS,it as SECTION_BLEEDS_HINT,Nr as SIDE_PAD_KEYS,or as SectionHeading,te as Segmented,qo as SiteGapDefaultReset,M as Slider,tt as Swatches,ka as TEXT_CONTROL_KINDS,E as TEXT_FIELD_MARKER,ya as TICKER_ITEMS_ROW,zr as TextListField,Jo as WidthDefaultReset,jr as aimAfterListChange,ea as anchorFields,N as backTo,Nl as backgroundField,Gl as boxAlignField,Wl as boxBlockSpacingField,Hl as boxJustifyField,Ul as boxPhoneRowField,Kl as boxShareField,Ml as boxWrapField,Rl as bucketHeader,Sr as cardCornersField,sr as cardImageBackgroundField,Yr as cardImageField,_a as cardMediaFields,Bl as cardShapeFields,Ea as cardShowFields,Ia as cardStyleFields,jl as cellWidthFields,oa as checkbox,la as colorInput,xl as copyText,rt as cornerSidesField,de as cornersRowField,ta as dateTime,wl as designGroupHeader,Xl as directionField,Ta as displayFields,da as edgePad,_l as entriesHiddenForTab,xa as focusAfterRemove,aa as focusKeptField,Pl as foldMarker,q as foldMetaOf,lr as foldTitleOf,Oa as galleryLayoutField,vl as gapField,S as group,Zl as heightFields,me as hidableText,nr as hintIsWhileTyping,P as iconOf,Ra as imageCornersField,pl as inOwnBox,Tl as isBucketHeader,Ol as isDesignGroupHeader,zo as isNoGlyph,yl as linkField,ua as multiSelect,jo as noGlyph,na as pageBackgroundField,Il as panelNote,zl as phoneChoiceField,Tr as phoneOverrideField,sa as placementField,bl as plainText,Sl as plainTextarea,ql as positionFields,Ar as positionPatch,nt as pxField,kl as quietMarker,he as readHidable,Xr as rowText,pa as searchSelect,El as section,Fl as sectionAnimationFields,at as sectionBorderField,pr as sectionCornersField,Al as sectionShapeFields,Ll as sectionThemeFields,pe as segmented,k as select,$r as setRowText,G as sharedStyleKinds,Yl as sidesPaddingFields,Lr as sidesPaddingPatch,$l as sizeField,K as slider,fa as sourceField,Vl as spacingFields,Ql as stickFields,Dl as templateField,ml as text,gt as textFieldIdentifier,sl as textFieldOffPage,dl as textFieldPanelOnly,Sa as textList,Ca as textListRowField,gl as textarea,F as toggle,ma as upload,Vo as usePageWidthDetail,A as useSelectedProps,ot as useSelectedSibling,Yo as useSiteGapDetail,Jl as widthField,ul as withIdentifier,al as withOffPage,cl as withPanelOnly,ll as withScaffold};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{say as n}from"../editor-words.js";import{anchorPath as d,linkKindsFor as f,pageAnchors as
|
|
1
|
+
import{say as n}from"../editor-words.js";import{anchorPath as d,linkKindsFor as P,isProductPath as f,pageAnchors as m,pagePath as v,popupPath as F,popupSlugOf as b,postPath as O}from"./page-link-rules.js";const y=()=>({choosePage:n("Choose a page"),chooseSection:n("Choose a section"),noSections:n("No section anchors yet"),sectionHint:n("Jumps to a section on that page."),choosePost:n("Choose a post"),chooseProduct:n("Choose a product"),choosePopup:n("Choose a popup")});function h(o,s,a){if(!o)return"page";if(b(o))return"popup";if(o.startsWith("/journal/"))return"blog";if(f(o))return"product";if(o.includes("#")){const r=o.slice(0,o.indexOf("#"));if(r===""||r==="/"||s.includes(r))return"anchor"}return o==="/"||s.includes(o)||a&&a.listingPaths.includes(a.targetOf(o))?"page":"custom"}function w(o,s){const a=y(),r=o.pages.map(e=>({value:v(e.slug),label:e.title})),c=s?.pageOptions?s.pageOptions(r):r,p=c.map(e=>e.value),l=o.pages.map(e=>({label:e.title,options:m(...e.docs).map(t=>({value:d(e.slug,t.slug),label:t.name}))})).filter(e=>e.options.length>0),g=e=>{switch(e){case"page":return{type:"select",options:c,placeholder:a.choosePage};case"anchor":return{type:"groups",groups:l,placeholder:l.length?a.chooseSection:a.noSections};case"blog":return{type:"select",options:o.posts.map(t=>({value:O(t.slug),label:t.title||t.slug})),placeholder:a.choosePost};case"product":return{type:"select",options:o.products.map(t=>({value:t.href,label:t.name||t.href})),placeholder:a.chooseProduct};case"popup":return{type:"select",options:(o.popups??[]).map(t=>({value:F(t.slug),label:t.title||t.slug})),placeholder:a.choosePopup};case"custom":return{type:"text"}}},i=P(o.offers).map(e=>({value:e.value,label:n(e.label),target:g(e.value),...e.value==="anchor"?{hint:a.sectionHint}:{},...e.value==="blog"||e.value==="product"||e.value==="popup"?{hideWhenEmpty:!0}:{}}));if(!s)return{kinds:i,rules:{kindOf:e=>h(e,p),targetOf:e=>e,readFilter:()=>null,withFilter:e=>e}};const u=e=>{const t=s.withFilter(e,null);return s.listingPaths.includes(t)?t:e};return{kinds:i,rules:{kindOf:e=>h(e,p,{listingPaths:s.listingPaths,targetOf:u}),targetOf:u,readFilter:s.readFilter,withFilter:s.withFilter},filtersFor:e=>s.listingPaths.includes(e)?s.filtersFor(e):null}}export{h as inferLinkKind,w as linkPickerSetup};
|
|
@@ -21,4 +21,5 @@ export declare function pageAnchors(...docs: unknown[]): {
|
|
|
21
21
|
name: string;
|
|
22
22
|
}[];
|
|
23
23
|
export declare function linkPagePath(url: string): string;
|
|
24
|
+
export declare function isProductPath(url: string): boolean;
|
|
24
25
|
export declare function inferKind(url: string, pagePaths: string[]): LinkKind;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{HOME_PAGE_SLUG as f}from"../puck/home-page.js";import{slugify as p}from"../slugify.js";const i=[{value:"page",label:"Page"},{value:"anchor",label:"Anchor"},{value:"blog",label:"Blog post",needs:"service"},{value:"product",label:"Product",needs:"commerce"},{value:"popup",label:"Popup"},{value:"custom",label:"Custom URL"}];function
|
|
1
|
+
import{HOME_PAGE_SLUG as f}from"../puck/home-page.js";import{slugify as p}from"../slugify.js";const i=[{value:"page",label:"Page"},{value:"anchor",label:"Anchor"},{value:"blog",label:"Blog post",needs:"service"},{value:"product",label:"Product",needs:"commerce"},{value:"popup",label:"Popup"},{value:"custom",label:"Custom URL"}];function g(e){return e.offersCommerce&&e.offersService?i:i.filter(t=>!t.needs||(t.needs==="commerce"?e.offersCommerce:e.offersService))}const u="#popup:";function P(e){return`${u}${e}`}function b(e){return e.startsWith(u)&&e.slice(u.length).trim()||null}function a(e){return e===f?"/":`/${e}`}function $(e){return`/journal/${e}`}function A(e){return`/wheels/${e}`}function y(e,t){return`${a(e)}#${t}`}function l(e){return p(e)}function h(e){return typeof e=="string"?e.trim():e&&typeof e=="object"&&typeof e.text=="string"?e.text.trim():""}function O(...e){const t=new Set,n=[];for(const o of e)for(const s of o?.content??[]){const c=h(s?.props?.anchor);if(!c)continue;const r=l(c);!r||t.has(r)||(t.add(r),n.push({slug:r,name:c}))}return n}function S(e){const t=e.indexOf("#"),n=t===-1?e:e.slice(0,t),o=n.indexOf("?");return o===-1?n:n.slice(0,o)}function m(e){return/^\/wheels\/[^/?#]+(?:[?#].*)?$/.test(e)}function w(e,t){if(!e)return"page";if(e.startsWith("/journal/"))return"blog";if(m(e))return"product";if(e.includes("#")){const n=e.slice(0,e.indexOf("#"));if(n===""||n==="/"||t.includes(n))return"anchor"}return e==="/"||t.includes(e)?"page":"custom"}export{i as LINK_KINDS,u as POPUP_LINK_PREFIX,y as anchorPath,w as inferKind,m as isProductPath,g as linkKindsFor,S as linkPagePath,O as pageAnchors,a as pagePath,P as popupPath,b as popupSlugOf,$ as postPath,l as slugifyAnchor,A as wheelPath};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type RuleReport, type SourceFile } from "./rule.js";
|
|
2
|
+
export type OneMapModuleOptions = {
|
|
3
|
+
readonly allowed?: Readonly<Record<string, string>>;
|
|
4
|
+
readonly minFiles: number;
|
|
5
|
+
};
|
|
6
|
+
export declare function oneMapModule(files: readonly SourceFile[], options: OneMapModuleOptions): RuleReport;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{ruleChecks as j}from"./rule.js";const b=/\.(ts|tsx|js|jsx|mjs|cjs)$/,s=t=>JSON.stringify(t),k=/(?:from\s*|import\s*\(\s*|require\s*\(\s*|import\s+)["']([^"']+)["']/g,x=/^(?:@googlemaps\/.+|@vis\.gl\/react-google-maps|@react-google-maps\/.+|google-map-react|leaflet(?:\/.*)?|react-leaflet(?:\/.*)?|mapbox-gl(?:\/.*)?|@mapbox\/.+|maplibre-gl(?:\/.*)?|react-map-gl(?:\/.*)?|ol(?:\/.*)?)$/,f=[["maps","googleapis","com"],["maps","gstatic","com"],["nominatim","openstreetmap","org"],["photon","komoot","io"],["api","mapbox","com"],["api","maptiler","com"],["api","opencagedata","com"],["geocode","maps","co"],["tile","openstreetmap","org"]].map(t=>t.join(".")),S=new RegExp(f.map(t=>t.replace(/\./g,"\\.")).join("|"),"g"),v=new RegExp(`\\b${["google","maps"].join("\\.")}\\b`,"g");function l(t){const a=[];for(const e of t.matchAll(k))x.test(e[1])&&a.push(`map SDK import (${e[1]})`);for(const e of t.matchAll(S))a.push(`geocoder or map API host (${e[0]})`);for(const e of t.matchAll(v))a.push(`Google Maps global (${e[0]})`);return a}function y(t,a){const{check:e,report:d}=j("one map module"),c=a.allowed??{};{const o=["@googlemaps","js-api-loader"].join("/"),r=["maplibre","gl"].join("-"),m="leaflet",u=[["a named SDK import",`import { Loader } from ${s(o)};`],["a dynamic import()",`const m = await import(${s(r)});`],["a require()",`const L = require(${s(m)});`],["a side-effect import",`import ${s(`${m}/dist/${m}.css`)};`],["a geocoder host",`fetch("https://${f[2]}/search?q=x")`],["the Google global",`new ${["google","maps"].join(".")}.Map(el)`]];for(const[p,n]of u)e(`the reader finds ${p}`,l(n).length===1,l(n).join(", "));const w=[["the shell's map",`import { EntityMap } from ${s("efficient-shell/map")};`],["a directions link",'href="https://www.google.com/maps/dir/?api=1"'],["a package that starts like one",`import x from ${s("olive")};`]];for(const[p,n]of w)e(`…and leaves ${p} alone`,l(n).length===0,l(n).join(", "))}const i=t.filter(o=>b.test(o.path));e(`read the source (${i.length} JS/TS files, at least ${a.minFiles})`,i.length>=a.minFiles,"fewer means the walk broke, and every check below is vacuous");const g=i.filter(o=>!(o.path in c)).flatMap(o=>l(o.text).map(r=>`${o.path}: ${r}`));e("no file draws its own map or asks a geocoder itself",g.length===0,`
|
|
2
|
+
${g.join(`
|
|
3
|
+
`)}
|
|
4
|
+
Draw with efficient-shell/map, over points the backend locates (logistics.geocoding);
|
|
5
|
+
a typed address goes to the backend's geocoder, never to a geocoder's host.`);const $=new Set(i.map(o=>o.path)),h=Object.keys(c).filter(o=>!$.has(o));return e("every exemption names a file that is still here",h.length===0,`drop these from \`allowed\`: ${h.join(", ")}`),d()}export{y as oneMapModule};
|
|
@@ -188,6 +188,16 @@ export interface WebsiteSocial {
|
|
|
188
188
|
get(scope?: SiteScope): Promise<SocialLinkSettings>;
|
|
189
189
|
update(patch: SocialLinkSettings, scope?: SiteScope): Promise<SocialLinkSettings>;
|
|
190
190
|
}
|
|
191
|
+
export interface GeocodeResult {
|
|
192
|
+
lat: number;
|
|
193
|
+
lng: number;
|
|
194
|
+
label: string;
|
|
195
|
+
}
|
|
196
|
+
export interface WebsiteGeocoder {
|
|
197
|
+
locate(query: string, scope?: {
|
|
198
|
+
country?: string;
|
|
199
|
+
}): Promise<GeocodeResult | null>;
|
|
200
|
+
}
|
|
191
201
|
export interface WebsiteBackend {
|
|
192
202
|
pages: WebsitePages;
|
|
193
203
|
lock?: WebsiteEditLock;
|
|
@@ -201,4 +211,5 @@ export interface WebsiteBackend {
|
|
|
201
211
|
chat?: WebsiteChat;
|
|
202
212
|
social?: WebsiteSocial;
|
|
203
213
|
theme?: WebsiteTheme;
|
|
214
|
+
geocode?: WebsiteGeocoder;
|
|
204
215
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-web-builder",
|
|
3
|
-
"version": "38.
|
|
3
|
+
"version": "38.1.0",
|
|
4
4
|
"description": "The EFFICIENT website builder: the website editor, the general sections and the renderer that draws them, compiled. Hostable by any EFFICIENT product; nothing here imports a host.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|