efficient-web-builder 44.0.1 → 46.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -2
- package/README.md +8 -0
- package/dist/editor/components/ApplyCornersToSiblings.d.ts +1 -3
- package/dist/editor/components/ApplyCornersToSiblings.js +1 -1
- package/dist/editor/components/BlogPostSource.js +1 -1
- package/dist/editor/components/CanvasPartsBridge.js +1 -1
- package/dist/editor/components/CardShadowField.js +1 -1
- package/dist/editor/components/ChatSettingsPanel.js +1 -1
- package/dist/editor/components/FieldGlyph.js +1 -1
- package/dist/editor/components/LocationsGroupedField.js +1 -1
- package/dist/editor/components/PartInkControl.js +1 -1
- package/dist/editor/components/PartSettingsPanel.d.ts +0 -2
- package/dist/editor/components/PartSettingsPanel.js +1 -1
- package/dist/editor/components/PartTextBox.d.ts +6 -3
- package/dist/editor/components/PartTextBox.js +1 -1
- package/dist/editor/components/PreviewChatContext.d.ts +1 -2
- package/dist/editor/components/PreviewChatContext.js +1 -1
- package/dist/editor/components/PreviewPartAnchors.js +1 -1
- package/dist/editor/components/SectionIcon.js +1 -1
- package/dist/editor/components/SectionThemePicker.js +1 -1
- package/dist/editor/components/SectionThumbnail.js +1 -1
- package/dist/editor/components/SectionWidthRows.d.ts +6 -13
- package/dist/editor/components/SectionWidthRows.js +1 -1
- package/dist/editor/components/SourceStatus.d.ts +2 -1
- package/dist/editor/components/SourceStatus.js +1 -1
- package/dist/editor/components/StorefrontEditor.js +1 -1
- package/dist/editor/components/ThemeCard.js +1 -1
- package/dist/editor/components/ThemeColourField.js +1 -1
- package/dist/editor/components/ThemeField.js +1 -1
- package/dist/editor/components/TickerSettingsPanel.js +1 -1
- package/dist/editor/components/WebsiteScreenParts.js +1 -1
- package/dist/editor/components/WebsiteSettingsPanel.js +1 -1
- package/dist/editor/components/storefront-editor.css +90 -359
- package/dist/editor/components/useHostDocumentBridge.js +1 -1
- package/dist/editor/components/useLocationsTree.js +1 -1
- package/dist/editor/components/useSectionToBoxPass.d.ts +8 -1
- package/dist/editor/components/useSectionToBoxPass.js +1 -1
- package/dist/editor/components/useSocialSettings.d.ts +2 -2
- package/dist/editor/lib/animation/AnimationDurationRow.d.ts +3 -0
- package/dist/editor/lib/animation/AnimationDurationRow.js +1 -0
- package/dist/editor/lib/animation/entrance-fields.d.ts +4 -0
- package/dist/editor/lib/animation/entrance-fields.js +1 -0
- package/dist/editor/lib/animation/fields.d.ts +2 -0
- package/dist/editor/lib/animation/fields.js +1 -0
- package/dist/editor/lib/animation/loop-fields.d.ts +2 -0
- package/dist/editor/lib/animation/loop-fields.js +1 -0
- package/dist/editor/lib/document/ColourControl.js +1 -1
- package/dist/editor/lib/document/add-palette.js +1 -1
- package/dist/editor/lib/document/block-offer.js +1 -1
- package/dist/editor/lib/document/block-source-fields.d.ts +1 -1
- package/dist/editor/lib/document/block-source-fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Banner/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Breadcrumb/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/ButtonBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Cards/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/CategoryBar/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Chart/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Divider/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/DocBody/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/DocMasthead/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/DocTabs/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Eyebrow/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/FAQ/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/FeaturedCover/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Flex/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Footprint/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Grid/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Heading/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Hero/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/HeroGroup/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/HeroSingle/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/HeroSlide/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/ImageBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Integrations/fields.js +2 -2
- package/dist/editor/lib/document/blocks/general/IntroBleed/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/KeyFeatures/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/LocationMap/fields.d.ts +10 -0
- package/dist/editor/lib/document/blocks/general/LocationMap/fields.js +1 -0
- package/dist/editor/lib/document/blocks/general/LogoBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Logos/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/LongRead/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Manifesto/fields.js +2 -2
- package/dist/editor/lib/document/blocks/general/Masthead/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Mockup/fields.js +2 -2
- package/dist/editor/lib/document/blocks/general/OrderSummary/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/ParagraphsA/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/PaymentBadges/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/PostCard/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/ProcessSteps/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Prose/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/SectionHeader/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Series/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/SpecStrip/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Split/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Stats/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/StatsParagraph/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Testimonials/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Text/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Ticker/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/Timeline/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/TimelineTrack/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/TitleWithButtons/fields.js +1 -1
- package/dist/editor/lib/document/blocks/general/index.d.ts +2 -2
- package/dist/editor/lib/document/blocks/general/index.js +1 -1
- package/dist/editor/lib/document/blocks/shared-fields.d.ts +2 -4
- package/dist/editor/lib/document/blocks/shared-fields.js +1 -1
- package/dist/editor/lib/document/box-fields.d.ts +36 -0
- package/dist/editor/lib/document/box-fields.js +1 -0
- package/dist/editor/lib/document/box-gutter-field.d.ts +1 -0
- package/dist/editor/lib/document/box-gutter-field.js +1 -0
- package/dist/editor/lib/document/canvas-typing.js +1 -1
- package/dist/editor/lib/document/card-row-fields.d.ts +1 -1
- package/dist/editor/lib/document/card-row-fields.js +1 -1
- package/dist/editor/lib/document/consent-words-field.d.ts +2 -3
- package/dist/editor/lib/document/consent-words-field.js +1 -1
- package/dist/editor/lib/document/controls.d.ts +34 -94
- package/dist/editor/lib/document/controls.js +1 -1
- package/dist/editor/lib/document/enclosing-section.d.ts +5 -1
- package/dist/editor/lib/document/enclosing-section.js +1 -1
- package/dist/editor/lib/document/field-groups.js +1 -1
- package/dist/editor/lib/document/general-registry.js +1 -1
- package/dist/editor/lib/document/overrides.js +1 -1
- package/dist/editor/lib/document/page-root-fields.d.ts +1 -1
- package/dist/editor/lib/document/page-root-fields.js +1 -1
- package/dist/editor/lib/document/page-root.d.ts +2 -7
- package/dist/editor/lib/document/page-root.js +2 -2
- package/dist/editor/lib/document/part-anchors.d.ts +0 -1
- package/dist/editor/lib/document/part-anchors.js +1 -1
- package/dist/editor/lib/document/part-panel-rows.d.ts +75 -0
- package/dist/editor/lib/document/part-panel-rows.js +1 -0
- package/dist/editor/lib/document/passes/inspector.js +1 -1
- package/dist/editor/lib/document/separator-field.d.ts +10 -0
- package/dist/editor/lib/document/separator-field.js +1 -0
- package/dist/editor/lib/document/shell-glyph.d.ts +2 -0
- package/dist/editor/lib/document/shell-glyph.js +1 -0
- package/dist/{format → editor}/lib/host-document-bridge.d.ts +1 -3
- package/dist/editor/lib/host-document-bridge.js +1 -0
- package/dist/editor/lib/pinned-chrome-doc.js +1 -1
- package/dist/editor/lib/sections/city-presets.d.ts +4 -0
- package/dist/editor/lib/sections/city-presets.js +1 -0
- package/dist/editor/lib/sections/new-section-node.js +1 -1
- package/dist/editor/lib/sections/section-dry-run.d.ts +13 -2
- package/dist/editor/lib/sections/section-dry-run.js +2 -2
- package/dist/editor/lib/sections/text-layouts.d.ts +6 -0
- package/dist/editor/lib/sections/text-layouts.js +1 -0
- package/dist/editor/lib/source-rules/part-slider-fills-row.d.ts +1 -0
- package/dist/editor/lib/source-rules/part-slider-fills-row.js +5 -5
- package/dist/format/lib/animation/index.d.ts +1 -0
- package/dist/format/lib/animation/index.js +1 -0
- package/dist/format/lib/animation/loop.d.ts +29 -0
- package/dist/format/lib/animation/loop.js +1 -0
- package/dist/format/lib/content/block-align.d.ts +2 -0
- package/dist/format/lib/content/block-align.js +1 -1
- package/dist/format/lib/content/block-size.d.ts +59 -0
- package/dist/format/lib/content/block-size.js +1 -0
- package/dist/format/lib/content/box-background.js +1 -1
- package/dist/format/lib/content/box-layout.d.ts +16 -37
- package/dist/format/lib/content/box-layout.js +1 -1
- package/dist/format/lib/content/box-link.d.ts +13 -0
- package/dist/format/lib/content/box-link.js +13 -0
- package/dist/format/lib/content/box-separator.d.ts +10 -0
- package/dist/format/lib/content/box-separator.js +1 -0
- package/dist/format/lib/content/box-shape.d.ts +10 -0
- package/dist/format/lib/content/box-shape.js +1 -0
- package/dist/format/lib/content/button-icon.d.ts +1 -0
- package/dist/format/lib/content/button-icon.js +1 -1
- package/dist/format/lib/content/card-corners.d.ts +0 -3
- package/dist/format/lib/content/card-corners.js +1 -1
- package/dist/format/lib/content/card-template.d.ts +2 -0
- package/dist/format/lib/content/card-template.js +1 -1
- package/dist/format/lib/content/cart-drawer.d.ts +7 -0
- package/dist/format/lib/content/cart-drawer.js +1 -1
- package/dist/format/lib/content/chat-launcher.js +1 -1
- package/dist/format/lib/content/container-gap.d.ts +9 -1
- package/dist/format/lib/content/container-gap.js +1 -1
- package/dist/format/lib/content/gallery-card-layout.js +1 -1
- package/dist/format/lib/content/gallery-layout.d.ts +1 -0
- package/dist/format/lib/content/gallery-layout.js +1 -1
- package/dist/format/lib/content/page-background.js +1 -1
- package/dist/format/lib/content/post-date.d.ts +1 -0
- package/dist/format/lib/content/post-date.js +1 -0
- package/dist/format/lib/content/scrim.d.ts +1 -0
- package/dist/format/lib/content/scrim.js +1 -0
- package/dist/format/lib/content/section-min-height.d.ts +4 -0
- package/dist/format/lib/content/section-min-height.js +1 -1
- package/dist/format/lib/content/section-width.d.ts +2 -18
- package/dist/format/lib/content/section-width.js +1 -1
- package/dist/format/lib/content/site-gutter.d.ts +11 -1
- package/dist/format/lib/content/site-gutter.js +1 -1
- package/dist/format/lib/content/tint.d.ts +1 -0
- package/dist/format/lib/content/tint.js +1 -0
- package/dist/format/lib/document/blocks/block-types.d.ts +0 -1
- package/dist/format/lib/document/blocks/general/HeroSingle/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/HeroSlide/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/IntroBleed/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/LocationMap/meta.d.ts +2 -0
- package/dist/format/lib/document/blocks/general/LocationMap/meta.js +1 -0
- package/dist/format/lib/document/blocks/general/SpecStrip/meta.d.ts +5 -0
- package/dist/format/lib/document/blocks/general/SpecStrip/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/Ticker/meta.js +1 -1
- package/dist/format/lib/document/blocks/general/metas.d.ts +1 -0
- package/dist/format/lib/document/blocks/general/metas.js +1 -1
- package/dist/format/lib/document/blocks/general/text-part-shapes.json +30 -0
- package/dist/format/lib/document/box-footer.d.ts +1 -0
- package/dist/format/lib/document/box-footer.js +1 -1
- package/dist/format/lib/document/cap-hero-groups.js +1 -1
- package/dist/format/lib/document/container-blocks.js +1 -1
- package/dist/format/lib/document/editor-site-widths.d.ts +2 -0
- package/dist/format/lib/document/editor-site-widths.js +1 -0
- package/dist/format/lib/document/general-order.d.ts +1 -1
- package/dist/format/lib/document/general-order.js +1 -1
- package/dist/format/lib/document/part-inks.js +1 -1
- package/dist/format/lib/document/passes/document-position.js +1 -1
- package/dist/format/lib/document/passes/settings-groups.js +1 -1
- package/dist/format/lib/document/passes/types.d.ts +10 -5
- package/dist/format/lib/document/renamed-props.js +1 -1
- package/dist/format/lib/document/section-catalog.js +2 -2
- package/dist/format/lib/editor-words-catalogue.d.ts +36 -32
- package/dist/format/lib/editor-words-catalogue.js +6 -6
- package/dist/format/lib/fit-words.js +77 -18
- package/dist/format/lib/fonts.d.ts +1 -0
- package/dist/format/lib/fonts.js +1 -1
- package/dist/format/lib/hero-group-placement.js +1 -1
- package/dist/format/lib/hero-texture.d.ts +1 -1
- package/dist/format/lib/hero-texture.js +1 -1
- package/dist/format/lib/locations-grid.d.ts +1 -0
- package/dist/format/lib/locations-grid.js +1 -1
- package/dist/format/lib/map-styles.d.ts +0 -1
- package/dist/format/lib/map-styles.js +1 -1
- package/dist/format/lib/popup/look.js +1 -1
- package/dist/format/lib/popup/text-kinds.d.ts +0 -1
- package/dist/format/lib/popup/text-kinds.js +1 -1
- package/dist/format/lib/sections/hero-overlay.d.ts +1 -1
- package/dist/format/lib/sections/hero-overlay.js +1 -1
- package/dist/format/lib/sections/section-head-placement.d.ts +0 -4
- package/dist/format/lib/sections/section-head-placement.js +1 -1
- package/dist/format/lib/sections/section-presets.js +1 -1
- package/dist/format/lib/sections/strip-shape.d.ts +16 -0
- package/dist/format/lib/sections/strip-shape.js +1 -0
- package/dist/format/lib/sections/timeline-year-shape.d.ts +4 -0
- package/dist/format/lib/sections/timeline-year-shape.js +1 -0
- package/dist/format/lib/source-rules/box-fields-from-easel.d.ts +4 -0
- package/dist/format/lib/source-rules/box-fields-from-easel.js +8 -0
- package/dist/format/lib/source-rules/editor-chrome-note.js +1 -1
- package/dist/format/lib/source-rules/editor-words.js +2 -2
- package/dist/format/lib/source-rules/no-glyph-rows.d.ts +0 -4
- package/dist/format/lib/source-rules/no-glyph-rows.js +4 -4
- package/dist/format/lib/source-rules/one-alignment-row.d.ts +9 -0
- package/dist/format/lib/source-rules/one-alignment-row.js +7 -0
- package/dist/format/lib/source-rules/one-loop-module.d.ts +7 -0
- package/dist/format/lib/source-rules/one-loop-module.js +6 -0
- package/dist/format/lib/source-rules/one-node-list.d.ts +2 -0
- package/dist/format/lib/source-rules/one-node-list.js +1 -0
- package/dist/format/lib/source-rules/one-page-theme-reader.d.ts +6 -0
- package/dist/format/lib/source-rules/one-page-theme-reader.js +6 -0
- package/dist/format/lib/source-rules/part-style-naming.js +1 -1
- package/dist/format/lib/source-rules/shell-width-token-not-colour.d.ts +5 -0
- package/dist/format/lib/source-rules/shell-width-token-not-colour.js +2 -0
- package/dist/format/lib/source-rules/site-square-by-default.js +3 -3
- package/dist/format/lib/source-rules/support/panel-select-cascade.js +2 -2
- package/dist/format/lib/theme.d.ts +6 -0
- package/dist/format/lib/theme.js +4 -4
- package/dist/render/components/Banner.js +1 -1
- package/dist/render/components/ButtonBlock.d.ts +2 -0
- package/dist/render/components/ButtonBlock.js +1 -1
- package/dist/render/components/CardRowContext.d.ts +4 -4
- package/dist/render/components/CardRowContext.js +1 -1
- package/dist/render/components/Cards.d.ts +1 -0
- package/dist/render/components/Cards.js +1 -1
- package/dist/render/components/ContactLocations.js +2 -14
- package/dist/render/components/Eyebrow.d.ts +2 -1
- package/dist/render/components/Eyebrow.js +1 -1
- package/dist/render/components/FeaturedCover.js +1 -1
- package/dist/render/components/Flex.d.ts +19 -1
- package/dist/render/components/Flex.js +1 -1
- package/dist/render/components/Grid.js +1 -1
- package/dist/render/components/Heading.d.ts +3 -4
- package/dist/render/components/Heading.js +1 -1
- package/dist/render/components/HeroSection.js +1 -1
- package/dist/render/components/HeroSingle.js +1 -1
- package/dist/render/components/HeroSlide.js +1 -1
- package/dist/render/components/HeroVideoPlay.js +1 -1
- package/dist/render/components/ImageBlock.d.ts +1 -2
- package/dist/render/components/ImageBlock.js +1 -1
- package/dist/render/components/InBoxContext.d.ts +2 -0
- package/dist/render/components/InBoxContext.js +1 -0
- package/dist/render/components/KeyFeatures.js +1 -1
- package/dist/render/components/LocationMap.d.ts +23 -0
- package/dist/render/components/LocationMap.js +1 -0
- package/dist/render/components/Logo.js +1 -1
- package/dist/render/components/LogoBlock.d.ts +1 -0
- package/dist/render/components/LogoBlock.js +1 -1
- package/dist/render/components/LongRead.js +1 -1
- package/dist/render/components/Manifesto.d.ts +2 -1
- package/dist/render/components/Manifesto.js +1 -1
- package/dist/render/components/PreviewHeaderContext.d.ts +12 -5
- package/dist/render/components/PreviewHeaderContext.js +1 -1
- package/dist/render/components/PreviewLocationPartContext.d.ts +1 -1
- package/dist/render/components/PreviewLocationPartContext.js +1 -1
- package/dist/render/components/ProcessSteps.js +1 -1
- package/dist/render/components/SectionAnimation.d.ts +16 -3
- package/dist/render/components/SectionAnimation.js +1 -1
- package/dist/render/components/SiteGutterFrame.d.ts +7 -1
- package/dist/render/components/SiteGutterFrame.js +1 -1
- package/dist/render/components/SiteMap.js +1 -1
- package/dist/render/components/SpecStrip.d.ts +2 -4
- package/dist/render/components/SpecStrip.js +1 -1
- package/dist/render/components/Split.d.ts +3 -1
- package/dist/render/components/Split.js +1 -1
- package/dist/render/components/Text.d.ts +5 -2
- package/dist/render/components/Text.js +1 -1
- package/dist/render/components/Ticker.d.ts +5 -4
- package/dist/render/components/Ticker.js +1 -1
- package/dist/render/components/TickerSection.d.ts +5 -4
- package/dist/render/components/TickerSection.js +1 -1
- package/dist/render/components/Timeline.js +1 -1
- package/dist/render/components/TimelineRail.d.ts +55 -0
- package/dist/render/components/TimelineRail.js +1 -0
- package/dist/render/components/TimelineTrack.js +1 -1
- package/dist/render/components/TitleWithButtons.d.ts +2 -1
- package/dist/render/components/TitleWithButtons.js +1 -1
- package/dist/render/components/goldPhrases.js +1 -1
- package/dist/render/lib/animation/LoopTrack.d.ts +14 -0
- package/dist/render/lib/animation/LoopTrack.js +1 -0
- package/dist/render/lib/animation/entrance.d.ts +18 -0
- package/dist/render/lib/animation/entrance.js +1 -0
- package/dist/render/lib/document/blocks/general/ButtonBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Eyebrow/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Flex/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Heading/render.js +1 -1
- package/dist/render/lib/document/blocks/general/ImageBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/general/LocationMap/render.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/LocationMap/render.js +1 -0
- package/dist/render/lib/document/blocks/general/LogoBlock/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Manifesto/render.js +1 -1
- package/dist/render/lib/document/blocks/general/SectionHeader/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Split/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Text/render.js +1 -1
- package/dist/render/lib/document/blocks/general/Ticker/render.js +1 -1
- package/dist/render/lib/document/blocks/general/TitleWithButtons/render.js +1 -1
- package/dist/render/lib/document/blocks/general/renders.d.ts +1 -0
- package/dist/render/lib/document/blocks/general/renders.js +1 -1
- package/dist/render/lib/document/blocks/general/section-head-looks.d.ts +9 -0
- package/dist/render/lib/document/blocks/general/section-head-looks.js +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.d.ts +9 -1
- package/dist/render/lib/document/blocks/general/section-to-box-row-parts.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-cards.js +1 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-head.d.ts +4 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-head.js +1 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-locations.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-locations.js +1 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-logos.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-stats.js +1 -1
- package/dist/render/lib/document/blocks/general/section-to-box-rows-strip.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-strip.js +1 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.d.ts +2 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows-timeline.js +3 -0
- package/dist/render/lib/document/blocks/general/section-to-box-rows.js +1 -1
- package/dist/render/lib/document/page-frame.d.ts +3 -21
- package/dist/render/lib/document/page-frame.js +1 -1
- package/dist/render/lib/document/page-render.js +1 -1
- package/dist/render/lib/document/part-styles.d.ts +15 -13
- package/dist/render/lib/document/part-styles.js +2 -2
- package/dist/render/lib/document/passes/block-size.d.ts +3 -0
- package/dist/render/lib/document/passes/block-size.js +1 -0
- package/dist/render/lib/document/passes/cell-width.d.ts +1 -0
- package/dist/render/lib/document/passes/cell-width.js +1 -1
- package/dist/render/lib/document/passes/clickable-parts.js +1 -1
- package/dist/render/lib/document/passes/corners.js +1 -1
- package/dist/render/lib/document/passes/index.js +1 -1
- package/dist/render/lib/document/passes/section-anchor.d.ts +1 -0
- package/dist/render/lib/document/passes/section-anchor.js +1 -1
- package/dist/render/lib/document/passes/section-animation.d.ts +1 -0
- package/dist/render/lib/document/passes/section-animation.js +1 -1
- package/dist/render/lib/document/passes/section-padding.js +1 -1
- package/dist/render/lib/document/passes/section-width.d.ts +1 -4
- package/dist/render/lib/document/passes/section-width.js +1 -1
- package/dist/render/lib/document/text-parts.d.ts +4 -0
- package/dist/render/lib/document/text-parts.js +1 -1
- package/dist/render/lib/sections/section-to-box.d.ts +30 -7
- package/dist/render/lib/sections/section-to-box.js +1 -1
- package/dist/render/lib/text-styles/site-text-styles.js +2 -2
- package/package.json +5 -5
- package/dist/editor/components/PartResetDot.d.ts +0 -5
- package/dist/editor/components/PartResetDot.js +0 -1
- package/dist/editor/lib/document/section-width-fields.d.ts +0 -2
- package/dist/editor/lib/document/section-width-fields.js +0 -1
- package/dist/format/lib/content/image-width.d.ts +0 -9
- package/dist/format/lib/content/image-width.js +0 -1
- package/dist/format/lib/content/section-animation.d.ts +0 -13
- package/dist/format/lib/content/section-animation.js +0 -1
- package/dist/format/lib/host-document-bridge.js +0 -1
- package/dist/format/lib/sections/ticker-scroll.d.ts +0 -11
- package/dist/format/lib/sections/ticker-scroll.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 46.0.0 - 2026-10-30
|
|
4
4
|
|
|
5
|
-
**
|
|
5
|
+
**MAJOR for hosts.** Peers: `efficient-easel` `^26.1.0` (was `^24.1.0`; easel 25 and 26 are majors: easel 26 removes `ColourPicker`, `ColourWindow` and the pick words, which web-builder does not use), `efficient-shell` `^11.8.0` (unchanged). The 45.0.0 notes are on the GitHub Release v45.0.0.
|
|
6
|
+
|
|
7
|
+
- **BREAKING: `ApplyCornersButton` takes no `doneCount`, and `APPLY_CORNERS_DONE_MS` is removed** (`editor/components/ApplyCornersToSiblings`). easel 25's `SettingsAction` has no `done` state: the confirmation "Applied to N cards" is the shell's toast, raised from `doneLabel`, so the 2.2 s timer has nothing left to time. Host user: efficient-storefront-blocks `scripts/test-apply-corners-to-siblings.tsx:308` (drop `doneCount={null}`).
|
|
8
|
+
|
|
9
|
+
### Changed (one alignment control for both editors, Lewis 2026-10-30)
|
|
10
|
+
|
|
11
|
+
- **Block alignment and Text alignment are easel's rows.** Text, Eyebrow, Button, Logo and Title with buttons draw easel's Block alignment (Box glyphs); Split and the text part panel draw Text alignment (text glyphs). Each row has a phone value: `alignPhone` (blocks), `textAlignPhone` (Split), `_partStyles.<part>.alignPhone` (part panel). An empty phone value follows the desktop one, so a page with none stored draws the same bytes.
|
|
12
|
+
- **The Heading has no block-level alignment**; its words follow the heading part's own Text alignment. A Text's `align` places its 680px measure (margins); its words follow the text part. Both draw `text-left` as the part's resting answer, which the part's own rule overrides. **Stored data:** a Heading or Text that stores `align: "center"` or `"right"` draws its words left until the part holds `_partStyles.text.align` with that value; inovit.com has 4 such nodes (all center, homepage; 0 right), a listed data move. A Text converted by section-to-box keeps centring as its part's own align.
|
|
13
|
+
- **No entry row where the canvas can type**: a part the canvas draws has no drill row in the panel; a part off the page or hidden keeps one (`canTypeOnCanvas`, `lib/document/text-parts`).
|
|
14
|
+
- **BREAKING:** `alignField` (`editor/lib/document/blocks/shared-fields`) is removed: use `alignmentField` / `blockAlignmentField` (and the `…Fields` pairs) from `editor/lib/document/box-fields`. `headingLook(level, face?)` takes no `align`, and the `Heading` component has no `align` prop (a host that passes one gets a type error; efficient-storefront-blocks `scripts/test-box-block-spacing.tsx` passes `align: "left"` and must drop it when it takes this release). No host imports `alignField` or `headingLook` (efficient-storefront-blocks, efficient-storefront, efficient-admin-portal main, 2026-10-30). `"Alignment"` is removed from `WEB_BUILDER_WORDS` (`format/lib/editor-words-catalogue`): the rows are named Block alignment / Text alignment by easel. efficient-storefront-blocks re-exports this list (`efficient-storefront-blocks/words`), so its own Alignment strips must move to easel's rows when it takes 46.
|
|
15
|
+
- New: `alignPhoneClass`, `blockAlignOf` (`render/lib/content/block-align`); source rule `oneAlignmentRow` (`format/lib/source-rules/one-alignment-row`) fails a block that builds its own Left / Center / Right strip.
|
|
6
16
|
|
|
7
17
|
## 44.0.0 - 2026-10-28
|
|
8
18
|
|
package/README.md
CHANGED
|
@@ -172,6 +172,14 @@ by the host's own Tailwind (its `@source` scans the shell's `dist/`). Then
|
|
|
172
172
|
easel's sheets (`efficient-easel/screen.css`), then
|
|
173
173
|
`components/storefront-editor.css`.
|
|
174
174
|
|
|
175
|
+
`efficient-shell/motion.css` holds the keyframes every block's Entrance plays
|
|
176
|
+
(C27, 45.0.0): the box draws the shell's `data-motion-entrance` attributes and
|
|
177
|
+
nothing moves without that sheet. Every page that draws blocks loads it, the
|
|
178
|
+
published page as well as the editor's canvas; it needs no Tailwind pass and
|
|
179
|
+
has no order against the sheets above. Each Entrance box carries the class
|
|
180
|
+
`sf-entrance`, so a host rule that styles a parent's direct child reaches
|
|
181
|
+
through it (`.sf-box-gap-only > .sf-entrance > *`).
|
|
182
|
+
|
|
175
183
|
### Releasing
|
|
176
184
|
|
|
177
185
|
A merge is not a release. The pull request that wants hosts to see a change
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { type ApplyCornersPlan } from "../lib/document/apply-card-corners.js";
|
|
2
|
-
export declare const APPLY_CORNERS_DONE_MS = 2200;
|
|
3
2
|
export declare const APPLY_CORNERS_LABEL = "Apply to all cards";
|
|
4
|
-
export declare function ApplyCornersButton({ plan,
|
|
3
|
+
export declare function ApplyCornersButton({ plan, onPress, }: {
|
|
5
4
|
plan: ApplyCornersPlan;
|
|
6
|
-
doneCount: number | null;
|
|
7
5
|
onPress: () => void;
|
|
8
6
|
}): import("react").JSX.Element;
|
|
9
7
|
export default function ApplyCornersToSiblings(): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as n}from"react/jsx-runtime";import{useCallback as l}from"react";import{useEasel as a}from"efficient-easel/easel";import{SettingsAction as i}from"efficient-easel/panel";import{say as c}from"../../format/lib/editor-words.js";import{applyCorners as m,applyCornersDoneLabel as f,applyCornersNote as u,planApplyCorners as C}from"../lib/document/apply-card-corners.js";import{useSectionOps as y}from"efficient-easel/screen/lib/document/use-section-ops";const A="apply-corners-to-siblings",b="Apply to all cards";function d({plan:o,onPress:r}){return n(i,{id:A,label:c(b),note:u(o),disabled:!o.can,doneLabel:f(o.others),onPress:r})}function S(){const{appState:o,config:r}=a(p=>p),t=y(),e=C(r,o.data.content??[],o.ui.itemSelector),s=l(()=>{m(e,t.replaceComponent)},[e,t]);return n(d,{plan:e,onPress:s})}export{b as APPLY_CORNERS_LABEL,d as ApplyCornersButton,S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as e,Fragment as i,jsxs as B}from"react/jsx-runtime";import{useContext as P}from"react";import{SettingsField as d}from"efficient-easel/panel";import{FieldSelect as g}from"efficient-easel/fields";import{BlogPostIcon as f}from"efficient-easel/icons";import{ScreenDocumentContext as L}from"efficient-easel/screen/components/ScreenDocumentContext";import{loadStorefrontBlogPosts as C}from"./useStorefrontBlogPosts.js";import{useSnapshotSource as F}from"./useSnapshotSource.js";import j from"./SourceStatus.js";import{say as t}from"../../format/lib/editor-words.js";import{postDateLabel as N}from"../../format/lib/content/post-date.js";function h(o){return{slug:o.slug,image:o.coverImage,title:o.title,dek:o.excerpt,date:N(o.publishedAt),href:o.href}}function T({value:o,onChange:l}){const n=P(L);return n&&!n.capabilities.hasBlog?o?.slug?e(w,{value:o,onChange:l}):e(i,{}):e(D,{value:o,onChange:l})}function w({value:o,onChange:l}){return e("div",{children:e(d,{label:t("Blog post source"),icon:e(f,{}),hint:e(i,{children:t("Linked to a blog post. This editor has no blog to pick another from; choose “None (manual)” to author the section yourself.")}),children:e(g,{value:o.slug,ariaLabel:t("Blog post source"),onChange:n=>n?void 0:l(null),options:[{label:t("None (manual)"),value:""},{label:o.title||o.slug,value:o.slug}]})})})}function D({value:o,onChange:l}){const{rows:n,loading:p,refreshing:a,errored:m,refresh:b}=F({load:C,resolve:(s,r)=>s.find(c=>c.slug===r.slug),snapshot:h,value:o,onChange:l}),k=s=>{if(!s){l(null);return}const r=(n??[]).find(c=>c.slug===s);r&&l(h(r))},S=o?.slug&&!(n??[]).some(s=>s.slug===o.slug),x=m?"error":a?"loading":"idle",u=t("Storefront → Blog"),y=m?t("Couldn’t reach {place}.",{place:u}):a?t("Syncing from {place}…",{place:u}):t("Linked to “{name}”",{name:o?.title||o?.slug||""});return B("div",{children:[e(d,{label:t("Blog post source"),icon:e(f,{}),hint:o?.slug?void 0:e(i,{children:t("Pick a post from {place} to auto-fill this section, or keep “None (manual)” to author it yourself below.",{place:u})}),children:e(g,{value:o?.slug??"",ariaLabel:t("Blog post source"),onChange:k,readOnly:p,options:[{label:t("None (manual)"),value:""},...S?[{label:t("{name} (unavailable)",{name:o.title||o.slug}),value:o.slug}]:[],...(n??[]).map(s=>({label:s.title,value:s.slug}))]})}),o?.slug?e(j,{status:x,statusText:y,onRefresh:b,busy:a,hint:e(i,{children:t("Auto-fills the cover image, headline, dek, date and link from this post each time you open the editor. Those fields are hidden while a post is linked; the remaining fields stay yours to set.")})}):null]})}export{T as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as O}from"react/jsx-runtime";import{useMemo as _,useRef as k}from"react";import{CanvasPartsContext as v}from"efficient-easel/easel";import{usePreviewParts as w}from"efficient-easel/draw/client";import{isOnlyPart as C,partLabelOf as L,partOfBlockAt as x}from"../lib/document/part-anchors.js";import{say as y}from"../../format/lib/editor-words.js";import{decodePartId as T,encodePartId as H,PART_ATTR as B}from"../../render/lib/document/text-parts.js";import{HERO_PART_ATTR as E,readHeroPartId as p}from"../../render/lib/document/hero-media-parts.js";import{usePreviewHeroPart as K}from"../../render/components/PreviewHeroPartContext.js";import{TICKER_PART_ATTR as b,readTickerPartId as A,tickerPartId as h,usePreviewTicker as q}from"../../render/components/PreviewTickerContext.js";import{decodeLocationPartId as $,usePreviewLocationPart as I}from"../../render/components/PreviewLocationPartContext.js";import{LOCATION_PICK_ATTR as g}from"../lib/document/part-anchors.js";import{BLOCK_ATTRIBUTE as j}from"efficient-easel/canvas";function Z({children:m}){const{selectedPartId:o,select:s}=w(),{selectedHeroPart:P,select:u}=K(),{selectedHeroId:l,select:c}=q(),{selectedLocationPartId:f,select:a}=I(),r=P??(l?h(l):null)??f??o,t=k(r);t.current=r;const R=_(()=>({partAt:x,selected:()=>t.current,selectedPart:e=>{const n=t.current,i=N(e,n);if(!n||!i)return null;const d=L(i,n);return{id:n,element:i,whole:C(i,n),...d?{label:y(d)}:{}}},select:e=>{if(e&&$(e)){a(e);return}if(e&&p(e)){u(e);return}const n=A(e);if(n){c(n);return}if(e){s(e);return}const i=t.current?T(t.current)?.nodeId:null;i&&s(H(i,null))}}),[s,u,c,a,r]);return O(v.Provider,{value:R,children:m})}function N(m,o){if(!o||!T(o)?.propKey)return null;const s=r=>r.replace(/["\\]/g,"\\$&"),P=[...m.querySelectorAll(`[${B}="${s(o)}"]`)],u=P.find(r=>!P.some(t=>t!==r&&r.contains(t)));if(u)return u;const l=(r,t)=>[...m.querySelectorAll(`[${j}="${s(r)}"] ${t}`)][0]??null,c=$(o);if(c)return l(c.nodeId,`[${g}="${c.index}:${c.part}"]`);const f=p(o);if(f)return l(f.nodeId,`[${E}="${f.part}"]`);const a=A(o);return a?l(a,`[${b}]`):null}export{Z as CanvasPartsBridge,N as openPartElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as o}from"react/jsx-runtime";import{SettingsDefaultReset as p,SettingsField as c}from"efficient-easel/panel";import{IconPicker as f}from"efficient-shell/ui";import{ShadowIcon as u}from"efficient-easel/icons";import{say as e,editorEaselWords as h}from"../../format/lib/editor-words.js";import{CARD_SHADOWS as m,DEFAULT_CARD_SHADOW as l}from"../../format/lib/theme.js";const a={none:"None",soft:"Soft",lifted:"Lifted"},x="Applies to cards — products, brands, journal entries and filter cells. Round things like swatches and status dots are never shadowed.",b={none:"none",soft:"0 1px 1px rgba(20, 20, 22, 0.10), 0 2px 4px -1px rgba(20, 20, 22, 0.14)",lifted:"0 1px 2px rgba(20, 20, 22, 0.10), 0 4px 7px -2px rgba(20, 20, 22, 0.30)"};function S({value:n,onChange:r,showHint:i=!0}){const s=n===null,d=n??l;return o(c,{label:e("Card shadow"),icon:o(u,{}),value:e(a[d]),changed:!s,action:o(p,{words:h()?.panel,label:e("Card shadow"),changed:!s,detail:e(a[l]),onReset:()=>r(null)}),hint:i?e(x):void 0,children:o(f,{label:e("Card shadow"),value:d,options:m.map(t=>({value:t,label:e(a[t]),icon:o("span",{className:"sf-shadow-chip border border-line bg-surface",style:{boxShadow:b[t]}})})),onChange:r})})}export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as n,jsxs as
|
|
1
|
+
"use client";import{jsx as n,jsxs as s,Fragment as L}from"react/jsx-runtime";import{useEffect as P,useId as C,useState as E}from"react";import{usePreviewChat as T,DEFAULT_CHAT_PREVIEW as R}from"./PreviewChatContext.js";import{usePreviewHeader as S}from"../../render/components/PreviewHeaderContext.js";import{IconPicker as _}from"efficient-shell/ui";import{SettingsDefaultReset as y,SettingsField as u,SettingsSegmented as A,SettingsSwitch as I}from"efficient-easel/panel";import{ButtonIcon as O,ButtonIconIcon as B,EyeIcon as H,PhoneIcon as N,PlacementIcon as v,TypeIcon as x}from"efficient-easel/icons";import{ColourRow as D}from"../lib/document/ColourControl.js";import{shellGlyphOf as F}from"../lib/document/shell-glyph.js";import{PanelBand as w}from"../lib/document/controls.js";import{say as o,editorEaselWords as U}from"../../format/lib/editor-words.js";import{normalizeTheme as k,themeButtonColour as j}from"../../format/lib/theme.js";import{CHAT_LAUNCHER_ICONS as G,DEFAULT_CHAT_LAUNCHER_ICON as m,DEFAULT_CHAT_LAUNCHER_POSITION as f,chatLauncherIcon as W}from"../../format/lib/content/chat-launcher.js";const z="Chat with us",K="We usually reply within a few minutes",V="Hi! Ask us anything — about a wheel, an order, or fitment. Leave your details and we’ll reply.";function b({label:e,value:t,placeholder:l,onCommit:i,multiline:r=!1,hint:a}){const[c,g]=E(t);P(()=>g(t),[t]);const p=()=>{c!==t&&i(c)};return n(u,{label:e,icon:n(x,{}),changed:t!=="",action:n(d,{label:e,changed:t!=="",onReset:()=>i("")}),hint:a,children:r?n("textarea",{value:c,placeholder:l,rows:3,onChange:h=>g(h.target.value),onBlur:p,"aria-label":e}):n("input",{type:"text",value:c,placeholder:l,onChange:h=>g(h.target.value),onBlur:p,onKeyDown:h=>{h.key==="Enter"&&h.currentTarget.blur()},"aria-label":e,autoComplete:"off"})})}function d({label:e,changed:t,onReset:l}){return n(y,{words:U()?.panel,label:e,changed:t,onReset:l})}function q({label:e,icon:t,checked:l,fallback:i,onChange:r,hint:a}){const c=C();return n(u,{label:e,labelId:c,icon:t,changed:l!==i,action:s("span",{className:"inline-flex items-center gap-2",children:[n(I,{checked:l,onChange:r,ariaLabelledBy:c}),n(d,{label:e,changed:l!==i,onReset:()=>r(i)})]}),hint:a})}const J=G.map(e=>({value:e,icon:F(e)}));function M(){const{theme:e}=S(),t=k(e).themes[0];return j(t)??t?.accent??""}function Q(){const{chat:e,setChat:t}=T(),l=C(),i=M(),r=e.launcherIcon?W(e.launcherIcon):m;return s(L,{children:[n(u,{label:o("Show the chat bubble"),labelId:l,icon:n(H,{}),changed:!e.enabled,action:s("span",{className:"inline-flex items-center gap-2",children:[n(I,{checked:e.enabled,onChange:a=>t({enabled:a}),ariaLabelledBy:l}),n(d,{label:o("Show the chat bubble"),changed:!e.enabled,onReset:()=>t({enabled:!0})})]}),hint:e.enabled?o("The floating chat bubble shows in the corner of every page."):o("The chat bubble is hidden across the whole site.")}),s(w,{title:o("Look"),children:[n(D,{label:o("Button color"),icon:n(O,{}),changed:e.launcherColor!=="",value:e.launcherColor,inherited:i,caption:e.launcherColor?void 0:o("Site button color"),onChange:a=>t({launcherColor:a}),onReset:()=>t({launcherColor:""})}),n(u,{label:o("Icon"),icon:n(B,{}),changed:r!==m,action:n(d,{label:o("Icon"),changed:r!==m,onReset:()=>t({launcherIcon:""})}),children:n(_,{label:o("Icon"),value:r,options:J,onChange:a=>t({launcherIcon:a===m?"":a})})}),n(u,{label:o("Position"),icon:n(v,{}),changed:e.launcherPosition!==f,action:n(d,{label:o("Position"),changed:e.launcherPosition!==f,onReset:()=>t({launcherPosition:f})}),children:n(A,{options:[{label:o("Right"),id:"right"},{label:o("Left"),id:"left"}],value:e.launcherPosition,ariaLabel:o("Position"),onChange:a=>t({launcherPosition:a})})}),n(b,{label:o("Label"),value:e.launcherLabel,placeholder:o("Icon only"),onCommit:a=>t({launcherLabel:a}),hint:o("Shows when a visitor points at the button")}),n(q,{label:o("Show on phones"),icon:n(N,{}),checked:e.showOnPhones,fallback:R.showOnPhones,onChange:a=>t({showOnPhones:a})})]}),s(w,{title:o("Wording"),children:[n(b,{label:o("Title"),value:e.title,placeholder:z,onCommit:a=>t({title:a})}),n(b,{label:o("Subtitle"),value:e.subtitle,placeholder:K,onCommit:a=>t({subtitle:a})}),n(b,{label:o("Greeting message"),value:e.greeting,placeholder:V,onCommit:a=>t({greeting:a}),multiline:!0}),n("p",{className:"es-field-hint sf-hint-keep",children:o("Leave a field blank to use the built-in wording.")})]})]})}export{Q as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as e,Fragment as t,jsxs as a}from"react/jsx-runtime";import{CaptionIcon as c,DateIcon as p,FlagIcon as u,TitleIcon as g,ButtonIcon as m,DollarIcon as M,HashIcon as x,LinkIcon as b,NoteIcon as w,TagIcon as v,TextLinesIcon as I}from"efficient-easel/icons";const l={body:I,button:m,link:b,label:v,number:x,price:M,note:w,name:u,date:p,caption:c,title:g},d={eyebrow:a(t,{children:[e("path",{d:"M5 6.5h5"}),e("path",{d:"M5 12.5h14"}),e("path",{d:"M5 18h11"})]}),heading:a(t,{children:[e("path",{d:"M6.5 5v14"}),e("path",{d:"M17.5 5v14"}),e("path",{d:"M6.5 12h11"})]}),intro:a(t,{children:[e("path",{d:"M4 5.5v13"}),e("path",{d:"M8 7.5h12"}),e("path",{d:"M8 12h12"}),e("path",{d:"M8 16.5h8"})]}),value:a(t,{children:[e("rect",{x:"2.5",y:"7",width:"19",height:"10",rx:"2"}),e("path",{d:"M6.5 12h7"})]}),quote:a(t,{children:[e("path",{d:"M9.5 5.5C7 7.2 5.5 9.7 5.5 12.8h4v5.7h-5v-5.7"}),e("path",{d:"M19.5 5.5c-2.5 1.7-4 4.2-4 7.3h4v5.7h-5v-5.7"})]}),tag:a(t,{children:[e("rect",{x:"3",y:"5.5",width:"18",height:"13",rx:"2.5"}),e("path",{d:"M8 9.5h8"}),e("path",{d:"M12 9.5v5"})]}),meta:a(t,{children:[e("path",{d:"M4 7h16"}),e("path",{d:"M4 14h3.5"}),e("path",{d:"M10.5 14h3"}),e("path",{d:"M17 14h3"})]})};function y({noun:h,size:n=14,strokeWidth:s=1.8,className:r,style:i}){const o=l[h];return o?e("span",{className:r,style:{display:"inline-flex",...i},"aria-hidden":"true",children:e(o,{size:n})}):e("svg",{className:r,style:i,width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:s,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:d[h]})}const L=Object.keys(l),T={eyebrow:"TextSmall — a small letterform, not a short rule over a long one",heading:"TextSize — the big/small pair, and it means a SIZE",intro:"TextLines — deliberately its sibling: the same run of lines WITH an indent rule",value:"Square — an empty rect; Background — a filled band. Neither carries a written line",quote:"Quote — a bar down the left of three lines, near our `intro` (bar and one line); using it makes a quote row and an intro row look the same",tag:"Tag — a luggage tag, which draws our Label instead (owner, 2026-09-05). Type — a bare T, which is the fallback",meta:"TextLines — this is that with the gaps that make it read as several facts"},S=Object.keys(d);export{y as FieldGlyph,S as OWN_DRAWN,L as SHELL_BACKED,T as SHELL_VERDICT};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as O,jsxs as f}from"react/jsx-runtime";import{useId as $,useState as V}from"react";import{InspectorUpLevel as I}from"efficient-easel/chrome";import{useEasel as Y}from"efficient-easel/easel";import{ListField as
|
|
1
|
+
"use client";import{jsx as e,Fragment as O,jsxs as f}from"react/jsx-runtime";import{useId as $,useState as V}from"react";import{InspectorUpLevel as I}from"efficient-easel/chrome";import{useEasel as Y}from"efficient-easel/easel";import{ListField as F}from"efficient-easel/fields";import{SettingsField as G}from"efficient-easel/panel";import{ClockIcon as H,ContrastIcon as Z,GlobeIcon as J,LinkIcon as Q,LocationIcon as X,PhoneIcon as K,SquareIcon as ee,TypeIcon as A}from"efficient-easel/icons";import ne from"./MediaUploadField.js";import{useLocationsHasTree as te}from"./LocationsTreeContext.js";import{say as n,sayCount as _}from"../../format/lib/editor-words.js";import{CoordsField as oe}from"../lib/document/controls.js";import{useLocationsFocus as ie,setLocationsFocus as v}from"../lib/document/locations-focus.js";import{groupKeyOf as x,groupLabelOf as re,NEW_CITY as R,writeGroupCities as ae,writeGroupOrder as le}from"../../format/lib/document/locations-tree.js";import{useSectionOps as se}from"efficient-easel/screen/lib/document/use-section-ops";import{ROOT_ZONE as ce}from"efficient-easel/draw";import{CONTACT_LOCATIONS_DEFAULTS as z,parseLocationTileShape as ue}from"../../format/lib/content/contact.js";const D=(l,t)=>t||l?re(l,t):n("Ungrouped");function pe(l){const t=[];return l.forEach((c,r)=>{const m=x(c);let s=t.find(i=>i.key===m);s||(s={key:m,name:String(c?.groupName??""),indices:[]},t.push(s)),s.indices.push(r)}),t}function E({children:l}){return e("div",{style:{fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--ink-faint)",margin:"14px 0 6px"},children:l})}const B={width:"100%",height:32,textAlign:"left",display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"0 12px",fontSize:12,border:"1px solid var(--line-strong)",borderRadius:6,background:"transparent",color:"inherit",cursor:"inherit"},de={padding:0,border:"none",background:"none",font:"inherit",fontSize:12,color:"var(--sf-accent)",cursor:"pointer"},M={...de,color:"var(--status-danger-soft-ink)"};function b({label:l,value:t,placeholder:c,textarea:r,icon:m,onChange:s,onBlur:i,onKeyDown:h}){const k=$();return e(G,{label:l,icon:m??e(A,{}),htmlFor:k,children:r?e("textarea",{id:k,value:t,placeholder:c,onChange:g=>s(g.target.value)}):e("input",{id:k,type:"text",value:t,placeholder:c,onChange:g=>s(g.target.value),onBlur:i,onKeyDown:h})})}const me=[{label:"Auto",value:"auto"},{label:"Dark",value:"dark"},{label:"Light",value:"light"}],he=[{label:"Tall (3:4)",value:"tall"},{label:"Square",value:"square"},{label:"Wide (2:1)",value:"wide"}];function P({label:l,icon:t,options:c,value:r,onChange:m}){return e(G,{label:l,icon:t,children:e("div",{role:"group","aria-label":l,style:{display:"flex",gap:4,flex:1},children:c.map(s=>{const i=r===s.value;return e("button",{type:"button","aria-pressed":i,onClick:()=>m(s.value),style:{flex:1,padding:"6px 8px",fontSize:12,borderRadius:6,cursor:"pointer",border:`1px solid ${i?"var(--sf-accent)":"var(--line-strong)"}`,background:i?"var(--sf-accent)":"transparent",color:i?"var(--sf-on-accent)":"inherit",fontWeight:i?500:400},children:n(s.label)},s.value)})})})}function U({props:l,setSection:t,headOnly:c}){const r=i=>String(l[i]??""),m=l.mapTheme||z.mapTheme,s=z;return f(O,{children:[!c&&e(E,{children:n("Section")}),e(b,{label:n("Section number"),value:r("sectionNumber"),placeholder:s.sectionNumber,onChange:i=>t({sectionNumber:i})}),e(b,{label:n("Heading"),textarea:!0,value:r("heading"),placeholder:s.heading,onChange:i=>t({heading:i})}),e(b,{label:n("Body"),textarea:!0,value:r("tagline"),placeholder:s.tagline,onChange:i=>t({tagline:i})}),c?null:f(O,{children:[e(E,{children:n("City strip")}),e(b,{label:n("Eyebrow"),value:r("galleryKicker"),placeholder:s.galleryKicker,onChange:i=>t({galleryKicker:i})}),e(b,{label:n("Hint"),value:r("galleryHint"),placeholder:s.galleryHint,onChange:i=>t({galleryHint:i})}),e(P,{label:n("Shape"),icon:e(ee,{}),options:he,value:ue(l.imageShape),onChange:i=>t({imageShape:i})}),e(E,{children:n("Map & Theme")}),e(P,{label:n("Map theme"),icon:e(Z,{}),options:me,value:m,onChange:i=>t({mapTheme:i})})]})]})}function ge({cards:l,groupKey:t,onChange:c,onBack:r,onOpenCity:m,onNavigate:s}){const i=l.map((a,d)=>x(a)===t?d:-1).filter(a=>a>=0),h=String(l[i[0]]?.groupName??""),k=new Set(l.map(x).filter(a=>a!==t)),[g,w]=V(t),C=a=>c(l.map(d=>x(d)===t?{...d,...a}:d)),L=()=>{const a=g;if(a!==t){if(k.has(a)){w(t);return}c(l.map(d=>x(d)===t?{...d,group:a}:d)),s(a)}};return f("div",{className:"sf-locations-view",children:[e(I,{inline:!0,name:n("Section"),onSelect:r,title:D(t,h)}),e(b,{label:n("Group heading"),value:g,placeholder:n("e.g. Americas"),onChange:w,onBlur:L,onKeyDown:a=>{a.key==="Enter"&&a.currentTarget.blur()}}),k.has(g)&&g!==t&&e("p",{className:"sf-note sf-note--error",role:"alert",children:n("Another group already uses this heading — pick a different one.")}),e(b,{label:n("Group name"),value:h,placeholder:n("Shown beside the heading"),onChange:a=>C({groupName:a})}),e(F,{label:n("Cities in this group"),noun:n("city"),items:i.map(a=>l[a]),onChange:a=>c(ae(l,t,a)),newItem:()=>({...R,group:t,groupName:h}),open:null,onOpen:()=>{},renderItem:()=>null,removeOnRow:!1,canDuplicate:()=>!1,renderRow:(a,d)=>f("button",{type:"button",style:B,onClick:()=>m(i[d]),children:[e("span",{children:a?.name||n("City")}),e("span",{"aria-hidden":"true",children:"›"})]})}),e("div",{style:{marginTop:12},children:e("button",{type:"button",style:M,onClick:()=>{c(l.filter(a=>x(a)!==t)),r()},children:_("Delete group ({n} city)","Delete group ({n} cities)",i.length)})})]})}function fe({value:l,onChange:t}){const c=Array.isArray(l)?l:[],r=ie(),m=te(),s=pe(c),{appState:i,selectedItem:h}=Y(o=>o),k=se(),g=h?.props??{},w=o=>{if(!h)return;const p=(i.data.content??[]).findIndex(y=>y.props.id===h.props.id);p<0||k.replaceComponent(ce,p,{type:h.type,props:{...h.props,...o}})},C=(o,u)=>t(c.map((p,y)=>y===o?{...p,...u}:p)),L=()=>{const o=new Set(s.map(y=>y.key));let u=s.length+1,p=`Group ${u}`;for(;o.has(p);)p=`Group ${++u}`;return p};if(r.level==="texts")return f("div",{className:"sf-locations-view",children:[e(I,{inline:!0,name:n("Locations"),onSelect:()=>v({level:"groups"}),title:n("Texts")}),e(U,{props:g,setSection:w,headOnly:!0})]});if(r.level==="image"){const o=c[r.index];return o?f("div",{className:"sf-locations-view",children:[e(I,{inline:!0,name:String(o.name??"")||n("City"),onSelect:()=>v({level:"city",index:r.index}),title:n("Image")}),e(ne,{value:o.photo||"",onChange:u=>C(r.index,{photo:u}),label:"Image",accept:"image/*"})]}):a()}if(r.level==="map"){const o=c[r.index];return o?f("div",{className:"sf-locations-view",children:[e(I,{inline:!0,name:String(o.name??"")||n("City"),onSelect:()=>v({level:"city",index:r.index}),title:n("Map")}),e(oe,{value:o.geocode,onChange:u=>C(r.index,{geocode:u}),label:"Coordinates"}),e(b,{label:n("Directions link"),icon:e(Q,{}),value:String(o.mapsUrl??""),onChange:u=>C(r.index,{mapsUrl:u})})]}):a()}if(r.level==="city"){const o=r.index,u=c[o];if(!u)return a();const p=x(u),y=(T,N)=>C(o,{[T]:N}),S=(T,N,j,W=!1)=>e(b,{label:N,icon:j,textarea:W,value:String(u[T]??""),onChange:q=>y(T,q)});return f("div",{className:"sf-locations-view",children:[e(I,{inline:!0,name:D(p,String(u.groupName??"")),onSelect:()=>v({level:"group",key:p}),title:u.name||n("City")}),S("name",n("Location name"),e(A,{})),S("state",n("State / Province"),e(A,{})),S("country",n("Country"),e(J,{})),S("address",n("Address"),e(X,{}),!0),S("phone",n("Phone"),e(K,{})),S("hours",n("Opening hours"),e(H,{})),S("timezone",n("Timezone chip"),e(H,{})),e("div",{style:{marginTop:12},children:e("button",{type:"button",style:M,onClick:()=>{t(c.filter((T,N)=>N!==o)),v({level:"group",key:p})},children:n("Delete city")})})]})}if(r.level==="group")return s.some(o=>o.key===r.key)?e(ge,{cards:c,groupKey:r.key,onChange:t,onBack:()=>v({level:"groups"}),onOpenCity:o=>v({level:"city",index:o}),onNavigate:o=>v({level:"group",key:o})},r.key):a();function a(){return f("div",{className:"sf-locations-view",children:[e(U,{props:g,setSection:w}),!m&&e(O,{children:d()})]})}function d(){return e(F,{label:n("Locations"),noun:n("group"),items:s,onChange:o=>{const u=o.find(p=>!s.some(y=>y.key===p.key));t(le(c,o.map(p=>p.key),p=>[{...R,group:p,groupName:""}])),u&&v({level:"group",key:u.key})},newItem:()=>({key:L(),name:"",indices:[]}),open:null,onOpen:()=>{},renderItem:()=>null,removeOnRow:!1,canDuplicate:()=>!1,above:s.length===0?e("div",{style:{fontSize:12,color:"var(--ink-faint)",padding:"4px 0"},children:n("No locations yet.")}):void 0,renderRow:o=>f("button",{type:"button",style:B,onClick:()=>v({level:"group",key:o.key}),children:[e("span",{style:{fontWeight:500},children:D(o.key,o.name)}),f("span",{style:{color:"var(--ink-faint)"},children:[_("{n} city","{n} cities",o.indices.length)," ›"]})]})})}return a()}export{fe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as o,jsxs as n}from"react/jsx-runtime";import{parseHexColor as c}from"efficient-shell/format";import{ColorSwatch as f,Tooltip as k}from"efficient-shell/ui";import{say as s}from"../../format/lib/editor-words.js";import{AnyColourSwatch as u}from"../lib/document/ColourControl.js";function v({value:t,label:i,colors:p,onChange:m}){const d=t===null,a=t||void 0,r=p.find(e=>e.key===a),l=r?r.value:a&&c(a)===a.toLowerCase()?a:void 0;return n("div",{className:"sf-part-ink",children:[n("div",{className:"sf-part-ink-top",children:[o("span",{className:"sf-part-ink-label",children:s(i)}),o("span",{className:"sf-part-ink-read",children:l?l.toUpperCase():d?s("Mixed"):s("Follows the style")})]}),n("div",{className:"sf-part-ink-swatches",role:"group","aria-label":s(i),children:[p.map(e=>o(k,{content:`${s(e.name)} · ${e.value.toUpperCase()}`,children:o(f,{color:e.value,"aria-label":s(e.name),size:"sm",selected:a===e.key,onClick:()=>m(a===e.key?null:e.key)})},e.key)),u({value:r?"":(l??"").toLowerCase(),label:"Any color",onChange:m})]})]})}export{v as PartInkControl};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import { PartResetDot } from "./PartResetDot.js";
|
|
3
2
|
import { type FontRole, type FontsValue } from "../../format/lib/fonts.js";
|
|
4
3
|
import { type TypeGroup } from "../../format/lib/theme.js";
|
|
5
4
|
import { type PartStyle, type PartStyleBase } from "../../render/lib/document/part-styles.js";
|
|
@@ -28,7 +27,6 @@ export declare function PartStyleSelect({ face, base, onPick, }: {
|
|
|
28
27
|
base: PartStyleBase | null;
|
|
29
28
|
onPick: (role: FontRole | null) => void;
|
|
30
29
|
}): import("react").JSX.Element;
|
|
31
|
-
export { PartResetDot };
|
|
32
30
|
export declare function PartPanelBody({ sectionName, onBack, textEditor, styleRow, children, }: {
|
|
33
31
|
sectionName: string;
|
|
34
32
|
onBack: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,Fragment as ne,jsxs as h}from"react/jsx-runtime";import{useContext as qe,useEffect as oe,useRef as Je,useState as Te}from"react";import{PartResetDot as Qe}from"./PartResetDot.js";import{FieldSelect as Ze,InspectorField as et}from"efficient-easel/fields";import{SettingsField as tt}from"efficient-easel/panel";import{InspectorUpLevel as K}from"efficient-easel/chrome";import{StylesIcon as nt,TypeIcon as ot}from"efficient-easel/icons";import{useEasel as lt}from"efficient-easel/easel";import{TextPartPanel as st}from"efficient-easel/copy";import{Tooltip as rt}from"efficient-shell/ui";import{PartTextBox as it,partTextCells as at}from"./PartTextBox.js";import{UiIcon as Ne}from"efficient-easel/draw/client";import{usePreviewHeader as ct}from"../../render/components/PreviewHeaderContext.js";import{UpdateStyleDialog as dt}from"./UpdateStyleDialog.js";import{ScreenDocumentContext as ut}from"efficient-easel/screen/components/ScreenDocumentContext";import{hasStyleChange as ft,partStyleToTextStyleValues as pt,pushIntoStyle as mt,resolveTextStyles as ht,styleIdOfRole as yt}from"../../render/lib/text-styles/site-text-styles.js";import{useSiteTextStylesWriter as St}from"../lib/site-text-styles-writer.js";import{useThemeRowPersist as gt}from"../lib/theme-row-persist.js";import{usePreviewDevice as xt}from"efficient-easel/draw/client";import{usePartStyle as bt}from"./PreviewPartStyleContext.js";import{say as l}from"../../format/lib/editor-words.js";import{readHidable as U,textFieldOffPage as Pt,textFieldPanelOnly as wt}from"../lib/document/controls.js";import{TEXT_FIELD_MARKER as vt}from"efficient-easel/draw";import{useSectionOps as Tt}from"efficient-easel/screen/lib/document/use-section-ops";import{FONT_OPTIONS as Nt,FONT_ROLES as Ce,FONT_ROLE_LABELS as ke,fontOption as le}from"../../format/lib/fonts.js";import{isMultilineKind as Ct,partPlaceholder as kt,typeInPlaceKind as Ot}from"../../render/lib/document/part-text.js";import{partRowField as Rt}from"../lib/document/part-row-field.js";import{decodePartKey as It,partPropsWithRowValue as Et,partRowValue as Ft}from"../../render/lib/document/part-rows.js";import{PART_WIDTH_MAX as _t,followedStyleOf as zt,propsWithPartStyleValue as E,propsWithoutPartStyle as At,readPartStyle as Oe}from"../../render/lib/document/part-styles.js";import{partThemeColors as Vt}from"../../format/lib/document/part-inks.js";import{styleKeyForPart as Lt}from"../../format/lib/sections/section-text-kinds.js";import{commitPartText as Kt}from"../lib/document/part-typing.js";import{keysOnCanvas as Ut,useCanvasTypingPart as Bt}from"../lib/document/canvas-typing.js";import{useEaselHost as Dt}from"efficient-easel/screen/lib/host";import{SOURCE_LINES as Wt,SOURCE_ACTIONS as Mt,SOURCE_ACTION_LABEL as jt,partSourceNoteFor as Gt,partSourceOf as Ht,sourceMenuIdOf as $t,sourceSlugOf as Re}from"../../format/lib/document/source-bound-parts.js";import{encodePartId as Xt,holdsAuthoredText as Yt}from"../../render/lib/document/text-parts.js";import{regionsForSection as qt}from"../../format/lib/sections/section-text-regions.js";import{textRegionOfPartKey as Jt}from"../../format/lib/sections/text-regions.js";function se(n){return n?l(n):null}function Ie(n){return n.kind==="role"?ke[n.role]:n.kind==="custom"?"Custom":null}function Qt(n){const o=n.role;return o&&Ce.includes(o)?{kind:"role",role:o}:null}function Zt(n,o){if(!n)return{kind:"unread"};const{faceRole:s,base:i}=n;if(o[s]===i.fontKey)return{kind:"role",role:s};const c=Object.keys(o).filter(r=>o[r]===i.fontKey);return c.length===1?{kind:"role",role:c[0]}:{kind:"custom"}}function re(n,o,s,i){return Qt(Oe(n,o))??Zt(s,i)}function en(n,o){if(!n.length)return null;const s=o(n[0]);return n.every(i=>o(i)===s)?s:null}const B="";function tn({face:n,base:o,onPick:s}){const i=n.kind==="role"?n.role:B,c=[{label:l("No style"),value:B},...Ce.map(r=>({label:l(ke[r]),value:r}))];return t(Ze,{ariaLabel:l("Style"),value:i,options:c,inline:!0,onChange:r=>s(r===B?null:r),renderOption:r=>r.value===B?h(ne,{children:[t("span",{className:"es-fsel-label sf-part-style-keep",children:r.label}),t("span",{className:"sf-part-style-aside","aria-hidden":"true",children:l("Section’s own")})]}):t("span",{className:"es-fsel-label",style:{fontFamily:`var(--font-role-${r.value})`},children:r.label}),renderValue:()=>t("span",{style:{fontFamily:o?.fontKey?`var(${le(o.fontKey)?.cssVar})`:void 0,fontWeight:o?.weight},children:se(Ie(n))}),valueText:r=>se(Ie(n))??r?.label??""})}function nn({sectionName:n,onBack:o,textEditor:s,styleRow:i,children:c}){return h("div",{className:"sf-part-panel",children:[t(K,{inline:!0,name:l(n),onSelect:o}),s,i,c]})}function Ee({source:n,slug:o,menuId:s}){const i=Dt(),c=Mt[n],r=!c.needsSlug||!!o;return t("div",{className:"sf-note sf-note--source",children:h("p",{className:"es-field-hint sf-hint-keep",children:[l(Wt[n]),r?h(ne,{children:[" ",t("button",{type:"button",className:"sf-source-open",onClick:()=>{c.type==="storefront-editor:open-menus"?i.send(c.type,{menuId:s??null}):o&&i.send(c.type,{slug:o})},children:l(jt)})]}):null]})})}const Fe=4,on=120;function ln({region:n,sizePx:o,face:s,base:i,onFollowStyle:c,source:r,slug:D,onBack:v}){const F=n.follows;return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:l(n.label)})}),t("p",{children:o?l("Its size follows Styles ▸ {follows} — {px}px right now.",{follows:l(F),px:Math.round(o)}):l("Its size follows Styles ▸ {follows}.",{follows:l(F)})}),c?t(ne,{children:t(tt,{label:l("Style"),icon:t(nt,{}),hint:l("Every {part} in this section follows it. The face and the size change; the letter case is the section’s own and stays as it is.",{part:l(n.label).toLowerCase()}),children:t(tn,{face:s,base:i,onPick:c})})}):t("p",{className:"es-field-hint sf-hint-keep",children:l("Only the size follows a site style. This section sets its own font, weight and letter case.")}),r?t(Ee,{source:r,slug:D}):null,t(K,{inline:!0,name:l("Page"),onSelect:v})]})}function sn({onBack:n}){return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:l("This part is no longer here.")})}),t("p",{children:l("The section it belonged to has been changed or removed.")}),t(K,{inline:!0,name:l("Page"),onSelect:n})]})}function rn({onBack:n,partId:o,why:s}){return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:l("This part's settings did not open.")})}),t("p",{children:l("The words are still on your page and nothing has been lost. The editor could not work out which control belongs to them, which is a fault on our side. Go back and click the section to open its settings instead.")}),t("p",{className:"sf-note-detail",children:h("code",{children:[o," — ",s]})}),t(K,{inline:!0,name:l("Page"),onSelect:n})]})}function an({nodeId:n,propKey:o,onBack:s,onEditStyle:i}){const{getItemById:c,getSelectorForId:r,config:D}=lt(e=>e),v=Tt(),F=Bt(),{partStyle:_}=bt(),{fonts:W,textStyles:_e}=ct(),M=qe(ut),ie=!M?.capabilities?.hasSiteTheme,{persist:ze}=gt({themeFromDocument:ie,tokenRef:M?.tokenRef,siteId:M?.siteId??null}),R=St({themeFromDocument:ie,persist:ze}),[Ae,j]=Te(!1),Ve=xt()==="mobile",ae=Je(null),d=c(n),m=r(n),ce=d?D.components[d.type]:void 0,{key:S,row:g}=It(o),de=ce?.fields?.[S],y=g?Rt(de,g):de,T=Xt(n,o),p=d?.props??{},x=Ot(y),ue=Pt(y),fe=Yt(y),Le=d?Ht(d.type):null,pe=d?Gt(d.type,S):null,G=g?Ft(p[S],g):p[S],me=!!g&&!(Array.isArray(p[S])&&g.index<p[S].length);oe(()=>{if(Ut(document))return;ae.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[T]);const[H,he]=Te(0);oe(()=>he(0),[T]);const $=!!d&&!me&&(!m||!y);oe(()=>{if(!$||H>=Fe)return;const e=setTimeout(()=>he(a=>a+1),on);return()=>clearTimeout(e)},[$,H]);const Ke=$&&H<Fe;if(!d||me)return t(sn,{onBack:s});const z=qt(d.type),ye=z?Jt(z,o):null;if(z&&ye){const e=_?.partId===T?_:null,a=z[ye],f=a.writable===!0&&!!m,b=te=>{m&&v.replaceComponent(m.zone,m.index,{...d,props:E(p,o,"role",te)})};return t(ln,{region:a,sizePx:e?.base.sizePx??null,face:re(p,o,e,W),base:e?.base??null,onFollowStyle:f?b:void 0,source:Le,slug:Re(p),onBack:s})}if(!m||!y)return Ke?t("div",{className:"sf-note","aria-busy":"true"}):t(rn,{onBack:s,partId:T,why:m?"no field":"no selector"});const Se=e=>{v.replaceComponent(m.zone,m.index,{...d,props:e})},X=e=>{if(U(e).hidden!==U(G).hidden||!x){const f=g?Et(p,S,g,e):{...p,[S]:e};f&&Se(f);return}Kt({node:d,propKey:o,kind:x,zone:m.zone,index:m.index},U(e).text,v.replaceComponent)},Ue=G,N=_?.partId===T?_:null,C=N?.styleOwner,A=C?c(C.owner):null,Y=C&&A?r(C.owner):null,q=!!(C&&A&&Y),k=q?A.props??{}:p,J=q?e=>v.replaceComponent(Y.zone,Y.index,{...A,props:e}):Se,V=q?C.kind:Lt(d?.type,o),P=Oe(k,V),u=[{partKey:V,face:re(k,V,N,W),sizeGroup:N?.sizeGroup??null,base:N?.base??dn,style:P}],Be=en(u,e=>e.sizeGroup),De=Vt(N?.inks),I=(e,a)=>{let f=k;for(const b of u)f=E(f,b.partKey,e,a);J(f)},We=e=>e?I("textStyle",e):Q({textStyle:null,role:null}),Q=e=>{let a=k;for(const f of u)for(const[b,te]of Object.entries(e))a=E(a,f.partKey,b,te??null);J(a)},Z=x==="text"||x==="textarea",{text:ge,hidden:O}=U(G),L=y?.[vt]?.label??o,xe=O?l("Show {label} on the slide",{label:l(L)}):l("Hide {label} on the slide",{label:l(L)}),be=h("div",{className:"sf-field-head",children:[t(ot,{}),t("span",{className:"sf-field-label sf-field-label--inline",children:l(L)}),Z&&t(rt,{content:xe,children:t("button",{type:"button",className:"sf-field-eye","aria-pressed":O,"aria-label":xe,onClick:()=>X({text:ge,hidden:!O}),children:O?t(Ne,{name:"eye-off",size:14}):t(Ne,{name:"eye",size:14})})})]}),Pe=!ue&&fe,Me=!!x&&(wt(y)||ue||O||!fe),we=re(k,V,N,W),je=we.kind==="role"?we.role:null,ee=zt(P)??yt(je),ve=ht(R.saved,R.old),Ge=Object.entries(P).filter(([e,a])=>e!=="role"&&e!=="textStyle"&&a!==void 0).length,He=()=>{let e=k;for(const a of u){const{role:f,textStyle:b}=a.style;e=At(e,a.partKey),f&&(e=E(e,a.partKey,"role",f)),b&&(e=E(e,a.partKey,"textStyle",b))}J(e)},w=ee,$e=ft(u[0].style),Xe=w?ve.find(e=>e.id===w)?.name??w:"",Ye=()=>{j(!1),w&&(R.write(mt({saved:R.saved,old:R.old,styleId:w,values:pt(u[0].style)}),!0),He())};return h(nn,{sectionName:ce?.label??d.type,onBack:s,textEditor:t("div",{ref:ae,className:"sf-part-text",children:Me?t(it,{text:ge,onTextChange:e=>X(Z?{text:e,hidden:O}:e),multiline:Ct(x),markup:x!=="plainText",styled:!1,style:u[0].style,base:u[0].base,setValue:Q,colors:De,placeholder:se(kt(y))??void 0,ariaLabel:l(L),head:be,typedOnCanvas:F===T}):x?Z?be:null:t(et,{field:y,name:o,value:Ue,onChange:X,id:`sf-part-${n}-${o}`})}),children:[pe&&t(Ee,{source:pe,slug:Re(p),menuId:$t(p)}),Pe&&t(st,{style:{value:ee??"",options:[{value:"",label:l("No style"),description:l("Section’s own")},...ve.map(e=>({value:e.id,label:e.name,description:e.values.font?le(e.values.font)?.label:void 0}))],onChange:e=>We(e||null),changed:Ge>0,onEditStyles:i,onUpdateStyle:w&&$e?()=>j(!0):void 0},font:{value:P.font??"",styleValue:le(u[0].base.fontKey)?.label,options:Nt.map(e=>({label:e.label,value:e.key})),onChange:e=>I("font",e||null)},italic:{value:P.italic,styleValue:cn(_e,ee),onChange:e=>I("italic",e??null)},cells:at(u[0].style,u[0].base,Q,{phone:Ve}),align:{value:P.align??"",styleValue:u[0].base.align,onChange:e=>I("align",e||null)},letterCase:{value:P.case??"",styleValue:u[0].base.case,onChange:e=>I("case",e||null)}}),Ae&&w&&t(dt,{styleName:Xe,onCancel:()=>j(!1),onConfirm:Ye}),Pe&&Be===null&&t("p",{className:"es-field-hint sf-hint-keep",children:l("Fixed size — the site’s Text setting doesn’t resize this.")})]})}function cn(n,o){return!o||!Array.isArray(n)?!1:n.find(i=>i?.id===o)?.values?.italic===!0}const dn={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0,widthPx:_t};export{nn as PartPanelBody,Qe as PartResetDot,Ee as PartSourceNote,tn as PartStyleSelect,an as default,re as partFace};
|
|
1
|
+
"use client";import{jsx as t,Fragment as K,jsxs as h}from"react/jsx-runtime";import{useContext as Je,useEffect as se,useRef as Qe,useState as Ce}from"react";import{FieldSelect as Ze,InspectorField as et,fieldShownInView as tt}from"efficient-easel/fields";import{SettingsField as nt}from"efficient-easel/panel";import{InspectorUpLevel as U}from"efficient-easel/chrome";import{StylesIcon as ot,TypeIcon as lt}from"efficient-easel/icons";import{useEasel as st}from"efficient-easel/easel";import{TextPartPanel as rt}from"efficient-easel/copy";import{Button as it,IconButton as at,Tooltip as ct}from"efficient-shell/ui";import{PartTextBox as dt,partTextCells as ut}from"./PartTextBox.js";import{UiIcon as ke}from"efficient-easel/draw/client";import{usePreviewHeader as ft}from"../../render/components/PreviewHeaderContext.js";import{UpdateStyleDialog as pt}from"./UpdateStyleDialog.js";import{ScreenDocumentContext as mt}from"efficient-easel/screen/components/ScreenDocumentContext";import{hasStyleChange as ht,partStyleToTextStyleValues as yt,pushIntoStyle as gt,resolveTextStyles as St,styleIdOfRole as xt}from"../../render/lib/text-styles/site-text-styles.js";import{useSiteTextStylesWriter as bt}from"../lib/site-text-styles-writer.js";import{useThemeRowPersist as wt}from"../lib/theme-row-persist.js";import{usePreviewDevice as Pt}from"efficient-easel/draw/client";import{shownTier as Oe}from"efficient-easel/screen/lib/document/device-fields";import{PART_PANEL_ROWS as vt}from"../lib/document/part-panel-rows.js";import{usePartStyle as Tt}from"./PreviewPartStyleContext.js";import{say as l}from"../../format/lib/editor-words.js";import{readHidable as W,textFieldOffPage as Nt,textFieldPanelOnly as Ct}from"../lib/document/controls.js";import{TEXT_FIELD_MARKER as kt}from"efficient-easel/draw";import{useSectionOps as Ot}from"efficient-easel/screen/lib/document/use-section-ops";import{FONT_OPTIONS as Rt,FONT_ROLES as It,FONT_ROLE_LABELS as Re,fontOption as re,fontRoleOf as Et}from"../../format/lib/fonts.js";import{isMultilineKind as Ft,partPlaceholder as _t,typeInPlaceKind as zt}from"../../render/lib/document/part-text.js";import{partRowField as At}from"../lib/document/part-row-field.js";import{decodePartKey as Vt,partPropsWithRowValue as Lt,partRowValue as Bt}from"../../render/lib/document/part-rows.js";import{followedStyleOf as Kt,propsWithPartStyleValue as z,propsWithoutPartStyle as Ut,readPartStyle as Ie}from"../../render/lib/document/part-styles.js";import{partThemeColors as Wt}from"../../format/lib/document/part-inks.js";import{styleKeyForPart as Dt}from"../../format/lib/sections/section-text-kinds.js";import{commitPartText as jt}from"../lib/document/part-typing.js";import{keysOnCanvas as Gt,useCanvasTypingPart as Ht}from"../lib/document/canvas-typing.js";import{useEaselHost as Mt}from"efficient-easel/screen/lib/host";import{SOURCE_LINES as $t,SOURCE_ACTIONS as Yt,SOURCE_ACTION_LABEL as qt,partSourceNoteFor as Xt,partSourceOf as Jt,sourceMenuIdOf as Qt,sourceSlugOf as Ee}from"../../format/lib/document/source-bound-parts.js";import{encodePartId as Zt,holdsAuthoredText as en}from"../../render/lib/document/text-parts.js";import{regionsForSection as tn}from"../../format/lib/sections/section-text-regions.js";import{textRegionOfPartKey as nn}from"../../format/lib/sections/text-regions.js";function ie(n){return n?l(n):null}function Fe(n){return n.kind==="role"?Re[n.role]:n.kind==="custom"?"Custom":null}function on(n){const o=Et(n.role);return o?{kind:"role",role:o}:null}function ln(n,o){if(!n)return{kind:"unread"};const{faceRole:s,base:i}=n;if(o[s]===i.fontKey)return{kind:"role",role:s};const c=Object.keys(o).filter(r=>o[r]===i.fontKey);return c.length===1?{kind:"role",role:c[0]}:{kind:"custom"}}function ae(n,o,s,i){return on(Ie(n,o))??ln(s,i)}function sn(n,o){if(!n.length)return null;const s=o(n[0]);return n.every(i=>o(i)===s)?s:null}const D="";function rn({face:n,base:o,onPick:s}){const i=n.kind==="role"?n.role:D,c=[{label:l("No style"),value:D},...It.map(r=>({label:l(Re[r]),value:r}))];return t(Ze,{ariaLabel:l("Style"),value:i,options:c,inline:!0,onChange:r=>s(r===D?null:r),renderOption:r=>r.value===D?h(K,{children:[t("span",{className:"es-fsel-label sf-part-style-keep",children:r.label}),t("span",{className:"sf-part-style-aside","aria-hidden":"true",children:l("Section’s own")})]}):t("span",{className:"es-fsel-label",style:{fontFamily:`var(--font-role-${r.value})`},children:r.label}),renderValue:()=>t("span",{style:{fontFamily:o?.fontKey?`var(${re(o.fontKey)?.cssVar})`:void 0,fontWeight:o?.weight},children:ie(Fe(n))}),valueText:r=>ie(Fe(n))??r?.label??""})}function an({sectionName:n,onBack:o,textEditor:s,styleRow:i,children:c}){return h("div",{className:"sf-part-panel",children:[t(U,{inline:!0,name:l(n),onSelect:o}),s,i,c]})}function _e({source:n,slug:o,menuId:s}){const i=Mt(),c=Yt[n],r=!c.needsSlug||!!o;return t("div",{className:"sf-note sf-note--source",children:h("p",{className:"es-field-hint sf-hint-keep",children:[l($t[n]),r?h(K,{children:[" ",t(it,{type:"button",variant:"link",size:"sm",onClick:()=>{c.type==="storefront-editor:open-menus"?i.send(c.type,{menuId:s??null}):o&&i.send(c.type,{slug:o})},children:l(qt)})]}):null]})})}const ze=4,cn=120;function dn({region:n,sizePx:o,face:s,base:i,onFollowStyle:c,source:r,slug:j,onBack:N,shows:C}){const v=n.follows;return h("div",{className:"sf-note",children:[C("regionNote")&&h(K,{children:[t("p",{children:t("strong",{children:l(n.label)})}),t("p",{children:o?l("Its size follows Styles ▸ {follows} — {px}px right now.",{follows:l(v),px:Math.round(o)}):l("Its size follows Styles ▸ {follows}.",{follows:l(v)})})]}),c?C("regionStyle")?t(K,{children:t(nt,{label:l("Style"),icon:t(ot,{}),hint:l("Every {part} in this section follows it. The face and the size change; the letter case is the section’s own and stays as it is.",{part:l(n.label).toLowerCase()}),children:t(rn,{face:s,base:i,onPick:c})})}):null:C("regionNote")&&t("p",{className:"es-field-hint sf-hint-keep",children:l("Only the size follows a site style. This section sets its own font, weight and letter case.")}),r&&C("sourceNote")?t(_e,{source:r,slug:j}):null,t(U,{inline:!0,name:l("Page"),onSelect:N})]})}function un({onBack:n}){return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:l("This part is no longer here.")})}),t("p",{children:l("The section it belonged to has been changed or removed.")}),t(U,{inline:!0,name:l("Page"),onSelect:n})]})}function fn({onBack:n,partId:o,why:s}){return h("div",{className:"sf-note",children:[t("p",{children:t("strong",{children:l("This part's settings did not open.")})}),t("p",{children:l("The words are still on your page and nothing has been lost. The editor could not work out which control belongs to them, which is a fault on our side. Go back and click the section to open its settings instead.")}),t("p",{className:"sf-note-detail",children:h("code",{children:[o," — ",s]})}),t(U,{inline:!0,name:l("Page"),onSelect:n})]})}function pn({nodeId:n,propKey:o,onBack:s,onEditStyle:i}){const{getItemById:c,getSelectorForId:r,config:j}=st(e=>e),N=Ot(),C=Ht(),{partStyle:v}=Tt(),{fonts:G,textStyles:Ae}=ft(),H=Je(mt),ce=!H?.capabilities?.hasSiteTheme,{persist:Ve}=wt({themeFromDocument:ce,tokenRef:H?.tokenRef,siteId:H?.siteId??null}),_=bt({themeFromDocument:ce,persist:Ve}),[Le,M]=Ce(!1),$=Pt(),y=e=>tt(vt[e],$),de=Qe(null),d=c(n),m=r(n),ue=d?j.components[d.type]:void 0,{key:x,row:b}=Vt(o),fe=ue?.fields?.[x],g=b?At(fe,b):fe,k=Zt(n,o),p=d?.props??{},w=zt(g),pe=Nt(g),me=en(g),Be=d?Jt(d.type):null,he=d?Xt(d.type,x):null,Y=b?Bt(p[x],b):p[x],ye=!!b&&!(Array.isArray(p[x])&&b.index<p[x].length);se(()=>{if(Gt(document))return;de.current?.querySelector(".es-copy [contenteditable='true'], .es-copy textarea, .sf-copybox textarea, .sf-copybox input")?.focus()},[k]);const[q,ge]=Ce(0);se(()=>ge(0),[k]);const X=!!d&&!ye&&(!m||!g);se(()=>{if(!X||q>=ze)return;const e=setTimeout(()=>ge(a=>a+1),cn);return()=>clearTimeout(e)},[X,q]);const Ke=X&&q<ze;if(!d||ye)return t(un,{onBack:s});const A=tn(d.type),Se=A?nn(A,o):null;if(A&&Se){const e=v?.partId===k?v:null,a=A[Se],f=a.writable===!0&&!!m,P=le=>{m&&N.replaceComponent(m.zone,m.index,{...d,props:z(p,o,"role",le)})};return t(dn,{region:a,sizePx:e?.base.sizePx??null,face:ae(p,o,e,G),base:e?.base??null,onFollowStyle:f?P:void 0,source:Be,slug:Ee(p),onBack:s,shows:y})}if(!m||!g)return Ke?t("div",{className:"sf-note","aria-busy":"true"}):t(fn,{onBack:s,partId:k,why:m?"no field":"no selector"});const xe=e=>{N.replaceComponent(m.zone,m.index,{...d,props:e})},J=e=>{if(W(e).hidden!==W(Y).hidden||!w){const f=b?Lt(p,x,b,e):{...p,[x]:e};f&&xe(f);return}jt({node:d,propKey:o,kind:w,zone:m.zone,index:m.index},W(e).text,N.replaceComponent)},Ue=Y,O=v?.partId===k?v:null,R=O?.styleOwner,V=R?c(R.owner):null,Q=R&&V?r(R.owner):null,Z=!!(R&&V&&Q),I=Z?V.props??{}:p,ee=Z?e=>N.replaceComponent(Q.zone,Q.index,{...V,props:e}):xe,L=Z?R.kind:Dt(d?.type,o),S=Ie(I,L),u=[{partKey:L,face:ae(I,L,O,G),sizeGroup:O?.sizeGroup??null,base:O?.base??hn,style:S}],We=sn(u,e=>e.sizeGroup),De=Wt(O?.inks),E=(e,a)=>{let f=I;for(const P of u)f=z(f,P.partKey,e,a);ee(f)},je=e=>e?E("textStyle",e):te({textStyle:null,role:null}),te=e=>{let a=I;for(const f of u)for(const[P,le]of Object.entries(e))a=z(a,f.partKey,P,le??null);ee(a)},ne=w==="text"||w==="textarea",{text:be,hidden:F}=W(Y),B=g?.[kt]?.label??o,we=F?l("Show {label} on the slide",{label:l(B)}):l("Hide {label} on the slide",{label:l(B)}),Pe=h("div",{className:"sf-field-head",children:[t(lt,{}),t("span",{className:"sf-field-label sf-field-label--inline",children:l(B)}),ne&&t(ct,{content:we,children:t(at,{"aria-pressed":F,"aria-label":we,onClick:()=>J({text:be,hidden:!F}),children:F?t(ke,{name:"eye-off",size:14}):t(ke,{name:"eye",size:14})})})]}),ve=!pe&&me,Ge=!!w&&(Ct(g)||pe||F||!me),Te=ae(I,L,O,G),He=Te.kind==="role"?Te.role:null,oe=Kt(S)??xt(He),Ne=St(_.saved,_.old),Me=Object.entries(S).filter(([e,a])=>e!=="role"&&e!=="textStyle"&&a!==void 0).length,$e=()=>{let e=I;for(const a of u){const{role:f,textStyle:P}=a.style;e=Ut(e,a.partKey),f&&(e=z(e,a.partKey,"role",f)),P&&(e=z(e,a.partKey,"textStyle",P))}ee(e)},T=oe,Ye=ht(u[0].style),qe=T?Ne.find(e=>e.id===T)?.name??T:"",Xe=()=>{M(!1),T&&(_.write(gt({saved:_.saved,old:_.old,styleId:T,values:yt(u[0].style)}),!0),$e())};return h(an,{sectionName:ue?.label??d.type,onBack:s,textEditor:y("words")?t("div",{ref:de,className:"sf-part-text",children:Ge?t(dt,{text:be,onTextChange:e=>J(ne?{text:e,hidden:F}:e),multiline:Ft(w),markup:w!=="plainText",styled:!1,style:u[0].style,base:u[0].base,setValue:te,colors:De,placeholder:ie(_t(g))??void 0,ariaLabel:l(B),head:Pe,typedOnCanvas:C===k}):w?ne?Pe:null:t(et,{field:g,name:o,value:Ue,onChange:J,id:`sf-part-${n}-${o}`})}):void 0,children:[he&&y("sourceNote")&&t(_e,{source:he,slug:Ee(p),menuId:Qt(p)}),ve&&t(rt,{style:y("style")?{value:oe??"",options:[{value:"",label:l("No style"),description:l("Section’s own")},...Ne.map(e=>({value:e.id,label:e.name,description:e.values.font?re(e.values.font)?.label:void 0}))],onChange:e=>je(e||null),changed:Me>0,onEditStyles:i,onUpdateStyle:T&&Ye?()=>M(!0):void 0}:void 0,font:y("font")?{value:S.font??"",styleValue:re(u[0].base.fontKey)?.label,options:Rt.map(e=>({label:e.label,value:e.key})),onChange:e=>E("font",e||null)}:void 0,italic:y("italic")?{value:S.italic,styleValue:mn(Ae,oe),onChange:e=>E("italic",e??null)}:void 0,cells:ut(u[0].style,u[0].base,te,Oe($)).filter(e=>y(e.key)),align:y("align")?Oe($)==="mobile"?{value:S.alignPhone??"",styleValue:S.align??u[0].base.align,onChange:e=>E("alignPhone",e||null)}:{value:S.align??"",styleValue:u[0].base.align,onChange:e=>E("align",e||null)}:void 0,letterCase:y("letterCase")?{value:S.case??"",styleValue:u[0].base.case,onChange:e=>E("case",e||null)}:void 0}),Le&&T&&t(pt,{styleName:qe,onCancel:()=>M(!1),onConfirm:Xe}),ve&&We===null&&y("fixedSizeHint")&&t("p",{className:"es-field-hint sf-hint-keep",children:l("Fixed size — the site’s Text setting doesn’t resize this.")})]})}function mn(n,o){return!o||!Array.isArray(n)?!1:n.find(i=>i?.id===o)?.values?.italic===!0}const hn={fontKey:"",sizePx:16,weight:400,lineRatio:1.4,letterEm:0,align:"left",case:"none",paddingPx:0};export{an as PartPanelBody,_e as PartSourceNote,rn as PartStyleSelect,pn as default,ae as partFace};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import { type CopyCell, type CopyThemeColor } from "efficient-easel/copy";
|
|
3
3
|
import { type PartStyle, type PartStyleBase } from "../../render/lib/document/part-styles.js";
|
|
4
|
+
import type { DeviceTier } from "efficient-easel/screen/lib/document/device-fields";
|
|
5
|
+
import type { PartCellKey } from "../lib/document/part-panel-rows.js";
|
|
4
6
|
export type PartStylePatch = {
|
|
5
7
|
[K in keyof PartStyle]?: PartStyle[K] | null;
|
|
6
8
|
};
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
}
|
|
9
|
+
export type PartTextCell = CopyCell & {
|
|
10
|
+
key: PartCellKey;
|
|
11
|
+
};
|
|
12
|
+
export declare function partTextCells(style: PartStyle, base: PartStyleBase, setValue: (patch: PartStylePatch) => void, tier?: DeviceTier): PartTextCell[];
|
|
10
13
|
export declare function PartTextBox({ text, onTextChange, multiline, markup, styled, style, base, setValue, colors, placeholder, ariaLabel, head, typedOnCanvas, }: {
|
|
11
14
|
text: string;
|
|
12
15
|
onTextChange: (next: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as c,jsxs as x}from"react/jsx-runtime";import{COPY_CELLS as t,CopyBox as S}from"efficient-easel/copy";import{PaddingYIcon as z}from"efficient-easel/icons";import{say as C}from"../../format/lib/editor-words.js";import{SHOP_MARKUP as _}from"../../format/lib/markup.js";import{partTextTools as A}from"../lib/document/canvas-typing.js";import{PART_PADDING_MAX as T,PART_PADDING_MIN as v,PART_PADDING_STEP as R,partSpacingOf as k}from"../../render/lib/document/part-styles.js";const D=["left","center","right","justify"];function H(n,a,i,r="desktop"){const o=k(n),l=r==="mobile",p=(l?n.sizePhone:void 0)??n.size??a.sizePx;return[l?{...t.fontSize,key:"fontSize",value:n.sizePhone,styleValue:Math.round(a.sizePx),onChange:e=>i({sizePhone:e??null})}:{...t.fontSize,key:"fontSize",value:n.size,styleValue:Math.round(a.sizePx),onChange:e=>i({size:e??null})},{...t.lineHeight,key:"lineHeight",value:o.lineHeight,styleValue:a.lineRatio,onChange:e=>i(e===void 0?{lineHeight:null,line:null}:{lineHeight:e})},{...t.letterSpacing,key:"letterSpacing",scale:p,value:o.letterSpacingEm,styleValue:a.letterEm,onChange:e=>i(e===void 0?{letterSpacing:null,letter:null}:{letterSpacing:e})},{...t.paragraphSpacing,key:"paragraphSpacing",value:n.paragraphSpacing,styleValue:0,onChange:e=>i({paragraphSpacing:e??null})},{key:"padding",name:C("Padding"),icon:c(z,{}),unit:"px",step:R,shiftStep:10,min:v,max:T,value:n.padding,styleValue:a.paddingPx,onChange:e=>i({padding:e??null})}]}function E({text:n,onTextChange:a,multiline:i,markup:r=!0,styled:o=!0,style:l,base:p,setValue:e,colors:u,placeholder:s,ariaLabel:h,head:d,typedOnCanvas:f=!1}){const P=H(l,p,e),m=A(r,i);return x("div",{className:"sf-part-textbox",children:[d,c(S,{value:n,onChange:a,multiline:i,placeholder:s,ariaLabel:h,rules:_,tools:m,barShows:f?"focus":"always",colors:r?u:[],align:o?{value:l.align??p.align,allow:D,onChange:g=>e({align:g})}:void 0,letterCase:o?{value:l.case==="capitalize"?"":l.case??"",onChange:g=>e({case:g||null})}:void 0,cells:o?P:void 0})]})}export{E as PartTextBox,H as partTextCells};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import type { ChatSettings } from "../../format/lib/web-backend.js";
|
|
3
3
|
import { type ChatLauncherPosition } from "../../format/lib/content/chat-launcher.js";
|
|
4
|
+
export declare const CHAT_CHROME_ID = "chat";
|
|
4
5
|
export type ChatPreview = {
|
|
5
6
|
enabled: boolean;
|
|
6
7
|
title: string;
|
|
@@ -17,9 +18,7 @@ export declare function chatPreviewFrom(s: ChatSettings): ChatPreview;
|
|
|
17
18
|
type Ctx = {
|
|
18
19
|
chat: ChatPreview;
|
|
19
20
|
setChat: (patch: Partial<ChatPreview>) => void;
|
|
20
|
-
selected: boolean;
|
|
21
21
|
setSelected: (b: boolean) => void;
|
|
22
|
-
select: () => void;
|
|
23
22
|
setSelectHandler: (fn: () => void) => void;
|
|
24
23
|
};
|
|
25
24
|
export declare function PreviewChatProvider({ children, chat, onChatChange, }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as c}from"react/jsx-runtime";import{createContext as d,useCallback as m,useContext as x,useMemo as b,useState as p}from"react";import{CanvasChromeContext as v}from"efficient-easel/easel";import{useSelectHandler as f}from"efficient-easel/draw/client";import{DEFAULT_CHAT_LAUNCHER_POSITION as I,chatLauncherColor as L,chatLauncherIcon as H,chatLauncherPosition as _}from"../../format/lib/content/chat-launcher.js";const l="chat",a={enabled:!0,title:"",subtitle:"",greeting:"",launcherColor:"",launcherIcon:"",launcherPosition:I,launcherLabel:"",showOnPhones:!0};function T(e){return{enabled:e.enabled,title:e.title,subtitle:e.subtitle,greeting:e.greeting,launcherColor:L(e.launcherColor),launcherIcon:e.launcherIcon?H(e.launcherIcon):"",launcherPosition:_(e.launcherPosition),launcherLabel:e.launcherLabel??"",showOnPhones:e.showOnPhones!==!1}}const h=d({chat:a,setChat:()=>{},setSelected:()=>{},setSelectHandler:()=>{}});function g({children:e,chat:s=a,onChatChange:r}){const[o,u]=p(!1),i=m(t=>r?.(t),[r]),{select:n,setSelectHandler:C}=f(),P=b(()=>({selected:()=>o?l:null,select:t=>t===l&&n()}),[o,n]);return c(h.Provider,{value:{chat:s,setChat:i,setSelected:u,setSelectHandler:C},children:c(v.Provider,{value:P,children:e})})}const D=()=>x(h);export{l as CHAT_CHROME_ID,a as DEFAULT_CHAT_PREVIEW,g as PreviewChatProvider,T as chatPreviewFrom,D as usePreviewChat};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as k}from"react/jsx-runtime";import{readInks as L}from"../../format/lib/document/part-inks.js";import{useEffect as W,useRef as B}from"react";import{markOverlayPortal as F}from"../../format/lib/document/overlay-portal.js";import{usePreviewParts as J}from"efficient-easel/draw/client";import{usePartStyle as z}from"./PreviewPartStyleContext.js";import{usePreviewDevice as Y}from"efficient-easel/draw/client";import{encodePartId as $}from"efficient-easel/draw";import{BLOCK_ATTRIBUTE as j}from"efficient-easel/canvas";import{engagePartAnchors as G}from"../lib/document/part-anchors.js";import{PART_ATTR as R,PART_STYLE_KIND_ATTR as w,PART_STYLE_OWNER_ATTR as H,partStyleOwnerOf as E}from"../../render/lib/document/text-parts.js";import{PART_STYLE_PROPERTIES as v,applyPartStyles as _,blockDrawsTextStyle as M,partFontKeyOf as q,partStyleBase as U,partStyleSource as V}from"../../render/lib/document/part-styles.js";import{fontRoleOfClassName as Q,styleRoleOfClassName as X}from"../../format/lib/fonts.js";import{typeScaleGroupOfClassName as x}from"../../format/lib/theme.js";import{styleKeyForPart as Z}from"../../format/lib/sections/section-text-kinds.js";function ee(i){let o=null,s=null;for(let t=i;t&&(o===null||s===null);t=t.parentElement){const a=t.getAttribute("class");o??=X(a),s??=x(a)}return{faceRole:o??"body",sizeGroup:s}}function N(i){const o=i.style,s={};for(const r of v)s[r]=o[r]??"",o[r]="";const t=getComputedStyle(i),a=getComputedStyle(i.ownerDocument.documentElement),p=U({fontSize:t.fontSize,fontWeight:t.fontWeight,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,textAlign:t.textAlign,textTransform:t.textTransform,paddingTop:t.paddingTop},q(t.fontFamily,r=>a.getPropertyValue(r)));for(const r of v)o[r]=s[r];return p}function te({needles:i,styles:o,type:s,children:t}){const a=B(null),{selectedPartId:p}=J(),{setPartStyle:r}=z(),d=Y()==="mobile",y=JSON.stringify(i),S=JSON.stringify(o);return W(()=>{const f=a.current;if(!f)return;const g=[],T=()=>f.parentElement,C=l=>{const n=T();if(!n)return null;const m=new MutationObserver(l);return m.observe(n,{attributes:!0,attributeFilter:[j]}),()=>m.disconnect()},I=l=>{const n=new MutationObserver(l);return n.observe(f,{childList:!0,subtree:!0,characterData:!0}),()=>n.disconnect()};let u=[];g.push(()=>{for(const l of u)l();u=[]});const D=JSON.parse(y),h=JSON.parse(S),K=G(f,D,T,C,(l,n,m)=>{for(const e of u)e();u=[];const P=[];for(const e of m){const c=e,A=F(c);A&&u.push(A),c.getAttribute(R)===p&&P.push(c)}const b=V(n,p,P,e=>Q(e)!==null||x(e)!==null);if(b&&p){const e=b;r({partId:p,...ee(e),base:N(e),inks:L(e),...(()=>{const c=E(e);return c?{styleOwner:c}:{}})()})}_(m.filter(e=>!E(e)).map(e=>({element:e,partId:e.getAttribute(R)??""})),h,e=>N(e),e=>Z(s,e),void 0,d,e=>M(s,e));const O=[...f.querySelectorAll(`[${H}="${CSS.escape(n)}"][${w}]`)];O.length&&_(O.map(e=>({element:e,partId:$(n,e.getAttribute(w)??"")})),h,void 0,e=>e,void 0,d)},I);return()=>{K();for(const l of g)l()}},[y,S,p,r,d]),k("div",{ref:a,"data-sf-part-host":"",style:{display:"contents"},children:t})}export{te as default,N as measureStyleBase,ee as styleTagsOf};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as h,Fragment as t,jsxs as e}from"react/jsx-runtime";import{BlockBannerIcon as n,BlockBoxIcon as M,BlockButtonIcon as
|
|
1
|
+
import{jsx as h,Fragment as t,jsxs as e}from"react/jsx-runtime";import{BlockBannerIcon as n,BlockBoxIcon as M,BlockButtonIcon as g,BlockDividerIcon as x,BlockFooterIcon as a,BlockHeadingIcon as y,BlockProductIcon as p,BlockSocialIcon as w,BlockTextIcon as s,CardPaymentIcon as B,ChatIcon as k,AccountIcon as u,GlobeIcon as I,GridIcon as m,ImageIcon as c,MapIcon as S,MediaIcon as L,PageIcon as F}from"efficient-easel/icons";import{CART_GLYPH as v}from"../../render/components/cartGlyph.js";const H={header:e(t,{children:[h("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),h("path",{d:"M3 9.5h18"})]}),social:e(t,{children:[h("circle",{cx:"6",cy:"12",r:"2.5"}),h("circle",{cx:"18",cy:"6",r:"2.5"}),h("circle",{cx:"18",cy:"18",r:"2.5"}),h("path",{d:"M8.2 10.8l7.6-3.6M8.2 13.2l7.6 3.6"})]}),ticker:e(t,{children:[h("rect",{x:"3",y:"8.5",width:"18",height:"7",rx:"2"}),h("path",{d:"M6 12h3.5M11.5 12h2M15.5 12h2.5"})]}),FooterLogo:e(t,{children:[h("path",{d:"M4 15.5h6M4 18h4"}),h("path",{d:"M14 8.5l3 7 3-7"})]}),FooterMenu:h("path",{d:"M6 7h12M6 11h12M6 15h8M6 19h8"}),FooterGroup:e(t,{children:[h("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",strokeDasharray:"3 2.5"}),h("path",{d:"M8 9h8M8 13h8M8 16h5"})]}),FooterText:h("path",{d:"M5 7h14M5 12h14M5 17h9"}),FooterEmailSignup:e(t,{children:[h("rect",{x:"3",y:"6",width:"18",height:"12",rx:"2"}),h("path",{d:"M3.5 7l8.5 6 8.5-6"})]}),SearchBlock:e(t,{children:[h("circle",{cx:"11",cy:"11",r:"6"}),h("path",{d:"M20 20l-4.2-4.2"})]}),CartBlock:v,CountrySwitchBlock:e(t,{children:[h("circle",{cx:"12",cy:"12",r:"8.5"}),h("path",{d:"M3.5 12h17M12 3.5c2.6 2.4 3.6 5.2 3.6 8.5s-1 6.1-3.6 8.5M12 3.5c-2.6 2.4-3.6 5.2-3.6 8.5s1 6.1 3.6 8.5"})]}),ThemeSwitchBlock:e(t,{children:[h("circle",{cx:"12",cy:"12",r:"8.5"}),h("path",{d:"M12 3.5v17M12 5.5l6 6M12 10.5l5.2 5.2M12 15.5l2.8 2.8"})]}),LegalLineBlock:e(t,{children:[h("path",{d:"M3 9h18"}),h("path",{d:"M3 14h8M14 14h2M18 14h3"})]}),Hero:e(t,{children:[h("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),h("path",{d:"M7 13.5h7M7 16.5h10"})]}),HeroSlide:e(t,{children:[h("rect",{x:"3",y:"5",width:"18",height:"14",rx:"2"}),h("path",{d:"M7 15h6M16 9.5h.01M9.5 12l-2.5 3"})]}),HeroSingle:e(t,{children:[h("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),h("path",{d:"M10.5 8.5l4 2.5-4 2.5z"}),h("path",{d:"M7 17h7"})]}),Collections:e(t,{children:[h("rect",{x:"3",y:"5",width:"4.6",height:"14",rx:"1.3"}),h("rect",{x:"9.7",y:"5",width:"4.6",height:"14",rx:"1.3"}),h("rect",{x:"16.4",y:"5",width:"4.6",height:"14",rx:"1.3"})]}),CollectionCard:e(t,{children:[h("rect",{x:"6",y:"4",width:"12",height:"16",rx:"2"}),h("path",{d:"M9 15h6M9 17.5h4"})]}),AlloyWheelsListing:e(t,{children:[h("path",{d:"M3 5h5M3 9h5M3 13h5M3 17h5"}),h("rect",{x:"11.5",y:"5",width:"4.2",height:"5",rx:"1"}),h("rect",{x:"17.3",y:"5",width:"4.2",height:"5",rx:"1"}),h("rect",{x:"11.5",y:"12",width:"4.2",height:"5",rx:"1"}),h("rect",{x:"17.3",y:"12",width:"4.2",height:"5",rx:"1"})]}),CatalogFilterBar:e(t,{children:[h("path",{d:"M3 7h9M15.5 7H21"}),h("circle",{cx:"13.5",cy:"7",r:"1.7"}),h("path",{d:"M3 12h4M10.5 12H21"}),h("circle",{cx:"8.5",cy:"12",r:"1.7"}),h("path",{d:"M3 17h9M15.5 17H21"}),h("circle",{cx:"13.5",cy:"17",r:"1.7"})]}),ProductGrid:e(t,{children:[h("rect",{x:"3",y:"5",width:"4.8",height:"6",rx:"1"}),h("rect",{x:"9.6",y:"5",width:"4.8",height:"6",rx:"1"}),h("rect",{x:"16.2",y:"5",width:"4.8",height:"6",rx:"1"}),h("rect",{x:"3",y:"13",width:"4.8",height:"6",rx:"1"}),h("rect",{x:"9.6",y:"13",width:"4.8",height:"6",rx:"1"}),h("rect",{x:"16.2",y:"13",width:"4.8",height:"6",rx:"1"})]}),RelatedProducts:e(t,{children:[h("path",{d:"M3 5h10"}),h("rect",{x:"3",y:"9.5",width:"5",height:"9",rx:"1"}),h("rect",{x:"9.5",y:"9.5",width:"5",height:"9",rx:"1"}),h("rect",{x:"16",y:"9.5",width:"5",height:"9",rx:"1"})]}),Gallery:e(t,{children:[h("rect",{x:"3",y:"4",width:"11",height:"16",rx:"2"}),h("rect",{x:"15.5",y:"4",width:"5.5",height:"7.5",rx:"1.5"}),h("rect",{x:"15.5",y:"12.5",width:"5.5",height:"7.5",rx:"1.5"})]}),GalleryB:e(t,{children:[h("rect",{x:"3.5",y:"4",width:"7.5",height:"7.5",rx:"1.5"}),h("rect",{x:"13",y:"4",width:"7.5",height:"7.5",rx:"1.5"}),h("rect",{x:"3.5",y:"12.5",width:"7.5",height:"7.5",rx:"1.5"}),h("rect",{x:"13",y:"12.5",width:"7.5",height:"7.5",rx:"1.5"})]}),GalleryItem:e(t,{children:[h("rect",{x:"4",y:"5",width:"16",height:"14",rx:"2"}),h("circle",{cx:"9",cy:"10",r:"1.6"}),h("path",{d:"M20 15.5l-4.5-4L7 19"})]}),Events:e(t,{children:[h("rect",{x:"4",y:"5",width:"16",height:"15",rx:"2"}),h("path",{d:"M4 9.5h16M8.5 3v4M15.5 3v4M8 14h2M14 14h2"})]}),PostCard:e(t,{children:[h("rect",{x:"4",y:"3.5",width:"16",height:"17",rx:"2"}),h("rect",{x:"6.5",y:"6",width:"11",height:"6",rx:"1"}),h("path",{d:"M6.5 14.5h11M6.5 17.5h7"})]}),Manifesto:e(t,{children:[h("path",{d:"M7 8h3.2v4c0 1.6-1 2.6-3 3.2"}),h("path",{d:"M14 8h3.2v4c0 1.6-1 2.6-3 3.2"})]}),Stats:e(t,{children:[h("path",{d:"M3.5 20h17"}),h("path",{d:"M6 20v-7M11 20V7M16 20v-5M20.5 20v-9"})]}),Logos:e(t,{children:[h("circle",{cx:"6",cy:"12",r:"2.6"}),h("rect",{x:"10",y:"9.4",width:"5.2",height:"5.2",rx:"1.2"}),h("path",{d:"M19 9.2l2.4 5h-4.8z"})]}),Ticker:e(t,{children:[h("rect",{x:"3",y:"8.5",width:"18",height:"7",rx:"2"}),h("path",{d:"M6 12h3.5M11.5 12h2M15.5 12h2.5"})]}),SectionHeader:e(t,{children:[h("rect",{x:"3.5",y:"6",width:"5",height:"5",rx:"1.2"}),h("path",{d:"M11 8.5h9M3.5 15.5h17"})]}),IntroBleed:e(t,{children:[h("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),h("path",{d:"M3 13.5h18M7 16.8h6"})]}),Split:e(t,{children:[h("rect",{x:"3",y:"5",width:"8",height:"14",rx:"1.5"}),h("path",{d:"M14 8.5h6M14 12h6M14 15.5h4"})]}),Eyebrow:e(t,{children:[h("path",{d:"M4 8.5h4.5M11 8.5h9"}),h("path",{d:"M4 14.5h16"})]}),HeroGroup:e(t,{children:[h("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2"}),h("path",{d:"M7 9h8M7 12.5h10M7 16h6"})]}),Form:e(t,{children:[h("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),h("path",{d:"M6.5 9h11M6.5 12.5h11"}),h("rect",{x:"6.5",y:"15",width:"6.5",height:"2.6",rx:"1.3"})]}),LogoBlock:h(t,{children:h("path",{d:"M12 3.5l7.5 3.2v5.1c0 4.2-3.2 7.1-7.5 8.7-4.3-1.6-7.5-4.5-7.5-8.7V6.7z"})}),Spacer:e(t,{children:[h("path",{d:"M12 4v6M9.5 6.5L12 4l2.5 2.5M12 20v-6M9.5 17.5L12 20l2.5-2.5"}),h("path",{d:"M5 13h14",strokeDasharray:"2 2.5"})]}),ContactRouting:e(t,{children:[h("rect",{x:"3",y:"4",width:"5",height:"5",rx:"1"}),h("rect",{x:"9.5",y:"4",width:"5",height:"5",rx:"1"}),h("rect",{x:"16",y:"4",width:"5",height:"5",rx:"1"}),h("path",{d:"M4 13.5h11M4 17.5h7"}),h("path",{d:"M17 15l3 2-3 2"})]}),CustomHTML:h("path",{d:"M9 8l-4 4 4 4M15 8l4 4-4 4"})},C=h("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2.5"}),P={footer:a,Footer:a,Divider:x,FooterDivider:x,Banner:n,Flex:M,FooterSocial:w,FooterPayment:B,page:F,website:I,AccountBlock:u,chat:k,Heading:y,Text:s,ImageBlock:c,ButtonBlock:g,LocationMap:S,Grid:m,ProductRef:p,heroMedia:L,heroImage:c,heroImage2:c},G={MenuBlock:"FooterMenu",EmailFormBlock:"FooterEmailSignup",SocialLogosBlock:"FooterSocial",PaymentLogosBlock:"FooterPayment",SiteHeader:"header",SiteFooter:"footer"};function f({type:i,size:r=16,className:d}){const o=G[i]??i,l=P[o];return l?h(l,{size:r,className:d}):h("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round",className:d,"aria-hidden":"true",children:H[o]??C})}export{f as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as e,jsxs as i,Fragment as
|
|
1
|
+
"use client";import{jsx as e,jsxs as i,Fragment as M}from"react/jsx-runtime";import{useCallback as _,useContext as W,useId as S,useRef as y,useState as O}from"react";import{ThemeIcon as V}from"efficient-easel/icons";import{Button as q,useClickOutside as G}from"efficient-shell/ui";import{SettingsField as J}from"efficient-easel/panel";import{usePreviewHeader as Q}from"../../render/components/PreviewHeaderContext.js";import{ScreenDocumentContext as U}from"efficient-easel/screen/components/ScreenDocumentContext";import{ThemeCard as X,ThemeCardTrigger as Y,ThemeColourRows as Z,themeName as b}from"./ThemeCard.js";import{useThemeRowPersist as ee}from"../lib/theme-row-persist.js";import{say as u}from"../../format/lib/editor-words.js";import{normalizeTheme as D,normalizeThemeColors as te,selectedThemeColors as ne}from"../../format/lib/theme.js";import{SECTION_ACCENT_INHERIT as se,resolveSectionAccent as oe}from"../../format/lib/content/section-surface.js";const ce="Follow the page",Ie="Follow the slideshow",re=s=>u("Editing {name} changes it everywhere.",{name:s});function ie({colors:s}){if(!s)return e("span",{className:"sf-secttheme-chip sf-secttheme-chip--none","aria-hidden":"true"});const t=te(s);return i("span",{className:"sf-secttheme-chip","aria-hidden":"true",children:[e("i",{style:{background:t.background}}),e("i",{className:"sf-secttheme-chip-accent",style:{background:t.accent}})]})}function le({themes:s,value:t,onPick:r,onEdit:f,menuId:l,followLabel:m}){return i("div",{className:"sf-multi-menu sf-secttheme-menu",id:l,role:"listbox",children:[m!==void 0&&i(M,{children:[i("button",{type:"button",role:"option","aria-selected":t===null,className:`sf-secttheme-item${t===null?" is-active":""}`,onClick:()=>r(se),children:[e(ie,{}),e("span",{className:"sf-secttheme-name",children:u(m)})]}),e("div",{className:"sf-secttheme-sep",role:"presentation"})]}),t!==null&&s[t]&&e("p",{className:"sf-secttheme-oncard",role:"presentation",children:u("{name} is on this section",{name:b(t)})}),s.map((E,c)=>c===t?null:e(X,{role:"option",index:c,colors:E,selected:!1,onPick:()=>r(c),onEdit:()=>f(c)},c))]})}function me({index:s,colors:t,onChange:r,onDone:f}){const l=b(s),m=S();return i("div",{className:"sf-secttheme-sheet",children:[i("div",{className:"sf-secttheme-sheet-head",children:[e("span",{children:l}),e(q,{variant:"secondary",className:"sf-secttheme-done",onClick:f,children:u("Done")})]}),e("div",{className:"sf-secttheme-rows",children:e(Z,{colors:t,onChange:r,idPrefix:m})}),e("p",{className:"sf-secttheme-warn",children:re(l)})]})}function ae({value:s,onChange:t,followLabel:r,hint:f}){const{theme:l,setTheme:m}=Q(),E=D(l),c=W(U),R=c?.tokenRef,F=c?.siteId??null,L=!c?.capabilities?.hasSiteTheme,{persist:P,flush:N}=ee({themeFromDocument:L,tokenRef:R,siteId:F}),g=D(E),a=g.themes,d=oe(s),v=d!==null?a[d]:void 0,j=v??(a.length?ne(g):void 0),[p,C]=O(!1),[o,x]=O(null),w=y(null),k=y(null),T=S(),h=_(()=>{C(!1),x(null)},[]),A=_(()=>{!p&&o===null||(N(),h())},[p,o,h,N]);G(w,A);const B=n=>{t(n),h()},H=n=>{if(o===null)return;const $=a.map((z,K)=>K===o?n:z),I={...g,themes:$};m(I),P({selected_preset:I.selected,theme_presets:I.themes})};return i("div",{className:"sf-secttheme",ref:w,children:[e(J,{label:u("Theme"),icon:e(V,{}),labelId:`${T}-label`,hint:f,children:e(Y,{colors:j,onEdit:d!==null?()=>{x(d),C(!1)}:void 0,name:v?b(d):u(r??ce),nameId:`${T}-value`,labelId:`${T}-label`,open:p,menuId:T,buttonRef:k,onClick:()=>{x(null),C(n=>!n)},onKeyDown:n=>{n.key==="Escape"&&(p||o!==null)&&(n.preventDefault(),h())}})}),p&&o===null&&e("div",{onKeyDown:n=>{n.key==="Escape"&&(n.preventDefault(),h(),k.current?.focus())},children:e(le,{themes:a,value:d,onPick:B,onEdit:n=>{x(n),C(!1)},menuId:T,followLabel:r})}),o!==null&&a[o]&&e(me,{index:o,colors:a[o],onChange:H,onDone:()=>{N(),h(),k.current?.focus()}})]})}export{Ie as BLOCK_THEME_FOLLOW_LABEL,ce as SECTION_THEME_FOLLOW_LABEL,me as SectionThemeEditor,le as SectionThemeMenu,ae as default,re as sectionThemeEditWarning};
|