efficient-web-builder 44.0.1 → 45.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 +0 -4
- package/README.md +8 -0
- 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/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/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/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 +3 -4
- package/dist/editor/lib/document/blocks/shared-fields.js +1 -1
- package/dist/editor/lib/document/box-fields.d.ts +32 -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/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/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-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 +32 -31
- 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-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 +3 -0
- package/dist/format/lib/theme.js +4 -4
- package/dist/render/components/Banner.js +1 -1
- package/dist/render/components/ButtonBlock.d.ts +1 -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/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 +1 -0
- 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/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 +1 -4
- 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 +2 -1
- package/dist/render/components/Split.js +1 -1
- package/dist/render/components/Text.d.ts +2 -0
- 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/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/Flex/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/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/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/part-styles.d.ts +14 -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/sections/section-to-box.d.ts +28 -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
|
@@ -19,9 +19,6 @@ export declare const PART_NUDGE_MAX = 10;
|
|
|
19
19
|
export declare const PART_PADDING_MIN = 0;
|
|
20
20
|
export declare const PART_PADDING_MAX = 64;
|
|
21
21
|
export declare const PART_PADDING_STEP = 2;
|
|
22
|
-
export declare const PART_WIDTH_MIN = 120;
|
|
23
|
-
export declare const PART_WIDTH_MAX = 1280;
|
|
24
|
-
export declare const PART_WIDTH_STEP = 10;
|
|
25
22
|
export declare const PART_MEASURED_TRACKS: {
|
|
26
23
|
readonly size: {
|
|
27
24
|
readonly min: 5;
|
|
@@ -38,11 +35,6 @@ export declare const PART_MEASURED_TRACKS: {
|
|
|
38
35
|
readonly max: 64;
|
|
39
36
|
readonly step: 2;
|
|
40
37
|
};
|
|
41
|
-
readonly width: {
|
|
42
|
-
readonly min: 120;
|
|
43
|
-
readonly max: 1280;
|
|
44
|
-
readonly step: 10;
|
|
45
|
-
};
|
|
46
38
|
};
|
|
47
39
|
export type PartMeasuredProp = keyof typeof PART_MEASURED_TRACKS;
|
|
48
40
|
export declare const PART_LINE_STEP = 0.05;
|
|
@@ -55,12 +47,25 @@ export declare const PART_LETTER_EM_MIN = -1;
|
|
|
55
47
|
export declare const PART_LETTER_EM_MAX = 1;
|
|
56
48
|
export declare const PART_PARAGRAPH_MIN = 0;
|
|
57
49
|
export declare const PART_PARAGRAPH_MAX = 400;
|
|
50
|
+
export declare const PART_SIZE_STEPS: readonly string[];
|
|
51
|
+
export type PartSizeToken = {
|
|
52
|
+
step: string;
|
|
53
|
+
px: number;
|
|
54
|
+
stepPhone?: string;
|
|
55
|
+
pxPhone?: number;
|
|
56
|
+
fluid?: {
|
|
57
|
+
minPx: number;
|
|
58
|
+
vw: number;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
58
61
|
export type PartStyle = {
|
|
59
62
|
font?: string;
|
|
60
63
|
role?: FontRole;
|
|
64
|
+
fontRole?: FontRole;
|
|
61
65
|
textStyle?: string;
|
|
62
66
|
weight?: PartWeight;
|
|
63
67
|
size?: number;
|
|
68
|
+
sizeToken?: PartSizeToken;
|
|
64
69
|
line?: number;
|
|
65
70
|
letter?: number;
|
|
66
71
|
lineHeight?: number;
|
|
@@ -69,7 +74,6 @@ export type PartStyle = {
|
|
|
69
74
|
case?: TextStyleCase;
|
|
70
75
|
align?: PartAlign;
|
|
71
76
|
padding?: number;
|
|
72
|
-
width?: number;
|
|
73
77
|
color?: string;
|
|
74
78
|
italic?: boolean;
|
|
75
79
|
sizePhone?: number;
|
|
@@ -83,7 +87,6 @@ export type PartStyleBase = {
|
|
|
83
87
|
align: PartAlign;
|
|
84
88
|
case: TextStyleCase;
|
|
85
89
|
paddingPx: number;
|
|
86
|
-
widthPx: number;
|
|
87
90
|
};
|
|
88
91
|
export type PartStyles = Record<string, PartStyle>;
|
|
89
92
|
export type StyledPartEl = PartEl & {
|
|
@@ -113,7 +116,6 @@ export declare const PART_PARAGRAPH_VAR = "--sf-part-para";
|
|
|
113
116
|
export declare function partPhoneDeclarations(style: PartStyle): Record<string, string>;
|
|
114
117
|
export declare function partStyleForScreen(style: PartStyle, phone: boolean): PartStyle;
|
|
115
118
|
export declare function partStyleDeclarations(style: PartStyle, base: PartStyleBase, options?: PartDeclarationOptions): Record<string, string>;
|
|
116
|
-
export declare function isHexColour(value: string): boolean;
|
|
117
119
|
export type MeasuredPartStyle = {
|
|
118
120
|
fontSize: string;
|
|
119
121
|
fontWeight: string;
|
|
@@ -122,7 +124,6 @@ export type MeasuredPartStyle = {
|
|
|
122
124
|
textAlign: string;
|
|
123
125
|
textTransform: string;
|
|
124
126
|
paddingTop: string;
|
|
125
|
-
maxWidth: string;
|
|
126
127
|
};
|
|
127
128
|
export declare function partStyleBase(measured: MeasuredPartStyle, fontKey: string): PartStyleBase;
|
|
128
129
|
export declare function partFontKeyOf(family: string, resolve: (cssVar: string) => string): string;
|
|
@@ -148,5 +149,5 @@ export declare function publishedPartStyles(needles: readonly PartNeedle[], styl
|
|
|
148
149
|
export declare function isPartKindKey(key: string): boolean;
|
|
149
150
|
export declare function partRuleForKind(sheet: PublishedPartSheet | null, kind: string): PublishedPartRule | null;
|
|
150
151
|
export declare function partStyleCss(sheet: PublishedPartSheet): string;
|
|
151
|
-
export declare function paragraphRules(scope: string): string[];
|
|
152
|
+
export declare function paragraphRules(scope: string, paragraph: string): string[];
|
|
152
153
|
export declare function partRuleForText(sheet: PublishedPartSheet | null, value: string): PublishedPartRule | null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{textStyleCaseCss as q,textStyleCaseOfCss as J}from"efficient-easel/draw";import{FONT_OPTIONS as Q,FONT_ROLES as O,fontOption as v,SIZE_STEP_OF_ROLE as tt}from"../../../format/lib/fonts.js";import{encodePartKey as et}from"../../../format/lib/document/part-key.js";import{decodePartId as H,normalizePartText as N}from"./text-parts.js";import{COLOUR_TOKEN as F}from"../../../format/lib/word-styles.js";import{PHONE_MEDIA as nt}from"../content/view-values.js";const w="_partStyles",rt="data-sf-part-styled",L="data-sf-text-style",ot=/^(heading|body)-[1-7]$/;function S(t){return typeof t=="string"&&ot.test(t)}const z={heading:"heading-1",heading2:"heading-2",heading3:"heading-3",body:"body-1",label:"body-5"};function it(t){if(!t)return null;for(const[e,n]of Object.entries(z))if(n===t)return e;return null}function re(t){if(S(t.textStyle))return t.textStyle;const e=t.role&&O.includes(t.role)?t.role:null;return e?z[e]:void 0}const st=[400,500,600,700],k=["left","center","right","justify"],D=5,j=1e3,at=-5,ct=10,lt=0,ft=64,ut=2,pt=120,E=1280,dt=10,W={size:{min:D,max:j,step:1},sizePhone:{min:D,max:j,step:1},padding:{min:lt,max:ft,step:ut},width:{min:pt,max:E,step:dt}},xt=.05,ht=.01,gt=["line","letter"],St=.5,mt=2.5,Pt=-1,Tt=1,_t=0,bt=400;function T(t){return!t||typeof t!="object"||Array.isArray(t)?null:t}function C(t){return T(t?.[w])??{}}function K(t,e){const n=C(t);return Object.hasOwn(n,e)?T(n[e])??{}:{}}function oe(t,e){return Object.values(K(t,e)).filter(n=>n!==void 0).length}function G(t,e,n){const r={...C(t)};if(At(n).length?r[e]=n:delete r[e],!Object.keys(r).length){const{[w]:o,...i}=t;return i}return{...t,[w]:r}}function At(t){return Object.entries(t).filter(([,e])=>e!==void 0)}function Rt(t){return gt.includes(t)}const _=(t,e,n)=>Math.min(n,Math.max(e,t));function Et(t,e){if(Rt(t)){const n=Math.round(Number(e));return!Number.isFinite(n)||n===0?null:_(n,at,ct)}if(t==="lineHeight"){const n=Number(e);return Number.isFinite(n)?m(_(n,St,mt),3):null}if(t==="letterSpacing"){const n=Number(e);return Number.isFinite(n)?m(_(n,Pt,Tt),4):null}if(t==="paragraphSpacing"){const n=Math.round(Number(e));return!Number.isFinite(n)||n<=0?null:_(n,_t,bt)}if(Object.hasOwn(W,t)){const{min:n,max:r}=W[t],o=Math.round(Number(e));return Number.isFinite(o)?_(o,n,r):null}return t==="italic"?typeof e=="boolean"?e:null:t==="role"?O.includes(String(e))?e:null:t==="textStyle"?S(e)?e:null:e}const yt=["weight","size","sizePhone","line","letter","lineHeight","letterSpacing","paragraphSpacing","padding","width"];function X(t){let e=null;const n=r=>{e??={...t},delete e[r]};for(const r of yt){const o=t[r];o!==void 0&&!(typeof o=="number"&&Number.isFinite(o))&&n(r)}return t.align!==void 0&&!k.includes(t.align)&&n("align"),t.textStyle!==void 0&&!S(t.textStyle)&&n("textStyle"),e??t}const Ot=[["font","role"],["role","textStyle"],["line","lineHeight"],["letter","letterSpacing"]];function Nt(t){const e=[];for(const[n,r]of Ot)n===t?e.push(r):r===t&&e.push(n);return e}function ie(t,e,n,r){const o={...K(t,e)},i=r==null?null:Et(n,r);if(i===null)delete o[n];else{o[n]=i;for(const s of Nt(n))delete o[s]}return G(t,e,o)}function se(t,e){return G(t,e,{})}function wt(t){return J(t)??"none"}function It(t){return q(t)??""}const $t={heading:"--font-role-heading",heading2:"--font-role-heading2",heading3:"--font-role-heading3",body:"--font-role-body",accent:"--font-role-accent",label:"--font-role-label"};function Mt(t,e){const n=t.role;return n&&O.includes(n)?n:e?.blockDrawsStyle?null:it(t.textStyle)}function ae(t,e){return t==="Text"&&e==="text"}const Ht={headingLarge:"min(clamp(64px,9vw,144px), var(--sf-heading-max,9999px))",headingMedium:"min(32px, var(--sf-heading-max,9999px))",headingSmall:"min(24px, var(--sf-heading-max,9999px))",accent:"32px",body:"14px",label:"12px"};function Ft(t){const e=tt[t],n=Ht[e];return n?`var(--size-${e}, ${n})`:`var(--size-${e})`}function Lt(t){const e={};return typeof t.lineHeight=="number"?e.lineHeight=t.lineHeight:t.line&&(e.lineHeight=m(zt+t.line*xt,3)),typeof t.letterSpacing=="number"?e.letterSpacingEm=t.letterSpacing:t.letter&&(e.letterSpacingEm=m(t.letter*ht,4)),e}const zt=1,b="--sf-part-para";function U(t){return t=X(t),typeof t.sizePhone=="number"&&t.sizePhone>0?{fontSize:`${t.sizePhone}px`}:{}}function kt(t,e){return e&&typeof t.sizePhone=="number"&&t.sizePhone>0?{...t,size:t.sizePhone}:t}function y(t,e,n){t=X(t);const r=Mt(t,n),o=Lt(t),i=t.size?`${t.size}px`:r?Ft(r):"";return{fontFamily:t.font?Ct(t.font):r?`var(${$t[r]})`:"",fontWeight:t.weight?String(t.weight):"",fontSize:i,minWidth:i?"0":"",overflowWrap:i?"break-word":"",lineHeight:o.lineHeight!==void 0?String(o.lineHeight):"",letterSpacing:o.letterSpacingEm!==void 0?`${o.letterSpacingEm}em`:"",[b]:t.paragraphSpacing?`${t.paragraphSpacing}px`:"",textTransform:It(t.case),textAlign:t.align??"",paddingTop:I(t.padding),paddingBottom:I(t.padding),maxWidth:I(t.width),color:Dt(t.color),fontStyle:t.italic===!0?"italic":t.italic===!1?"normal":""}}const Dt=t=>t===void 0||t===""?"":Object.hasOwn(F,t)?F[t]:B.test(t)?t:"",B=/^#[0-9a-fA-F]{6}$/;function ce(t){return B.test(t)}const I=t=>t===void 0?"":`${t}px`,m=(t,e)=>Number(t.toFixed(e));function le(t,e){const n=Number.parseFloat(t.fontSize)||16,r=Number.parseFloat(t.lineHeight),o=Number.parseFloat(t.letterSpacing),i=Number.parseFloat(t.paddingTop),s=Number.parseFloat(t.maxWidth);return{fontKey:e,sizePx:n,weight:jt(Number.parseInt(t.fontWeight,10)),lineRatio:Number.isFinite(r)?m(r/n,3):1.2,letterEm:Number.isFinite(o)?m(o/n,4):0,align:Wt(t.textAlign),case:wt(t.textTransform),paddingPx:Number.isFinite(i)?Math.round(i):0,widthPx:Number.isFinite(s)&&s<E?Math.round(s):E}}function jt(t){return Number.isFinite(t)?st.reduce((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e):400}function Wt(t){for(const e of k)if(e===t)return e;return t==="end"?"right":"left"}function fe(t,e){const n=V(t);if(!n)return"";for(const r of Q)if(V(e(r.cssVar))===n)return r.key;return""}const V=t=>(t.split(",")[0]??"").replace(/["']/g,"").replace(/\s+/g," ").trim().toLowerCase();function Ct(t){const e=v(t);return e?`var(${e.cssVar})`:""}function ue(t,e,n,r){return!e||H(e)?.nodeId!==t?null:n.find(i=>r(i.getAttribute("class")))??n[0]??null}function pe(t,e,n=()=>A,r=d=>d,o=Xt,i=!1,s=()=>!1){let d=0;for(const{element:a,partId:c}of t){const u=H(c)?.propKey;if(!u)continue;const l=r(u),p=Object.hasOwn(e,l)?T(e[l])??{}:{},f=y(kt(p,i),A,{blockDrawsStyle:s(u)});S(p.textStyle)?a.setAttribute?.(L,p.textStyle):a.removeAttribute?.(L);const g=M.some(h=>a.style[h]);let x=!1;for(const[h,P]of Object.entries(f))Ut(a,h,P),P&&(x=!0);if(g||M.some(h=>f[h]))for(const h of Kt(a,o))for(const P of M)h.style[P]=f[P]??"";x&&(d+=1)}return d}function Kt(t,e){const n=N(t.textContent??""),r=[];let o=t;for(let i=0;i<Gt&&e(o);i+=1){const s=o.parentElement;if(!s||N(s.textContent??"")!==n)break;r.push(s),o=s}return r}const Gt=8;function Xt(t){const e=t;return typeof window>"u"||!e?.ownerDocument?!1:window.getComputedStyle(e).display==="inline"}const A={fontKey:"",sizePx:16,weight:400,lineRatio:1,letterEm:0,align:"left",case:"none",paddingPx:0,widthPx:E};function Ut(t,e,n){if(!e.startsWith("--")){t.style[e]=n;return}const r=t.style;typeof r.setProperty=="function"?n?r.setProperty(e,n):r.removeProperty?.(e):r[e]=n;const o=t;e===b&&(n?o.setAttribute?.(Y,""):o.removeAttribute?.(Y))}const Y="data-sf-part-para",Bt=Object.keys(y({},A)),$=new Set(["color","overflowWrap",b,"fontStyle"]),M=Bt.filter(t=>!$.has(t));function de(t,e,n,r=i=>i,o=()=>!1){const i=new Map;for(const a of t){const c=et(a.key,a.row);for(const u of a.texts){const l=i.get(u);l?(l.keys.add(a.key),l.partKeys.add(c)):i.set(u,{keys:new Set([a.key]),partKeys:new Set([c])})}}const s=new Map;for(const a of Object.keys(e)){if(!Vt(a))continue;const c=T(e[a])??{},u=y(c,A),l=U(c),p=S(c.textStyle)?c.textStyle:void 0;!Object.values(u).some(Boolean)&&!Object.keys(l).length&&!p||s.set(a,{stamp:Z(n,a),declarations:u,...Object.keys(l).length?{phone:l}:{},...p?{textStyle:p}:{}})}const d=new Map;for(const[a,{keys:c,partKeys:u}]of i){const l=u.size===1?[...u][0]:c.size===1?[...c][0]:null;if(!l)continue;const p=r(l);if(!Object.hasOwn(e,p))continue;const f=T(e[p])??{},g=y(f,A,{blockDrawsStyle:o(l)}),x=U(f),R=S(f.textStyle)?f.textStyle:void 0;!Object.values(g).some(Boolean)&&!Object.keys(x).length&&!R||d.set(a,{stamp:Z(n,l),declarations:g,...Object.keys(x).length?{phone:x}:{},...R?{textStyle:R}:{}})}return d.size||s.size?{rules:d,kindRules:s,drawn:new Set(i.keys())}:null}function Vt(t){return t.startsWith("@")}function xe(t,e){return t?.kindRules.get(e)??null}function Z(t,e){const n=r=>r.replace(/[^A-Za-z0-9_-]+/g,"-");return`${n(t)}~${n(e)}`}function he(t){const e=[],n=new Set,r=o=>{const{stamp:i,declarations:s}=o;if(n.has(i))return;n.add(i);const d=Object.entries(s).filter(([,f])=>f!==""),a=f=>f.map(([g,x])=>`${Zt(g)}: ${x}`).join("; "),c=`[${rt}="${i}"]`,u=d.filter(([f])=>!$.has(f)),l=d.filter(([f])=>$.has(f));u.length&&e.push(`${c}, *:has(> ${c}) { ${a(u)} }`),l.length&&e.push(`${c} { ${a(l)} }`),s[b]&&e.push(...Yt(c));const p=Object.entries(o.phone??{}).filter(([,f])=>f!=="");p.length&&e.push(`@media ${nt} { ${c}, *:has(> ${c}) { ${a(p)} } }`)};for(const o of t.rules.values())r(o);for(const o of t.kindRules.values())r(o);return e.join(`
|
|
2
|
-
`)}function
|
|
1
|
+
import{textStyleCaseCss as v,textStyleCaseOfCss as tt}from"efficient-easel/draw";import{parseHexColor as et}from"efficient-shell/format";import{FONT_OPTIONS as nt,fontOption as rt,fontRoleOf as E,SIZE_STEP_OF_ROLE as I}from"../../../format/lib/fonts.js";import{encodePartKey as ot}from"../../../format/lib/document/part-key.js";import{decodePartId as k,normalizePartText as O}from"./text-parts.js";import{COLOUR_TOKEN as M}from"../../../format/lib/word-styles.js";import{PHONE_MEDIA as it}from"../content/view-values.js";const N="_partStyles",st="data-sf-part-styled",F="data-sf-text-style",ct=/^(heading|body)-[1-7]$/;function m(t){return typeof t=="string"&&ct.test(t)}const L={heading:"heading-1",heading2:"heading-2",heading3:"heading-3",body:"body-1",label:"body-5"};function at(t){if(!t)return null;for(const[e,n]of Object.entries(L))if(n===t)return e;return null}function se(t){if(m(t.textStyle))return t.textStyle;const e=E(t.role);return e?L[e]:void 0}const ft=[400,500,600,700],j=["left","center","right","justify"],H=5,D=1e3,lt=-5,ut=10,pt=0,dt=64,xt=2,C={size:{min:H,max:D,step:1},sizePhone:{min:H,max:D,step:1},padding:{min:pt,max:dt,step:xt}},ht=.05,St=.01,gt=["line","letter"],mt=.5,Pt=2.5,Tt=-1,bt=1,_t=0,Rt=400,At=[...new Set(Object.values(I))];function b(t){return!t||typeof t!="object"||Array.isArray(t)?null:t}function K(t){return b(t?.[N])??{}}function W(t,e){const n=K(t);return Object.hasOwn(n,e)?b(n[e])??{}:{}}function ce(t,e){return Object.values(W(t,e)).filter(n=>n!==void 0).length}function G(t,e,n){const r={...K(t)};if(Et(n).length?r[e]=n:delete r[e],!Object.keys(r).length){const{[N]:o,...i}=t;return i}return{...t,[N]:r}}function Et(t){return Object.entries(t).filter(([,e])=>e!==void 0)}function yt(t){return gt.includes(t)}const _=(t,e,n)=>Math.min(n,Math.max(e,t));function Ot(t,e){if(yt(t)){const n=Math.round(Number(e));return!Number.isFinite(n)||n===0?null:_(n,lt,ut)}if(t==="lineHeight"){const n=Number(e);return Number.isFinite(n)?P(_(n,mt,Pt),3):null}if(t==="letterSpacing"){const n=Number(e);return Number.isFinite(n)?P(_(n,Tt,bt),4):null}if(t==="paragraphSpacing"){const n=Math.round(Number(e));return!Number.isFinite(n)||n<=0?null:_(n,_t,Rt)}if(Object.hasOwn(C,t)){const{min:n,max:r}=C[t],o=Math.round(Number(e));return Number.isFinite(o)?_(o,n,r):null}return t==="italic"?typeof e=="boolean"?e:null:t==="role"||t==="fontRole"?E(e)?e:null:t==="sizeToken"?$(e)?e:null:t==="textStyle"?m(e)?e:null:e}const Nt=["weight","size","sizePhone","line","letter","lineHeight","letterSpacing","paragraphSpacing","padding"];function X(t){let e=null;const n=r=>{e??={...t},delete e[r]};for(const r of Nt){const o=t[r];o!==void 0&&!(typeof o=="number"&&Number.isFinite(o))&&n(r)}return t.align!==void 0&&!j.includes(t.align)&&n("align"),t.textStyle!==void 0&&!m(t.textStyle)&&n("textStyle"),t.sizeToken!==void 0&&!$(t.sizeToken)&&n("sizeToken"),t.fontRole!==void 0&&!E(t.fontRole)&&n("fontRole"),e??t}function $(t){if(!t||typeof t!="object")return!1;const{step:e,px:n,stepPhone:r,pxPhone:o,fluid:i}=t,c=s=>typeof s=="number"&&Number.isFinite(s)&&s>0,p=s=>typeof s=="string"&&At.includes(s);return p(e)&&c(n)&&(r===void 0||p(r))&&(o===void 0||c(o))&&(i===void 0||$t(i,n))}function $t(t,e){if(!t||typeof t!="object"||Array.isArray(t))return!1;const{minPx:n,vw:r,...o}=t;return Object.keys(o).length===0&&typeof n=="number"&&Number.isFinite(n)&&n>0&&n<e&&typeof r=="number"&&Number.isFinite(r)&&r>0&&r<=100}function U(t){return t?.pxPhone&&$(t)?{step:t.stepPhone??t.step,px:t.pxPhone}:null}function B({step:t,px:e,fluid:n}){const r=n?`clamp(${n.minPx}px, ${n.vw}vw, ${e}px)`:`${e}px`,o=`var(--size-${t}, ${r})`;return t.startsWith("heading")?`min(${o}, var(--sf-heading-max,9999px))`:o}const wt=[["font","role"],["font","fontRole"],["role","textStyle"],["line","lineHeight"],["letter","letterSpacing"]];function zt(t){const e=[];for(const[n,r]of wt)n===t?e.push(r):r===t&&e.push(n);return e}function ae(t,e,n,r){const o={...W(t,e)},i=r==null?null:Ot(n,r);if(i===null)delete o[n];else{o[n]=i;for(const c of zt(n))delete o[c]}return G(t,e,o)}function fe(t,e){return G(t,e,{})}function It(t){return tt(t)??"none"}function kt(t){return v(t)??""}const V={heading:"--font-role-heading",heading2:"--font-role-heading2",heading3:"--font-role-heading3",body:"--font-role-body",accent:"--font-role-accent",label:"--font-role-label"};function Mt(t,e){const n=E(t.role);return n||(e?.blockDrawsStyle?null:at(t.textStyle))}function le(t,e){return t==="Text"&&e==="text"}const Ft={headingLarge:"min(clamp(64px,9vw,144px), var(--sf-heading-max,9999px))",headingMedium:"min(32px, var(--sf-heading-max,9999px))",headingSmall:"min(24px, var(--sf-heading-max,9999px))",accent:"32px",body:"14px",label:"12px"};function Lt(t){const e=I[t],n=Ft[e];return n?`var(--size-${e}, ${n})`:`var(--size-${e})`}function jt(t){const e={};return typeof t.lineHeight=="number"?e.lineHeight=t.lineHeight:t.line&&(e.lineHeight=P(Ht+t.line*ht,3)),typeof t.letterSpacing=="number"?e.letterSpacingEm=t.letterSpacing:t.letter&&(e.letterSpacingEm=P(t.letter*St,4)),e}const Ht=1,S="--sf-part-para";function Y(t){if(t=X(t),typeof t.sizePhone=="number"&&t.sizePhone>0)return{fontSize:`${t.sizePhone}px`};const e=U(t.sizeToken);return e?{fontSize:B(e)}:{}}function Dt(t,e){if(!e)return t;if(typeof t.sizePhone=="number"&&t.sizePhone>0)return{...t,size:t.sizePhone};const n=U(t.sizeToken);return n?{...t,size:void 0,sizeToken:n}:t}function y(t,e,n){t=X(t);const r=Mt(t,n),o=jt(t),i=t.size?`${t.size}px`:t.sizeToken?B(t.sizeToken):r?Lt(r):"";return{fontFamily:t.font?Gt(t.font):t.fontRole?`var(${V[t.fontRole]})`:r?`var(${V[r]})`:"",fontWeight:t.weight?String(t.weight):"",fontSize:i,minWidth:i?"0":"",overflowWrap:i?"break-word":"",lineHeight:o.lineHeight!==void 0?String(o.lineHeight):"",letterSpacing:o.letterSpacingEm!==void 0?`${o.letterSpacingEm}em`:"",[S]:t.paragraphSpacing?`${t.paragraphSpacing}px`:"",textTransform:kt(t.case),textAlign:t.align??"",paddingTop:Z(t.padding),paddingBottom:Z(t.padding),color:Ct(t.color),fontStyle:t.italic===!0?"italic":t.italic===!1?"normal":""}}const Ct=t=>t===void 0||t===""?"":Object.hasOwn(M,t)?M[t]:et(t)===t.toLowerCase()?t:"",Z=t=>t===void 0?"":`${t}px`,P=(t,e)=>Number(t.toFixed(e));function ue(t,e){const n=Number.parseFloat(t.fontSize)||16,r=Number.parseFloat(t.lineHeight),o=Number.parseFloat(t.letterSpacing),i=Number.parseFloat(t.paddingTop);return{fontKey:e,sizePx:n,weight:Kt(Number.parseInt(t.fontWeight,10)),lineRatio:Number.isFinite(r)?P(r/n,3):1.2,letterEm:Number.isFinite(o)?P(o/n,4):0,align:Wt(t.textAlign),case:It(t.textTransform),paddingPx:Number.isFinite(i)?Math.round(i):0}}function Kt(t){return Number.isFinite(t)?ft.reduce((e,n)=>Math.abs(n-t)<Math.abs(e-t)?n:e):400}function Wt(t){for(const e of j)if(e===t)return e;return t==="end"?"right":"left"}function pe(t,e){const n=q(t);if(!n)return"";for(const r of nt)if(q(e(r.cssVar))===n)return r.key;return""}const q=t=>(t.split(",")[0]??"").replace(/["']/g,"").replace(/\s+/g," ").trim().toLowerCase();function Gt(t){const e=rt(t);return e?`var(${e.cssVar})`:""}function de(t,e,n,r){return!e||k(e)?.nodeId!==t?null:n.find(i=>r(i.getAttribute("class")))??n[0]??null}function xe(t,e,n=()=>R,r=p=>p,o=Bt,i=!1,c=()=>!1){let p=0;for(const{element:s,partId:a}of t){const u=k(a)?.propKey;if(!u)continue;const f=r(u),d=Object.hasOwn(e,f)?b(e[f])??{}:{},l=y(Dt(d,i),R,{blockDrawsStyle:c(u)});m(d.textStyle)?s.setAttribute?.(F,d.textStyle):s.removeAttribute?.(F);const g=z.some(h=>s.style[h]);let x=!1;for(const[h,T]of Object.entries(l))Vt(s,h,T),T&&(x=!0);if(g||z.some(h=>l[h]))for(const h of Xt(s,o))for(const T of z)h.style[T]=l[T]??"";x&&(p+=1)}return p}function Xt(t,e){const n=O(t.textContent??""),r=[];let o=t;for(let i=0;i<Ut&&e(o);i+=1){const c=o.parentElement;if(!c||O(c.textContent??"")!==n)break;r.push(c),o=c}return r}const Ut=8;function Bt(t){const e=t;return typeof window>"u"||!e?.ownerDocument?!1:window.getComputedStyle(e).display==="inline"}const R={fontKey:"",sizePx:16,weight:400,lineRatio:1,letterEm:0,align:"left",case:"none",paddingPx:0};function Vt(t,e,n){if(!e.startsWith("--")){t.style[e]=n;return}const r=t.style;typeof r.setProperty=="function"?n?r.setProperty(e,n):r.removeProperty?.(e):r[e]=n;const o=t;e===S&&(n?o.setAttribute?.(J,""):o.removeAttribute?.(J))}const J="data-sf-part-para",Yt=Object.keys(y({},R)),w=new Set(["color","overflowWrap",S,"fontStyle"]),z=Yt.filter(t=>!w.has(t));function he(t,e,n,r=i=>i,o=()=>!1){const i=new Map;for(const s of t){const a=ot(s.key,s.row);for(const u of s.texts){const f=i.get(u);f?(f.keys.add(s.key),f.partKeys.add(a)):i.set(u,{keys:new Set([s.key]),partKeys:new Set([a])})}}const c=new Map;for(const s of Object.keys(e)){if(!Zt(s))continue;const a=b(e[s])??{},u=y(a,R),f=Y(a),d=m(a.textStyle)?a.textStyle:void 0;!Object.values(u).some(Boolean)&&!Object.keys(f).length&&!d||c.set(s,{stamp:Q(n,s),declarations:u,...Object.keys(f).length?{phone:f}:{},...d?{textStyle:d}:{}})}const p=new Map;for(const[s,{keys:a,partKeys:u}]of i){const f=u.size===1?[...u][0]:a.size===1?[...a][0]:null;if(!f)continue;const d=r(f);if(!Object.hasOwn(e,d))continue;const l=b(e[d])??{},g=y(l,R,{blockDrawsStyle:o(f)}),x=Y(l),A=m(l.textStyle)?l.textStyle:void 0;!Object.values(g).some(Boolean)&&!Object.keys(x).length&&!A||p.set(s,{stamp:Q(n,f),declarations:g,...Object.keys(x).length?{phone:x}:{},...A?{textStyle:A}:{}})}return p.size||c.size?{rules:p,kindRules:c,drawn:new Set(i.keys())}:null}function Zt(t){return t.startsWith("@")}function Se(t,e){return t?.kindRules.get(e)??null}function Q(t,e){const n=r=>r.replace(/[^A-Za-z0-9_-]+/g,"-");return`${n(t)}~${n(e)}`}function ge(t){const e=[],n=new Set,r=o=>{const{stamp:i,declarations:c}=o;if(n.has(i))return;n.add(i);const p=Object.entries(c).filter(([,l])=>l!==""),s=l=>l.map(([g,x])=>`${Jt(g)}: ${x}`).join("; "),a=`[${st}="${i}"]`,u=p.filter(([l])=>!w.has(l)),f=p.filter(([l])=>w.has(l));u.length&&e.push(`${a}, *:has(> ${a}) { ${s(u)} }`),f.length&&e.push(`${a} { ${s(f)} }`),c[S]&&(e.push(`*:has(> ${a}) { ${S}: ${c[S]} }`),e.push(...qt(a,`*:has(> ${a})`)));const d=Object.entries(o.phone??{}).filter(([,l])=>l!=="");d.length&&e.push(`@media ${it} { ${a}, *:has(> ${a}) { ${s(d)} } }`)};for(const o of t.rules.values())r(o);for(const o of t.kindRules.values())r(o);return e.join(`
|
|
2
|
+
`)}function qt(t,e){const n=`var(${S})`,r=":is([data-sf-bullet], [data-sf-number])";return[`${t} br:not(br + br) { display: block; content: ""; margin-top: ${n} }`,`${t} ${r}:not(:first-child) { margin-top: ${n} }`,`${t} ${r}:not(:last-child) { margin-bottom: ${n} }`,`:is(${e}) + :is(${e}) { margin-top: ${n} }`]}const Jt=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`);function me(t,e){if(!t)return null;const n=O(e),r=t.rules.get(n);if(r)return r;if(n.length<Qt||t.drawn.has(n))return null;let o=null;for(const[i,c]of t.rules)if(i.includes(n)){if(o&&o.stamp!==c.stamp)return null;o=c}return o}const Qt=8;export{j as PART_ALIGNS,bt as PART_LETTER_EM_MAX,Tt as PART_LETTER_EM_MIN,St as PART_LETTER_STEP,Pt as PART_LINE_HEIGHT_MAX,mt as PART_LINE_HEIGHT_MIN,ht as PART_LINE_STEP,C as PART_MEASURED_TRACKS,ut as PART_NUDGE_MAX,lt as PART_NUDGE_MIN,dt as PART_PADDING_MAX,pt as PART_PADDING_MIN,xt as PART_PADDING_STEP,J as PART_PARAGRAPH_ATTR,Rt as PART_PARAGRAPH_MAX,_t as PART_PARAGRAPH_MIN,S as PART_PARAGRAPH_VAR,gt as PART_RELATIVE_PROPS,D as PART_SIZE_MAX,H as PART_SIZE_MIN,At as PART_SIZE_STEPS,st as PART_STYLED_ATTR,N as PART_STYLES_PROP,Yt as PART_STYLE_PROPERTIES,ft as PART_WEIGHTS,z as SHARED_PART_PROPERTIES,L as STYLE_ID_OF_ROLE,F as TEXT_STYLE_ATTR,xe as applyPartStyles,le as blockDrawsTextStyle,se as followedStyleOf,Zt as isPartKindKey,m as isTextStyleId,qt as paragraphRules,It as partCaseOfTransform,kt as partCaseTransform,pe as partFontKeyOf,Y as partPhoneDeclarations,Se as partRuleForKind,me as partRuleForText,jt as partSpacingOf,ue as partStyleBase,ce as partStyleCount,ge as partStyleCss,y as partStyleDeclarations,Dt as partStyleForScreen,de as partStyleSource,ae as propsWithPartStyleValue,fe as propsWithoutPartStyle,he as publishedPartStyles,W as readPartStyle,K as readPartStyles};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as H}from"react/jsx-runtime";import{phoneKey as o}from"efficient-easel/draw";import{BLOCK_SIZE_KEYS as N,blockSizeOf as z,parseBlockWidthFit as R}from"../../../../format/lib/content/block-size.js";import{boxPhoneRowFits as j,boxShareClasses as D}from"../../../../format/lib/content/box-layout.js";import{resolveContainerDirection as K}from"../../../../format/lib/content/container-direction.js";import{containerBlocksFor as P}from"../../../../format/lib/document/container-blocks.js";import{readPartStyle as C}from"../part-styles.js";import{addShowWhenFacts as A,withRowRules as h}from"../../../../format/lib/document/show-when-attach.js";import{BOX_BLOCK_KEYS as L}from"./cell-width.js";import{findParentNode as v}from"../../../../format/lib/document/passes/document-position.js";const Z=new Set(["Text","Heading"]),G=new Set(["h1","h2","h3","h4","h5","h6"]);function _(t,e){return t==="Heading"?!0:t!=="Text"?!1:typeof e.tag=="string"&&G.has(e.tag)?!0:C(e,"text").textStyle?.startsWith("heading-")===!0}const c={not:{context:"blockOutsideBox",is:!0}},m={all:[c,{not:{context:"boxSharesWidth",is:!0}}]},g={all:[c,{not:{context:"boxSharesWidthPhone",is:!0}}]};function O(t,e,n){return{any:[{field:o(t),is:e},{all:[{field:o(t),set:!1},n??{field:t,is:e}]}]}}const b={any:[{field:"textFit",is:"shrink"},{all:[{field:"textFit",set:!1},{not:{context:"textWrapsByDefault",is:!0}}]}]},X=[[["_gBlockSize","minWidth",o("minWidth"),"maxWidth",o("maxWidth")],c],[["widthFit"],m],[[o("widthFit")],g],[["width"],{all:[m,{field:"widthFit",is:"fixed"}]}],[[o("width")],{all:[g,O("widthFit","fixed")]}]],k=[[["_gText","textFit",o("textFit")],c],[["minFont"],{all:[c,b]}],[[o("minFont")],{all:[c,O("textFit","shrink",b)]}]],u=(t,e)=>v(e.appState,t.props?.id),x=t=>!!t&&typeof t.type=="string"&&P(t.type)!==null,B=t=>(t.type==="Flex"||t.type==="HeroGroup")&&K(t.type,t.props?.direction)==="row",W=t=>{const e=R(t);return e!==void 0&&e!=="fit"},U={blockOutsideBox:(t,e)=>!x(u(t,e)),boxSharesWidth:(t,e)=>{const n=u(t,e);return x(n)&&B(n)&&D(n.props?.share)!==""&&!W(t.props?.widthFit)},boxSharesWidthPhone:(t,e)=>{const n=u(t,e);if(!x(n)||!B(n))return!1;const i=n.props?.phoneRow;return(Number(i)===2||Number(i)===3)&&!j(i,n.props?.[o("share")])&&!W(t.props?.[o("widthFit")]??t.props?.widthFit)}},Y=t=>/^_[gds][A-Z]/.test(t);function M(t,e,n){const i=Object.entries(t),s=i.findIndex(([l])=>l===e);if(s===-1)return null;let r=s+1;for(;r<i.length&&!Y(i[r][0]);)r++;return Object.fromEntries([...i.slice(0,r),...Object.entries(n),...i.slice(r)])}function T(t,e,n){const i=Object.entries(t);return Object.fromEntries([...i.slice(0,e),...Object.entries(n),...i.slice(e)])}function V(t,e,n){const i=Object.keys(e);if(i.includes("_dSize")){const{_gBlockSize:s,...r}=n;return T(e,i.indexOf("_dSize")+1,r)}return q.has(t)&&i.includes("_gSpacing")?T(e,i.indexOf("_gSpacing"),n):{...e,...n}}const q=new Set(["Text","Heading"]);function J(t,e){const{_gText:n,...i}=e;return M(t,"_gText",i)??{...t,...e}}function Q(t){const e=new WeakMap;return n=>{if(!n||!("textFit"in n))return n;let i=e.get(n);if(!i){i={...n};for(const s of["textFit",o("textFit")])s in i&&(i[s]=t[s]);e.set(n,i)}return i}}const dt={name:"blockSize",applies:(t,e,n)=>L.includes(t)&&!!n&&typeof n.render=="function",panel(t,e,n){const i=Z.has(e),{size:s,text:r}=n.blockSizeFields(i?{textFit:e==="Heading"?"shrink":"wrap"}:{});let l=V(e,t.fields??{},h(s,X));if(i){const f=h(r,k);if(l=J(l,f),e==="Text"){const y=h(n.blockSizeFields({textFit:"shrink"}).text,k),E=Q(y),p=t.resolveFields,I=(S,a)=>{const d=p?p(S,a):a.fields,w=F=>_(e,S?.props??{})?E(F??a.fields):F;return d instanceof Promise?d.then(w):w(d)};t.resolveFields=I}}t.fields=l,A(t,{...U,textWrapsByDefault:f=>!_(e,f.props??{})})},draw(t){tt(t)}};function $(t){const e={};for(const n of N){const i=t[n],s=t[o(n)];(i!==void 0||s!==void 0)&&(e[n]={desktop:i,phone:s})}return e}function tt(t){const e=t.render;t.render=n=>{const i=z($(n)),s=e(n);return i===null?s:H("div",{className:i.className,...Object.keys(i.style).length?{style:i.style}:{},...i.attrs,children:s})}}export{dt as blockSize,_ as textShrinksByDefault};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ShowWhenRule } from "../../../../format/lib/document/show-when-attach.js";
|
|
2
2
|
import type { BlockPass } from "../../../../format/lib/document/passes/types.js";
|
|
3
|
+
export declare const BOX_BLOCK_KEYS: readonly string[];
|
|
3
4
|
export declare const CELL_WIDTH_SHOW_WHEN: ShowWhenRule;
|
|
4
5
|
export declare const cellWidth: BlockPass;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{GRID_SPAN_ATTR as s,resolveGridSpan as l}from"../../../../format/lib/content/grid-span.js";import{withRowsShownWhen as d}from"../../../../format/lib/document/show-when-attach.js";import{CONTAINER_BLOCK_CHOICES as _}from"../../../../format/lib/document/container-blocks.js";import{RETIRED_NESTABLE_SECTIONS as f}from"../../../../format/lib/document/section-catalog.js";import{BOX_MAY_HOLD as a}from"../../../../format/lib/document/passes/slot-rules.js";const c=Array.from(new Set([..._.map(e=>e.type),...a])),S=Array.from(new Set([...c,...f,"GalleryItem"])),m={not:{context:"parentOffersPositions",is:!1}},h={name:"cellWidth",applies:(e,n,r)=>S.includes(e)&&!!r&&typeof r.render=="function",panel(e,n,r){const t=r.cellWidthFields;e.fields={...e.fields,...t()},e.fields=d(e.fields??{},Object.keys(t()),m)},draw(e){const n=e.render;e.render=r=>{const t=l(r.gridSpan),i=n(r);return t==null?i:o("div",{className:"sf-grid-cell",[s]:String(t),children:i})}}};export{c as BOX_BLOCK_KEYS,m as CELL_WIDTH_SHOW_WHEN,h as cellWidth};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import{CardRowDrawn as m}from"../../../components/CardRowContext.js";import{PublishedPartStyles as y}from"../../../components/PublishedPartStylesContext.js";import{readPartStyles as h}from"../part-styles.js";import{partNeedles as f}from"../text-parts.js";const j={name:"clickableParts",applies:(o,t,s)=>typeof s?.render=="function",draw(o,t,s){const r=o,d=()=>r.textParts??r.fields,i=r.render,a=s.inspector?.PartAnchors;r.render=e=>{const c=h(e);return e.editor?.isEditing&&a?n(m,{type:t,props:e,children:l=>n(a,{needles:f(d(),l),styles:c,type:t,children:i(e)})}):Object.keys(c).length?n(m,{type:t,props:e,children:l=>n(y,{needles:f(d(),l),styles:c,type:t,children:i(e)})}):i(e)}}};export{j as clickableParts};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import{
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{cardCornerStyle as d}from"../../../../format/lib/content/card-corners.js";import{sectionCornerStyle as i}from"../../../../format/lib/content/section-corners.js";const f={name:"sectionCorners",applies:(r,n,e)=>n.isSection(r)&&!!e&&typeof e.render=="function",panel(r,n,e){r.fields={...r.fields,...e.sectionShapeFields()}},draw(r){const n=r.render;r.render=e=>{const s=i(e.sectionCorners,e.sectionCornerSides),t=n(e);return s?o("div",{className:"sf-section-corners",style:{display:"contents",...s},children:t}):t}}},c=["CollectionCard"],y={name:"cardCorners",applies:(r,n,e)=>c.includes(r)&&!!e&&typeof e.render=="function",panel(r,n,e){r.fields={...r.fields,...e.cardShapeFields()}},draw(r){const n=r.render;r.render=e=>{const s=d(e.cardCorners,e.cardCornerSides),t=n(e);return s?o("div",{className:"sf-card-corners",style:{display:"contents",...s},children:t}):t}}};export{c as CARD_BLOCK_KEYS,y as cardCorners,f as sectionCorners};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{catalogueLabel as m}from"../../../../format/lib/document/passes/catalogue-labels.js";import{
|
|
1
|
+
import{catalogueLabel as m}from"../../../../format/lib/document/passes/catalogue-labels.js";import{blockSize as n}from"./block-size.js";import{cellWidth as s}from"./cell-width.js";import{clickableParts as p}from"./clickable-parts.js";import{cardCorners as c,sectionCorners as f}from"./corners.js";import{emptyHeadings as a}from"../../../../format/lib/document/passes/empty-headings.js";import{showWhenRows as l}from"../../../../format/lib/document/passes/show-when-rows.js";import{hiddenNodes as d}from"../../../../format/lib/document/passes/hidden-nodes.js";import{mediaValues as h}from"../../../../format/lib/document/passes/media-values.js";import{sectionAnchor as u}from"./section-anchor.js";import{blockEntrance as g,sectionAnimation as S}from"./section-animation.js";import{sectionHeight as b}from"./section-height.js";import{cardSticky as w,sectionSticky as P}from"./section-sticky.js";import{sectionBorder as k}from"./borders.js";import{blockPadding as A,sectionPadding as C}from"./section-padding.js";import{sectionTheme as W,slideTheme as y}from"./section-theme.js";import{buttonAlignInRow as B,containedWidth as G,sectionWidth as E}from"./section-width.js";import{blockGroups as H,sectionGroups as L}from"../../../../format/lib/document/passes/settings-groups.js";import{openSlotDisallow as R,sectionGroupAllow as T}from"../../../../format/lib/document/passes/slot-rules.js";import{registryPassContext as io}from"../../../../format/lib/document/passes/registry-context.js";const z=[h,T,R,C,f,k,c,A,g,s,E,G,B,b,u,W,S,P,w,y,n,L,H,l,a,p,d,m];function $(r,e,o){const i=e;for(const t of z)t.applies(r,o,i)&&(o.inspector&&t.panel?.(i,r,o.inspector,o),t.draw?.(i,r,o));return e}export{z as BLOCK_PASSES,$ as applyBlockPasses,io as registryPassContext};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as s,Fragment as
|
|
1
|
+
import{jsx as s,Fragment as i,jsxs as t}from"react/jsx-runtime";import{slugify as a}from"efficient-shell/format";import{useInBox as c}from"../../../components/InBoxContext.js";const d="!grow-0 !shrink-0 !basis-0";function f({anchor:n}){const e=a(typeof n=="string"?n:""),r=c();return e?s("span",{id:e,className:r?`sf-section-anchor ${d}`:"sf-section-anchor","aria-hidden":"true"}):null}const x={name:"sectionAnchor",applies:(n,e,r)=>e.isSection(n)&&!!r&&typeof r.render=="function",panel(n,e,r){const o=r.anchorFields;n.fields={...n.fields,...o()}},draw(n){n.defaultProps={...n.defaultProps,anchor:""};const e=n.render;n.render=r=>t(i,{children:[s(f,{anchor:r.anchor}),e(r)]})}};export{d as SECTION_ANCHOR_IN_BOX_CLASS,x as sectionAnchor};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as s}from"react/jsx-runtime";import{SectionAnimation as d}from"../../../components/SectionAnimation.js";import{ENTRANCE_EXCLUDED as l,entranceDrawn as m}from"../../animation/entrance.js";import{BOX_TYPE as f}from"../../../../format/lib/document/container-blocks.js";const p={[f]:"box",Ticker:"marquee"},r=(n,e)=>!l.has(n)&&!!e&&typeof e.render=="function";function a(n,e,o){n.fields={...n.fields,...o.animationTabFields(e)}}function c(n){const e=n,o=e.render;e.render=i=>{const t=m(i);return t?s(d,{desktop:t.desktop,phone:t.phone,editing:!!i.editor?.isEditing,children:o(i)}):o(i)}}const A={name:"sectionAnimation",applies:(n,e,o)=>e.isSection(n)&&r(n,o),panel:(n,e,o)=>a(n,p[e]??"section",o),draw:n=>c(n)},k={name:"blockEntrance",applies:(n,e,o)=>!e.isSection(n)&&r(n,o),panel:(n,e,o)=>a(n,"block",o),draw:n=>c(n)};export{k as blockEntrance,A as sectionAnimation};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _}from"react/jsx-runtime";import{isBackgroundBox as
|
|
1
|
+
import{jsx as _}from"react/jsx-runtime";import{isBackgroundBox as u}from"../../../../format/lib/content/box-background.js";import{SECTION_PAD_KEYS as S,padValuesOf as p,resolveSectionPadding as m,sectionPadAttrs as T}from"../../content/section-padding.js";import{sectionFillPassClass as g}from"../../../../format/lib/content/section-min-height.js";const l={ParagraphsA:{top:60,bottom:80},StatsParagraph:{top:120,bottom:120},Timeline:{top:120,bottom:120},Footprint:{top:120,bottom:120},TimelineTrack:{top:120,bottom:120},TitleWithButtons:{top:140,bottom:140},ProcessSteps:{top:120,bottom:120},DetailRows:{top:100,bottom:100}},c=new Set(Object.keys(l)),P=new Set(["Flex","Text","Heading"]),A=new Set(["Divider"]),D=new Set(["Hero","HeroSingle","IntroBleed","CategoryBar","DocTabs"]),f=new Set(["ProductGrid"]);function i(t,e,n=!1){const r=t.render;t.render=o=>{if(e?.(o))return r(o);const s=T(p(o,S,n)),a=r(o),d=g(o);return s?_("div",{className:d?`${s.className} ${d}`:s.className,style:s.style,children:a}):a}}const h={name:"sectionPadding",applies:(t,e,n)=>e.isSection(t)&&!D.has(t)&&!!n&&typeof n.render=="function",panel(t,e,n){c.has(e)||f.has(e)||(t.fields={...t.fields,...n.sidesPaddingFields()})},draw(t,e){if(c.has(e)){const n=t.render,r=l[e];t.render=o=>{const s=m(o,r);return n({...o,padTop:s.top,padBottom:s.bottom})};return}if(f.has(e)){i(t);return}P.has(e)||A.has(e)||i(t,e==="Flex"?n=>u(n.bgImage):void 0,!0)}},E=["Heading","Text"],N=["LogoBlock"],B={name:"blockPadding",applies:(t,e,n)=>(E.includes(t)||N.includes(t))&&!!n&&typeof n.render=="function",panel(t,e,n){t.fields={...t.fields,...n.sidesPaddingFields()}},draw(t,e){P.has(e)||i(t,void 0,!0)}};export{A as PADS_ITS_OWN_SPACE,P as PAD_ON_ROOT,c as SECTION_PAD_INNER,l as SECTION_PAD_INNER_DEFAULTS,B as blockPadding,h as sectionPadding};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type WidthMode } from "../../../../format/lib/content/section-width.js";
|
|
2
2
|
import type { BlockPass } from "../../../../format/lib/document/passes/types.js";
|
|
3
|
-
export declare function drawsTwoWidthRows(key: string, comp?: object): boolean;
|
|
4
3
|
export declare const SITE_CONTENT_VAR = "--sf-sw-site";
|
|
5
4
|
export declare const SECTION_CONTENT_VAR = "--sf-sw-content";
|
|
6
5
|
export declare const SECTION_BACKGROUND_VAR = "--sf-bg-cap";
|
|
7
6
|
export declare const SECTION_CONTENT_CLASS = "contents [--sf-site-width:var(--sf-sw-content)] max-[800px]:[--sf-site-width:var(--sf-sw-site)]";
|
|
8
|
-
export declare function contentOverride(w: SectionWidths, background: WidthAnswer | null): string | null;
|
|
9
7
|
export declare const SECTION_CONTENT_CAP_VAR = "--sf-content-cap";
|
|
10
8
|
export declare const SECTION_CONTENT_CAP_CLASS = "contents max-[800px]:[--sf-content-cap:none]";
|
|
11
9
|
export declare const sectionWidth: BlockPass;
|
|
@@ -15,4 +13,3 @@ export declare function widthModeFields<T extends Record<string, unknown>>(field
|
|
|
15
13
|
}): T;
|
|
16
14
|
export declare const containedWidth: BlockPass;
|
|
17
15
|
export declare const buttonAlignInRow: BlockPass;
|
|
18
|
-
export declare const imageWidth: BlockPass;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as u}from"react/jsx-runtime";import{resolveContainerDirection as S}from"../../../../format/lib/content/container-direction.js";import{HERO_BACKGROUND_VAR as A,HERO_CHROME_CAP_VAR as B,HERO_CHROME_INSET_VAR as v,SITE_WIDTH_CAP as f,centredCap as I,heroBackgroundTokens as W}from"../../../../format/lib/content/page-width.js";import{SECTION_WIDTH_FAMILY as y,hasWidthFamily as g,resolveWidth as w,siteWidthsOf as G}from"../../../../format/lib/content/section-width.js";import{boxGutterOf as b,boxPlaceOf as F,isFrameContainer as T,siteDrawsGutter as H}from"../../../../format/lib/content/site-gutter.js";import{getEditorSiteContentWidth as P}from"../../../../format/lib/document/editor-site-widths.js";import{NestedBoxChoice as D,SplitBandAndColumn as M}from"../../../components/SiteGutterFrame.js";import{FRAME as m}from"../../../components/BlockFrame.js";import{sectionFillPassClass as k}from"../../../../format/lib/content/section-min-height.js";import{parentCapsWidth as V}from"../../../../format/lib/sections/section-head-placement.js";import{addShowWhenFacts as _,withRowsShownWhen as h}from"../../../../format/lib/document/show-when-attach.js";import{findParentNode as j,isNestedNode as L}from"../../../../format/lib/document/passes/document-position.js";const N="--sf-sw-site",U="--sf-sw-content",K="--sf-bg-cap",Y="contents [--sf-site-width:var(--sf-sw-content)] max-[800px]:[--sf-site-width:var(--sf-sw-site)]";function O(t,e){return t==="full"&&e!=="content"?"100vw":null}function E(t,e){return e===null?t:u("div",{className:"contents",style:{[N]:f},children:u("div",{className:Y,style:{[U]:e},children:t})})}const $="--sf-content-cap",q="contents max-[800px]:[--sf-content-cap:none]";function z(t,e){return t==="full"||e==="content"?null:`var(${N})`}function J(t,e){return e===null?t:u("div",{className:"contents",style:{[N]:f},children:u("div",{className:q,style:{[$]:e},children:t})})}const p=(t,e,n="")=>t==="content"?u("div",{className:n||void 0,style:I(f),children:e}):e;function x(t,e,n,o,i){return n==="full"?p(o,t({...e,contained:!1}),i):o==="content"?t({...e,contained:!0}):u(M,{children:t({...e,contained:!0})})}function Q(t,e){const n=y[e],o=t.render;t.render=i=>{const s=G(i),r=s.content??"content";if(n==="hero"){const d=s.background,l=E(o(i),O(r,d));return d==="full"?u("div",{style:{[A]:"none",[v]:"initial",[B]:"initial"},children:l}):d==="content"?u("div",{style:W(!0),children:l}):l}const c=s.background??"full",a=k(i);if(n==="scrollOver"){const d=o({...i,fullWidth:r==="full"});return c==="content"?u("div",{className:"contents",style:{[K]:f},children:d}):d}switch(n){case"both":return p(c,J(o(i),z(r,c)),a);case"contained":{const d=x(o,i,r,c,a);if(!T(e))return d;const l=b(i),C=l===void 0?r:l?"content":"full";return C===r?d:u(D,{atTop:d,nested:x(o,i,C,c,a)})}case"contentColumn":case"contentFull":case"productGrid":{const l=o({...i,widthMode:r==="full"?"full":"page"});return n==="productGrid"?c==="content"?u("div",{className:a?`${m} ${a}`:m,children:l}):l:p(c,l,a)}default:return p(c,E(o(i),O(r,c)),a)}}}const Ct={name:"sectionWidth",applies:(t,e,n)=>g(t)&&!!n&&typeof n.render=="function",panel(t,e,n){if(!T(e))return;const o=n.boxGutterFields();t.fields=R(e,t,{...t.fields,...o},Object.keys(o))},draw(t,e){Q(t,e)}};function X(t,e){if(!t||!("widthMode"in t))return t;const n={...t},o=n.widthMode;return o&&(n.widthMode={...o,currentValue:e.mode,inherited:e.inherited}),n}const Z=new Set(["Heading","Text","ImageBlock","ButtonBlock"]),wt={name:"containedWidth",applies:(t,e,n)=>Z.has(t)&&!!n&&typeof n.render=="function",panel(t,e,n){const o=n.widthField;t.fields=R(e,t,{...t.fields,...o("page")});const i=t.resolveFields;t.resolveFields=(s,r)=>{const c=i?i(s,r):r.fields,a=w(s?.props??{},"page"),d=l=>X(l,a);return c&&typeof c.then=="function"?c.then(d):d(c)}},draw(t){const e=t.render;t.render=n=>{const{mode:o}=w(n,"page");return e({...n,contained:o!=="full"})}}},tt={not:{context:"inHeroGroupRow",is:!0}},Tt={name:"buttonAlignInRow",applies:t=>t==="ButtonBlock",panel(t){const e=t;e.fields=h(e.fields??{},["align"],tt),_(e,{inHeroGroupRow:(n,o)=>{const i=j(o.appState,n.props?.id);return!!i&&i.type==="HeroGroup"&&S("HeroGroup",i.props?.direction)==="row"}})}};function et(t){return Object.values(t).some(e=>!!e&&typeof e=="object"&&e.type==="slot")}const nt={any:[]},ot={all:[{context:"insideBox",is:!0},{not:{context:"insideSiteGutter",is:!0}}]},it={not:{context:"widthCappedByParent",is:!0}};function R(t,e,n,o=["widthMode"]){if(t==="ButtonBlock")return h(n,["_gWidth",...o],nt);if(et(n)){const i=(s,r)=>F(r.appState?.data?.content,s.props?.id,H(P()));return _(e,{insideBox:(s,r)=>i(s,r)?.inBox,insideSiteGutter:(s,r)=>i(s,r)?.insideGutter}),h(n,o,ot)}return _(e,{widthCappedByParent:(i,s)=>"parent"in s?V(s.parent):L({props:i.props??{}},s)}),h(n,o,it)}export{K as SECTION_BACKGROUND_VAR,q as SECTION_CONTENT_CAP_CLASS,$ as SECTION_CONTENT_CAP_VAR,Y as SECTION_CONTENT_CLASS,U as SECTION_CONTENT_VAR,N as SITE_CONTENT_VAR,Tt as buttonAlignInRow,wt as containedWidth,Ct as sectionWidth,X as widthModeFields};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { StoredTextStyle } from "../text-styles/site-text-styles.js";
|
|
2
|
+
import type { ThemeColors } 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,6 +31,8 @@ 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;
|
|
@@ -51,7 +57,7 @@ export type SectionConversion = {
|
|
|
51
57
|
skipped?: string;
|
|
52
58
|
};
|
|
53
59
|
export type TextRole = "heading" | "body" | "eyebrow";
|
|
54
|
-
export type BoxEntry = string | readonly [string, string] | readonly [string, string, (value: unknown, props: Props) => unknown];
|
|
60
|
+
export type BoxEntry = string | readonly [string, string] | readonly [string, string, (value: unknown, props: Props, ctx: ConvertContext) => unknown];
|
|
55
61
|
export type ButtonVariantOf = {
|
|
56
62
|
key: string;
|
|
57
63
|
map: Readonly<Record<string, string>>;
|
|
@@ -71,11 +77,24 @@ export type ListPart = {
|
|
|
71
77
|
name: string;
|
|
72
78
|
parts: readonly PartRow[];
|
|
73
79
|
flat?: boolean;
|
|
74
|
-
props?:
|
|
80
|
+
props?: OwnProps;
|
|
75
81
|
item?: (item: Props, index: number, node: Props) => ListItemLook;
|
|
76
82
|
perRow?: (node: Props) => number;
|
|
77
83
|
rowName?: string;
|
|
78
84
|
rowProps?: Props;
|
|
85
|
+
groups?: ListGroups;
|
|
86
|
+
};
|
|
87
|
+
export type ListGroups = {
|
|
88
|
+
of: (item: Props) => string;
|
|
89
|
+
name: string;
|
|
90
|
+
props?: Props;
|
|
91
|
+
head?: (items: Props[], node: Props) => Props;
|
|
92
|
+
parts?: readonly PartRow[];
|
|
93
|
+
itemsName: string;
|
|
94
|
+
itemsProps?: (count: number, node: Props) => Props;
|
|
95
|
+
perRow?: (count: number, node: Props) => number;
|
|
96
|
+
rowName?: string;
|
|
97
|
+
rowProps?: Props;
|
|
79
98
|
};
|
|
80
99
|
export type BlockSeed = {
|
|
81
100
|
type: string;
|
|
@@ -93,13 +112,14 @@ type PartRowKind = {
|
|
|
93
112
|
size: number;
|
|
94
113
|
sizePhone?: number;
|
|
95
114
|
};
|
|
115
|
+
mark?: "accentLead";
|
|
96
116
|
} | {
|
|
97
117
|
kind: "button";
|
|
98
118
|
key: string;
|
|
99
119
|
href: string;
|
|
100
120
|
variant?: string | ButtonVariantOf;
|
|
101
121
|
style?: Props;
|
|
102
|
-
props?:
|
|
122
|
+
props?: OwnProps;
|
|
103
123
|
} | {
|
|
104
124
|
kind: "image";
|
|
105
125
|
key: string;
|
|
@@ -122,7 +142,7 @@ type PartRowKind = {
|
|
|
122
142
|
keepEmpty?: boolean;
|
|
123
143
|
} | {
|
|
124
144
|
kind: "core";
|
|
125
|
-
keep: readonly string[];
|
|
145
|
+
keep: readonly string[] | "rest";
|
|
126
146
|
as?: string;
|
|
127
147
|
rename?: Readonly<Record<string, string>>;
|
|
128
148
|
props?: Props;
|
|
@@ -130,7 +150,6 @@ type PartRowKind = {
|
|
|
130
150
|
};
|
|
131
151
|
export interface SectionToBoxRow {
|
|
132
152
|
name: string;
|
|
133
|
-
on: boolean;
|
|
134
153
|
box?: readonly BoxEntry[];
|
|
135
154
|
boxProps?: OwnProps;
|
|
136
155
|
parts: readonly PartRow[];
|
|
@@ -138,6 +157,7 @@ export interface SectionToBoxRow {
|
|
|
138
157
|
site?: (node: SectionNode, ctx: ConvertContext) => readonly SiteWrite[];
|
|
139
158
|
skip?: (props: Props) => string | undefined;
|
|
140
159
|
also?: readonly SectionPiece[];
|
|
160
|
+
reads?: Readonly<Record<string, string>>;
|
|
141
161
|
}
|
|
142
162
|
export type SectionPiece = {
|
|
143
163
|
name: string;
|
|
@@ -148,6 +168,7 @@ export type SectionPiece = {
|
|
|
148
168
|
export declare function sectionBoxIdOf(oldId: string, piece: number): string;
|
|
149
169
|
export declare function registerBoxNativeSections(types: Readonly<Record<string, string>>): void;
|
|
150
170
|
export declare function boxNativeReason(type: string): string | undefined;
|
|
171
|
+
export declare const SECTION_TO_BOX_ON: readonly string[];
|
|
151
172
|
export declare function registerSectionToBox(rows: Readonly<Record<string, SectionToBoxRow>>): void;
|
|
152
173
|
export declare function sectionToBoxRow(type: string): SectionToBoxRow | undefined;
|
|
153
174
|
export declare function sectionToBoxTypes(): string[];
|
|
@@ -157,11 +178,11 @@ export declare const hasWords: (v: unknown) => boolean;
|
|
|
157
178
|
export declare function convertSection(node: SectionNode, row: SectionToBoxRow, ctx?: ConvertContext): SectionConversion;
|
|
158
179
|
export declare function convertSectionsInPage<D extends {
|
|
159
180
|
content?: unknown;
|
|
160
|
-
}>(data: D): D;
|
|
181
|
+
}>(data: D, on?: readonly string[]): D;
|
|
161
182
|
export type SectionToBoxEdit = {
|
|
162
183
|
index: number;
|
|
163
184
|
node: SectionNode;
|
|
164
185
|
nodes: SectionNode[];
|
|
165
186
|
};
|
|
166
|
-
export declare function sectionToBoxEdits(content: unknown): SectionToBoxEdit[];
|
|
187
|
+
export declare function sectionToBoxEdits(content: unknown, on?: readonly string[]): SectionToBoxEdit[];
|
|
167
188
|
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 Q}from"efficient-easel/draw";import{BOX_TYPE as U,CONTAINER_BLOCKS_SLOT as Z}from"../../../format/lib/document/container-blocks.js";import{headingTextSeed as ee,labelTextSeed as te}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 ne}from"../../../format/lib/locations-grid.js";const _=U,j=Z;function se(t,o){return o===0?`${t}~box`:`${t}~box-${o+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 ke(t){for(const[o,r]of Object.entries(t)){if(o in R&&R[o]!==r)throw new Error(`lib/sections/section-to-box: "${o}" is already Box-native`);R[o]=r}}function be(t){return R[t]}const V=new Set(["id"]),T={},C=[];function me(t){for(const[o,r]of Object.entries(t)){if(o in T&&T[o]!==r)throw new Error(`lib/sections/section-to-box: "${o}" already has a row`);T[o]=r}}function xe(t){return T[t]}function ge(){return Object.keys(T)}function $e(t){return t in T&&C.includes(t)}function we(t){const o=oe[t];if(!o)throw new Error(`lib/sections/section-to-box: "${t}" has no head row in SPLITTABLE_SECTIONS`);const r=[{kind:"text",key:o.num,role:"eyebrow"},{kind:"text",key:o.title,role:"heading"}];return o.description&&r.push({kind:"text",key:o.description,role:"body"}),o.headRows.includes("linkText")&&o.headRows.includes("linkHref")&&r.push({kind:"button",key:"linkText",href:"linkHref"}),r}const H=t=>Q(t),Oe=t=>H(t).text.trim()!=="";function ie(t){if(t.includes("=="))return t;const o=t.indexOf("/"),r=o===-1?t:t.slice(0,o),a=r.trim();if(!a)return t;const y=r.indexOf(a);return`${r.slice(0,y)}==${a}==${r.slice(y+a.length)}${o===-1?"":t.slice(o)}`}const re=t=>t==="heading"?ee():t==="eyebrow"?te():{};function ae(t,o,r){const y={...t._partStyles?.text??{},...o??{},...r??{}};return Object.keys(y).length?{_partStyles:{text:y}}:{}}function ce(t,o){if(t===void 0)return{};if(typeof t=="string")return{variant:t};const r=o[t.key];return{variant:typeof r=="string"&&Object.hasOwn(t.map,r)?t.map[r]:t.fallback}}function Y(t,o,r,a,y={}){const c={...o};for(const h of t){const[g,E,P]=typeof h=="string"?[h,h,void 0]:h;if(r[g]===void 0)continue;const S=P?P(r[g],r,y):r[g];S===void 0?delete c[E]:c[E]=S,a(g,E,S===void 0)}return c}function fe(t){const o=new Set([...V,"headPlacement","_partStyles",...Object.keys(t.drop??{}),...Object.keys(t.reads??{})]),r=y=>{for(const c of y??[])o.add(typeof c=="string"?c:c[0])},a=y=>{for(const c of y)switch(c.kind){case"text":case"image":o.add(c.key),c.kind==="image"&&c.alt&&o.add(c.alt);break;case"button":o.add(c.key),o.add(c.href),typeof c.variant=="object"&&o.add(c.variant.key);break;case"list":o.add(c.key);break;case"group":case"block":r(c.box),a(c.parts??[]);break;case"core":c.keep!=="rest"&&c.keep.forEach(h=>o.add(h)),Object.keys(c.rename??{}).forEach(h=>o.add(h));for(const h of Object.values(c.slots??{}))for(const g of h)"kind"in g&&o.add(g.key);break}};for(const y of[t,...t.also??[]])r(y.box),a(y.parts);return o}function D(t,o,r={}){const a=t.props,y=o.skip?.(a);if(y!==void 0)return{node:t,nodes:[t],carried:[],dropped:[],siteWrites:[],restyled:[],skipped:y};const c=String(a.id??t.type),h=[],g=[],E=[],P=new Set,S=(n,i)=>{h.push({key:n,home:i}),P.add(n)},X=a._partStyles??{},L=fe(o);let F=0;const $=(n,i)=>({type:n,props:{...i,id:`${c}~${n}-${++F}`}}),K=(n,i,k,l,b,d,w)=>{if(b){for(const f of n??[]){const s=typeof f=="string"?f:f[0];k[s]!==void 0&&w(s,`nothing — the ${l} has no parts, so it is not drawn`)}return}const e=typeof i=="function"?i(a,r):i??{};return Y(n??[],e,k,(f,s,m)=>w(f,m?`nothing — the old value draws nothing (${l}: no ${s})`:`${d}${l}: ${s}`),r)},M=n=>n.map(i=>{const k={...i.props??{}};for(const[l,b]of Object.entries(i.slots??{}))k[l]=M(b);return $(i.type,k)}),W=(n,i,k)=>{const l=Array.isArray(i[n.key])?i[n.key]:[],b=typeof n.props=="function"?n.props(a,r):n.props??{},d=l.map((s,m)=>{const p=s??{},u=n.item?.(p,m,a)??{},x=v(u.reverse?[...n.parts].reverse():n.parts,p,!1,`item ${m+1}: `);return n.flat?u.props?x.map(B=>({...B,props:{...B.props,...u.props,id:B.props.id}})):x:[$(_,{name:`${n.name} ${m+1}`,...b,...u.props??{},[j]:x})]});if(n.groups){const s=n.groups;return k(n.key,l.length?`one Box per item (${l.length}), in a Box per group`:"nothing — the list is empty"),ne(l.map(m=>m??{}),s.of,s.of).map((m,p)=>{const u=m.items.map(O=>O.item),x=s.parts?v(s.parts,s.head?.(u,a)??{},!1,`group ${p+1}: `):[],B=m.items.map(O=>d[O.index]),A=s.perRow?.(u.length,a),N=Number.isInteger(A)&&A>=1?A:1,z=[];if(s.perRow&&N<B.length)for(let O=0;O*N<B.length;O++)z.push(B.slice(O*N,(O+1)*N).flat());return $(_,{name:`${s.name} ${p+1}`,...s.props??{},[j]:[...x,$(_,{name:`${s.itemsName} ${p+1}`,...s.itemsProps?.(u.length,a)??{},[j]:z.length?z.map((O,J)=>$(_,{name:`${s.rowName??`${s.itemsName} row`} ${J+1}`,...s.rowProps??{},[j]:O})):B.flat()})]})})}const w=n.perRow?.(a),e=n.perRow?Number.isInteger(w)&&w>=1?w:1:0;if(k(n.key,(l.length?n.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 f=[];for(let s=0;s*e<d.length;s++)f.push($(_,{name:`${n.rowName??`${n.name} row`} ${s+1}`,...n.rowProps??{},[j]:d.slice(s*e,(s+1)*e).flat()}));return f},v=(n,i,k,l)=>{const b=[],d=(e,f)=>k?S(e,f):void 0,w=e=>k?X[e]:void 0;for(const e of n)if(!(e.when&&!e.when(a,k?void 0:i)))switch(e.kind){case"text":{const f=H(i[e.key]);if(!f.text.trim()){d(e.key,"nothing — empty words draw nothing, so no block");break}const s=re(e.role??"body"),{_partStyles:m,...p}=s,u=ae(s,e.style,w(e.key));if(e.was&&k){const x=u._partStyles?.text??{};E.push({key:e.key,was:e.was,...typeof x.textStyle=="string"?{textStyle:x.textStyle}:{},...I(x.size)!==void 0?{size:I(x.size)}:{},...I(x.sizePhone)!==void 0?{sizePhone:I(x.sizePhone)}:{}})}b.push($("Text",{text:e.mark==="accentLead"?ie(f.text):f.text,...p,...e.props??{},...u,...f.hidden?{_hidden:!0}:{}})),d(e.key,`${l}Text block: its words${f.hidden?", hidden":""}`);break}case"button":{const f=H(i[e.key]);if(!f.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 i[e.href]=="string"&&i[e.href]?i[e.href]:"#",m={...e.style??{},...w(e.key)??{}};b.push($("ButtonBlock",{label:f.text,href:s,...typeof e.props=="function"?e.props(i,r):e.props??{},...ce(e.variant,i),...Object.keys(m).length?{_partStyles:{label:m}}:{},...f.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 f=i[e.key];if(typeof f!="string"||!f){d(e.key,"nothing — no picture, no block"),e.alt&&d(e.alt,"nothing — no picture to describe");break}const s=e.alt&&typeof i[e.alt]=="string"?i[e.alt]:"";b.push($("ImageBlock",{src:f,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,i,d));break}case"group":{const f=v(e.parts,i,k,l),s=K(e.box,e.props,i,`${e.name} Box`,!f.length&&!e.keepEmpty,l,d);s&&b.push($(_,{name:e.name,...s,[j]:f}));break}case"block":{const f=e.parts?v(e.parts,i,k,l):[],s=K(e.box,e.props,i,`${e.type} block`,!!e.parts&&!f.length&&!e.keepEmpty,l,d);s&&b.push($(e.type,{...s,...e.slot?{[e.slot]:f}:{}}));break}case"core":{const f=e.as??t.type,s={headPlacement:"own-box",...e.props??{}},m=e.keep==="rest"?Object.keys(i).filter(p=>!L.has(p)&&!(p in s)):e.keep;for(const p of m)i[p]!==void 0&&(s[p]=i[p],d(p,`the ${f} block inside the Box`));if(e.keep==="rest"){for(const u of Object.keys(e.props??{}))i[u]!==void 0&&!L.has(u)&&d(u,`nothing — the ${f} block inside the Box has the row's own value`);i.headPlacement!==void 0&&d("headPlacement",`the ${f} block inside the Box: own-box`);const p=Object.fromEntries(Object.entries(X).filter(([u])=>!L.has(u)));Object.keys(p).length&&(s._partStyles=p)}for(const[p,u]of Object.entries(e.rename??{}))i[p]!==void 0&&(s[u]=i[p],d(p,`the ${f} block inside the Box: ${u}`));for(const[p,u]of Object.entries(e.slots??{}))s[p]=u.flatMap(x=>"kind"in x?W(x,i,d):M([x]));b.push($(f,s));break}}return b},q=(n,i)=>{const k=i===0?"Box":`${n.name} Box`,l=v(n.parts,a,!0,i===0?"":`${k}: `),b=typeof n.boxProps=="function"?n.boxProps(a,r):n.boxProps??{},d=Y(n.box??[],b,a,(w,e,f)=>S(w,f?`nothing — the old value draws nothing (${k}: no ${e})`:`${k}: ${e}`),r);return{type:_,props:{name:n.name,...d,[j]:l,id:se(c,i)}}},G=[o,...o.also??[]].map(q);a._partStyles!==void 0&&S("_partStyles","each old part's style moved to its new part");for(const[n,i]of Object.entries(o.reads??{}))a[n]!==void 0&&S(n,i);for(const[n,i]of Object.entries(o.drop??{}))n in a&&(g.push({key:n,why:i}),P.add(n));for(const n of Object.keys(a))V.has(n)||P.has(n)||g.push({key:n,why:"not in the row — not carried"});return{node:G[0],nodes:G,carried:h,dropped:g,siteWrites:[...o.site?.(t,r)??[]],restyled:E}}function Se(t,o=C){const r=t.content;if(!Array.isArray(r))return t;let a=!1;const y=r.flatMap(c=>{const h=c&&typeof c.type=="string"&&o.includes(c.type)?T[c.type]:void 0;if(!h)return[c];const g=D(c,h);return g.skipped!==void 0?[c]:(a=!0,g.nodes)});return a?{...t,content:y}:t}function Be(t,o=C){if(!Array.isArray(t))return[];const r=[];return t.forEach((a,y)=>{const c=a&&typeof a.type=="string"&&o.includes(a.type)?T[a.type]:void 0;if(!c)return;const h=D(a,c);h.skipped===void 0&&r.push({index:y,node:h.node,nodes:h.nodes})}),r}export{j as SECTION_BOX_SLOT,_ as SECTION_BOX_TYPE,C as SECTION_TO_BOX_ON,be as boxNativeReason,D as convertSection,Se as convertSectionsInPage,$e as convertsToBox,Oe as hasWords,we as headParts,ke as registerBoxNativeSections,me as registerSectionToBox,se as sectionBoxIdOf,Be as sectionToBoxEdits,xe as sectionToBoxRow,ge 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": "45.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": "^24.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": "^24.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};
|