@swell/apps-sdk 1.0.129 → 1.0.130
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/dist/index.cjs +70 -67
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +70 -67
- package/dist/index.js.map +3 -3
- package/dist/index.mjs +70 -67
- package/dist/index.mjs.map +3 -3
- package/dist/src/easyblocks/config.d.ts +1 -1
- package/dist/src/theme.d.ts +7 -7
- package/dist/types/swell.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Backend, InternalTemplate, NoCodeComponentDefinition } from '@swell/easyblocks-core';
|
|
2
2
|
import type { SwellTheme } from '../theme';
|
|
3
3
|
import type { ThemeGlobals, ThemeLayoutSectionGroupConfig, ThemePageSectionSchema, ThemeSectionConfig } from 'types/swell';
|
|
4
|
-
export declare function getEasyblocksPageTemplate<T>(theme: SwellTheme, pageId: string): Promise<T | string | undefined>;
|
|
4
|
+
export declare function getEasyblocksPageTemplate<T>(theme: SwellTheme, pageId: string, altTemplate?: string): Promise<T | string | undefined>;
|
|
5
5
|
export declare function getEasyblocksPagePropsWithConfigs(themeGlobals: ThemeGlobals, allSections: ThemePageSectionSchema[], pageSections: ThemeSectionConfig[], layoutSectionGroups: ThemeLayoutSectionGroupConfig[], pageId: string): {
|
|
6
6
|
easyblocksConfig: {
|
|
7
7
|
components: NoCodeComponentDefinition<Record<string, any>, Record<string, any>>[];
|
package/dist/src/theme.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export declare class SwellTheme {
|
|
|
13
13
|
liquidSwell: LiquidSwell;
|
|
14
14
|
themeLoader: ThemeLoader;
|
|
15
15
|
themeConfigs: Map<string, SwellThemeConfig> | null;
|
|
16
|
-
page?:
|
|
16
|
+
page?: ThemePage;
|
|
17
17
|
pageId: string | undefined;
|
|
18
18
|
shopifyCompatibility: ShopifyCompatibility | null;
|
|
19
19
|
shopifyCompatibilityClass: typeof ShopifyCompatibility;
|
|
@@ -29,8 +29,9 @@ export declare class SwellTheme {
|
|
|
29
29
|
shopifyCompatibilityClass?: typeof ShopifyCompatibility;
|
|
30
30
|
});
|
|
31
31
|
getSwellAppThemeProps(swellConfig?: SwellAppConfig): SwellAppStorefrontThemeProps;
|
|
32
|
-
initGlobals(
|
|
32
|
+
initGlobals(): Promise<void>;
|
|
33
33
|
setGlobals(globals: Partial<ThemeGlobals>): void;
|
|
34
|
+
initPageGlobals(pageId: string, altTemplate?: string): Promise<void>;
|
|
34
35
|
getSettingsAndConfigs(): Promise<{
|
|
35
36
|
store: SwellData;
|
|
36
37
|
session: SwellData;
|
|
@@ -38,10 +39,9 @@ export declare class SwellTheme {
|
|
|
38
39
|
geo: SwellSettingsGeo;
|
|
39
40
|
configs: ThemeConfigs;
|
|
40
41
|
}>;
|
|
41
|
-
resolvePageData(store: SwellData, configs: ThemeConfigs
|
|
42
|
+
resolvePageData(store: SwellData, configs: ThemeConfigs): Promise<{
|
|
42
43
|
settings: ThemeSettings;
|
|
43
44
|
request: SwellPageRequest;
|
|
44
|
-
page: ThemePage;
|
|
45
45
|
cart: SwellStorefrontSingleton | {};
|
|
46
46
|
account: SwellStorefrontSingleton | null;
|
|
47
47
|
customer?: SwellStorefrontSingleton | null;
|
|
@@ -110,11 +110,11 @@ export declare class SwellTheme {
|
|
|
110
110
|
* Preloads updated theme configs. Used to optimize initial theme load.
|
|
111
111
|
*/
|
|
112
112
|
preloadThemeConfigs(version: SwellThemeVersion, configs: SwellThemeConfig[]): Promise<void>;
|
|
113
|
-
getPageConfigPath(pageId: string): string | null;
|
|
113
|
+
getPageConfigPath(pageId: string, altTemplate?: string): string | null;
|
|
114
114
|
getThemeConfig(filePath: string): Promise<SwellThemeConfig | null>;
|
|
115
115
|
getThemeConfigsByPath(pathPrefix: string, pathSuffix?: string): Promise<Map<string, SwellThemeConfig>>;
|
|
116
116
|
getThemeTemplateConfig(filePath: string): Promise<SwellThemeConfig | null>;
|
|
117
|
-
getThemeTemplateConfigByType(type: string, name: string): Promise<SwellThemeConfig | null>;
|
|
117
|
+
getThemeTemplateConfigByType(type: string, name: string, suffix?: string): Promise<SwellThemeConfig | null>;
|
|
118
118
|
getAssetUrl(filePath: string): Promise<string | null>;
|
|
119
119
|
renderTemplate(config: SwellThemeConfig | null, data?: SwellData): Promise<string>;
|
|
120
120
|
renderTemplateString(templateString: string, data?: SwellData): Promise<string>;
|
|
@@ -143,7 +143,7 @@ export declare class SwellTheme {
|
|
|
143
143
|
/**
|
|
144
144
|
* Get a list of sections and section groups in a page layout.
|
|
145
145
|
*/
|
|
146
|
-
getPageSectionGroups(pageId: string): Promise<ThemeSectionGroupInfo[]>;
|
|
146
|
+
getPageSectionGroups(pageId: string, altTemplate?: string): Promise<ThemeSectionGroupInfo[]>;
|
|
147
147
|
getLayoutSectionGroups(sectionGroups: ThemeSectionGroupInfo[], resolveSettings?: boolean): Promise<ThemeLayoutSectionGroupConfig[]>;
|
|
148
148
|
renderPageSections(sectionGroup: ThemeSectionGroup, data?: SwellData): Promise<ThemeSectionConfig[]>;
|
|
149
149
|
renderSectionConfigs(sectionConfigs: ThemeSectionConfig[], data?: SwellData): Promise<ThemeSectionConfig[]>;
|
package/dist/types/swell.d.ts
CHANGED
|
@@ -74,6 +74,7 @@ export interface SwellAppStorefrontThemeProps {
|
|
|
74
74
|
provider: 'app';
|
|
75
75
|
pages: Array<SwellAppStorefrontThemePage>;
|
|
76
76
|
resources?: SwellAppStorefrontThemeResources;
|
|
77
|
+
template_collections?: Record<string, string>;
|
|
77
78
|
}
|
|
78
79
|
export interface SwellAppStorefrontThemeResources {
|
|
79
80
|
singletons: Record<string, string>;
|