@toototech/webbuilder-plugins 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -0
- package/README.md +3 -0
- package/dist/basic/cssScope.d.ts +3 -0
- package/dist/basic/index.d.ts +81 -0
- package/dist/basic/injectStyle.d.ts +20 -0
- package/dist/basic/plugin.d.ts +19 -0
- package/dist/basic/publisher.d.ts +4 -0
- package/dist/basic/registries/interactive/accordion/index.d.ts +3 -0
- package/dist/basic/registries/interactive/backButton/index.d.ts +3 -0
- package/dist/basic/registries/interactive/button/index.d.ts +10 -0
- package/dist/basic/registries/interactive/countUp/index.d.ts +9 -0
- package/dist/basic/registries/interactive/customCode/index.d.ts +3 -0
- package/dist/basic/registries/interactive/index.d.ts +2 -0
- package/dist/basic/registries/interactive/inquiryForm/index.d.ts +3 -0
- package/dist/basic/registries/interactive/klaviyoSubscribe/index.d.ts +3 -0
- package/dist/basic/registries/interactive/popup/index.d.ts +5 -0
- package/dist/basic/registries/interactive/salesmartlyChatButton/index.d.ts +10 -0
- package/dist/basic/registries/interactive/search/index.d.ts +10 -0
- package/dist/basic/registries/interactive/socialShare/index.d.ts +33 -0
- package/dist/basic/registries/interactive/tabs/index.d.ts +3 -0
- package/dist/basic/registries/layout/container/index.d.ts +19 -0
- package/dist/basic/registries/layout/divider/index.d.ts +7 -0
- package/dist/basic/registries/layout/grid/index.d.ts +11 -0
- package/dist/basic/registries/layout/index.d.ts +2 -0
- package/dist/basic/registries/layout/layoutBase/index.d.ts +10 -0
- package/dist/basic/registries/layout/section/index.d.ts +3 -0
- package/dist/basic/registries/layout/sectionGridBlock/index.d.ts +3 -0
- package/dist/basic/registries/layout/spacer/index.d.ts +7 -0
- package/dist/basic/registries/media/banner/index.d.ts +11 -0
- package/dist/basic/registries/media/carousel/index.d.ts +6 -0
- package/dist/basic/registries/media/flipbook/index.d.ts +5 -0
- package/dist/basic/registries/media/icon/index.d.ts +3 -0
- package/dist/basic/registries/media/image/index.d.ts +3 -0
- package/dist/basic/registries/media/index.d.ts +2 -0
- package/dist/basic/registries/media/industryTabs/index.d.ts +3 -0
- package/dist/basic/registries/media/marquee/index.d.ts +4 -0
- package/dist/basic/registries/media/ourSolutions/helpers.d.ts +289 -0
- package/dist/basic/registries/media/ourSolutions/index.d.ts +4 -0
- package/dist/basic/registries/media/ourSolutions/script.d.ts +1 -0
- package/dist/basic/registries/media/ourSolutions/style.d.ts +1 -0
- package/dist/basic/registries/media/pdfViewer/index.d.ts +3 -0
- package/dist/basic/registries/media/productCategories/index.d.ts +4 -0
- package/dist/basic/registries/media/tabMediaGallery/index.d.ts +3 -0
- package/dist/basic/registries/media/video/index.d.ts +12 -0
- package/dist/basic/registries/navigation/footer/index.d.ts +10 -0
- package/dist/basic/registries/navigation/index.d.ts +2 -0
- package/dist/basic/registries/navigation/languageSwitcher/index.d.ts +6 -0
- package/dist/basic/registries/navigation/logo/index.d.ts +9 -0
- package/dist/basic/registries/navigation/navbar/constants.d.ts +38 -0
- package/dist/basic/registries/navigation/navbar/factories.d.ts +848 -0
- package/dist/basic/registries/navigation/navbar/helpers.d.ts +12 -0
- package/dist/basic/registries/navigation/navbar/index.d.ts +4 -0
- package/dist/basic/registries/navigation/navbar/registerMegaTypes.d.ts +2 -0
- package/dist/basic/registries/navigation/navbar/registerMenuTypes.d.ts +2 -0
- package/dist/basic/registries/navigation/navbar/registerRootTypes.d.ts +2 -0
- package/dist/basic/registries/navigation/navbar/script.d.ts +1 -0
- package/dist/basic/registries/navigation/navbar/style.d.ts +1 -0
- package/dist/basic/registries/navigation/socialLinks/index.d.ts +3 -0
- package/dist/basic/registries/section/allApplications/index.d.ts +3 -0
- package/dist/basic/registries/section/cardCarouselSection/index.d.ts +3 -0
- package/dist/basic/registries/section/caseSpotlight/index.d.ts +3 -0
- package/dist/basic/registries/section/companyScale/index.d.ts +3 -0
- package/dist/basic/registries/section/customizationGrid/index.d.ts +3 -0
- package/dist/basic/registries/section/factoryMap/index.d.ts +3 -0
- package/dist/basic/registries/section/focaHistoryTimeline/index.d.ts +3 -0
- package/dist/basic/registries/section/historyTimeline/index.d.ts +3 -0
- package/dist/basic/registries/section/homeBannerCarousel/index.d.ts +4 -0
- package/dist/basic/registries/section/hotspotShowcase/index.d.ts +30 -0
- package/dist/basic/registries/section/index.d.ts +2 -0
- package/dist/basic/registries/section/map/index.d.ts +4 -0
- package/dist/basic/registries/section/milestoneCardStrip/index.d.ts +3 -0
- package/dist/basic/registries/section/moreCardCarousel/index.d.ts +3 -0
- package/dist/basic/registries/section/ourAdvantages/index.d.ts +4 -0
- package/dist/basic/registries/section/overviewSplit/index.d.ts +3 -0
- package/dist/basic/registries/section/processTimeline/index.d.ts +3 -0
- package/dist/basic/registries/section/productCardStrip/index.d.ts +3 -0
- package/dist/basic/registries/section/resourceSection/index.d.ts +6 -0
- package/dist/basic/registries/section/responsiveHeroCarousel/index.d.ts +4 -0
- package/dist/basic/registries/section/serviceIconGrid/index.d.ts +4 -0
- package/dist/basic/registries/section/servicesCarousel/index.d.ts +4 -0
- package/dist/basic/registries/section/servicesShowcase/index.d.ts +4 -0
- package/dist/basic/registries/section/servicesThb/index.d.ts +4 -0
- package/dist/basic/registries/section/solutionList/index.d.ts +4 -0
- package/dist/basic/registries/section/staticPinMap/index.d.ts +4 -0
- package/dist/basic/registries/section/statsCards/index.d.ts +3 -0
- package/dist/basic/registries/section/swiperRuntime.d.ts +3 -0
- package/dist/basic/registries/shared/sharedTraits.d.ts +37 -0
- package/dist/basic/registries/types.d.ts +5 -0
- package/dist/basic/registries/typography/heading/index.d.ts +8 -0
- package/dist/basic/registries/typography/index.d.ts +2 -0
- package/dist/basic/registries/typography/textEditor/index.d.ts +6 -0
- package/dist/basic/registryManifest.d.ts +9 -0
- package/dist/basic/styleHelpers.d.ts +29 -0
- package/dist/basic/svgIcon.d.ts +11 -0
- package/dist/basic/traitBridge.d.ts +20 -0
- package/dist/basic/traitFactory.d.ts +106 -0
- package/dist/basic.js +1146 -0
- package/dist/cms/cmsFactory.d.ts +164 -0
- package/dist/cms/dynamicRenderPipeline.d.ts +12 -0
- package/dist/cms/index.d.ts +31 -0
- package/dist/cms/plugin.d.ts +12 -0
- package/dist/cms/publisher.d.ts +7 -0
- package/dist/cms/registries/dynamic/cms/constants.d.ts +16 -0
- package/dist/cms/registries/dynamic/cms/dynamicField/bindings.d.ts +78 -0
- package/dist/cms/registries/dynamic/cms/dynamicField/blocks/breadcrumbBlock.d.ts +1 -0
- package/dist/cms/registries/dynamic/cms/dynamicField/blocks/conditionalBlock.d.ts +1 -0
- package/dist/cms/registries/dynamic/cms/dynamicField/blocks/datetimeBlock.d.ts +1 -0
- package/dist/cms/registries/dynamic/cms/dynamicField/blocks/htmlBlock.d.ts +1 -0
- package/dist/cms/registries/dynamic/cms/dynamicField/blocks/imageBlock.d.ts +1 -0
- package/dist/cms/registries/dynamic/cms/dynamicField/blocks/linkBlock.d.ts +1 -0
- package/dist/cms/registries/dynamic/cms/dynamicField/blocks/seoBlock.d.ts +1 -0
- package/dist/cms/registries/dynamic/cms/dynamicField/blocks/textBlock.d.ts +1 -0
- package/dist/cms/registries/dynamic/cms/dynamicField/blocks/tocBlock.d.ts +1 -0
- package/dist/cms/registries/dynamic/cms/dynamicField/constants.d.ts +19 -0
- package/dist/cms/registries/dynamic/cms/dynamicField/helpers.d.ts +52 -0
- package/dist/cms/registries/dynamic/cms/dynamicField/registerBlock.d.ts +57 -0
- package/dist/cms/registries/dynamic/cms/dynamicField/styles.d.ts +7 -0
- package/dist/cms/registries/dynamic/cms/media/previewMediaTrait.d.ts +7 -0
- package/dist/cms/registries/dynamic/cms/menu/siteMenuAttrs.d.ts +11 -0
- package/dist/cms/registries/dynamic/cms/menuTree/menuTreeAttrs.d.ts +8 -0
- package/dist/cms/registries/dynamic/cms/post/styles.d.ts +6 -0
- package/dist/cms/registries/dynamic/cms/product/detail.styles.d.ts +1 -0
- package/dist/cms/registries/dynamic/cms/product/detailV2.styles.d.ts +1 -0
- package/dist/cms/registries/dynamic/cms/product/previewProductTrait.d.ts +6 -0
- package/dist/cms/registries/dynamic/cms/product/styles.d.ts +6 -0
- package/dist/cms/registries/dynamic/dataProvider.d.ts +45 -0
- package/dist/cms/registries/dynamic/loopGrid/paginationStyles.d.ts +5 -0
- package/dist/cms/registries/dynamic/loopGrid/preview.d.ts +16 -0
- package/dist/cms/registries/dynamic/loopGrid/publisher.d.ts +3 -0
- package/dist/cms/registries/dynamic/loopGrid/types.d.ts +97 -0
- package/dist/cms/registries/navigation/navbarThb/index.d.ts +3 -0
- package/dist/cms/registries/navigation/navbarThb/script.d.ts +1 -0
- package/dist/cms/registries/navigation/navbarThb/style.d.ts +1 -0
- package/dist/cms.js +4535 -0
- package/dist/global-settings/components/FontFamilySelect.vue.d.ts +29 -0
- package/dist/global-settings/components/FontManagerPanel.vue.d.ts +37 -0
- package/dist/global-settings/index.d.ts +8 -0
- package/dist/global-settings/plugin.d.ts +3 -0
- package/dist/global-settings/publisher.d.ts +15 -0
- package/dist/global-settings/runtime/canvasInjection.d.ts +13 -0
- package/dist/global-settings/runtime/panelDraftSave.d.ts +17 -0
- package/dist/global-settings/runtime/settingsSource.d.ts +4 -0
- package/dist/global-settings/useFontManager.d.ts +38 -0
- package/dist/global-settings/useGoogleFonts.d.ts +20 -0
- package/dist/global-settings/vue.d.ts +1 -0
- package/dist/global-settings.js +66 -0
- package/dist/i18n/I18nPanel.vue.d.ts +23 -0
- package/dist/i18n/i18n.d.ts +25 -0
- package/dist/i18n/index.d.ts +7 -0
- package/dist/i18n/languageOrder.d.ts +9 -0
- package/dist/i18n/plugin.d.ts +21 -0
- package/dist/i18n/types.d.ts +101 -0
- package/dist/i18n/useWebBuilderI18n.d.ts +164 -0
- package/dist/i18n/vue.d.ts +1 -0
- package/dist/i18n-BYR3l48y.js +959 -0
- package/dist/i18n.js +929 -0
- package/dist/index-CxJlLwvG.js +35378 -0
- package/dist/index-DWfJ4PBm.js +5724 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +12 -0
- package/dist/layout-template/components/LayoutPanel.vue.d.ts +37 -0
- package/dist/layout-template/components/TemplateRulesPanel.vue.d.ts +41 -0
- package/dist/layout-template/config/layoutSharedResources.d.ts +9 -0
- package/dist/layout-template/config/templateSharedResources.d.ts +28 -0
- package/dist/layout-template/index.d.ts +9 -0
- package/dist/layout-template/plugin.d.ts +13 -0
- package/dist/layout-template/runtime/storageAdapter.d.ts +49 -0
- package/dist/layout-template/utils/layoutProjectData.d.ts +15 -0
- package/dist/layout-template/utils/layoutRulePages.d.ts +19 -0
- package/dist/layout-template/utils/layoutSettings.d.ts +45 -0
- package/dist/layout-template/utils/templateRules.d.ts +52 -0
- package/dist/layout-template/vue.d.ts +2 -0
- package/dist/layout-template.js +435 -0
- package/dist/layoutSettings-D4SYUMri.js +252 -0
- package/dist/plugin-BPA8qlaC.js +40 -0
- package/dist/plugin-C0PrxrIe.js +228 -0
- package/dist/plugin-DQshk1sY.js +361 -0
- package/dist/plugin-DebyCjXx.js +191 -0
- package/dist/plugin-Dr6TOtyH.js +73 -0
- package/dist/publisher/index.d.ts +5 -0
- package/dist/publisher/publisherAssets.d.ts +9 -0
- package/dist/publisher/publisherComponents.d.ts +7 -0
- package/dist/publisher/publisherPlugins.d.ts +12 -0
- package/dist/publisher-C6VWXq8u.js +25 -0
- package/dist/publisher.js +1711 -0
- package/dist/solar-BsElUqfQ.js +29843 -0
- package/dist/style.css +1181 -0
- package/dist/templateSharedResources-D1u7eFIs.js +89 -0
- package/dist/types-DNbok59z.js +2359 -0
- package/dist/useFontManager-CdrLq1eG.js +336 -0
- package/dist/vue.d.ts +3 -0
- package/dist/vue.js +2171 -0
- package/package.json +77 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { L as LAYOUT_REGISTRIES, T as TYPOGRAPHY_REGISTRIES, g as BASIC_MEDIA_REGISTRIES, B as BASIC_INTERACTIVE_REGISTRIES, bq as registerInquiryFormComponent, br as registerKlaviyoSubscribeComponent, i as BASIC_SECTION_REGISTRIES, h as BASIC_NAVIGATION_REGISTRIES } from "./index-CxJlLwvG.js";
|
|
2
|
+
const BASIC_REGISTRY_MANIFEST = [
|
|
3
|
+
{ id: "layoutBase", registeredTypes: ["wb-layout-base"], failurePolicy: "core" },
|
|
4
|
+
{ id: "container", registeredTypes: ["wb-container"], failurePolicy: "core" },
|
|
5
|
+
{ id: "section", registeredTypes: ["wb-section"], failurePolicy: "core" },
|
|
6
|
+
{ id: "grid", registeredTypes: ["wb-grid"], failurePolicy: "core" },
|
|
7
|
+
{
|
|
8
|
+
id: "sectionGridBlock",
|
|
9
|
+
registeredTypes: ["wb-section-grid-block", "wb-section-grid-bg", "wb-section-bg"],
|
|
10
|
+
failurePolicy: "core"
|
|
11
|
+
},
|
|
12
|
+
{ id: "spacer", registeredTypes: ["wb-spacer"], failurePolicy: "core" },
|
|
13
|
+
{ id: "divider", registeredTypes: ["wb-divider"], failurePolicy: "core" },
|
|
14
|
+
{ id: "heading", registeredTypes: ["wb-heading"], failurePolicy: "core" },
|
|
15
|
+
{ id: "textEditor", registeredTypes: ["wb-text-editor"], failurePolicy: "core" },
|
|
16
|
+
{ id: "carousel", registeredTypes: ["wb-carousel"], failurePolicy: "core" },
|
|
17
|
+
{ id: "image", registeredTypes: ["wb-image"], failurePolicy: "core" },
|
|
18
|
+
{ id: "icon", registeredTypes: ["wb-icon"], failurePolicy: "core" },
|
|
19
|
+
{ id: "marquee", registeredTypes: ["wb-marquee", "wb-marquee-item"], failurePolicy: "core" },
|
|
20
|
+
{ id: "industryTabs", registeredTypes: ["wb-industry-tabs"], failurePolicy: "core" },
|
|
21
|
+
{
|
|
22
|
+
id: "productCategories",
|
|
23
|
+
registeredTypes: ["wb-product-categories", "wb-product-category-item"],
|
|
24
|
+
failurePolicy: "core"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "ourSolutions",
|
|
28
|
+
registeredTypes: ["wb-our-solutions", "wb-our-solutions-item"],
|
|
29
|
+
failurePolicy: "core"
|
|
30
|
+
},
|
|
31
|
+
{ id: "flipbook", registeredTypes: ["wb-flipbook", "wb-flipbook-page"], failurePolicy: "core" },
|
|
32
|
+
{ id: "video", registeredTypes: ["wb-video"], failurePolicy: "core" },
|
|
33
|
+
{ id: "pdfViewer", registeredTypes: ["wb-pdf-viewer"], failurePolicy: "core" },
|
|
34
|
+
{ id: "tabMediaGallery", registeredTypes: ["wb-tab-media-gallery"], failurePolicy: "core" },
|
|
35
|
+
{ id: "button", registeredTypes: ["wb-button"], failurePolicy: "core" },
|
|
36
|
+
{
|
|
37
|
+
id: "popup",
|
|
38
|
+
registeredTypes: ["wb-popup", "wb-popup-template-ref", "wb-popup-trigger"],
|
|
39
|
+
failurePolicy: "core"
|
|
40
|
+
},
|
|
41
|
+
{ id: "accordion", registeredTypes: ["wb-accordion"], failurePolicy: "core" },
|
|
42
|
+
{ id: "tabs", registeredTypes: ["wb-tabs"], failurePolicy: "core" },
|
|
43
|
+
{ id: "countUp", registeredTypes: ["wb-count-up"], failurePolicy: "core" },
|
|
44
|
+
{ id: "search", registeredTypes: ["search-spotlight"], failurePolicy: "core" },
|
|
45
|
+
{ id: "backButton", registeredTypes: ["wb-back-button"], failurePolicy: "core" },
|
|
46
|
+
{ id: "socialShare", registeredTypes: ["wb-social-share"], failurePolicy: "core" },
|
|
47
|
+
{ id: "customCode", registeredTypes: ["wb-custom-code"], failurePolicy: "core" },
|
|
48
|
+
{ id: "salesmartlyChatButton", registeredTypes: ["wb-salesmartly-chat-button"], failurePolicy: "core" },
|
|
49
|
+
{ id: "inquiryForm", registeredTypes: ["wb-inquiry-form"], failurePolicy: "core" },
|
|
50
|
+
{ id: "klaviyoSubscribe", registeredTypes: ["wb-klaviyo-subscribe"], failurePolicy: "core" },
|
|
51
|
+
{ id: "navbar", registeredTypes: ["wb-navbar"], failurePolicy: "core" },
|
|
52
|
+
{ id: "logo", registeredTypes: ["logo-brand"], failurePolicy: "core" },
|
|
53
|
+
{ id: "languageSwitcher", registeredTypes: ["wb-language-switcher"], failurePolicy: "core" },
|
|
54
|
+
{ id: "socialLinks", registeredTypes: ["wb-social-links"], failurePolicy: "core" },
|
|
55
|
+
{ id: "footer", registeredTypes: ["footer-section"], failurePolicy: "core" },
|
|
56
|
+
{ id: "historyTimeline", registeredTypes: ["wb-history-timeline"], failurePolicy: "optional" },
|
|
57
|
+
{ id: "focaHistoryTimeline", registeredTypes: ["wb-foca-history-timeline"], failurePolicy: "optional" },
|
|
58
|
+
{ id: "productCardStrip", registeredTypes: ["wb-product-card-strip"], failurePolicy: "optional" },
|
|
59
|
+
{ id: "caseSpotlight", registeredTypes: ["wb-case-spotlight"], failurePolicy: "optional" },
|
|
60
|
+
{ id: "milestoneCardStrip", registeredTypes: ["wb-milestone-card-strip"], failurePolicy: "optional" },
|
|
61
|
+
{ id: "allApplications", registeredTypes: ["wb-all-applications"], failurePolicy: "optional" },
|
|
62
|
+
{ id: "moreCardCarousel", registeredTypes: ["wb-more-card-carousel"], failurePolicy: "optional" },
|
|
63
|
+
{ id: "map", registeredTypes: ["wb-map", "wb-map-pin"], failurePolicy: "optional" },
|
|
64
|
+
{ id: "staticPinMap", registeredTypes: ["wb-static-pin-map", "wb-static-pin"], failurePolicy: "optional" },
|
|
65
|
+
{ id: "factoryMap", registeredTypes: ["wb-factory-map"], failurePolicy: "optional" },
|
|
66
|
+
{ id: "statsCards", registeredTypes: ["wb-stats-cards"], failurePolicy: "optional" },
|
|
67
|
+
{ id: "customizationGrid", registeredTypes: ["wb-customization-grid"], failurePolicy: "optional" },
|
|
68
|
+
{ id: "processTimeline", registeredTypes: ["wb-process-timeline"], failurePolicy: "optional" },
|
|
69
|
+
{ id: "companyScale", registeredTypes: ["wb-company-scale"], failurePolicy: "optional" },
|
|
70
|
+
{ id: "solutionList", registeredTypes: ["wb-solution-list", "wb-solution-list-card"], failurePolicy: "optional" },
|
|
71
|
+
{ id: "ourAdvantages", registeredTypes: ["wb-our-advantages", "wb-our-advantages-item"], failurePolicy: "optional" },
|
|
72
|
+
{ id: "serviceIconGrid", registeredTypes: ["wb-service-icon-grid", "wb-service-icon-grid-item"], failurePolicy: "optional" },
|
|
73
|
+
{ id: "servicesCarousel", registeredTypes: ["wb-services-carousel", "wb-services-carousel-item"], failurePolicy: "optional" },
|
|
74
|
+
{ id: "servicesShowcase", registeredTypes: ["wb-services-showcase", "wb-services-showcase-item"], failurePolicy: "optional" },
|
|
75
|
+
{ id: "serviceThb", registeredTypes: ["wb-service-thb", "wb-service-thb-item"], failurePolicy: "optional" },
|
|
76
|
+
{ id: "responsiveHeroCarousel", registeredTypes: ["wb-responsive-hero-carousel", "wb-responsive-hero-carousel-item"], failurePolicy: "optional" },
|
|
77
|
+
{ id: "homeBannerCarousel", registeredTypes: ["wb-home-banner-carousel", "wb-home-banner-slide"], failurePolicy: "optional" },
|
|
78
|
+
{ id: "overviewSplit", registeredTypes: ["wb-overview-split"], failurePolicy: "optional" },
|
|
79
|
+
{ id: "hotspotShowcase", registeredTypes: ["wb-hotspot-showcase", "wb-hotspot-showcase-item"], failurePolicy: "optional" },
|
|
80
|
+
{ id: "resourceSection", registeredTypes: ["wb-resource-section"], failurePolicy: "optional" },
|
|
81
|
+
{ id: "cardCarouselSection", registeredTypes: ["wb-card-carousel-section"], failurePolicy: "optional" }
|
|
82
|
+
];
|
|
83
|
+
function getBasicRegistryTypes(entries = BASIC_REGISTRY_MANIFEST) {
|
|
84
|
+
return entries.flatMap((entry) => entry.registeredTypes);
|
|
85
|
+
}
|
|
86
|
+
function assertUniqueBasicRegistryTypes(entries = BASIC_REGISTRY_MANIFEST) {
|
|
87
|
+
const seen = /* @__PURE__ */ new Map();
|
|
88
|
+
for (const entry of entries) {
|
|
89
|
+
for (const type of entry.registeredTypes) {
|
|
90
|
+
const existingEntryId = seen.get(type);
|
|
91
|
+
if (existingEntryId) {
|
|
92
|
+
throw new Error(`Duplicate Basic registry type "${type}" in ${existingEntryId} and ${entry.id}`);
|
|
93
|
+
}
|
|
94
|
+
seen.set(type, entry.id);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
const BASIC_COMPONENTS_PLUGIN_ID = "components-basic";
|
|
99
|
+
const BASIC_COMPONENT_REGISTRIES = [
|
|
100
|
+
...LAYOUT_REGISTRIES,
|
|
101
|
+
...TYPOGRAPHY_REGISTRIES,
|
|
102
|
+
...BASIC_MEDIA_REGISTRIES,
|
|
103
|
+
...BASIC_INTERACTIVE_REGISTRIES,
|
|
104
|
+
{ id: "inquiryForm", register: registerInquiryFormComponent },
|
|
105
|
+
{ id: "klaviyoSubscribe", register: registerKlaviyoSubscribeComponent },
|
|
106
|
+
...BASIC_SECTION_REGISTRIES,
|
|
107
|
+
...BASIC_NAVIGATION_REGISTRIES
|
|
108
|
+
];
|
|
109
|
+
const getErrorMessage = (error) => {
|
|
110
|
+
if (error instanceof Error)
|
|
111
|
+
return error.message;
|
|
112
|
+
if (typeof error === "string")
|
|
113
|
+
return error;
|
|
114
|
+
if (error && typeof error === "object" && "message" in error) {
|
|
115
|
+
return String(error.message || "Registration failed");
|
|
116
|
+
}
|
|
117
|
+
return "Registration failed";
|
|
118
|
+
};
|
|
119
|
+
const createRegistryMap = (registries, manifest) => {
|
|
120
|
+
const manifestIds = new Set(manifest.map((entry) => entry.id));
|
|
121
|
+
const registriesById = /* @__PURE__ */ new Map();
|
|
122
|
+
for (const registry of registries) {
|
|
123
|
+
if (!manifestIds.has(registry.id)) {
|
|
124
|
+
throw new Error(`[WebBuilder Basic] Unknown registry executor ${registry.id}`);
|
|
125
|
+
}
|
|
126
|
+
if (registriesById.has(registry.id)) {
|
|
127
|
+
throw new Error(`[WebBuilder Basic] Duplicate registry executor ${registry.id}`);
|
|
128
|
+
}
|
|
129
|
+
registriesById.set(registry.id, registry);
|
|
130
|
+
}
|
|
131
|
+
return registriesById;
|
|
132
|
+
};
|
|
133
|
+
const getOrderedRegistries = (registries, manifest) => {
|
|
134
|
+
const registriesById = createRegistryMap(registries, manifest);
|
|
135
|
+
return manifest.map((entry) => {
|
|
136
|
+
const registry = registriesById.get(entry.id);
|
|
137
|
+
if (!registry) {
|
|
138
|
+
throw new Error(`[WebBuilder Basic] Missing registry executor for ${entry.id}`);
|
|
139
|
+
}
|
|
140
|
+
return { entry, registry };
|
|
141
|
+
});
|
|
142
|
+
};
|
|
143
|
+
const registerBasicComponents = (editor, options) => {
|
|
144
|
+
var _a;
|
|
145
|
+
for (const { entry, registry } of getOrderedRegistries(options.registries, options.manifest)) {
|
|
146
|
+
try {
|
|
147
|
+
registry.register(editor);
|
|
148
|
+
} catch (error) {
|
|
149
|
+
const message = getErrorMessage(error);
|
|
150
|
+
if (entry.failurePolicy === "core" || options.throwOnOptionalFailure) {
|
|
151
|
+
throw new Error(`[WebBuilder Basic] Failed to register ${entry.id}: ${message}`);
|
|
152
|
+
}
|
|
153
|
+
(_a = options.onRegistrationFailure) == null ? void 0 : _a.call(options, {
|
|
154
|
+
registryId: entry.id,
|
|
155
|
+
message: `[WebBuilder Basic] Optional registry ${entry.id} failed: ${message}`,
|
|
156
|
+
error
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
const componentsBasic = (options = {}) => {
|
|
162
|
+
const includeOptional = options.includeOptional ?? true;
|
|
163
|
+
const manifest = (options.manifest ?? BASIC_REGISTRY_MANIFEST).filter((entry) => includeOptional || entry.failurePolicy === "core");
|
|
164
|
+
const registries = options.registries ?? BASIC_COMPONENT_REGISTRIES;
|
|
165
|
+
assertUniqueBasicRegistryTypes(manifest);
|
|
166
|
+
const componentTypes = getBasicRegistryTypes(manifest);
|
|
167
|
+
return {
|
|
168
|
+
id: BASIC_COMPONENTS_PLUGIN_ID,
|
|
169
|
+
label: "Basic Components",
|
|
170
|
+
order: 10,
|
|
171
|
+
alwaysEnabled: options.alwaysEnabled ?? true,
|
|
172
|
+
loadComponentTypes: componentTypes,
|
|
173
|
+
insertComponentTypes: componentTypes,
|
|
174
|
+
activateEditor: ({ editor }) => {
|
|
175
|
+
registerBasicComponents(editor, {
|
|
176
|
+
registries,
|
|
177
|
+
manifest,
|
|
178
|
+
throwOnOptionalFailure: options.throwOnOptionalFailure ?? false,
|
|
179
|
+
onRegistrationFailure: options.onRegistrationFailure
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
export {
|
|
185
|
+
BASIC_COMPONENTS_PLUGIN_ID as B,
|
|
186
|
+
BASIC_COMPONENT_REGISTRIES as a,
|
|
187
|
+
BASIC_REGISTRY_MANIFEST as b,
|
|
188
|
+
componentsBasic as c,
|
|
189
|
+
assertUniqueBasicRegistryTypes as d,
|
|
190
|
+
getBasicRegistryTypes as g
|
|
191
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { hasWebBuilderCapability } from "@toototech/webbuilder/core";
|
|
2
|
+
const I18N_PLUGIN_ID = "i18n";
|
|
3
|
+
const I18N_PLUGIN_CAPABILITY = "webbuilder:i18n";
|
|
4
|
+
const runI18nPreflight = async (runtime, action) => {
|
|
5
|
+
var _a;
|
|
6
|
+
(_a = runtime == null ? void 0 : runtime.refreshSourceEntries) == null ? void 0 : _a.call(runtime);
|
|
7
|
+
if (!(runtime == null ? void 0 : runtime.ensureReadyOrConfirm))
|
|
8
|
+
return true;
|
|
9
|
+
return runtime.ensureReadyOrConfirm(action);
|
|
10
|
+
};
|
|
11
|
+
const createI18nPlugin = (runtime) => ({
|
|
12
|
+
id: I18N_PLUGIN_ID,
|
|
13
|
+
label: "I18n",
|
|
14
|
+
order: 30,
|
|
15
|
+
activateWhen: (context) => hasWebBuilderCapability(context.capabilityIds, I18N_PLUGIN_CAPABILITY),
|
|
16
|
+
panels: [
|
|
17
|
+
{
|
|
18
|
+
id: "i18n",
|
|
19
|
+
label: "I18n",
|
|
20
|
+
order: 30,
|
|
21
|
+
preserveOnSelection: true,
|
|
22
|
+
component: runtime == null ? void 0 : runtime.panelComponent,
|
|
23
|
+
props: runtime == null ? void 0 : runtime.panelProps
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
preview: {
|
|
27
|
+
canLoadPreview: runtime == null ? void 0 : runtime.canLoadPreview,
|
|
28
|
+
getPreviewProjectData: runtime == null ? void 0 : runtime.getPreviewProjectData,
|
|
29
|
+
hasPreview: runtime == null ? void 0 : runtime.hasPreview,
|
|
30
|
+
restorePreview: runtime == null ? void 0 : runtime.restorePreview
|
|
31
|
+
},
|
|
32
|
+
beforeProjectSerialize: () => {
|
|
33
|
+
var _a;
|
|
34
|
+
(_a = runtime == null ? void 0 : runtime.refreshSourceEntries) == null ? void 0 : _a.call(runtime);
|
|
35
|
+
},
|
|
36
|
+
resources: [
|
|
37
|
+
(context) => context.resourceMode === "lifecycle" ? [
|
|
38
|
+
{
|
|
39
|
+
id: "i18n-draft",
|
|
40
|
+
label: "多语言草稿",
|
|
41
|
+
isDirty: () => {
|
|
42
|
+
var _a;
|
|
43
|
+
return Boolean((_a = runtime == null ? void 0 : runtime.isDirty) == null ? void 0 : _a.call(runtime));
|
|
44
|
+
},
|
|
45
|
+
failurePolicy: "warning",
|
|
46
|
+
flushDraft: () => true,
|
|
47
|
+
publish: () => true,
|
|
48
|
+
releaseLock: () => void 0
|
|
49
|
+
}
|
|
50
|
+
] : []
|
|
51
|
+
],
|
|
52
|
+
beforeSave: () => runI18nPreflight(runtime, "save"),
|
|
53
|
+
beforePublish: () => runI18nPreflight(runtime, "publish"),
|
|
54
|
+
afterSaveSuccess: async (context) => {
|
|
55
|
+
var _a;
|
|
56
|
+
if (!context.silent)
|
|
57
|
+
return;
|
|
58
|
+
await ((_a = runtime == null ? void 0 : runtime.autoTranslateMissing) == null ? void 0 : _a.call(runtime, {
|
|
59
|
+
publishReady: false,
|
|
60
|
+
reloadCurrentLocale: false,
|
|
61
|
+
silent: true
|
|
62
|
+
}));
|
|
63
|
+
},
|
|
64
|
+
afterPublishSuccess: async () => {
|
|
65
|
+
var _a;
|
|
66
|
+
await ((_a = runtime == null ? void 0 : runtime.reloadBundle) == null ? void 0 : _a.call(runtime));
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
export {
|
|
70
|
+
I18N_PLUGIN_CAPABILITY as I,
|
|
71
|
+
I18N_PLUGIN_ID as a,
|
|
72
|
+
createI18nPlugin as c
|
|
73
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { collectPublisherContributions, } from '@toototech/webbuilder/core';
|
|
2
|
+
export * from './publisherPlugins.js';
|
|
3
|
+
export * from './publisherAssets.js';
|
|
4
|
+
export * from './publisherComponents.js';
|
|
5
|
+
export type { TenantContext, WebBuilderFeaturePlugin, WebBuilderPluginResolveContext, WebBuilderPublisherAssets, WebBuilderPublisherContext, WebBuilderPublisherContribution, } from '@toototech/webbuilder/core';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PageResourceIdentity, TenantContext, WebBuilderFeaturePlugin, WebBuilderPublisherAssets, WebBuilderPublisherContext } from '@toototech/webbuilder/core';
|
|
2
|
+
export interface WebBuilderPublisherRuntimeRenderOptions extends WebBuilderPublisherContext {
|
|
3
|
+
resource?: PageResourceIdentity;
|
|
4
|
+
capabilityIds?: Iterable<string>;
|
|
5
|
+
tenant?: Partial<TenantContext>;
|
|
6
|
+
}
|
|
7
|
+
export declare const WEB_BUILDER_PUBLISHER_FEATURE_PLUGINS: WebBuilderFeaturePlugin[];
|
|
8
|
+
export declare const createWebBuilderPublisherRuntimeRegistry: (options: WebBuilderPublisherRuntimeRenderOptions) => import("./publisherPlugins.js").WebBuilderPublisherPluginRegistry;
|
|
9
|
+
export declare const renderWebBuilderPublisherPluginAssets: (options: WebBuilderPublisherRuntimeRenderOptions) => Promise<WebBuilderPublisherAssets>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Editor } from 'grapesjs';
|
|
2
|
+
export interface WebBuilderPublisherComponentRegistrar {
|
|
3
|
+
id: string;
|
|
4
|
+
register: (editor: Editor) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const WEB_BUILDER_PUBLISHER_COMPONENT_REGISTRARS: WebBuilderPublisherComponentRegistrar[];
|
|
7
|
+
export declare function registerWebBuilderPublisherComponents(editor: Editor): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type WebBuilderFeaturePlugin, type WebBuilderPluginResolveContext, type WebBuilderPublisherAssets, type WebBuilderPublisherContext, type WebBuilderPublisherContribution } from '@toototech/webbuilder/core';
|
|
2
|
+
export interface WebBuilderPublisherPluginRegistryOptions {
|
|
3
|
+
plugins: WebBuilderFeaturePlugin[];
|
|
4
|
+
resolveContext: WebBuilderPluginResolveContext;
|
|
5
|
+
}
|
|
6
|
+
export interface WebBuilderPublisherPluginRegistry {
|
|
7
|
+
activePlugins: WebBuilderFeaturePlugin[];
|
|
8
|
+
publisherContributions: WebBuilderPublisherContribution[];
|
|
9
|
+
renderPublisherAssets: (context: WebBuilderPublisherContext) => Promise<WebBuilderPublisherAssets>;
|
|
10
|
+
}
|
|
11
|
+
export declare const renderWebBuilderPublisherAssets: (contributions: WebBuilderPublisherContribution[], context: WebBuilderPublisherContext) => Promise<WebBuilderPublisherAssets>;
|
|
12
|
+
export declare const createWebBuilderPublisherPluginRegistry: (options: WebBuilderPublisherPluginRegistryOptions) => WebBuilderPublisherPluginRegistry;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { L as LAYOUT_REGISTRIES, T as TYPOGRAPHY_REGISTRIES, g as BASIC_MEDIA_REGISTRIES, B as BASIC_INTERACTIVE_REGISTRIES, bq as registerInquiryFormComponent, br as registerKlaviyoSubscribeComponent, i as BASIC_SECTION_REGISTRIES, h as BASIC_NAVIGATION_REGISTRIES } from "./index-CxJlLwvG.js";
|
|
2
|
+
const BASIC_PUBLISHER_REGISTRIES = [
|
|
3
|
+
...LAYOUT_REGISTRIES,
|
|
4
|
+
...TYPOGRAPHY_REGISTRIES,
|
|
5
|
+
...BASIC_MEDIA_REGISTRIES,
|
|
6
|
+
...BASIC_INTERACTIVE_REGISTRIES,
|
|
7
|
+
{ id: "inquiryForm", register: registerInquiryFormComponent },
|
|
8
|
+
{ id: "klaviyoSubscribe", register: registerKlaviyoSubscribeComponent },
|
|
9
|
+
...BASIC_SECTION_REGISTRIES,
|
|
10
|
+
...BASIC_NAVIGATION_REGISTRIES
|
|
11
|
+
];
|
|
12
|
+
function registerBasicPublisherComponents(editor) {
|
|
13
|
+
for (const registry of BASIC_PUBLISHER_REGISTRIES) {
|
|
14
|
+
try {
|
|
15
|
+
registry.register(editor);
|
|
16
|
+
} catch (error) {
|
|
17
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
18
|
+
throw new Error(`[WebBuilder Publisher] Failed to register basic:${registry.id}: ${message}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
BASIC_PUBLISHER_REGISTRIES as B,
|
|
24
|
+
registerBasicPublisherComponents as r
|
|
25
|
+
};
|