efficient-web-builder 1.0.0 → 2.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 +30 -0
- package/README.md +2 -1
- package/dist/components/AddBlockRow.d.ts +1 -7
- package/dist/components/AddBlockRow.js +1 -1
- package/dist/components/AddChildRow.d.ts +1 -6
- package/dist/components/AddChildRow.js +1 -1
- package/dist/components/AddSidePanel.d.ts +2 -39
- package/dist/components/AddSidePanel.js +1 -1
- package/dist/components/BlockGapField.js +1 -1
- package/dist/components/BlogPostSource.js +1 -1
- package/dist/components/CardShadowField.js +1 -1
- package/dist/components/ChatSettingsPanel.js +1 -1
- package/dist/components/CornersField.d.ts +0 -1
- package/dist/components/CornersField.js +1 -1
- package/dist/components/DuplicateToPageMenu.js +1 -1
- package/dist/components/EditorScreenMount.d.ts +1 -0
- package/dist/components/EditorScreenMount.js +1 -0
- package/dist/components/EditorStoreProvider.d.ts +1 -0
- package/dist/components/EditorStoreProvider.js +1 -0
- package/dist/components/HeroImageField.js +1 -1
- package/dist/components/HeroSection.d.ts +2 -6
- package/dist/components/HeroSection.js +4 -4
- package/dist/components/HoverEffectField.js +1 -1
- package/dist/components/ImageFocusRow.js +1 -1
- package/dist/components/KeepHint.d.ts +5 -0
- package/dist/components/KeepHint.js +1 -0
- package/dist/components/LocationsGroupedField.js +1 -1
- package/dist/components/MediaSidePanel.d.ts +1 -6
- package/dist/components/MediaSidePanel.js +1 -1
- package/dist/components/MediaUploadField.js +1 -1
- package/dist/components/MultiSelectField.d.ts +4 -1
- package/dist/components/MultiSelectField.js +1 -1
- package/dist/components/NodeContextMenu.d.ts +2 -96
- package/dist/components/NodeContextMenu.js +1 -1
- package/dist/components/PageEditGuardNotices.d.ts +1 -1
- package/dist/components/PageEditGuardNotices.js +1 -1
- package/dist/components/PanelToggleIcon.d.ts +1 -3
- package/dist/components/PanelToggleIcon.js +1 -1
- package/dist/components/PartSettingsPanel.d.ts +5 -0
- package/dist/components/PartSettingsPanel.js +1 -1
- package/dist/components/PhotographyField.js +1 -1
- package/dist/components/PreviewDeviceContext.d.ts +2 -4
- package/dist/components/PreviewDeviceContext.js +1 -1
- package/dist/components/PreviewPartsContext.d.ts +1 -3
- package/dist/components/PreviewPartsContext.js +1 -1
- package/dist/components/SearchSelectField.d.ts +3 -1
- package/dist/components/SearchSelectField.js +1 -1
- package/dist/components/SectionEditor.d.ts +2 -5
- package/dist/components/SectionEditor.js +1 -1
- package/dist/components/SectionEditorShell.d.ts +1 -1
- package/dist/components/SectionEditorShell.js +1 -1
- package/dist/components/SectionThemePicker.d.ts +3 -1
- package/dist/components/SectionThemePicker.js +1 -1
- package/dist/components/ShadowColourField.js +1 -1
- package/dist/components/SidePanelHead.d.ts +1 -23
- package/dist/components/SidePanelHead.js +1 -1
- package/dist/components/SideSpaceField.d.ts +0 -1
- package/dist/components/SideSpaceField.js +1 -1
- package/dist/components/SiteEditorProvider.d.ts +3 -10
- package/dist/components/SiteEditorProvider.js +1 -1
- package/dist/components/SiteWidthField.d.ts +0 -1
- package/dist/components/SiteWidthField.js +1 -1
- package/dist/components/SlotChildActionsContext.d.ts +2 -13
- package/dist/components/SlotChildActionsContext.js +1 -1
- package/dist/components/SocialLinksPanel.js +1 -1
- package/dist/components/SourceStatus.js +1 -1
- package/dist/components/StandaloneSectionEditor.d.ts +1 -0
- package/dist/components/StandaloneSectionEditor.js +1 -1
- package/dist/components/StorefrontDocumentContext.d.ts +2 -67
- package/dist/components/StorefrontDocumentContext.js +1 -1
- package/dist/components/StorefrontEditor.d.ts +1 -0
- package/dist/components/StorefrontEditor.js +1 -1
- package/dist/components/StorefrontEditorChrome.d.ts +1 -1
- package/dist/components/StorefrontEditorChrome.js +1 -1
- package/dist/components/StorefrontLinkField.d.ts +9 -0
- package/dist/components/StorefrontLinkField.js +1 -1
- package/dist/components/ThemeField.js +1 -1
- package/dist/components/TickerSettingsPanel.js +1 -1
- package/dist/components/UiIcon.d.ts +2 -10
- package/dist/components/UiIcon.js +1 -1
- package/dist/components/WebsiteScreenParts.d.ts +2 -0
- package/dist/components/WebsiteScreenParts.js +1 -0
- package/dist/components/WidthFollowField.js +1 -1
- package/dist/components/panel-widths.d.ts +2 -12
- package/dist/components/panel-widths.js +1 -1
- package/dist/components/storefront-editor.css +125 -986
- package/dist/components/useFooterFocus.d.ts +2 -0
- package/dist/components/useFooterFocus.js +1 -0
- package/dist/components/useLocationsTree.d.ts +6 -0
- package/dist/components/useLocationsTree.js +1 -0
- package/dist/components/usePartBridge.d.ts +1 -9
- package/dist/components/usePartBridge.js +1 -1
- package/dist/components/usePinnedChromeSeed.d.ts +2 -0
- package/dist/components/usePinnedChromeSeed.js +1 -0
- package/dist/components/useSocialSettings.js +1 -1
- package/dist/components/useStorefrontBlogPosts.js +1 -1
- package/dist/lib/client-only.d.ts +1 -0
- package/dist/lib/client-only.js +1 -0
- package/dist/lib/content/view-tiers.d.ts +2 -6
- package/dist/lib/content/view-tiers.js +1 -1
- package/dist/lib/editor-admin-bridge.d.ts +2 -29
- package/dist/lib/editor-admin-bridge.js +1 -1
- package/dist/lib/editor-backend-error.d.ts +2 -0
- package/dist/lib/editor-backend-error.js +1 -0
- package/dist/lib/editor-blocks.d.ts +2 -2
- package/dist/lib/editor-chrome.d.ts +2 -52
- package/dist/lib/editor-chrome.js +1 -1
- package/dist/lib/editor-document-adapter.d.ts +3 -51
- package/dist/lib/editor-document-adapter.js +1 -1
- package/dist/lib/editor-document-addressing.d.ts +2 -0
- package/dist/lib/editor-document-addressing.js +1 -0
- package/dist/lib/editor-document-contract.d.ts +1 -0
- package/dist/lib/editor-document-contract.js +0 -0
- package/dist/lib/editor-document-hooks.d.ts +1 -15
- package/dist/lib/editor-document-switch.d.ts +2 -0
- package/dist/lib/editor-document-switch.js +1 -0
- package/dist/lib/editor-failure.d.ts +1 -4
- package/dist/lib/editor-failure.js +1 -1
- package/dist/lib/editor-host-inbound.d.ts +1 -1
- package/dist/lib/editor-host-inbound.js +1 -1
- package/dist/lib/editor-host.d.ts +2 -135
- package/dist/lib/editor-host.js +1 -1
- package/dist/lib/editor-key-scope.d.ts +1 -3
- package/dist/lib/editor-key-scope.js +1 -1
- package/dist/lib/editor-load-error.d.ts +1 -4
- package/dist/lib/editor-load-error.js +1 -1
- package/dist/lib/editor-media-panel.d.ts +2 -23
- package/dist/lib/editor-media-panel.js +1 -1
- package/dist/lib/editor-media-picker.d.ts +2 -12
- package/dist/lib/editor-media-picker.js +1 -1
- package/dist/lib/editor-page-lock.d.ts +1 -1
- package/dist/lib/editor-page-lock.js +1 -1
- package/dist/lib/editor-screen.d.ts +2 -0
- package/dist/lib/editor-screen.js +1 -0
- package/dist/lib/editor-section-templates.d.ts +1 -2
- package/dist/lib/editor-section-templates.js +1 -1
- package/dist/lib/editor-session-context.d.ts +1 -7
- package/dist/lib/editor-session-context.js +1 -1
- package/dist/lib/editor-session.d.ts +2 -45
- package/dist/lib/editor-session.js +1 -1
- package/dist/lib/editor-site-slug.js +1 -1
- package/dist/lib/editor-theme.d.ts +1 -1
- package/dist/lib/editor-theme.js +1 -1
- package/dist/lib/hero-arrows.d.ts +1 -1
- package/dist/lib/links/link-filters.d.ts +1 -0
- package/dist/lib/links/link-filters.js +0 -0
- package/dist/lib/links/link-picker-setup.d.ts +29 -0
- package/dist/lib/links/link-picker-setup.js +1 -0
- package/dist/lib/puck/ColourControl.d.ts +4 -1
- package/dist/lib/puck/ColourControl.js +1 -1
- package/dist/lib/puck/add-palette.d.ts +3 -9
- package/dist/lib/puck/add-palette.js +1 -1
- package/dist/lib/puck/add-target-types.d.ts +1 -0
- package/dist/lib/puck/add-target-types.js +0 -0
- package/dist/lib/puck/add-target.d.ts +2 -9
- package/dist/lib/puck/block-choice.d.ts +2 -0
- package/dist/lib/puck/block-choice.js +1 -0
- package/dist/lib/puck/block-offer.js +1 -1
- package/dist/lib/puck/block-types-in.d.ts +1 -1
- package/dist/lib/puck/block-types-in.js +1 -1
- package/dist/lib/puck/blocks/general/index.d.ts +2 -2
- package/dist/lib/puck/content-tree.d.ts +2 -43
- package/dist/lib/puck/content-tree.js +1 -1
- package/dist/lib/puck/controls.d.ts +11 -22
- package/dist/lib/puck/controls.js +1 -1
- package/dist/lib/puck/device-fields.d.ts +2 -24
- package/dist/lib/puck/device-fields.js +1 -1
- package/dist/lib/puck/field-buckets.d.ts +2 -0
- package/dist/lib/puck/field-buckets.js +1 -0
- package/dist/lib/puck/field-groups.d.ts +3 -3
- package/dist/lib/puck/field-groups.js +1 -1
- package/dist/lib/puck/field-markers.d.ts +2 -16
- package/dist/lib/puck/field-markers.js +1 -1
- package/dist/lib/puck/footer-block-row-name.d.ts +4 -0
- package/dist/lib/puck/footer-block-row-name.js +1 -0
- package/dist/lib/puck/footer-blocks.d.ts +2 -10
- package/dist/lib/puck/footer-blocks.js +1 -1
- package/dist/lib/puck/hidable.d.ts +2 -9
- package/dist/lib/puck/hidable.js +1 -1
- package/dist/lib/puck/palette-sections.d.ts +2 -0
- package/dist/lib/puck/palette-sections.js +1 -0
- package/dist/lib/puck/panel-fields.d.ts +2 -12
- package/dist/lib/puck/panel-fields.js +1 -1
- package/dist/lib/puck/panel-no-control-mark.d.ts +2 -7
- package/dist/lib/puck/panel-no-control-mark.js +1 -1
- package/dist/lib/puck/part-id.d.ts +1 -0
- package/dist/lib/puck/part-id.js +1 -0
- package/dist/lib/puck/pinned-seed-gate.d.ts +2 -12
- package/dist/lib/puck/pinned-seed-gate.js +1 -1
- package/dist/lib/puck/preview-click.d.ts +1 -2
- package/dist/lib/puck/preview-click.js +1 -1
- package/dist/lib/puck/preview-dom.d.ts +1 -6
- package/dist/lib/puck/preview-dom.js +1 -1
- package/dist/lib/puck/preview-events.d.ts +2 -0
- package/dist/lib/puck/preview-events.js +1 -0
- package/dist/lib/puck/preview-selection-context.d.ts +2 -19
- package/dist/lib/puck/preview-selection-context.js +1 -1
- package/dist/lib/puck/section-doc.d.ts +1 -5
- package/dist/lib/puck/section-doc.js +1 -1
- package/dist/lib/puck/section-groups.d.ts +1 -1
- package/dist/lib/puck/slot-child-name.d.ts +2 -8
- package/dist/lib/puck/slot-child-name.js +1 -1
- package/dist/lib/puck/slot-heal.d.ts +1 -2
- package/dist/lib/puck/slot-heal.js +1 -1
- package/dist/lib/puck/slot-section-spec.d.ts +1 -0
- package/dist/lib/puck/slot-section-spec.js +0 -0
- package/dist/lib/puck/slot-specs.d.ts +2 -13
- package/dist/lib/puck/style-clipboard.d.ts +1 -19
- package/dist/lib/puck/style-clipboard.js +1 -1
- package/dist/lib/puck/text-control-kinds.d.ts +2 -13
- package/dist/lib/puck/text-control-kinds.js +1 -1
- package/dist/lib/puck/text-parts.d.ts +2 -5
- package/dist/lib/puck/text-parts.js +1 -1
- package/dist/lib/puck/tree-reveal.d.ts +1 -11
- package/dist/lib/puck/tree-reveal.js +1 -1
- package/dist/lib/puck/use-section-ops.d.ts +2 -25
- package/dist/lib/puck/use-section-ops.js +1 -1
- package/dist/lib/reel.d.ts +1 -1
- package/dist/lib/section-template-types.d.ts +1 -21
- package/dist/lib/sections/new-section-node.d.ts +2 -0
- package/dist/lib/sections/new-section-node.js +1 -0
- package/dist/lib/source-rules/accent-token-name.d.ts +20 -0
- package/dist/lib/source-rules/accent-token-name.js +4 -0
- package/dist/lib/source-rules/button-corners.d.ts +13 -0
- package/dist/lib/source-rules/button-corners.js +2 -0
- package/dist/lib/source-rules/editor-chrome-note.d.ts +16 -0
- package/dist/lib/source-rules/editor-chrome-note.js +13 -0
- package/dist/lib/source-rules/editor-context-menu.d.ts +5 -0
- package/dist/lib/source-rules/editor-context-menu.js +4 -0
- package/dist/lib/source-rules/editor-puck-drag-off.d.ts +8 -0
- package/dist/lib/source-rules/editor-puck-drag-off.js +4 -0
- package/dist/lib/source-rules/efficient-easel-version.d.ts +9 -0
- package/dist/lib/source-rules/efficient-easel-version.js +2 -0
- package/dist/lib/source-rules/every-button-follows-the-button-colour.d.ts +12 -0
- package/dist/lib/source-rules/every-button-follows-the-button-colour.js +7 -0
- package/dist/lib/source-rules/flat-theme-palette.d.ts +10 -0
- package/dist/lib/source-rules/flat-theme-palette.js +8 -0
- package/dist/lib/source-rules/full-width-means-full.d.ts +8 -0
- package/dist/lib/source-rules/full-width-means-full.js +2 -0
- package/dist/lib/source-rules/heading-ceiling-sweep.d.ts +11 -0
- package/dist/lib/source-rules/heading-ceiling-sweep.js +8 -0
- package/dist/lib/source-rules/label-hints.d.ts +7 -0
- package/dist/lib/source-rules/label-hints.js +5 -0
- package/dist/lib/source-rules/label-vocabulary.d.ts +14 -0
- package/dist/lib/source-rules/label-vocabulary.js +5 -0
- package/dist/lib/source-rules/mirrored-rows-agree.d.ts +19 -0
- package/dist/lib/source-rules/mirrored-rows-agree.js +10 -0
- package/dist/lib/source-rules/no-comment-in-jsx.d.ts +9 -0
- package/dist/lib/source-rules/no-comment-in-jsx.js +7 -0
- package/dist/lib/source-rules/no-glyph-rows.d.ts +15 -0
- package/dist/lib/source-rules/no-glyph-rows.js +4 -0
- package/dist/lib/source-rules/one-colour-control.d.ts +7 -0
- package/dist/lib/source-rules/one-colour-control.js +2 -0
- package/dist/lib/source-rules/one-dropdown.d.ts +10 -0
- package/dist/lib/source-rules/one-dropdown.js +4 -0
- package/dist/lib/source-rules/one-editable-list.d.ts +16 -0
- package/dist/lib/source-rules/one-editable-list.js +6 -0
- package/dist/lib/source-rules/one-editor-list.d.ts +7 -0
- package/dist/lib/source-rules/one-editor-list.js +3 -0
- package/dist/lib/source-rules/one-right-click.d.ts +10 -0
- package/dist/lib/source-rules/one-right-click.js +2 -0
- package/dist/lib/source-rules/one-switch.d.ts +9 -0
- package/dist/lib/source-rules/one-switch.js +7 -0
- package/dist/lib/source-rules/one-up-level-link.d.ts +16 -0
- package/dist/lib/source-rules/one-up-level-link.js +18 -0
- package/dist/lib/source-rules/panel-colour-tokens.d.ts +48 -0
- package/dist/lib/source-rules/panel-colour-tokens.js +20 -0
- package/dist/lib/source-rules/panel-no-divider-lines.d.ts +14 -0
- package/dist/lib/source-rules/panel-no-divider-lines.js +10 -0
- package/dist/lib/source-rules/panel-one-arrow.d.ts +21 -0
- package/dist/lib/source-rules/panel-one-arrow.js +1 -0
- package/dist/lib/source-rules/panel-one-hover.d.ts +8 -0
- package/dist/lib/source-rules/panel-one-hover.js +2 -0
- package/dist/lib/source-rules/panel-rows-use-the-shared-row.d.ts +23 -0
- package/dist/lib/source-rules/panel-rows-use-the-shared-row.js +22 -0
- package/dist/lib/source-rules/part-slider-fills-row.d.ts +11 -0
- package/dist/lib/source-rules/part-slider-fills-row.js +29 -0
- package/dist/lib/source-rules/part-style-naming.d.ts +10 -0
- package/dist/lib/source-rules/part-style-naming.js +2 -0
- package/dist/lib/source-rules/puck-document-surfaces.d.ts +16 -0
- package/dist/lib/source-rules/puck-document-surfaces.js +8 -0
- package/dist/lib/source-rules/reduced-motion.d.ts +26 -0
- package/dist/lib/source-rules/reduced-motion.js +9 -0
- package/dist/lib/source-rules/route-content-width.d.ts +22 -0
- package/dist/lib/source-rules/route-content-width.js +5 -0
- package/dist/lib/source-rules/rule.d.ts +21 -0
- package/dist/lib/source-rules/rule.js +1 -0
- package/dist/lib/source-rules/section-theme-preview.d.ts +9 -0
- package/dist/lib/source-rules/section-theme-preview.js +8 -0
- package/dist/lib/source-rules/site-gutter.d.ts +6 -0
- package/dist/lib/source-rules/site-gutter.js +4 -0
- package/dist/lib/source-rules/site-square-by-default.d.ts +17 -0
- package/dist/lib/source-rules/site-square-by-default.js +3 -0
- package/dist/lib/source-rules/site-width.d.ts +11 -0
- package/dist/lib/source-rules/site-width.js +7 -0
- package/dist/lib/source-rules/size-token-paints.d.ts +8 -0
- package/dist/lib/source-rules/size-token-paints.js +11 -0
- package/dist/lib/source-rules/social-icons-import.d.ts +6 -0
- package/dist/lib/source-rules/social-icons-import.js +6 -0
- package/dist/lib/source-rules/source-status-is-shared.d.ts +7 -0
- package/dist/lib/source-rules/source-status-is-shared.js +1 -0
- package/dist/lib/source-rules/style-face-matches-size.d.ts +10 -0
- package/dist/lib/source-rules/style-face-matches-size.js +4 -0
- package/dist/lib/source-rules/support/accent-rename-bytes.d.ts +5 -0
- package/dist/lib/source-rules/support/accent-rename-bytes.js +1 -0
- package/dist/lib/source-rules/support/css-box-model.d.ts +5 -0
- package/dist/lib/source-rules/support/css-box-model.js +1 -0
- package/dist/lib/source-rules/support/css-length.d.ts +2 -0
- package/dist/lib/source-rules/support/css-length.js +1 -0
- package/dist/lib/source-rules/support/css-rules.d.ts +12 -0
- package/dist/lib/source-rules/support/css-rules.js +1 -0
- package/dist/lib/source-rules/support/css-source.d.ts +2 -0
- package/dist/lib/source-rules/support/css-source.js +3 -0
- package/dist/lib/source-rules/support/label-extraction.d.ts +14 -0
- package/dist/lib/source-rules/support/label-extraction.js +5 -0
- package/dist/lib/source-rules/support/panel-select-cascade.d.ts +72 -0
- package/dist/lib/source-rules/support/panel-select-cascade.js +2 -0
- package/dist/lib/source-rules/support/part-slider-call-sites.d.ts +9 -0
- package/dist/lib/source-rules/support/part-slider-call-sites.js +17 -0
- package/dist/lib/source-rules/support/registry-source.d.ts +14 -0
- package/dist/lib/source-rules/support/registry-source.js +3 -0
- package/dist/lib/source-rules/support/ts-source.d.ts +2 -0
- package/dist/lib/source-rules/support/ts-source.js +3 -0
- package/dist/lib/source-rules/theme-mode-controls-gone.d.ts +10 -0
- package/dist/lib/source-rules/theme-mode-controls-gone.js +5 -0
- package/dist/lib/source-rules/upload-intake-guard.d.ts +11 -0
- package/dist/lib/source-rules/upload-intake-guard.js +6 -0
- package/dist/lib/source-rules/word-styles.d.ts +8 -0
- package/dist/lib/source-rules/word-styles.js +4 -0
- package/dist/lib/theme-row-persist.js +1 -1
- package/dist/lib/theme-save-message.js +1 -1
- package/dist/lib/web-backend.d.ts +4 -59
- package/dist/lib/web-backend.js +1 -1
- package/dist/lib/website-document-addressing.d.ts +2 -0
- package/dist/lib/website-document-addressing.js +1 -0
- package/dist/lib/website-host-inbound.d.ts +1 -0
- package/dist/lib/website-host-inbound.js +1 -0
- package/dist/lib/website-session.d.ts +5 -0
- package/dist/lib/website-session.js +1 -0
- package/package.json +15 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useEffect as o,useRef as T}from"react";import{usePreviewFooter as v}from"./PreviewFooterContext.js";import{useStorefrontDocument as O}from"./StorefrontDocumentContext.js";import{SITE_FOOTER_SLUG as p}from"../lib/content/footer.js";import{FOOTER_TYPE as P}from"../lib/puck/footer-blocks.js";import{clearFooterReturn as R,readFooterReturn as E}from"../lib/puck/footer-return.js";import{pinPreviewToBottom as I,pinPreviewToSection as n}from"../lib/puck/preview-dom.js";function C(i,f){const{currentSlug:d,siteId:m,navigate:l,footerOriginSlug:c}=O(),{selected:u}=i,S=i.data?.content??[],F=f.refreshes,r=d===p,{editFooter:s}=v(),e=T(null);o(()=>{const t=u?.props.id;r&&typeof t=="string"&&(e.current?.(),e.current=n(t))},[u?.props.id,r]);const a=t=>{e.current?.(),e.current=n(t)};return o(()=>{if(!r||!c)return;const t=S.find(g=>g.type===P)?.props?.id;if(t)return e.current?.(),e.current=n(String(t)),()=>{e.current?.(),e.current=null}},[r,c,F]),o(()=>{if(!(r||!E()))return I(()=>R())},[]),{pinnedSource:r,holdCanvasOn:r?a:void 0,editPinnedSource:()=>s?s():l({kind:"page",slug:p,siteId:m??void 0})}}export{C as useFooterFocus};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ScreenInspector, ScreenNode, ScreenTree, ScreenTreeFolds } from "../lib/editor-screen.js";
|
|
2
|
+
export declare const LOCATIONS_TYPE = "ContactLocations";
|
|
3
|
+
export declare function useLocationsTree(inspector: ScreenInspector, tree: ScreenTree): {
|
|
4
|
+
renderLocationTree: (section: ScreenNode, si: number, { rowClick, isCollapsed, toggleCollapse }: ScreenTreeFolds) => import("react").JSX.Element;
|
|
5
|
+
sectionPressed: (node: ScreenNode | undefined) => void;
|
|
6
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as t,jsxs as d,Fragment as ge}from"react/jsx-runtime";import{Fragment as q,useEffect as J,useRef as F}from"react";import{useTreeDrag as Q}from"efficient-easel/drag";import{ImageIcon as ye,TextLinesIcon as ke,TrashIcon as V}from"efficient-easel/icons";import{Subtree as X,TreeRow as L,TreeRowAction as Z,TreeSeam as b}from"efficient-easel/tree";import{decodeLocationPartId as ve,encodeLocationPartId as xe,usePreviewLocationPart as fe}from"./PreviewLocationPartContext.js";import{PUCK_MODE as he}from"./SectionEditor.js";import{useLocationsFocus as me,setLocationsFocus as p}from"../lib/puck/locations-focus.js";import{bucketsOf as ee,moveGroup as oe,moveCity as ne,addCity as Le,addGroup as Ie,deleteGroup as Pe,deleteCity as Ce,absCityIndex as te,groupLabelOf as Se,cardKey as re}from"../lib/puck/locations-tree.js";const ce="ContactLocations";function $e({size:c=13}){return d("svg",{width:c,height:c,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t("circle",{cx:"12",cy:"12",r:"9"}),t("path",{d:"M3 12h18M12 3c2.6 2.6 2.6 15.4 0 18M12 3c-2.6 2.6-2.6 15.4 0 18"})]})}function we({size:c=13}){return d("svg",{width:c,height:c,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t("path",{d:"M12 21s6-5 6-10a6 6 0 10-12 0c0 5 6 10 6 10z"}),t("circle",{cx:"12",cy:"11",r:"2"})]})}function Te({size:c=13}){return d("svg",{width:c,height:c,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[t("path",{d:"M9 4 3 6.5v13L9 17l6 3 6-2.5v-13L15 7z"}),t("path",{d:"M9 4v13M15 7v13"})]})}const $=c=>({parentId:`locations-${c}`,slot:"groups"}),O=(c,y)=>({parentId:`locations-${c}`,slot:`cities:${y}`});function _e(c,y){const{readOnly:I,selected:P}=y,v=y.data?.content??[],le=c.kind===he.kind,w=F(null);J(()=>{const o=P?.type===ce?String(P.props.id):null;o&&o!==w.current&&p({level:"groups"}),w.current=o},[P?.props.id]);const{selectedLocationPartId:se,setSelectedLocationPartId:G,setSelectHandler:j}=fe(),l=me(),g=(o,e)=>{const r=v[o];r&&y.replace(o,{type:r.type,props:{...r.props,locations:e}})},f=o=>{const e=v[o]?.props?.locations;return Array.isArray(e)?e:[]},A=Q({keyOf:o=>`group:${o.si}:${o.index}`,readOnly:!!I,canDrop:(o,e)=>e.parentId===$(o.si).parentId&&e.slot==="groups",onDrop:(o,e)=>{g(o.si,oe(f(o.si),o.index,e.index)),l.level==="city"&&p({level:"groups"})},onStep:(o,e)=>{g(o.si,oe(f(o.si),o.index,e<0?o.index-1:o.index+2)),l.level==="city"&&p({level:"groups"})}}),T=Q({keyOf:o=>`city:${o.si}:${o.group}:${o.index}`,readOnly:!!I,canDrop:(o,e)=>e.parentId===$(o.si).parentId&&e.slot.startsWith("cities:"),onDrop:(o,e)=>{const r=e.slot.slice(7);g(o.si,ne(f(o.si),o.group,o.index,r,e.index)),p({level:"group",key:r})},onStep:(o,e)=>{g(o.si,ne(f(o.si),o.group,o.index,o.group,e<0?o.index-1:o.index+2)),l.level==="city"&&p({level:"group",key:o.group})}}),N=F(v);N.current=v;const R=F(()=>{});J(()=>{j(o=>{const e=ve(o);if(!e)return;const r=N.current.findIndex(C=>C.props?.id===e.nodeId);r<0||R.current(r,{level:e.part,index:e.index})})},[j]);const s=(o,e)=>{w.current=v[o]?.props?.id??null,y.select(o),p(e),c.reveal();const r=v[o]?.props?.id;typeof r=="string"&&(e.level==="image"||e.level==="map")?G(xe(r,e.index,e.level)):G(null),typeof r=="string"&&y.scrollTo(r)};return R.current=s,{renderLocationTree:(o,e,{rowClick:r,isCollapsed:C,toggleCollapse:z})=>{const x=f(e),ie=ee(x),h=String(o.props.id),m=le&&P?.props.id===h,_=n=>t(b,{...I?{}:A.seam({place:{...$(e),index:n}})},`seam:${h}:groups:${n}`),B=(n,u)=>t(b,{...I?{}:T.seam({place:{...O(e,n),index:u}})},`seam:${h}:cities:${n}:${u}`);return d(ge,{children:[t(L,{icon:t(ke,{size:13}),name:"Texts",onSelect:()=>s(e,{level:"texts"}),selected:m&&l.level==="texts",rowProps:{onClick:r(()=>s(e,{level:"texts"}))}}),ie.map((n,u)=>{const D=`${h}::grp::${n.key}`,E=C(D),ae=m&&l.level==="group"&&l.key===n.key,W=Se(n.key,n.name),K={...O(e,n.key),index:n.cards.length},H=T.row({item:{si:e,group:n.key,index:-1},place:K,into:K,canDrag:!1},{onClick:r(()=>s(e,{level:"group",key:n.key}))}),S=A.row({item:{si:e,index:u},place:{...$(e),index:u}},H.rowProps);return d(q,{children:[u===0&&_(0),t(L,{icon:t($e,{size:13}),name:W,onSelect:()=>s(e,{level:"group",key:n.key}),selected:ae,draggable:S.draggable,dragging:S.dragging,drop:S.drop??H.drop,fold:{open:!E,label:"group",onToggle:()=>z(D)},actions:t(Z,{kind:"delete",label:`Delete ${W} group (${n.cards.length} ${n.cards.length===1?"city":"cities"})`,onClick:()=>{g(e,Pe(x,n.key)),p({level:"groups"})},children:t(V,{size:15})}),rowProps:S.rowProps,children:t("span",{className:"es-group-count",children:n.cards.length})}),!E&&d(X,{children:[n.cards.map((k,a)=>{const i=te(x,n.key,a),de=m&&l.level==="city"&&l.index===i,M=String(k?.name??"")||"City",U=`${h}::city::${re(k)}`,Y=C(U),{rowProps:pe,...ue}=T.row({item:{si:e,group:n.key,index:a},place:{...O(e,n.key),index:a}},{onClick:r(()=>s(e,{level:"city",index:i}))});return d(q,{children:[a===0&&B(n.key,0),t(L,{icon:t(we,{size:13}),name:M,onSelect:()=>s(e,{level:"city",index:i}),selected:de,...ue,fold:{open:!Y,label:M,onToggle:()=>z(U)},actions:t(Z,{kind:"delete",label:`Delete ${M}`,onClick:()=>{g(e,Ce(x,n.key,a)),p({level:"group",key:n.key})},children:t(V,{size:15})}),rowProps:pe}),!Y&&d(X,{children:[t(L,{icon:t(ye,{size:13}),name:"Image",onSelect:()=>s(e,{level:"image",index:i}),selected:m&&l.level==="image"&&l.index===i,rowProps:{onClick:r(()=>s(e,{level:"image",index:i}))}}),t(L,{icon:t(Te,{size:13}),name:"Map",onSelect:()=>s(e,{level:"map",index:i}),selected:m&&l.level==="map"&&l.index===i,rowProps:{onClick:r(()=>s(e,{level:"map",index:i}))}})]}),B(n.key,a+1)]},re(k))}),d("button",{type:"button",className:"sf-add-card",onClick:()=>{const k=Le(x,n.key);g(e,k);const a=ee(k).find(i=>i.key===n.key);p(a&&a.cards.length?{level:"city",index:te(k,n.key,a.cards.length-1)}:{level:"group",key:n.key})},children:[t("span",{className:"sf-plus sf-plus--sm",children:"+"}),"Add city"]})]}),_(u+1)]},D)}),d("button",{type:"button",className:"sf-add-card",onClick:()=>{const{cards:n,key:u}=Ie(x);g(e,n),s(e,{level:"group",key:u})},children:[t("span",{className:"sf-plus sf-plus--sm",children:"+"}),"Add group"]})]})},sectionPressed:o=>{o?.type===ce&&p({level:"groups"})}}}export{ce as LOCATIONS_TYPE,_e as useLocationsTree};
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function usePartBridge({ mode, setMode, onOpenPart, }: {
|
|
3
|
-
mode: InspectorMode;
|
|
4
|
-
setMode: (update: (current: InspectorMode) => InspectorMode) => void;
|
|
5
|
-
onOpenPart?: (nodeId: string) => void;
|
|
6
|
-
}): {
|
|
7
|
-
selectNode: (nodeId: string) => void;
|
|
8
|
-
openPartId: string | null;
|
|
9
|
-
};
|
|
1
|
+
export { usePartBridge } from "efficient-easel/screen/components/usePartBridge";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{usePartBridge as t}from"efficient-easel/screen/components/usePartBridge";export{t as usePartBridge};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{useEffect as x,useRef as w}from"react";import{createNode as z,newId as Y}from"efficient-easel/data";import{useEaselApi as v}from"efficient-easel/easel";import{useStorefrontDocument as A}from"./StorefrontDocumentContext.js";import{SITE_FOOTER_SLUG as H}from"../lib/content/footer.js";import{boxFooterFromFooter as B}from"../lib/puck/box-footer.js";import{ROOT_ZONE as m,missingPinnedTypes as G,pinnedDuplicateIds as R}from"../lib/puck/content-tree.js";import{FOOTER_TYPE as r,HEADER_TYPE as h,buildDefaultFooterBlocks as _,buildDefaultHeaderNode as b}from"../lib/puck/footer-blocks.js";import{canSeedPinnedChrome as L}from"../lib/puck/pinned-seed-gate.js";import{siteFooterDocChrome as U,SITE_FOOTER_TYPE as S}from"../lib/puck/section-groups.js";function $(t,y){const{capabilities:I,currentSlug:N,docId:a,data:E,saveStatus:g}=A(),{hasSiteSettings:D,hasPinnedChrome:F}=I,T=N===H,O=v().getState,P=w(null);x(()=>{if(!L({docId:a,saveStatus:g,seededDocId:P.current})||(P.current=a,!F))return;const d=O().appState.data,n=d.content,f=E?.content??[],c=(e,s)=>e.some(o=>o?.type===s);if(!D){const e=new Set(R(n)),s=e.size?n.filter(i=>!e.has(i.props.id)):n;e.size&&t.setDocument({...d,content:s});const o=G(s,f);if(o.includes(r)){const i=s.length,u=t.insertSection(r,i);t.replaceComponent(m,i,{type:r,props:{id:u,blocks:_()}})}o.includes(h)&&t.insertNode(m,0,b());return}if(T){const e=U(n);if(e!==n&&t.setDocument({...d,content:[...e]}),!e.find(o=>o.type===r)&&!c(f,r)&&!c(e,S)&&!c(f,S)){const o=(u,C)=>z(y,u,C),i={type:r,props:{blocks:_()}};t.insertNode(m,e.length,B(i,o,Y(S)))}return}const l=n.filter(e=>e.type!==r),k=new Set(R(l)),p=k.size?l.filter(e=>!k.has(e.props.id)):l;p.length!==n.length&&t.setDocument({...d,content:p}),!c(p,h)&&!c(f,h)&&t.insertNode(m,0,b())},[a,g,E,O,t,D,F,T])}export{$ as usePinnedChromeSeed};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{useCallback as L,useEffect as A,useMemo as v,useRef as O,useState as C}from"react";import{EMPTY_SOCIAL_ROWS as b}from"./PreviewSocialContext.js";import{SOCIAL_PLATFORMS as d,normalizeSocialLinks as p}from"../lib/content/social-links.js";import{backendOf as w}from"../lib/
|
|
1
|
+
"use client";import{useCallback as L,useEffect as A,useMemo as v,useRef as O,useState as C}from"react";import{EMPTY_SOCIAL_ROWS as b}from"./PreviewSocialContext.js";import{SOCIAL_PLATFORMS as d,normalizeSocialLinks as p}from"../lib/content/social-links.js";import{backendOf as w}from"../lib/website-session.js";import{useEditorSession as y}from"../lib/editor-session-context.js";import{WebsiteBackendError as _}from"../lib/web-backend.js";const g="Could not save this link. Check your connection and try again.";function F(n,r){if(!(n instanceof _)||n.kind!=="invalid")return null;const s=n.fields?.[r];return typeof s=="string"&&s.trim()?s:null}function R(n){return Object.fromEntries(d.map(r=>[r,{value:n[r]??"",error:null}]))}function z({token:n,siteId:r,enabled:s}){const[c,i]=C(b),m=O(null),a=O(!1),h=y(),t=w(h).social,o=s&&!!n&&!!r&&!!t;A(()=>{if(!o||!n||!r||!t)return;m.current!==r&&(m.current=r,a.current=!1,i(b));let e=!1;return t.get({siteId:r}).then(l=>{!e&&!a.current&&i(R(l))}).catch(()=>{}),()=>{e=!0}},[o,n,r,t]);const S=L(async(e,l)=>{if(!o||!n||!r||!t)return{ok:!1,error:"There is no website to save to."};try{const f=await t.update({[e]:l.trim()},{siteId:r});return a.current=!0,i(u=>({...u,[e]:{value:f[e]??"",error:null}})),{ok:!0}}catch(f){const u=F(f,e)??g;return i(E=>({...E,[e]:{...E[e],error:u}})),{ok:!1,error:u}}},[o,n,r,t]),k=v(()=>p(Object.fromEntries(d.map(e=>[e,c[e].value]))),[c]);return v(()=>({links:k,rows:c,canSave:o,saveLink:S}),[k,c,o,S])}export{g as SOCIAL_SAVE_FAILED,F as socialFieldError,z as useSocialSettings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{getEditorSiteId as t}from"../lib/editor-site.js";import{backendOf as e}from"../lib/
|
|
1
|
+
"use client";import{getEditorSiteId as t}from"../lib/editor-site.js";import{backendOf as e}from"../lib/website-session.js";import{makeSessionLoader as r}from"../lib/editor-session-loader.js";const f=r({fetch:async(n,o)=>await e().blog?.posts(o?{siteId:o}:void 0)??[],keyBy:t});export{f as loadStorefrontBlogPosts};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { clientOnly } from "efficient-easel/screen/lib/client-only";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{clientOnly as n}from"efficient-easel/screen/lib/client-only";export{n as clientOnly};
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export declare const VIEW_TIER_LABEL: Record<ViewTier, string>;
|
|
4
|
-
export declare const VIEW_TABLET_MIN = 720;
|
|
5
|
-
export declare const VIEW_DESKTOP_MIN = 1100;
|
|
6
|
-
export declare function viewTierForWidth(width: number): ViewTier;
|
|
1
|
+
export { VIEW_DESKTOP_MIN, VIEW_TABLET_MIN, VIEW_TIER_LABEL, VIEW_TIERS, viewTierForWidth } from "efficient-easel/screen/lib/content/view-tiers";
|
|
2
|
+
export type { ViewTier } from "efficient-easel/screen/lib/content/view-tiers";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{VIEW_DESKTOP_MIN as _,VIEW_TABLET_MIN as T,VIEW_TIER_LABEL as W,VIEW_TIERS as r,viewTierForWidth as V}from"efficient-easel/screen/lib/content/view-tiers";export{_ as VIEW_DESKTOP_MIN,T as VIEW_TABLET_MIN,r as VIEW_TIERS,W as VIEW_TIER_LABEL,V as viewTierForWidth};
|
|
@@ -1,29 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export interface AuthMessage {
|
|
4
|
-
type?: string;
|
|
5
|
-
token?: string;
|
|
6
|
-
siteId?: string;
|
|
7
|
-
brandId?: string;
|
|
8
|
-
theme?: string;
|
|
9
|
-
can?: unknown;
|
|
10
|
-
}
|
|
11
|
-
export type BridgedCapabilities = {
|
|
12
|
-
canCreatePlatformTemplate: boolean;
|
|
13
|
-
};
|
|
14
|
-
export declare const NO_BRIDGED_CAPABILITIES: BridgedCapabilities;
|
|
15
|
-
export declare function applyAuthGrant(d: AuthMessage & {
|
|
16
|
-
token: string;
|
|
17
|
-
}, opts?: {
|
|
18
|
-
stampChromeTheme?: boolean;
|
|
19
|
-
session?: EditorSession;
|
|
20
|
-
}): void;
|
|
21
|
-
export interface AdminBridge {
|
|
22
|
-
token: string | null;
|
|
23
|
-
tokenRef: RefObject<string | null>;
|
|
24
|
-
capabilities: BridgedCapabilities;
|
|
25
|
-
}
|
|
26
|
-
export declare function useAdminBridge(handlers?: {
|
|
27
|
-
onAuth?: (hadToken: boolean) => void;
|
|
28
|
-
onMessage?: (data: unknown) => void;
|
|
29
|
-
}): AdminBridge;
|
|
1
|
+
export { applyAuthGrant, NO_BRIDGED_CAPABILITIES, useAdminBridge } from "efficient-easel/screen/lib/admin-bridge";
|
|
2
|
+
export type { AdminBridge, AuthMessage, BridgedCapabilities } from "efficient-easel/screen/lib/admin-bridge";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{applyAuthGrant as t,NO_BRIDGED_CAPABILITIES as A,useAdminBridge as I}from"efficient-easel/screen/lib/admin-bridge";export{A as NO_BRIDGED_CAPABILITIES,t as applyAuthGrant,I as useAdminBridge};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { hostLoadRefusalOf, hostUnreachableMessage, isBackendError, provideHostFailures, readHostFailure, STATUS_UNREACHABLE, WebsiteBackendError } from "efficient-easel/screen/lib/backend-error";
|
|
2
|
+
export type { HostFailure, WebsiteBackendErrorKind } from "efficient-easel/screen/lib/backend-error";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{hostLoadRefusalOf as a,hostUnreachableMessage as o,isBackendError as s,provideHostFailures as t,readHostFailure as d,STATUS_UNREACHABLE as i,WebsiteBackendError as l}from"efficient-easel/screen/lib/backend-error";export{i as STATUS_UNREACHABLE,l as WebsiteBackendError,a as hostLoadRefusalOf,o as hostUnreachableMessage,s as isBackendError,t as provideHostFailures,d as readHostFailure};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentConfig } from "efficient-easel/blocks";
|
|
2
|
-
import { type EditorSession } from "./editor-session.js";
|
|
2
|
+
import { type EditorSession, type SessionBlocks } from "./editor-session.js";
|
|
3
3
|
import { type BlockSet } from "./puck/section-catalog.js";
|
|
4
4
|
export interface EditorBlockCategory {
|
|
5
5
|
key: string;
|
|
@@ -16,5 +16,5 @@ export interface EditorBlocks {
|
|
|
16
16
|
metadata?: Record<string, unknown>;
|
|
17
17
|
}
|
|
18
18
|
export type OfferedSets = Readonly<Record<BlockSet, boolean>>;
|
|
19
|
-
export declare function offeredSets(blocks: EditorBlocks | null | undefined): OfferedSets;
|
|
19
|
+
export declare function offeredSets(blocks: EditorBlocks | SessionBlocks | null | undefined): OfferedSets;
|
|
20
20
|
export declare function offeredSetsOf(session?: EditorSession): OfferedSets;
|
|
@@ -1,52 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export type EditorSurface
|
|
3
|
-
export interface HostPanelProps {
|
|
4
|
-
placeholderMode: boolean;
|
|
5
|
-
tokenRef: RefObject<string | null>;
|
|
6
|
-
siteId: string | null;
|
|
7
|
-
websiteName: string | null;
|
|
8
|
-
onOpenWebsiteSettings?: () => void;
|
|
9
|
-
onAuthExpired: () => void;
|
|
10
|
-
}
|
|
11
|
-
export interface HostPageRow {
|
|
12
|
-
key: string;
|
|
13
|
-
label: string;
|
|
14
|
-
href: string;
|
|
15
|
-
icon: ReactNode;
|
|
16
|
-
}
|
|
17
|
-
export interface HostProduct {
|
|
18
|
-
slug: string;
|
|
19
|
-
name: string;
|
|
20
|
-
href: string;
|
|
21
|
-
}
|
|
22
|
-
export interface HostLinkRowProps {
|
|
23
|
-
value: string;
|
|
24
|
-
onChange: (url: string) => void;
|
|
25
|
-
pages: readonly {
|
|
26
|
-
slug: string;
|
|
27
|
-
layout?: unknown;
|
|
28
|
-
}[];
|
|
29
|
-
}
|
|
30
|
-
export interface EditorChrome {
|
|
31
|
-
wrap?: ComponentType<{
|
|
32
|
-
surface: EditorSurface;
|
|
33
|
-
children: ReactNode;
|
|
34
|
-
}>;
|
|
35
|
-
panels?: {
|
|
36
|
-
header?: ComponentType<HostPanelProps>;
|
|
37
|
-
chromePage?: ComponentType;
|
|
38
|
-
};
|
|
39
|
-
pageRows?: {
|
|
40
|
-
title: string;
|
|
41
|
-
rows: readonly HostPageRow[];
|
|
42
|
-
};
|
|
43
|
-
products?: {
|
|
44
|
-
list(): Promise<readonly HostProduct[]>;
|
|
45
|
-
};
|
|
46
|
-
linkRow?: ComponentType<HostLinkRowProps>;
|
|
47
|
-
}
|
|
48
|
-
export declare function ChromeWrap({ wrap: Wrap, surface, children, }: {
|
|
49
|
-
wrap: EditorChrome["wrap"] | undefined;
|
|
50
|
-
surface: EditorSurface;
|
|
51
|
-
children: ReactNode;
|
|
52
|
-
}): import("react").JSX.Element;
|
|
1
|
+
export { ChromeWrap } from "efficient-easel/screen/lib/host-chrome";
|
|
2
|
+
export type { EaselChrome as EditorChrome, EaselSurface as EditorSurface, HostLinkRowProps, HostPageRow, HostPanelProps, HostProduct } from "efficient-easel/screen/lib/host-chrome";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{ChromeWrap as o}from"efficient-easel/screen/lib/host-chrome";export{o as ChromeWrap};
|
|
@@ -1,55 +1,7 @@
|
|
|
1
1
|
import { type OfferedSets } from "./editor-blocks.js";
|
|
2
|
-
import type {
|
|
2
|
+
import type { EditorCapabilities, EditorDocument, EditorDocumentAdapter } from "./editor-document-contract.js";
|
|
3
|
+
import type { EditorPageRow, WebsiteBackend } from "./web-backend.js";
|
|
3
4
|
export type { EditorPageRow };
|
|
4
|
-
export type EditorCapabilities
|
|
5
|
-
canPublish: boolean;
|
|
6
|
-
hasSiteSettings: boolean;
|
|
7
|
-
hasSiteTheme: boolean;
|
|
8
|
-
placeholderFrames: boolean;
|
|
9
|
-
mediaEditing: boolean;
|
|
10
|
-
pageCreationInAdminForm: boolean;
|
|
11
|
-
canDeletePagesInline: boolean;
|
|
12
|
-
hasEditLock: boolean;
|
|
13
|
-
hasEditGuard: boolean;
|
|
14
|
-
hasPinnedChrome: boolean;
|
|
15
|
-
explainsSiteSettings: boolean;
|
|
16
|
-
hasSiteRecord: boolean;
|
|
17
|
-
canEditSiteRecord: boolean;
|
|
18
|
-
hasPreviewLink: boolean;
|
|
19
|
-
hasCatalog: boolean;
|
|
20
|
-
hasForms: boolean;
|
|
21
|
-
hasBlog: boolean;
|
|
22
|
-
offersCommerce: boolean;
|
|
23
|
-
offersService: boolean;
|
|
24
|
-
};
|
|
25
|
-
export type EditorDocument = {
|
|
26
|
-
id: string;
|
|
27
|
-
layout: unknown;
|
|
28
|
-
kind?: string | null;
|
|
29
|
-
version?: string | null;
|
|
30
|
-
};
|
|
31
|
-
export interface EditorDocumentAdapter {
|
|
32
|
-
capabilities: EditorCapabilities;
|
|
33
|
-
resolve(slug: string): Promise<EditorDocument | null>;
|
|
34
|
-
saveLayout(id: string, layout: Record<string, unknown>, version: string | null, clientId?: string): Promise<{
|
|
35
|
-
version: string | null;
|
|
36
|
-
}>;
|
|
37
|
-
rereadVersion?(id: string): Promise<string | null>;
|
|
38
|
-
publish?(id: string, version?: string): Promise<{
|
|
39
|
-
version: string | null;
|
|
40
|
-
}>;
|
|
41
|
-
lock?: WebsiteEditLock;
|
|
42
|
-
listPages(): Promise<EditorPageRow[]>;
|
|
43
|
-
createPage?(input: {
|
|
44
|
-
slug: string;
|
|
45
|
-
title: string;
|
|
46
|
-
layout: Record<string, unknown>;
|
|
47
|
-
}): Promise<EditorPageRow>;
|
|
48
|
-
deletePage?(id: string): Promise<void>;
|
|
49
|
-
site?(): Promise<SiteRecord>;
|
|
50
|
-
updateSite?(patch: SiteRecordPatch): Promise<SiteRecord>;
|
|
51
|
-
templateName?(): Promise<string>;
|
|
52
|
-
previewHref?(slug: string): string;
|
|
53
|
-
}
|
|
5
|
+
export type { EditorCapabilities, EditorDocument, EditorDocumentAdapter };
|
|
54
6
|
export declare function makeSitePageAdapter(siteId: string | undefined, backend?: WebsiteBackend, offered?: OfferedSets): EditorDocumentAdapter;
|
|
55
7
|
export declare function makeTemplatePageAdapter(templateId: string, backend?: WebsiteBackend, offered?: OfferedSets): EditorDocumentAdapter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{offeredSetsOf as c}from"./editor-blocks.js";import{
|
|
1
|
+
"use client";import{offeredSetsOf as c}from"./editor-blocks.js";import{isEfficientBackend as m}from"./editor-session.js";import{backendOf as u}from"./website-session.js";function h(t,i){const s=i?{siteId:i}:void 0;return{resolve:e=>t.load({slug:e,...s}),saveLayout:(e,o,r,a)=>t.save(e,{layout:o},{version:r,clientId:a??""}),rereadVersion:t.version?e=>t.version(e):void 0,publish:t.publish?(e,o)=>t.publish(e,o?{version:o}:void 0):void 0,listPages:()=>t.list(s),createPage:t.create?e=>t.create({...e,...s}):void 0,deletePage:t.remove?e=>t.remove(e):void 0}}function f(t,i=u(),s=c()){const e=m(i),o=t?{siteId:t}:void 0,r=e?!!t:!0,a=i.site.update;return{capabilities:{canPublish:!!i.pages.publish,hasSiteSettings:e,hasSiteTheme:!!i.theme,placeholderFrames:!1,mediaEditing:!0,pageCreationInAdminForm:!i.pages.create,canDeletePagesInline:!!i.pages.remove,hasEditLock:!!i.lock,hasEditGuard:!0,hasPinnedChrome:e&&s.commerce&&s.service,explainsSiteSettings:!1,hasSiteRecord:r,canEditSiteRecord:r&&!!a,hasPreviewLink:e||!!i.preview,hasCatalog:e&&s.commerce,hasForms:e&&s.service,hasBlog:!!i.blog&&s.service,offersCommerce:s.commerce,offersService:s.service},...h(i.pages,t),lock:i.lock,site:r?()=>i.site.get(o):void 0,updateSite:r&&a?n=>a(n,o):void 0,previewHref:i.preview?n=>i.preview.href(n):void 0}}function g(t,i=u(),s=c()){const e=m(i),o=i.templates,r=o?o.pages(t):{list:()=>Promise.reject(new Error(l)),load:()=>Promise.reject(new Error(l)),save:()=>Promise.reject(new Error(l))};return{capabilities:{canPublish:!1,hasSiteSettings:!1,hasSiteTheme:!1,placeholderFrames:!0,mediaEditing:!1,pageCreationInAdminForm:!r.create,canDeletePagesInline:!!r.remove,hasEditLock:!1,hasEditGuard:!1,hasPinnedChrome:e&&s.commerce&&s.service,explainsSiteSettings:e,hasSiteRecord:!1,canEditSiteRecord:!1,hasPreviewLink:!1,hasCatalog:e&&s.commerce,hasForms:e&&s.service,hasBlog:!!i.blog&&s.service,offersCommerce:s.commerce,offersService:s.service},...h(r,void 0),publish:void 0,templateName:o?()=>o.get(t).then(a=>a.name):void 0}}const l="This editor's backend has no website templates.";export{f as makeSitePageAdapter,g as makeTemplatePageAdapter};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{NO_DOCUMENT_ADDRESSING as o}from"efficient-easel/screen/lib/document-addressing";export{o as NO_DOCUMENT_ADDRESSING};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { EaselCapabilities as EditorCapabilities, EaselDocument as EditorDocument, EaselDocumentAdapter as EditorDocumentAdapter, EaselPageRow as EditorPageRow, SiteRecord, SiteRecordPatch, WebsiteEditLock } from "efficient-easel/screen/lib/document-contract";
|
|
File without changes
|
|
@@ -1,15 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { EditorCapabilities } from "./editor-document-adapter.js";
|
|
3
|
-
export interface OpeningDocument {
|
|
4
|
-
slug: string;
|
|
5
|
-
isTemplate: boolean;
|
|
6
|
-
capabilities: EditorCapabilities;
|
|
7
|
-
}
|
|
8
|
-
export interface EditorDocumentHooks {
|
|
9
|
-
opening?(document: OpeningDocument): (layout: Data) => Promise<Data>;
|
|
10
|
-
stored?(layout: Data): Data;
|
|
11
|
-
storedNode?<T extends {
|
|
12
|
-
type: string;
|
|
13
|
-
props?: Record<string, unknown>;
|
|
14
|
-
}>(node: T): T;
|
|
15
|
-
}
|
|
1
|
+
export type { EaselDocumentHooks as EditorDocumentHooks, OpeningDocument } from "efficient-easel/screen/lib/document-hooks";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{resetForDocumentSwitch as o,saveStatusForNewDocument as r,saveStatusOf as s}from"efficient-easel/screen/lib/document-switch";export{o as resetForDocumentSwitch,r as saveStatusForNewDocument,s as saveStatusOf};
|
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const PAGE_CONFLICT_CODE = "page_changed_elsewhere";
|
|
3
|
-
export declare function readEditorFailure(err: unknown): EditLockFailure | null;
|
|
4
|
-
export declare function isExpiredSession(err: unknown): boolean;
|
|
1
|
+
export { isExpiredSession, PAGE_CONFLICT_CODE, readEaselFailure as readEditorFailure } from "efficient-easel/screen/lib/failure";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{isExpiredSession as a,PAGE_CONFLICT_CODE as i,readEaselFailure as s}from"efficient-easel/screen/lib/failure";export{i as PAGE_CONFLICT_CODE,a as isExpiredSession,s as readEditorFailure};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { routeSharedHostMessage } from "efficient-easel/screen/lib/host-inbound";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{routeSharedHostMessage as r}from"efficient-easel/screen/lib/host-inbound";export{r as routeSharedHostMessage};
|
|
@@ -1,135 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export interface HostPickedMedia {
|
|
4
|
-
id: string;
|
|
5
|
-
url: string;
|
|
6
|
-
kind: "image" | "video";
|
|
7
|
-
}
|
|
8
|
-
export type SectionEditorTarget = {
|
|
9
|
-
kind: "section";
|
|
10
|
-
id: string;
|
|
11
|
-
type?: string;
|
|
12
|
-
name?: string;
|
|
13
|
-
};
|
|
14
|
-
export type EditorToHostMessage = {
|
|
15
|
-
type: "storefront-editor:ready";
|
|
16
|
-
} | {
|
|
17
|
-
type: "storefront-editor:auth-expired";
|
|
18
|
-
} | {
|
|
19
|
-
type: "storefront-editor:dirty";
|
|
20
|
-
} | {
|
|
21
|
-
type: "storefront-editor:saved";
|
|
22
|
-
} | {
|
|
23
|
-
type: "storefront-editor:published";
|
|
24
|
-
} | {
|
|
25
|
-
type: "storefront-editor:save-failed";
|
|
26
|
-
} | {
|
|
27
|
-
type: "storefront-editor:navigated";
|
|
28
|
-
target: EditorTarget;
|
|
29
|
-
} | {
|
|
30
|
-
type: "storefront-editor:open-media-picker";
|
|
31
|
-
requestId: string;
|
|
32
|
-
accept: string;
|
|
33
|
-
title: string;
|
|
34
|
-
file?: File;
|
|
35
|
-
} | {
|
|
36
|
-
type: "storefront-editor:open-form";
|
|
37
|
-
requestId?: string;
|
|
38
|
-
mode: "create" | "edit";
|
|
39
|
-
formId?: string;
|
|
40
|
-
} | {
|
|
41
|
-
type: "storefront-editor:open-category";
|
|
42
|
-
categoryId: string;
|
|
43
|
-
name?: string;
|
|
44
|
-
} | {
|
|
45
|
-
type: "storefront-editor:open-product";
|
|
46
|
-
slug: string;
|
|
47
|
-
name?: string;
|
|
48
|
-
} | {
|
|
49
|
-
type: "storefront-editor:open-post";
|
|
50
|
-
slug: string;
|
|
51
|
-
title?: string;
|
|
52
|
-
} | {
|
|
53
|
-
type: "storefront-editor:open-menus";
|
|
54
|
-
menuId?: string | null;
|
|
55
|
-
} | {
|
|
56
|
-
type: "storefront-editor:open-page";
|
|
57
|
-
slug: string;
|
|
58
|
-
} | {
|
|
59
|
-
type: "storefront-editor:new-page";
|
|
60
|
-
} | {
|
|
61
|
-
type: "storefront-editor:save-as-template";
|
|
62
|
-
siteId: string;
|
|
63
|
-
slug: string;
|
|
64
|
-
};
|
|
65
|
-
export type HostToEditorMessage = {
|
|
66
|
-
type: "storefront-editor:auth";
|
|
67
|
-
token: string;
|
|
68
|
-
siteId?: string;
|
|
69
|
-
brandId?: string;
|
|
70
|
-
theme?: string;
|
|
71
|
-
can?: {
|
|
72
|
-
canCreatePlatformTemplate?: boolean;
|
|
73
|
-
};
|
|
74
|
-
} | {
|
|
75
|
-
type: "storefront-editor:navigate";
|
|
76
|
-
target: EditorTarget | SectionEditorTarget;
|
|
77
|
-
} | {
|
|
78
|
-
type: "storefront-editor:category-updated";
|
|
79
|
-
categoryId?: string;
|
|
80
|
-
} | {
|
|
81
|
-
type: "storefront-editor:menus-updated";
|
|
82
|
-
} | {
|
|
83
|
-
type: "storefront-editor:form-saved";
|
|
84
|
-
requestId?: string;
|
|
85
|
-
form?: {
|
|
86
|
-
id: string;
|
|
87
|
-
slug: string;
|
|
88
|
-
};
|
|
89
|
-
} | {
|
|
90
|
-
type: "storefront-editor:form-closed";
|
|
91
|
-
requestId?: string;
|
|
92
|
-
} | {
|
|
93
|
-
type: "storefront-editor:media-picked";
|
|
94
|
-
requestId: string;
|
|
95
|
-
media: HostPickedMedia;
|
|
96
|
-
} | {
|
|
97
|
-
type: "storefront-editor:media-pick-cancelled";
|
|
98
|
-
requestId: string;
|
|
99
|
-
};
|
|
100
|
-
export type EditorMessageType = EditorToHostMessage["type"];
|
|
101
|
-
type PayloadOf<T extends EditorMessageType> = Omit<Extract<EditorToHostMessage, {
|
|
102
|
-
type: T;
|
|
103
|
-
}>, "type">;
|
|
104
|
-
export type SendToHost = <T extends EditorMessageType>(type: T, ...payload: Record<string, never> extends PayloadOf<T> ? [PayloadOf<T>?] : [PayloadOf<T>]) => void;
|
|
105
|
-
export type InboundHostMessage = {
|
|
106
|
-
type: string;
|
|
107
|
-
} & Record<string, unknown>;
|
|
108
|
-
export interface EditorHostAddress {
|
|
109
|
-
search(): string;
|
|
110
|
-
show(target: EditorTarget | SectionEditorTarget): void;
|
|
111
|
-
load(target: EditorTarget): void;
|
|
112
|
-
reload(): void;
|
|
113
|
-
}
|
|
114
|
-
export interface EditorHost {
|
|
115
|
-
readonly connected: boolean;
|
|
116
|
-
readonly ownsDocument: boolean;
|
|
117
|
-
send: SendToHost;
|
|
118
|
-
subscribe(listener: (message: InboundHostMessage) => void): () => void;
|
|
119
|
-
readonly address: EditorHostAddress;
|
|
120
|
-
}
|
|
121
|
-
export declare const DETACHED_EDITOR_HOST: EditorHost;
|
|
122
|
-
export declare const EditorHostContext: import("react").Context<EditorHost>;
|
|
123
|
-
export declare function EditorHostProvider({ host, children }: {
|
|
124
|
-
host: EditorHost;
|
|
125
|
-
children: ReactNode;
|
|
126
|
-
}): import("react").JSX.Element;
|
|
127
|
-
export declare function useEditorHost(): EditorHost;
|
|
128
|
-
export declare function createEditorHost(options: {
|
|
129
|
-
onMessage: (message: EditorToHostMessage) => void;
|
|
130
|
-
address: EditorHostAddress;
|
|
131
|
-
}): {
|
|
132
|
-
host: EditorHost;
|
|
133
|
-
deliver: (message: HostToEditorMessage) => void;
|
|
134
|
-
};
|
|
135
|
-
export {};
|
|
1
|
+
export { createEaselHost as createEditorHost, DETACHED_EASEL_HOST as DETACHED_EDITOR_HOST, EaselHostContext as EditorHostContext, EaselHostProvider as EditorHostProvider, useEaselHost as useEditorHost } from "efficient-easel/screen/lib/host";
|
|
2
|
+
export type { EaselHost as EditorHost, EaselHostAddress as EditorHostAddress, EaselMessageType as EditorMessageType, EaselToHostMessage as EditorToHostMessage, HostPickedMedia, HostToEaselMessage as HostToEditorMessage, InboundHostMessage, SectionScreenTarget as SectionEditorTarget, SendToHost } from "efficient-easel/screen/lib/host";
|
package/dist/lib/editor-host.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{createEaselHost as o,DETACHED_EASEL_HOST as e,EaselHostContext as E,EaselHostProvider as r,useEaselHost as H}from"efficient-easel/screen/lib/host";export{e as DETACHED_EDITOR_HOST,E as EditorHostContext,r as EditorHostProvider,o as createEditorHost,H as useEditorHost};
|
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function useEditorKeyTarget(rootRef: RefObject<HTMLElement | null>): EventTarget | null;
|
|
3
|
-
export declare function useEditorUndoKeys(rootRef: RefObject<HTMLElement | null>): void;
|
|
1
|
+
export { useEaselKeyTarget as useEditorKeyTarget, useEaselUndoKeys as useEditorUndoKeys } from "efficient-easel/screen/lib/key-scope";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{useEaselKeyTarget as a,useEaselUndoKeys as o}from"efficient-easel/screen/lib/key-scope";export{a as useEditorKeyTarget,o as useEditorUndoKeys};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{describeLoadFailure as a,hostLoadRefusal as r}from"efficient-easel/screen/lib/load-error";export{a as describeLoadFailure,r as hostLoadRefusal};
|
|
@@ -1,23 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export interface MediaPickRequest {
|
|
4
|
-
requestId: string;
|
|
5
|
-
accept: string;
|
|
6
|
-
title: string;
|
|
7
|
-
file?: File | null;
|
|
8
|
-
}
|
|
9
|
-
export interface MediaPanelProps {
|
|
10
|
-
pick: MediaPickRequest | null;
|
|
11
|
-
onPick: (media: HostPickedMedia) => void;
|
|
12
|
-
}
|
|
13
|
-
export type MediaPanelComponent = ComponentType<MediaPanelProps>;
|
|
14
|
-
export declare function MediaPanelProvider({ panel, children }: {
|
|
15
|
-
panel: MediaPanelComponent | null;
|
|
16
|
-
children: ReactNode;
|
|
17
|
-
}): import("react").JSX.Element;
|
|
18
|
-
export declare function useMediaPanel(): MediaPanelComponent | null;
|
|
19
|
-
export declare function hasMediaPanel(): boolean;
|
|
20
|
-
export declare function requestPanelPick(request: MediaPickRequest): Promise<HostPickedMedia | null>;
|
|
21
|
-
export declare function settlePanelPick(requestId: string, media: HostPickedMedia | null): void;
|
|
22
|
-
export declare function cancelPanelPick(): void;
|
|
23
|
-
export declare function usePanelPick(): MediaPickRequest | null;
|
|
1
|
+
export { cancelPanelPick, hasMediaPanel, MediaPanelProvider, requestPanelPick, settlePanelPick, useMediaPanel, usePanelPick } from "efficient-easel/screen/lib/media-panel";
|
|
2
|
+
export type { MediaPanelComponent, MediaPanelProps, MediaPickRequest } from "efficient-easel/screen/lib/media-panel";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{
|
|
1
|
+
"use client";import{cancelPanelPick as P,hasMediaPanel as l,MediaPanelProvider as i,requestPanelPick as n,settlePanelPick as c,useMediaPanel as s,usePanelPick as r}from"efficient-easel/screen/lib/media-panel";export{i as MediaPanelProvider,P as cancelPanelPick,l as hasMediaPanel,n as requestPanelPick,c as settlePanelPick,s as useMediaPanel,r as usePanelPick};
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
id: string;
|
|
4
|
-
url: string;
|
|
5
|
-
kind: "image" | "video";
|
|
6
|
-
}
|
|
7
|
-
export declare function requestMediaPick(host: EditorHost, opts: {
|
|
8
|
-
accept: string;
|
|
9
|
-
title: string;
|
|
10
|
-
file?: File | null;
|
|
11
|
-
}): Promise<PickedMedia | null>;
|
|
12
|
-
export declare function resolveMediaPick(requestId: string, media: PickedMedia | null): void;
|
|
1
|
+
export { requestMediaPick, resolveMediaPick } from "efficient-easel/screen/lib/media-picker";
|
|
2
|
+
export type { PickedMedia } from "efficient-easel/screen/lib/media-picker";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{requestMediaPick as r,resolveMediaPick as o}from"efficient-easel/screen/lib/media-picker";export{r as requestMediaPick,o as resolveMediaPick};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { pageEditLock } from "efficient-easel/screen/lib/page-lock";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{pageEditLock as p}from"efficient-easel/screen/lib/page-lock";export{p as pageEditLock};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { ScreenPartsProvider as EditorScreenProvider, sameInspectorMode, SELECTION_MODE, useScreenParts as useEditorScreen, useScreenBlockLook, useScreenBlockRules, useScreenBridges, useScreenCanvasFrame, useScreenDevices, useScreenDocumentPass, useScreenInspectorPanel, useScreenLeftView, useScreenOwnerName, useScreenPinned, useStandaloneScreenBridges } from "efficient-easel/screen/lib/screen-parts";
|
|
2
|
+
export type { ScreenParts as EditorScreenParts, NodeDefaults, ScreenBlockLook, ScreenBlockRules, ScreenBridges, ScreenCanvas, ScreenDevices, ScreenDocumentOps, ScreenInspector, ScreenInspectorMode, ScreenInspectorPanelProps, ScreenLeftPanel, ScreenLeftView, ScreenLeftViewFrame, ScreenLeftViewRules, ScreenNewNode, ScreenNode, ScreenNodeLevel, ScreenNodeMaker, ScreenPartMode, ScreenPinnedNodes, ScreenRailItem, ScreenTree, ScreenTreeFolds, ScreenTreeRows } from "efficient-easel/screen/lib/screen-parts";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{ScreenPartsProvider as s,sameInspectorMode as n,SELECTION_MODE as c,useScreenParts as S,useScreenBlockLook as u,useScreenBlockRules as o,useScreenBridges as a,useScreenCanvasFrame as t,useScreenDevices as i,useScreenDocumentPass as d,useScreenInspectorPanel as P,useScreenLeftView as l,useScreenOwnerName as m,useScreenPinned as E,useStandaloneScreenBridges as v}from"efficient-easel/screen/lib/screen-parts";export{s as EditorScreenProvider,c as SELECTION_MODE,n as sameInspectorMode,S as useEditorScreen,u as useScreenBlockLook,o as useScreenBlockRules,a as useScreenBridges,t as useScreenCanvasFrame,i as useScreenDevices,d as useScreenDocumentPass,P as useScreenInspectorPanel,l as useScreenLeftView,m as useScreenOwnerName,E as useScreenPinned,v as useStandaloneScreenBridges};
|