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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { StoredTextStyle } from "../text-styles/site-text-styles.js";
|
|
2
|
+
import { type ThemeColors, type ThemeValue } from "../../../format/lib/theme.js";
|
|
2
3
|
type Props = Record<string, unknown>;
|
|
3
4
|
export type SectionNode = {
|
|
4
5
|
type: string;
|
|
@@ -18,6 +19,9 @@ export type HeadingStyleId = "heading-1" | "heading-2" | "heading-3";
|
|
|
18
19
|
export type SiteWrite = {
|
|
19
20
|
kind: "heading-case-upper";
|
|
20
21
|
styles: readonly HeadingStyleId[];
|
|
22
|
+
} | {
|
|
23
|
+
kind: "band-preset";
|
|
24
|
+
page: number;
|
|
21
25
|
};
|
|
22
26
|
export type SiteFacts = {
|
|
23
27
|
schema: string;
|
|
@@ -27,10 +31,14 @@ export type SiteFacts = {
|
|
|
27
31
|
textStylesList?: readonly StoredTextStyle[] | null;
|
|
28
32
|
ownThemeRow?: boolean | null;
|
|
29
33
|
deleted?: boolean;
|
|
34
|
+
themePresets?: readonly ThemeColors[] | null;
|
|
35
|
+
selectedPreset?: number | null;
|
|
30
36
|
};
|
|
31
37
|
export type ConvertContext = {
|
|
32
38
|
site?: SiteFacts;
|
|
39
|
+
theme?: ThemeValue;
|
|
33
40
|
};
|
|
41
|
+
export declare function convertTheme(ctx: ConvertContext): ThemeValue | undefined;
|
|
34
42
|
export type Restyled = {
|
|
35
43
|
key: string;
|
|
36
44
|
was: {
|
|
@@ -51,7 +59,7 @@ export type SectionConversion = {
|
|
|
51
59
|
skipped?: string;
|
|
52
60
|
};
|
|
53
61
|
export type TextRole = "heading" | "body" | "eyebrow";
|
|
54
|
-
export type BoxEntry = string | readonly [string, string] | readonly [string, string, (value: unknown, props: Props) => unknown];
|
|
62
|
+
export type BoxEntry = string | readonly [string, string] | readonly [string, string, (value: unknown, props: Props, ctx: ConvertContext) => unknown];
|
|
55
63
|
export type ButtonVariantOf = {
|
|
56
64
|
key: string;
|
|
57
65
|
map: Readonly<Record<string, string>>;
|
|
@@ -71,11 +79,24 @@ export type ListPart = {
|
|
|
71
79
|
name: string;
|
|
72
80
|
parts: readonly PartRow[];
|
|
73
81
|
flat?: boolean;
|
|
74
|
-
props?:
|
|
82
|
+
props?: OwnProps;
|
|
75
83
|
item?: (item: Props, index: number, node: Props) => ListItemLook;
|
|
76
84
|
perRow?: (node: Props) => number;
|
|
77
85
|
rowName?: string;
|
|
78
86
|
rowProps?: Props;
|
|
87
|
+
groups?: ListGroups;
|
|
88
|
+
};
|
|
89
|
+
export type ListGroups = {
|
|
90
|
+
of: (item: Props) => string;
|
|
91
|
+
name: string;
|
|
92
|
+
props?: Props;
|
|
93
|
+
head?: (items: Props[], node: Props) => Props;
|
|
94
|
+
parts?: readonly PartRow[];
|
|
95
|
+
itemsName: string;
|
|
96
|
+
itemsProps?: (count: number, node: Props) => Props;
|
|
97
|
+
perRow?: (count: number, node: Props) => number;
|
|
98
|
+
rowName?: string;
|
|
99
|
+
rowProps?: Props;
|
|
79
100
|
};
|
|
80
101
|
export type BlockSeed = {
|
|
81
102
|
type: string;
|
|
@@ -93,13 +114,14 @@ type PartRowKind = {
|
|
|
93
114
|
size: number;
|
|
94
115
|
sizePhone?: number;
|
|
95
116
|
};
|
|
117
|
+
mark?: "accentLead";
|
|
96
118
|
} | {
|
|
97
119
|
kind: "button";
|
|
98
120
|
key: string;
|
|
99
121
|
href: string;
|
|
100
122
|
variant?: string | ButtonVariantOf;
|
|
101
123
|
style?: Props;
|
|
102
|
-
props?:
|
|
124
|
+
props?: OwnProps;
|
|
103
125
|
} | {
|
|
104
126
|
kind: "image";
|
|
105
127
|
key: string;
|
|
@@ -122,7 +144,7 @@ type PartRowKind = {
|
|
|
122
144
|
keepEmpty?: boolean;
|
|
123
145
|
} | {
|
|
124
146
|
kind: "core";
|
|
125
|
-
keep: readonly string[];
|
|
147
|
+
keep: readonly string[] | "rest";
|
|
126
148
|
as?: string;
|
|
127
149
|
rename?: Readonly<Record<string, string>>;
|
|
128
150
|
props?: Props;
|
|
@@ -130,7 +152,6 @@ type PartRowKind = {
|
|
|
130
152
|
};
|
|
131
153
|
export interface SectionToBoxRow {
|
|
132
154
|
name: string;
|
|
133
|
-
on: boolean;
|
|
134
155
|
box?: readonly BoxEntry[];
|
|
135
156
|
boxProps?: OwnProps;
|
|
136
157
|
parts: readonly PartRow[];
|
|
@@ -138,6 +159,7 @@ export interface SectionToBoxRow {
|
|
|
138
159
|
site?: (node: SectionNode, ctx: ConvertContext) => readonly SiteWrite[];
|
|
139
160
|
skip?: (props: Props) => string | undefined;
|
|
140
161
|
also?: readonly SectionPiece[];
|
|
162
|
+
reads?: Readonly<Record<string, string>>;
|
|
141
163
|
}
|
|
142
164
|
export type SectionPiece = {
|
|
143
165
|
name: string;
|
|
@@ -148,6 +170,7 @@ export type SectionPiece = {
|
|
|
148
170
|
export declare function sectionBoxIdOf(oldId: string, piece: number): string;
|
|
149
171
|
export declare function registerBoxNativeSections(types: Readonly<Record<string, string>>): void;
|
|
150
172
|
export declare function boxNativeReason(type: string): string | undefined;
|
|
173
|
+
export declare const SECTION_TO_BOX_ON: readonly string[];
|
|
151
174
|
export declare function registerSectionToBox(rows: Readonly<Record<string, SectionToBoxRow>>): void;
|
|
152
175
|
export declare function sectionToBoxRow(type: string): SectionToBoxRow | undefined;
|
|
153
176
|
export declare function sectionToBoxTypes(): string[];
|
|
@@ -157,11 +180,11 @@ export declare const hasWords: (v: unknown) => boolean;
|
|
|
157
180
|
export declare function convertSection(node: SectionNode, row: SectionToBoxRow, ctx?: ConvertContext): SectionConversion;
|
|
158
181
|
export declare function convertSectionsInPage<D extends {
|
|
159
182
|
content?: unknown;
|
|
160
|
-
}>(data: D): D;
|
|
183
|
+
}>(data: D, on?: readonly string[], ctx?: ConvertContext): D;
|
|
161
184
|
export type SectionToBoxEdit = {
|
|
162
185
|
index: number;
|
|
163
186
|
node: SectionNode;
|
|
164
187
|
nodes: SectionNode[];
|
|
165
188
|
};
|
|
166
|
-
export declare function sectionToBoxEdits(content: unknown): SectionToBoxEdit[];
|
|
189
|
+
export declare function sectionToBoxEdits(content: unknown, on?: readonly string[], ctx?: ConvertContext): SectionToBoxEdit[];
|
|
167
190
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readHidable as X}from"efficient-easel/draw";import{BOX_TYPE as K,CONTAINER_BLOCKS_SLOT as V}from"../../../format/lib/document/container-blocks.js";import{headingTextSeed as Y,labelTextSeed as D}from"../../../format/lib/document/text-seeds.js";import{SPLITTABLE_SECTIONS as F}from"../../../format/lib/sections/section-head-placement.js";import{finiteNumber as _}from"../../../format/lib/finite-number.js";const E=K,v=V;function G(e,r){return r===0?`${e}~box`:`${e}~box-${r+1}`}const P={Flex:"the Box itself",Hero:"its slides hold Boxes of real blocks (Hero › Slide › Box)",Divider:"one block with no text, picture or button",CustomHTML:"the HTML box is the whole section; it has no parts"};function st(e){for(const[r,i]of Object.entries(e)){if(r in P&&P[r]!==i)throw new Error(`lib/sections/section-to-box: "${r}" is already Box-native`);P[r]=i}}function rt(e){return P[e]}const q=new Set(["id"]),$={};function it(e){for(const[r,i]of Object.entries(e)){if(r in $&&$[r]!==i)throw new Error(`lib/sections/section-to-box: "${r}" already has a row`);$[r]=i}}function ct(e){return $[e]}function at(){return Object.keys($)}function ft(e){return $[e]?.on===!0}function dt(e){const r=F[e];if(!r)throw new Error(`lib/sections/section-to-box: "${e}" has no head row in SPLITTABLE_SECTIONS`);const i=[{kind:"text",key:r.num,role:"eyebrow"},{kind:"text",key:r.title,role:"heading"}];return r.description&&i.push({kind:"text",key:r.description,role:"body"}),r.headRows.includes("linkText")&&r.headRows.includes("linkHref")&&i.push({kind:"button",key:"linkText",href:"linkHref"}),i}const j=e=>X(e),pt=e=>j(e).text.trim()!=="",J=e=>e==="heading"?Y():e==="eyebrow"?D():{};function Q(e,r,i){const p={...e._partStyles?.text??{},...r??{},...i??{}};return Object.keys(p).length?{_partStyles:{text:p}}:{}}function U(e,r){if(e===void 0)return{};if(typeof e=="string")return{variant:e};const i=r[e.key];return{variant:typeof i=="string"&&Object.hasOwn(e.map,i)?e.map[i]:e.fallback}}function z(e,r,i,d){const p={...r};for(const h of e){const[b,S,O]=typeof h=="string"?[h,h,void 0]:h;if(i[b]===void 0)continue;const B=O?O(i[b],i):i[b];B===void 0?delete p[S]:p[S]=B,d(b,S,B===void 0)}return p}function C(e,r,i={}){const d=e.props,p=r.skip?.(d);if(p!==void 0)return{node:e,nodes:[e],carried:[],dropped:[],siteWrites:[],restyled:[],skipped:p};const h=String(d.id??e.type),b=[],S=[],O=[],B=new Set,I=(o,n)=>{b.push({key:o,home:n}),B.add(o)},H=d._partStyles??{};let M=0;const w=(o,n)=>({type:o,props:{...n,id:`${h}~${o}-${++M}`}}),N=(o,n,u,f,y,a,k)=>{if(y){for(const s of o??[]){const c=typeof s=="string"?s:s[0];u[c]!==void 0&&k(c,`nothing — the ${f} has no parts, so it is not drawn`)}return}const t=typeof n=="function"?n(d,i):n??{};return z(o??[],t,u,(s,c,l)=>k(s,l?`nothing — the old value draws nothing (${f}: no ${c})`:`${a}${f}: ${c}`))},A=o=>o.map(n=>{const u={...n.props??{}};for(const[f,y]of Object.entries(n.slots??{}))u[f]=A(y);return w(n.type,u)}),L=(o,n,u)=>{const f=Array.isArray(n[o.key])?n[o.key]:[],y=f.map((s,c)=>{const l=s??{},x=o.item?.(l,c,d)??{},m=T(x.reverse?[...o.parts].reverse():o.parts,l,!1,`item ${c+1}: `);return o.flat?x.props?m.map(g=>({...g,props:{...g.props,...x.props,id:g.props.id}})):m:[w(E,{name:`${o.name} ${c+1}`,...o.props??{},...x.props??{},[v]:m})]}),a=o.perRow?.(d),k=o.perRow?Number.isInteger(a)&&a>=1?a:1:0;if(u(o.key,(f.length?o.flat?`each item's parts (${f.length} items), in order`:`one Box per item (${f.length}), its parts inside`:"nothing — the list is empty")+(k&&f.length?`, in rows of ${k}`:"")),!k)return y.flat();const t=[];for(let s=0;s*k<y.length;s++)t.push(w(E,{name:`${o.rowName??`${o.name} row`} ${s+1}`,...o.rowProps??{},[v]:y.slice(s*k,(s+1)*k).flat()}));return t},T=(o,n,u,f)=>{const y=[],a=(t,s)=>u?I(t,s):void 0,k=t=>u?H[t]:void 0;for(const t of o)if(!(t.when&&!t.when(d,u?void 0:n)))switch(t.kind){case"text":{const s=j(n[t.key]);if(!s.text.trim()){a(t.key,"nothing — empty words draw nothing, so no block");break}const c=J(t.role??"body"),{_partStyles:l,...x}=c,m=Q(c,t.style,k(t.key));if(t.was&&u){const g=m._partStyles?.text??{};O.push({key:t.key,was:t.was,...typeof g.textStyle=="string"?{textStyle:g.textStyle}:{},..._(g.size)!==void 0?{size:_(g.size)}:{},..._(g.sizePhone)!==void 0?{sizePhone:_(g.sizePhone)}:{}})}y.push(w("Text",{text:s.text,...x,...t.props??{},...m,...s.hidden?{_hidden:!0}:{}})),a(t.key,`${f}Text block: its words${s.hidden?", hidden":""}`);break}case"button":{const s=j(n[t.key]);if(!s.text.trim()){a(t.key,"nothing — no words, no button"),a(t.href,"nothing — no button to link"),typeof t.variant=="object"&&a(t.variant.key,"nothing — no button to style");break}const c=typeof n[t.href]=="string"&&n[t.href]?n[t.href]:"#",l={...t.style??{},...k(t.key)??{}};y.push(w("ButtonBlock",{label:s.text,href:c,...t.props??{},...U(t.variant,n),...Object.keys(l).length?{_partStyles:{label:l}}:{},...s.hidden?{_hidden:!0}:{}})),a(t.key,`${f}Button block: its words`),a(t.href,`${f}Button block: its link`),typeof t.variant=="object"&&a(t.variant.key,`${f}Button block: its Style`);break}case"image":{const s=n[t.key];if(typeof s!="string"||!s){a(t.key,"nothing — no picture, no block"),t.alt&&a(t.alt,"nothing — no picture to describe");break}const c=t.alt&&typeof n[t.alt]=="string"?n[t.alt]:"";y.push(w("ImageBlock",{src:s,alt:c,...t.props??{}})),a(t.key,`${f}Image block: its picture`),t.alt&&a(t.alt,`${f}Image block: its alt text`);break}case"list":{y.push(...L(t,n,a));break}case"group":{const s=T(t.parts,n,u,f),c=N(t.box,t.props,n,`${t.name} Box`,!s.length&&!t.keepEmpty,f,a);c&&y.push(w(E,{name:t.name,...c,[v]:s}));break}case"block":{const s=t.parts?T(t.parts,n,u,f):[],c=N(t.box,t.props,n,`${t.type} block`,!!t.parts&&!s.length&&!t.keepEmpty,f,a);c&&y.push(w(t.type,{...c,...t.slot?{[t.slot]:s}:{}}));break}case"core":{const s=t.as??e.type,c={headPlacement:"own-box",...t.props??{}};for(const l of t.keep)n[l]!==void 0&&(c[l]=n[l],a(l,`the ${s} block inside the Box`));for(const[l,x]of Object.entries(t.rename??{}))n[l]!==void 0&&(c[x]=n[l],a(l,`the ${s} block inside the Box: ${x}`));for(const[l,x]of Object.entries(t.slots??{}))c[l]=x.flatMap(m=>"kind"in m?L(m,n,a):A([m]));y.push(w(s,c));break}}return y},W=(o,n)=>{const u=n===0?"Box":`${o.name} Box`,f=T(o.parts,d,!0,n===0?"":`${u}: `),y=typeof o.boxProps=="function"?o.boxProps(d,i):o.boxProps??{},a=z(o.box??[],y,d,(k,t,s)=>I(k,s?`nothing — the old value draws nothing (${u}: no ${t})`:`${u}: ${t}`));return{type:E,props:{name:o.name,...a,[v]:f,id:G(h,n)}}},R=[r,...r.also??[]].map(W);d._partStyles!==void 0&&I("_partStyles","each old part's style moved to its new part");for(const[o,n]of Object.entries(r.drop??{}))o in d&&(S.push({key:o,why:n}),B.add(o));for(const o of Object.keys(d))q.has(o)||B.has(o)||S.push({key:o,why:"not in the row — not carried"});return{node:R[0],nodes:R,carried:b,dropped:S,siteWrites:[...r.site?.(e,i)??[]],restyled:O}}function lt(e){const r=e.content;if(!Array.isArray(r))return e;let i=!1;const d=r.flatMap(p=>{const h=p&&typeof p.type=="string"?$[p.type]:void 0;if(!h?.on)return[p];const b=C(p,h);return b.skipped!==void 0?[p]:(i=!0,b.nodes)});return i?{...e,content:d}:e}function ut(e){if(!Array.isArray(e))return[];const r=[];return e.forEach((i,d)=>{const p=i&&typeof i.type=="string"?$[i.type]:void 0;if(!p?.on)return;const h=C(i,p);h.skipped===void 0&&r.push({index:d,node:h.node,nodes:h.nodes})}),r}export{v as SECTION_BOX_SLOT,E as SECTION_BOX_TYPE,rt as boxNativeReason,C as convertSection,lt as convertSectionsInPage,ft as convertsToBox,pt as hasWords,dt as headParts,st as registerBoxNativeSections,it as registerSectionToBox,G as sectionBoxIdOf,ut as sectionToBoxEdits,ct as sectionToBoxRow,at as sectionToBoxTypes};
|
|
1
|
+
import{readHidable as U}from"efficient-easel/draw";import{BOX_TYPE as Z,CONTAINER_BLOCKS_SLOT as ee}from"../../../format/lib/document/container-blocks.js";import{headingTextSeed as te,labelTextSeed as ne}from"../../../format/lib/document/text-seeds.js";import{SPLITTABLE_SECTIONS as oe}from"../../../format/lib/sections/section-head-placement.js";import{finiteNumber as I}from"../../../format/lib/finite-number.js";import{bucketByGroup as se}from"../../../format/lib/locations-grid.js";import{normalizeTheme as V}from"../../../format/lib/theme.js";const j=Z,E=ee;function be(t){if(t.theme)return V(t.theme);const n=t.site?.themePresets;return n?V({selected:t.site?.selectedPreset??0,themes:[...n]}):void 0}function re(t,n){return n===0?`${t}~box`:`${t}~box-${n+1}`}const R={Flex:"the Box itself",Hero:"its slides hold Boxes of real blocks (Hero › Slide › Box)",Divider:"one block with no text, picture or button",CustomHTML:"the HTML box is the whole section; it has no parts"};function xe(t){for(const[n,i]of Object.entries(t)){if(n in R&&R[n]!==i)throw new Error(`lib/sections/section-to-box: "${n}" is already Box-native`);R[n]=i}}function ge(t){return R[t]}const Y=new Set(["id"]),_={},C=[];function $e(t){for(const[n,i]of Object.entries(t)){if(n in _&&_[n]!==i)throw new Error(`lib/sections/section-to-box: "${n}" already has a row`);_[n]=i}}function we(t){return _[t]}function Oe(){return Object.keys(_)}function Se(t){return t in _&&C.includes(t)}function Be(t){const n=oe[t];if(!n)throw new Error(`lib/sections/section-to-box: "${t}" has no head row in SPLITTABLE_SECTIONS`);const i=[{kind:"text",key:n.num,role:"eyebrow"},{kind:"text",key:n.title,role:"heading"}];return n.description&&i.push({kind:"text",key:n.description,role:"body"}),n.headRows.includes("linkText")&&n.headRows.includes("linkHref")&&i.push({kind:"button",key:"linkText",href:"linkHref"}),i}const H=t=>U(t),Te=t=>H(t).text.trim()!=="";function ie(t){if(t.includes("=="))return t;const n=t.indexOf("/"),i=n===-1?t:t.slice(0,n),a=i.trim();if(!a)return t;const u=i.indexOf(a);return`${i.slice(0,u)}==${a}==${i.slice(u+a.length)}${n===-1?"":t.slice(n)}`}const ae=t=>t==="heading"?te():t==="eyebrow"?ne():{};function ce(t,n,i,a){const f={...t._partStyles?.text??{},...n??{},...i??{}};return(a==="center"||a==="right")&&f.align===void 0&&(f.align=a),Object.keys(f).length?{_partStyles:{text:f}}:{}}function fe(t,n){if(t===void 0)return{};if(typeof t=="string")return{variant:t};const i=n[t.key];return{variant:typeof i=="string"&&Object.hasOwn(t.map,i)?t.map[i]:t.fallback}}function D(t,n,i,a,u={}){const f={...n};for(const h of t){const[m,S,P]=typeof h=="string"?[h,h,void 0]:h;if(i[m]===void 0)continue;const B=P?P(i[m],i,u):i[m];B===void 0?delete f[S]:f[S]=B,a(m,S,B===void 0)}return f}function de(t){const n=new Set([...Y,"headPlacement","_partStyles",...Object.keys(t.drop??{}),...Object.keys(t.reads??{})]),i=u=>{for(const f of u??[])n.add(typeof f=="string"?f:f[0])},a=u=>{for(const f of u)switch(f.kind){case"text":case"image":n.add(f.key),f.kind==="image"&&f.alt&&n.add(f.alt);break;case"button":n.add(f.key),n.add(f.href),typeof f.variant=="object"&&n.add(f.variant.key);break;case"list":n.add(f.key);break;case"group":case"block":i(f.box),a(f.parts??[]);break;case"core":f.keep!=="rest"&&f.keep.forEach(h=>n.add(h)),Object.keys(f.rename??{}).forEach(h=>n.add(h));for(const h of Object.values(f.slots??{}))for(const m of h)"kind"in m&&n.add(m.key);break}};for(const u of[t,...t.also??[]])i(u.box),a(u.parts);return n}function F(t,n,i={}){const a=t.props,u=n.skip?.(a);if(u!==void 0)return{node:t,nodes:[t],carried:[],dropped:[],siteWrites:[],restyled:[],skipped:u};const f=String(a.id??t.type),h=[],m=[],S=[],P=new Set,B=(o,r)=>{h.push({key:o,home:r}),P.add(o)},X=a._partStyles??{},L=de(n);let q=0;const $=(o,r)=>({type:o,props:{...r,id:`${f}~${o}-${++q}`}}),K=(o,r,k,l,b,d,w)=>{if(b){for(const c of o??[]){const s=typeof c=="string"?c:c[0];k[s]!==void 0&&w(s,`nothing — the ${l} has no parts, so it is not drawn`)}return}const e=typeof r=="function"?r(a,i):r??{};return D(o??[],e,k,(c,s,x)=>w(c,x?`nothing — the old value draws nothing (${l}: no ${s})`:`${d}${l}: ${s}`),i)},M=o=>o.map(r=>{const k={...r.props??{}};for(const[l,b]of Object.entries(r.slots??{}))k[l]=M(b);return $(r.type,k)}),W=(o,r,k)=>{const l=Array.isArray(r[o.key])?r[o.key]:[],b=typeof o.props=="function"?o.props(a,i):o.props??{},d=l.map((s,x)=>{const p=s??{},y=o.item?.(p,x,a)??{},g=v(y.reverse?[...o.parts].reverse():o.parts,p,!1,`item ${x+1}: `);return o.flat?y.props?g.map(T=>({...T,props:{...T.props,...y.props,id:T.props.id}})):g:[$(j,{name:`${o.name} ${x+1}`,...b,...y.props??{},[E]:g})]});if(o.groups){const s=o.groups;return k(o.key,l.length?`one Box per item (${l.length}), in a Box per group`:"nothing — the list is empty"),se(l.map(x=>x??{}),s.of,s.of).map((x,p)=>{const y=x.items.map(O=>O.item),g=s.parts?v(s.parts,s.head?.(y,a)??{},!1,`group ${p+1}: `):[],T=x.items.map(O=>d[O.index]),A=s.perRow?.(y.length,a),N=Number.isInteger(A)&&A>=1?A:1,z=[];if(s.perRow&&N<T.length)for(let O=0;O*N<T.length;O++)z.push(T.slice(O*N,(O+1)*N).flat());return $(j,{name:`${s.name} ${p+1}`,...s.props??{},[E]:[...g,$(j,{name:`${s.itemsName} ${p+1}`,...s.itemsProps?.(y.length,a)??{},[E]:z.length?z.map((O,Q)=>$(j,{name:`${s.rowName??`${s.itemsName} row`} ${Q+1}`,...s.rowProps??{},[E]:O})):T.flat()})]})})}const w=o.perRow?.(a),e=o.perRow?Number.isInteger(w)&&w>=1?w:1:0;if(k(o.key,(l.length?o.flat?`each item's parts (${l.length} items), in order`:`one Box per item (${l.length}), its parts inside`:"nothing — the list is empty")+(e&&l.length?`, in rows of ${e}`:"")),!e)return d.flat();const c=[];for(let s=0;s*e<d.length;s++)c.push($(j,{name:`${o.rowName??`${o.name} row`} ${s+1}`,...o.rowProps??{},[E]:d.slice(s*e,(s+1)*e).flat()}));return c},v=(o,r,k,l)=>{const b=[],d=(e,c)=>k?B(e,c):void 0,w=e=>k?X[e]:void 0;for(const e of o)if(!(e.when&&!e.when(a,k?void 0:r)))switch(e.kind){case"text":{const c=H(r[e.key]);if(!c.text.trim()){d(e.key,"nothing — empty words draw nothing, so no block");break}const s=ae(e.role??"body"),{_partStyles:x,...p}=s,y=ce(s,e.style,w(e.key),e.props?.align);if(e.was&&k){const g=y._partStyles?.text??{};S.push({key:e.key,was:e.was,...typeof g.textStyle=="string"?{textStyle:g.textStyle}:{},...I(g.size)!==void 0?{size:I(g.size)}:{},...I(g.sizePhone)!==void 0?{sizePhone:I(g.sizePhone)}:{}})}b.push($("Text",{text:e.mark==="accentLead"?ie(c.text):c.text,...p,...e.props??{},...y,...c.hidden?{_hidden:!0}:{}})),d(e.key,`${l}Text block: its words${c.hidden?", hidden":""}`);break}case"button":{const c=H(r[e.key]);if(!c.text.trim()){d(e.key,"nothing — no words, no button"),d(e.href,"nothing — no button to link"),typeof e.variant=="object"&&d(e.variant.key,"nothing — no button to style");break}const s=typeof r[e.href]=="string"&&r[e.href]?r[e.href]:"#",x={...e.style??{},...w(e.key)??{}};b.push($("ButtonBlock",{label:c.text,href:s,...typeof e.props=="function"?e.props(r,i):e.props??{},...fe(e.variant,r),...Object.keys(x).length?{_partStyles:{label:x}}:{},...c.hidden?{_hidden:!0}:{}})),d(e.key,`${l}Button block: its words`),d(e.href,`${l}Button block: its link`),typeof e.variant=="object"&&d(e.variant.key,`${l}Button block: its Style`);break}case"image":{const c=r[e.key];if(typeof c!="string"||!c){d(e.key,"nothing — no picture, no block"),e.alt&&d(e.alt,"nothing — no picture to describe");break}const s=e.alt&&typeof r[e.alt]=="string"?r[e.alt]:"";b.push($("ImageBlock",{src:c,alt:s,...e.props??{}})),d(e.key,`${l}Image block: its picture`),e.alt&&d(e.alt,`${l}Image block: its alt text`);break}case"list":{b.push(...W(e,r,d));break}case"group":{const c=v(e.parts,r,k,l),s=K(e.box,e.props,r,`${e.name} Box`,!c.length&&!e.keepEmpty,l,d);s&&b.push($(j,{name:e.name,...s,[E]:c}));break}case"block":{const c=e.parts?v(e.parts,r,k,l):[],s=K(e.box,e.props,r,`${e.type} block`,!!e.parts&&!c.length&&!e.keepEmpty,l,d);s&&b.push($(e.type,{...s,...e.slot?{[e.slot]:c}:{}}));break}case"core":{const c=e.as??t.type,s={headPlacement:"own-box",...e.props??{}},x=e.keep==="rest"?Object.keys(r).filter(p=>!L.has(p)&&!(p in s)):e.keep;for(const p of x)r[p]!==void 0&&(s[p]=r[p],d(p,`the ${c} block inside the Box`));if(e.keep==="rest"){for(const y of Object.keys(e.props??{}))r[y]!==void 0&&!L.has(y)&&d(y,`nothing — the ${c} block inside the Box has the row's own value`);r.headPlacement!==void 0&&d("headPlacement",`the ${c} block inside the Box: own-box`);const p=Object.fromEntries(Object.entries(X).filter(([y])=>!L.has(y)));Object.keys(p).length&&(s._partStyles=p)}for(const[p,y]of Object.entries(e.rename??{}))r[p]!==void 0&&(s[y]=r[p],d(p,`the ${c} block inside the Box: ${y}`));for(const[p,y]of Object.entries(e.slots??{}))s[p]=y.flatMap(g=>"kind"in g?W(g,r,d):M([g]));b.push($(c,s));break}}return b},J=(o,r)=>{const k=r===0?"Box":`${o.name} Box`,l=v(o.parts,a,!0,r===0?"":`${k}: `),b=typeof o.boxProps=="function"?o.boxProps(a,i):o.boxProps??{},d=D(o.box??[],b,a,(w,e,c)=>B(w,c?`nothing — the old value draws nothing (${k}: no ${e})`:`${k}: ${e}`),i);return{type:j,props:{name:o.name,...d,[E]:l,id:re(f,r)}}},G=[n,...n.also??[]].map(J);a._partStyles!==void 0&&B("_partStyles","each old part's style moved to its new part");for(const[o,r]of Object.entries(n.reads??{}))a[o]!==void 0&&B(o,r);for(const[o,r]of Object.entries(n.drop??{}))o in a&&(m.push({key:o,why:r}),P.add(o));for(const o of Object.keys(a))Y.has(o)||P.has(o)||m.push({key:o,why:"not in the row — not carried"});return{node:G[0],nodes:G,carried:h,dropped:m,siteWrites:[...n.site?.(t,i)??[]],restyled:S}}function _e(t,n=C,i={}){const a=t.content;if(!Array.isArray(a))return t;let u=!1;const f=a.flatMap(h=>{const m=h&&typeof h.type=="string"&&n.includes(h.type)?_[h.type]:void 0;if(!m)return[h];const S=F(h,m,i);return S.skipped!==void 0?[h]:(u=!0,S.nodes)});return u?{...t,content:f}:t}function je(t,n=C,i={}){if(!Array.isArray(t))return[];const a=[];return t.forEach((u,f)=>{const h=u&&typeof u.type=="string"&&n.includes(u.type)?_[u.type]:void 0;if(!h)return;const m=F(u,h,i);m.skipped===void 0&&a.push({index:f,node:m.node,nodes:m.nodes})}),a}export{E as SECTION_BOX_SLOT,j as SECTION_BOX_TYPE,C as SECTION_TO_BOX_ON,ge as boxNativeReason,F as convertSection,_e as convertSectionsInPage,be as convertTheme,Se as convertsToBox,Te as hasWords,Be as headParts,xe as registerBoxNativeSections,$e as registerSectionToBox,re as sectionBoxIdOf,je as sectionToBoxEdits,we as sectionToBoxRow,Oe as sectionToBoxTypes};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{defaultTextStyles as A,textStyleCaseCss as Y}from"efficient-easel/text-styles/model";import{FONT_OPTIONS as
|
|
2
|
-
`)}const
|
|
1
|
+
import{defaultTextStyles as A,textStyleCaseCss as Y}from"efficient-easel/text-styles/model";import{parseHexColor as G}from"efficient-shell/format";import{FONT_OPTIONS as U,normalizeFonts as I}from"../../../format/lib/fonts.js";import{PHONE_MEDIA as X}from"../content/view-values.js";import{STYLE_ID_OF_ROLE as Z,TEXT_STYLE_ATTR as q,paragraphRules as B,partSpacingOf as K}from"../document/part-styles.js";import{faceClassOf as L}from"../../../format/lib/text-style-face.js";import{compressionMetrics as Q,headingTypographyFromRow as ee,normalizeHeadingCompression as k,normalizeSizes as j}from"../../../format/lib/theme.js";import{finiteNumber as m}from"../../../format/lib/finite-number.js";import{nonEmptyString as _}from"../../../format/lib/non-empty-string.js";const H=e=>e==="sentence"?"none":void 0,F=["font","color","size","sizePhone","weight","italic","lineHeight","letterSpacing","paragraphSpacing","letterCase","largestSize"];function g(e){const i={};for(const n of F)e[n]!==void 0&&(i[n]=e[n]);return i}function T(e,i){const{auto:n,...t}=e,o=new Set(i??[]),r=F.filter(a=>o.has(a)&&e.values[a]===void 0);return r.length?{...t,auto:r}:t}function M(e){const i=e.fonts,n=e.sizes,t=e.typography,o=Q(e.compression),r={"heading-1":{font:_(i.heading),size:m(n.headingLarge),weight:m(t.weight),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:H(t.case),largestSize:m(t.maxPx)},"heading-2":{font:_(i.heading2),size:m(n.headingMedium),weight:m(t.weight2),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:H(t.case2)},"heading-3":{font:_(i.heading3),size:m(n.headingSmall),weight:m(t.weight3),lineHeight:o.lineHeight,letterSpacing:o.letterSpacing,letterCase:H(t.case3)},"body-1":{font:_(i.body),size:m(n.body)},"body-5":{font:_(i.label),size:m(n.label)}};return A().map(({id:a,kind:l,name:d})=>({id:a,kind:l,name:d,values:g(r[a]??{})}))}function C(e){return Array.isArray(e)&&e.every(n=>n&&typeof n=="object"&&typeof n.id=="string"&&(n.kind==="heading"||n.kind==="body")&&typeof n.name=="string")?e.map(n=>T({...n,values:g(n.values??{})},Array.isArray(n.auto)?n.auto:void 0)):null}function he(e){return C(e)??[]}function R(e){return C(e)??A().map(({id:i,kind:n,name:t})=>({id:i,kind:n,name:t,values:{}}))}function O(e,i){const n=M(i),t=C(e);return t?t.map(o=>{const r={...w(n,o.id)};for(const a of o.auto??[])delete r[a];return{...o,values:g({...r,...o.values})}}):n}const w=(e,i)=>e.find(n=>n.id===i)?.values??{},V=["heading-1","heading-2","heading-3"];function me({saved:e,old:i,cur:n,next:t,sizeOf:o}){const r=M(i),a=R(e),l=O(a,i),d=[],S=t.map(s=>{const c=n.find(f=>f.id===s.id),x=a.find(f=>f.id===s.id);if(!c||!x)return ne([s],o)[0];const u={...x.values},z=new Set(x.auto??[]),v=s.values,E=c.values,N=[...new Set([...Object.keys(v),...Object.keys(E)])].filter(f=>JSON.stringify(v[f])!==JSON.stringify(E[f]));N.sort((f,y)=>+(f==="letterSpacing")-+(y==="letterSpacing"));for(const f of N){const y=f==="lineSpacing"?"lineHeight":f,$=v[f];if($===void 0){delete u[y],w(r,s.id)[y]!==void 0&&(d.push([s.id,y]),z.add(y));continue}if(z.delete(y),f==="lineSpacing")u.lineHeight=b($/100,3);else if(f==="letterSpacing"){const J=l.find(W=>W.id===s.id),P=o({...s,values:g({...J?.values??{},...u})});u.letterSpacing=P?b($/P,4):0}else u[y]=$}return T({id:s.id,kind:s.kind,name:s.name,values:g(u)},z)});let p=i.compression;if(d.some(([s,c])=>(c==="lineHeight"||c==="letterSpacing")&&V.includes(s))&&k(p)!=="normal"){for(const s of V){const c=S.find(u=>u.id===s);if(!c)continue;const x={...c.values};for(const u of["lineHeight","letterSpacing"])d.some(([z,v])=>z===s&&v===u)||x[u]===void 0&&!(c.auto??[]).includes(u)&&(x[u]=w(r,s)[u]);c.values=g(x)}p="normal"}return{saved:S,old:{...i,compression:p}}}function ye(e,i){const n={text_styles:e.saved};return e.old.compression!==i.compression&&(n.heading_compression=k(e.old.compression)),n}const b=(e,i)=>Number(e.toFixed(i));function Se(e,i){return e.map(n=>{const{lineHeight:t,letterSpacing:o,...r}=n.values,a={...r};return t!==void 0&&(a.lineSpacing=b(t*100,1)),o!==void 0&&(a.letterSpacing=b(o*i(n),2)),{id:n.id,kind:n.kind,name:n.name,values:a}})}function ne(e,i){return e.map(n=>{const{lineSpacing:t,letterSpacing:o,...r}=n.values,a={id:n.id,kind:n.kind,name:n.name,values:g({...r})},l={...a.values};if(t!==void 0&&(l.lineHeight=b(t/100,3)),o!==void 0){const d=i({...a,values:{...a.values}});l.letterSpacing=d?b(o/d,4):0}return{...a,values:g(l)}})}function xe(e){const i={fonts:I({heading:e.heading_font??void 0,heading2:e.heading_2_font??void 0,heading3:e.heading_3_font??void 0,body:e.body_font??void 0,accent:e.accent_font??void 0,label:e.label_font??void 0}),sizes:j({headingLarge:e.heading_size_large_px,headingMedium:e.heading_size_medium_px,headingSmall:e.heading_size_small_px,accent:e.accent_size_px,body:e.body_size_px,label:e.label_size_px}),compression:k(e.heading_compression),typography:ee(e)},n=e.text_styles??null,t=Array.isArray(n)?D(O(n,i),i):i;return{fonts:I(t.fonts),sizes:j(t.sizes),compression:k(t.compression),typography:t.typography,textStyles:n}}function D(e,i){const n=s=>e.find(c=>c.id===s)?.values??{},t=n("heading-1"),o=n("heading-2"),r=n("heading-3"),a=n("body-1"),l=n("body-5"),d=i.fonts,S=i.sizes,p=i.typography,h=s=>s==="none"?"sentence":"authored";return{fonts:{...d,heading:t.font??d.heading,heading2:o.font??t.font??d.heading2,heading3:r.font??t.font??d.heading3,body:a.font??d.body,label:l.font??d.label},sizes:{...S,headingLarge:t.size??null,headingMedium:o.size??null,headingSmall:r.size??null,body:a.size??null,label:l.size??null},compression:i.compression,typography:{...p,case:h(t.letterCase),weight:t.weight??null,maxPx:t.largestSize??null,weight2:o.weight??null,weight3:r.weight??null,case2:h(o.letterCase),case3:h(r.letterCase)}}}function be(e){const i=C(e.textStyles);if(!i||i.every(o=>Object.keys(o.values).length===0&&!o.auto))return e;const n={fonts:e.fonts??{},sizes:e.sizes??{},compression:String(e.headingCompression??"normal"),typography:e.headingTypography??{}},t=D(O(i,n),n);return{...e,fonts:t.fonts,sizes:t.sizes,headingCompression:t.compression,headingTypography:t.typography}}function te(e){return e==="accent"?"var(--accent)":e==="text"?"var(--fg)":e==="labels"?"var(--fg-dim)":G(e)===e.toLowerCase()?e:null}function ze(e){const i=[];for(const n of e){const t=n.values,o=`.${L(n)}`,r=`[${q}="${n.id}"]`,a=`${o}, ${r}`,l=[],d=t.font!==void 0?U.find(s=>s.key===t.font)?.cssVar:void 0;if(d&&l.push(`font-family: var(${d})`),t.size!==void 0){const s=t.largestSize!==void 0?Math.min(t.size,t.largestSize):t.size;l.push(`font-size: ${s}px`)}const S=t.color!==void 0?te(t.color):null;S&&l.push(`color: ${S}`),t.italic===!0&&l.push("font-style: italic"),t.weight!==void 0&&l.push(`font-weight: ${t.weight}`);const p=[];t.lineHeight!==void 0&&p.push(`line-height: ${t.lineHeight}`),t.letterSpacing!==void 0&&p.push(`letter-spacing: ${t.letterSpacing}em`),n.kind==="body"&&l.push(...p);const h=Y(t.letterCase);if(h&&n.kind==="body"&&l.push(`text-transform: ${h}`),t.paragraphSpacing&&l.push(`--sf-part-para: ${t.paragraphSpacing}px`),l.length&&i.push(`${a} { ${l.join("; ")} }`),n.kind==="heading"&&p.length&&i.push(`${a}, ${o}:is(h1, h2, h3, h4), ${r}:is(h1, h2, h3, h4) { ${p.join("; ")} }`),n.kind==="heading"&&h&&i.push(`${r}, ${o}:is(h1, h2, h3, h4) { text-transform: ${h} }`),t.paragraphSpacing&&(i.push(`*:has(> ${r}) { --sf-part-para: ${t.paragraphSpacing}px }`),i.push(...B(`:is(${a})`,`*:has(> ${r})`))),t.sizePhone!==void 0){const s=ie[n.id],c=[`${a} { font-size: ${t.sizePhone}px }`];s&&c.push(`.sf-themed-content { --size-${s}: ${t.sizePhone}px !important }`),i.push(`@media ${X} { ${c.join(" ")} }`)}}return i.join(`
|
|
2
|
+
`)}const ie={"heading-1":"headingLarge","heading-2":"headingMedium","heading-3":"headingSmall","body-1":"body","body-5":"label"};function ve(e){return e!==!0&&e!==!1?"":`em.text-accent { font-style: ${e?"italic":"normal"} }`}function _e(e){return e?Z[e]:void 0}function oe(e){const i=K(e);return g({font:e.font,color:e.color,size:e.size,weight:e.weight,italic:e.italic,lineHeight:i.lineHeight,letterSpacing:i.letterSpacingEm,paragraphSpacing:e.paragraphSpacing,letterCase:e.case})}function $e(e){return Object.keys(oe(e)).length>0}function ke({saved:e,old:i,styleId:n,values:t}){const o=R(e);return{saved:se(o,n,t),old:i}}function se(e,i,n){return e.map(t=>t.id===i?T({...t,values:g({...t.values,...n})},t.auto):t)}function Ce(e){const i=e.filter(n=>n.kind==="body").map(n=>Number(/^body-(\d+)$/.exec(n.id)?.[1])).filter(n=>Number.isInteger(n)&&n>0);return i.length?`body-${Math.max(...i)}`:"body-1"}export{ve as accentItalicCss,me as applyListChange,Ce as eyebrowStyleId,L as faceClassOf,ne as fromPanelStyles,$e as hasStyleChange,ye as listChangePatch,R as listToWrite,oe as partStyleToTextStyleValues,ke as pushIntoStyle,O as resolveTextStyles,se as setStyleValues,xe as siteTextFromRow,he as storedTextStyles,_e as styleIdOfRole,ze as textStylesCss,M as textStylesFromOld,D as textStylesToOld,be as themeWithTextStyles,Se as toPanelStyles};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "efficient-web-builder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "46.0.0",
|
|
4
4
|
"description": "The EFFICIENT website builder: the website editor, the general sections and the renderer that draws them, compiled. Hostable by any EFFICIENT product; nothing here imports a host.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Efficient Pty Ltd",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@tabler/icons-react": "^3.46.0",
|
|
56
|
-
"efficient-easel": "^
|
|
57
|
-
"efficient-shell": "^
|
|
56
|
+
"efficient-easel": "^26.1.0",
|
|
57
|
+
"efficient-shell": "^11.8.0",
|
|
58
58
|
"isomorphic-dompurify": "^3.18.0",
|
|
59
59
|
"next": ">=16",
|
|
60
60
|
"react": ">=19",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"@types/node": "^20",
|
|
73
73
|
"@types/react": "^19",
|
|
74
74
|
"@types/react-dom": "^19",
|
|
75
|
-
"efficient-easel": "^
|
|
76
|
-
"efficient-shell": "^
|
|
75
|
+
"efficient-easel": "^26.1.0",
|
|
76
|
+
"efficient-shell": "^11.8.0",
|
|
77
77
|
"esbuild": "^0.28.0",
|
|
78
78
|
"happy-dom": "^20.14.5",
|
|
79
79
|
"isomorphic-dompurify": "^3.18.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as a,jsxs as o}from"react/jsx-runtime";import{Tooltip as c}from"efficient-shell/ui";import{say as e}from"../../format/lib/editor-words.js";function f({label:t,onClear:n,what:r="override"}){const l=e(t),i=r==="override"?e("Clear override"):r==="change"?e("Clear change"):e("Clear {what}",{what:r}),s=r==="override"?e("Clear override: {label}",{label:l}):r==="change"?e("Clear change: {label}",{label:l}):e("Clear {what}: {label}",{what:r,label:l});return a(c,{content:i,children:a("button",{type:"button",className:"sf-part-mark","aria-label":s,onClick:n,children:a(d,{})})})}function d(){return o("svg",{width:"12",height:"12",viewBox:"0 0 16 16","aria-hidden":"true",children:[a("circle",{className:"sf-part-mark-dot",cx:"8",cy:"8",r:"3",fill:"currentColor"}),o("g",{className:"sf-part-mark-arrow",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",children:[a("path",{d:"M13 8a5 5 0 1 1-1.6-3.7"}),a("path",{d:"M13 2.5V5h-2.6"})]})]})}export{f as PartResetDot};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{jsx as r}from"react/jsx-runtime";import{usePreviewDevice as y}from"efficient-easel/draw/client";import{usePreviewHeader as w}from"../../../render/components/PreviewHeaderContext.js";import{BackgroundWidthRow as I,CONTENT_INSIDE_BACKGROUND_HINT as S,ContentWidthRow as C,WIDTH_GROUP_LABEL as E,WIDTH_PHONE_HINT as T}from"../../components/SectionWidthRows.js";import{PAGE_WIDTH as p}from"../../../format/lib/content/page-width.js";import{FOLLOW_SITE as h,WIDTH_CHOICE_LABEL as H,resolveSectionWidth as m}from"../../../format/lib/content/section-width.js";import{say as f}from"../../../format/lib/editor-words.js";import{group as D,sharedStyleKinds as N,useSelectedPatch as O,useSelectedProps as W}from"./controls.js";import{NoControlMark as g,noControlField as x}from"efficient-easel/screen/lib/document/panel-no-control-mark";const u=t=>f(H[t==="content"?"page":"full"]),_=t=>`${t} ${f("from Styles")}`;function b(){const{siteWidth:t,sectionBackgroundWidth:o,sectionContentWidth:e}=w();return{px:typeof t=="number"?t:p.default,background:o??"full",content:e??"content"}}function k(){try{return y()==="mobile"}catch{return!1}}function P({type:t,onChange:o}){const e=W(),n=b(),i=k(),c=m(t,e).background;return r(I,{value:c??n.background,changed:c!==null,detail:_(u(n.background)),onChange:a=>o(a),onReset:()=>o(h),disabled:i})}function B({type:t}){const o=W(),e=O(),n=b(),i=k(),c=m(t,o),s=(c.background??n.background)==="content",l=c.content??n.content;return r(C,{mode:s&&l==="full"?"content":l,px:c.contentMax??n.px,max:s?n.px:p.max,changed:c.content!==null,detail:_(n.content==="full"?u("full"):`${u("content")} ${n.px}px`),fullClosed:s,disabled:i,hint:i?T:s?S:void 0,onMode:d=>e(d==="full"?{contentWidth:d,contentMax:null}:{contentWidth:d}),onPx:d=>e({contentWidth:"content",contentMax:d}),onReset:()=>e({contentWidth:h,contentMax:null})})}function M(t){return N({_gWidth:D(E),backgroundWidth:{type:"custom",render:({onChange:o})=>r(P,{type:t,onChange:o})},contentWidth:{type:"custom",render:()=>r(B,{type:t})},contentMax:{...x({type:"custom",render:()=>r(g,{})},"always"),reachedBy:"contentWidth"},widthMode:{...x({type:"custom",render:()=>r(g,{})},"always"),reachedBy:"backgroundWidth"}})}const U=Object.keys(M(""));export{U as SECTION_WIDTH_FIELD_KEYS,M as sectionWidthFields};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties } from "react";
|
|
2
|
-
export declare const IMAGE_WIDTH: {
|
|
3
|
-
readonly min: 40;
|
|
4
|
-
readonly max: 2000;
|
|
5
|
-
readonly step: 10;
|
|
6
|
-
readonly fallback: 2000;
|
|
7
|
-
readonly unit: "px";
|
|
8
|
-
};
|
|
9
|
-
export declare function imageWidthStyle(value: number | undefined): CSSProperties | null;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const n={min:40,max:2e3,step:10,fallback:2e3,unit:"px"};function i(t){return typeof t!="number"?null:{width:`${t}${n.unit}`,maxWidth:"100%"}}export{n as IMAGE_WIDTH,i as imageWidthStyle};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const SECTION_MOTIONS: readonly ["fade", "rise", "scale"];
|
|
2
|
-
export type SectionMotion = (typeof SECTION_MOTIONS)[number];
|
|
3
|
-
export declare const SECTION_MOTION_NONE = "none";
|
|
4
|
-
export declare const SECTION_MOTION_OPTIONS: readonly {
|
|
5
|
-
label: string;
|
|
6
|
-
value: string;
|
|
7
|
-
}[];
|
|
8
|
-
export declare function normalizeSectionMotion(value: unknown): SectionMotion | null;
|
|
9
|
-
export declare const SECTION_ANIM_ATTR = "data-sf-anim";
|
|
10
|
-
export declare const SECTION_ANIM_STATE = "data-sf-anim-state";
|
|
11
|
-
export declare function armSectionEntrance(el: HTMLElement): () => void;
|
|
12
|
-
export declare function playSectionEntrance(el: HTMLElement): void;
|
|
13
|
-
export declare const SECTION_ANIM_EXCLUDED: ReadonlySet<string>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{SECTION_THEME_EXCLUDED as s}from"./section-surface.js";const u=["fade","rise","scale"],d="none",O=[{label:"None",value:d},{label:"Fade",value:"fade"},{label:"Rise",value:"rise"},{label:"Scale",value:"scale"}];function I(t){return u.includes(t)?t:null}const i="data-sf-anim",n="data-sf-anim-state";function N(t){const e=()=>{};if(typeof IntersectionObserver>"u"||!t.getAttribute(i))return e;const r=window.innerHeight||document.documentElement.clientHeight;if(t.getBoundingClientRect().top<r)return e;t.setAttribute(n,"armed");const o=new IntersectionObserver(c=>{for(const a of c)if(a.isIntersecting){o.disconnect(),f(t);break}},{threshold:0});return o.observe(t),()=>{o.disconnect(),t.removeAttribute(n)}}function f(t){if(!t.getAttribute(i))return;t.removeAttribute(n),t.offsetWidth,t.setAttribute(n,"play");const e=r=>{r.target===t&&(t.removeAttribute(n),t.removeEventListener("animationend",e))};t.addEventListener("animationend",e)}const m=s;export{i as SECTION_ANIM_ATTR,m as SECTION_ANIM_EXCLUDED,n as SECTION_ANIM_STATE,u as SECTION_MOTIONS,d as SECTION_MOTION_NONE,O as SECTION_MOTION_OPTIONS,N as armSectionEntrance,I as normalizeSectionMotion,f as playSectionEntrance};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const p=t=>!!t&&typeof t=="object"&&typeof t.type=="string"&&!!t.props&&typeof t.props=="object";function u(t,e){const n=t.components[e]?.label;return typeof n=="string"&&n.trim()?n.trim():e}function j(t){return t.length>3&&t.endsWith("s")?t.slice(0,-1):t}function b(t,e,n,o){t.forEach((s,c)=>{if(p(s)){o.push({node:s,list:t,index:c,parent:e,slot:n});for(const[r,l]of Object.entries(s.props))Array.isArray(l)&&l.some(p)&&b(l,s,r,o)}})}function _(t){const e=[];b(Array.isArray(t.content)?t.content:[],null,"",e);for(const n of Object.values(t.zones??{}))Array.isArray(n)&&b(n,null,"",e);return e}function y(t,e){return _(t).find(n=>String(n.node.props.id)===e)}function v(t,e,n){if(!n)return null;const o=y(e,n);if(!o)return null;const s=u(t,o.node.type),c=o.parent?`${u(t,o.parent.type)} · ${j(o.slot)} ${o.index+1}`:s;return{blockId:n,type:o.node.type,label:c,path:""}}const k="sfDescribedAs";function E(t,e){return{...t,[k]:e}}const $=t=>t.filter(e=>!!e&&typeof e=="object"&&"value"in e).map(e=>typeof e.label=="string"?{value:e.value,label:e.label}:{value:e.value});function m(t){if(!t||typeof t!="object")return null;const e=t;if(typeof e.type!="string")return null;const n=e.type==="custom"?e[k]:void 0,o={type:n?.type??e.type},s=n?.label??e.label;typeof s=="string"&&(o.label=s);const c=n?.options??e.options;Array.isArray(c)&&(o.options=$(c));for(const r of["arrayFields","objectFields"]){const l=n?.[r]??e[r];l&&typeof l=="object"&&(o[r]=h(l))}return o}function h(t){const e={};for(const[n,o]of Object.entries(t??{})){const s=m(o);s&&(e[n]=s)}return e}function O(t){const e={};for(const[n,o]of Object.entries(t.components))o&&(e[n]={label:u(t,n),fields:h(o.fields)});return e}function x(t,e){let n=t;for(const o of e?e.split("."):[]){const s=/^([A-Za-z_][A-Za-z0-9_]*)(?:\[(\d+)\])?$/.exec(o);if(!s||!n||typeof n!="object")return null;n=n[s[1]],s[2]!==void 0&&(n=Array.isArray(n)?n[Number(s[2])]:void 0)}return n&&typeof n=="object"&&!Array.isArray(n)?n:null}function d(t,e){return t.findIndex(n=>p(n)&&String(n.props.id)===e)}function A(t,e,n){const o=e||n;if(!o)return t.length;const s=d(t,o);if(s<0)throw new Error(`there is no top-level block ${o}`);return e?s+1:s}function w(t,e,n,o){const s=structuredClone(e),c=Array.isArray(s.content)?s.content:s.content=[];try{n.forEach((r,l)=>{const a=i=>{throw new Error(`change ${l+1}: ${i}`)};switch(r.op){case"set_props":{const i=y(s,r.block_id)??a(`there is no block ${r.block_id}`);"id"in r.props&&a("a block's id is never changed");const f=x(i.node.props,r.path)??a(`there is no ${r.path} in that block`);Object.assign(f,structuredClone(r.props));break}case"insert_block":{const i=t.components[r.type]??a(`there is no block type ${r.type}`),f=i.defaultProps&&typeof i.defaultProps=="object"?i.defaultProps:{},g={type:r.type,props:{...structuredClone(f),...structuredClone(r.props),id:o(r.type)}};c.splice(A(c,r.after,r.before),0,g);break}case"remove_block":{const i=d(c,r.block_id);i<0&&a(`there is no top-level block ${r.block_id}`),c.splice(i,1);break}case"move_block":{const i=d(c,r.block_id);i<0&&a(`there is no top-level block ${r.block_id}`);const[f]=c.splice(i,1);c.splice(A(c,r.after,r.before),0,f);break}default:a(`"${r.op}" is not a change this editor makes`)}})}catch(r){return{ok:!1,reason:r instanceof Error?r.message:String(r)}}return{ok:!0,document:s}}export{k as FIELD_DESCRIPTION_MARKER,w as applyPageEdits,u as blockLabel,O as describeBlocks,v as describeSelection,E as describedAs};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { EdgeCell } from "efficient-easel/draw";
|
|
2
|
-
export type TickerScroll = "left" | "right" | "up" | "down";
|
|
3
|
-
export declare const DEFAULT_TICKER_SCROLL: TickerScroll;
|
|
4
|
-
export declare const TICKER_SCROLL_OPTIONS: readonly {
|
|
5
|
-
label: string;
|
|
6
|
-
value: TickerScroll;
|
|
7
|
-
cell: EdgeCell;
|
|
8
|
-
}[];
|
|
9
|
-
export declare function parseTickerScroll(value: unknown): TickerScroll;
|
|
10
|
-
export declare function isVerticalScroll(scroll: TickerScroll): boolean;
|
|
11
|
-
export declare function tickerAnimation(scroll: TickerScroll, durationSec: number): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{parseOption as r}from"../parse-option.js";const o="left",l=[{label:"Left",value:"left",cell:"left"},{label:"Right",value:"right",cell:"right"},{label:"Up",value:"up",cell:"top"},{label:"Down",value:"down",cell:"bottom"}],n={left:"storefront-ticker",right:"storefront-ticker-right",up:"storefront-ticker-up",down:"storefront-ticker-down"};function c(t){return r(l,o,t)}function p(t){return t==="up"||t==="down"}function f(t,e){return`${n[t]} ${e}s linear infinite`}export{o as DEFAULT_TICKER_SCROLL,l as TICKER_SCROLL_OPTIONS,p as isVerticalScroll,c as parseTickerScroll,f as tickerAnimation};
|