@swell/apps-sdk 1.0.83 → 1.0.85
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 +39 -46
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +39 -46
- package/dist/index.js.map +3 -3
- package/dist/index.mjs +39 -46
- package/dist/index.mjs.map +3 -3
- package/dist/src/api.d.ts +4 -0
- package/dist/src/liquid/filters/money_with_currency.d.ts +1 -1
- package/dist/src/liquid/index.d.ts +4 -4
- package/dist/src/theme.d.ts +3 -4
- package/dist/types/swell.d.ts +1 -1
- package/package.json +1 -1
package/dist/src/api.d.ts
CHANGED
|
@@ -33,6 +33,10 @@ export declare class Swell {
|
|
|
33
33
|
getAppSettings(): Promise<SwellData>;
|
|
34
34
|
getStorefrontSettings(force?: boolean): Promise<SwellData>;
|
|
35
35
|
getStorefrontMenus(): SwellMenu[];
|
|
36
|
+
getStorefrontLocalization(): {
|
|
37
|
+
currency: string;
|
|
38
|
+
locale: string;
|
|
39
|
+
};
|
|
36
40
|
get<T = SwellData>(...args: Parameters<SwellBackendAPI['get']>): Promise<T | undefined>;
|
|
37
41
|
put<T = SwellData>(...args: Parameters<SwellBackendAPI['put']>): Promise<T | undefined>;
|
|
38
42
|
post<T = SwellData>(...args: Parameters<SwellBackendAPI['post']>): Promise<T | undefined>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { LiquidSwell } from
|
|
1
|
+
import { LiquidSwell } from '..';
|
|
2
2
|
export default function bind(liquidSwell: LiquidSwell): (value: number) => string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Liquid, type FS } from 'liquidjs';
|
|
2
2
|
import { SwellTheme } from '../theme';
|
|
3
|
-
import type { GetAssetUrl, GetThemeConfig, GetThemeTemplateConfigByType, RenderCurrency, RenderTemplate,
|
|
3
|
+
import type { GetAssetUrl, GetThemeConfig, GetThemeTemplateConfigByType, RenderCurrency, RenderTemplate, RenderPageSections, RenderTemplateString, RenderTranslation, ThemeSectionSchema } from 'types/swell';
|
|
4
4
|
export * from './color';
|
|
5
5
|
export * from './form';
|
|
6
6
|
export * from './font';
|
|
@@ -11,7 +11,7 @@ interface LiquidSwellOptions {
|
|
|
11
11
|
getAssetUrl: GetAssetUrl;
|
|
12
12
|
renderTemplate: RenderTemplate;
|
|
13
13
|
renderTemplateString: RenderTemplateString;
|
|
14
|
-
|
|
14
|
+
renderPageSections: RenderPageSections;
|
|
15
15
|
renderTranslation: RenderTranslation;
|
|
16
16
|
renderCurrency: RenderCurrency;
|
|
17
17
|
isEditor: boolean;
|
|
@@ -29,7 +29,7 @@ export declare class LiquidSwell extends Liquid {
|
|
|
29
29
|
getAssetUrl: GetAssetUrl;
|
|
30
30
|
renderTemplate: RenderTemplate;
|
|
31
31
|
renderTemplateString: RenderTemplateString;
|
|
32
|
-
|
|
32
|
+
renderPageSections: RenderPageSections;
|
|
33
33
|
renderTranslation: RenderTranslation;
|
|
34
34
|
renderCurrency: RenderCurrency;
|
|
35
35
|
engine: Liquid;
|
|
@@ -41,7 +41,7 @@ export declare class LiquidSwell extends Liquid {
|
|
|
41
41
|
componentsDir: string | undefined;
|
|
42
42
|
sectionsDir: string | undefined;
|
|
43
43
|
lastSchema: ThemeSectionSchema | undefined;
|
|
44
|
-
constructor({ theme, getThemeConfig, getThemeTemplateConfigByType, getAssetUrl, renderTemplate, renderTemplateString,
|
|
44
|
+
constructor({ theme, getThemeConfig, getThemeTemplateConfigByType, getAssetUrl, renderTemplate, renderTemplateString, renderPageSections, renderTranslation, renderCurrency, isEditor, locale, currency, layoutName, extName, componentsDir, sectionsDir, }: LiquidSwellOptions);
|
|
45
45
|
initLiquidEngine(): Liquid;
|
|
46
46
|
getLiquidFS(): FS;
|
|
47
47
|
parseAndRender(template: string, data: any): Promise<string>;
|
package/dist/src/theme.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export declare class SwellTheme {
|
|
|
35
35
|
geo: SwellData;
|
|
36
36
|
configs: ThemeConfigs;
|
|
37
37
|
}>;
|
|
38
|
-
resolvePageData(store: SwellData, configs: SwellData,
|
|
38
|
+
resolvePageData(store: SwellData, configs: SwellData, pageId?: string): Promise<{
|
|
39
39
|
settings: ThemeSettings;
|
|
40
40
|
request: ThemeSettings;
|
|
41
41
|
page: ThemeSettings;
|
|
@@ -90,8 +90,8 @@ export declare class SwellTheme {
|
|
|
90
90
|
updateSettings(form: Record<string, {
|
|
91
91
|
value: unknown;
|
|
92
92
|
} | undefined>, config: Record<string, unknown>): ThemeSettings;
|
|
93
|
-
resolveTranslationLocale(translationsConfig: ThemeSettings
|
|
94
|
-
setCompatibilityConfigs(configs: ThemeConfigs
|
|
93
|
+
resolveTranslationLocale(translationsConfig: ThemeSettings): ThemeSettings;
|
|
94
|
+
setCompatibilityConfigs(configs: ThemeConfigs): Promise<void>;
|
|
95
95
|
setCompatibilityData(pageData: SwellData): void;
|
|
96
96
|
resolveLookupSetting(setting: ThemeSettingFieldSchema, value: any): SwellData | SwellStorefrontRecord | SwellStorefrontCollection | null;
|
|
97
97
|
resolveLookupResource(collection: string, id: string): StorefrontResource<SwellRecord>;
|
|
@@ -145,7 +145,6 @@ export declare class SwellTheme {
|
|
|
145
145
|
getLayoutSectionGroups(resolveSettings?: boolean): Promise<ThemeLayoutSectionGroupConfig[]>;
|
|
146
146
|
renderPageSections(sectionGroup: ThemeSectionGroup, data?: SwellData): Promise<ThemeSectionConfig[]>;
|
|
147
147
|
renderSectionConfigs(sectionConfigs: ThemeSectionConfig[], data?: SwellData): Promise<ThemeSectionConfig[]>;
|
|
148
|
-
renderTemplateSections(sectionGroup: ThemeSectionGroup, data?: SwellData): Promise<string>;
|
|
149
148
|
renderTranslation(key: string, data?: unknown, fallback?: string): Promise<string>;
|
|
150
149
|
renderTranslationValue(localeCode: string, langConfig: any, key: string, data?: any, fallback?: string): Promise<string>;
|
|
151
150
|
renderCurrency(amount: number, params: any): string;
|
package/dist/types/swell.d.ts
CHANGED
|
@@ -439,7 +439,7 @@ export type GetThemeTemplateConfigByType = (type: string, name: string) => Promi
|
|
|
439
439
|
export type GetAssetUrl = (assetPath: string) => Promise<string | null>;
|
|
440
440
|
export type RenderTemplate = (config: SwellThemeConfig | null, data?: SwellData) => Promise<string>;
|
|
441
441
|
export type RenderTemplateString = (templateString: string, data?: SwellData) => Promise<string>;
|
|
442
|
-
export type
|
|
442
|
+
export type RenderPageSections = (sections: ThemeSectionGroup, data?: SwellData) => Promise<ThemeSectionConfig[]>;
|
|
443
443
|
export type RenderTranslation = (key: string, data?: unknown, locale?: string) => Promise<string>;
|
|
444
444
|
export type RenderCurrency = (amount: number, params?: FormatInput) => string;
|
|
445
445
|
export type ResolveFilePath = (fileName: string, extName?: string) => string;
|