@swell/apps-sdk 1.0.105 → 1.0.107
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 +40 -40
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +40 -40
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +40 -40
- package/dist/index.mjs.map +4 -4
- package/dist/src/compatibility/shopify.d.ts +5 -6
- package/dist/src/easyblocks/utils.d.ts +2 -0
- package/dist/src/theme.d.ts +3 -2
- package/dist/types/shopify.d.ts +0 -6
- package/dist/types/swell.d.ts +8 -2
- package/package.json +1 -1
|
@@ -3,8 +3,8 @@ import { ThemeFont } from '@/liquid/font';
|
|
|
3
3
|
import { ThemeForm } from '@/liquid/form';
|
|
4
4
|
import { SwellTheme } from '@/theme';
|
|
5
5
|
import { ShopifyResource } from './shopify-objects';
|
|
6
|
-
import type { ThemeGlobals, ThemeSettings, ThemePresetSchema, ThemeEditorSchema, ThemeSectionSchemaData, SwellData, SwellMenu, SwellAppShopifyCompatibilityConfig, SwellSettingsGeo } from '../../types/swell';
|
|
7
|
-
import type { ShopifySettingsData, ShopifySettingsSchema, ShopifySectionSchema, ShopifyPageResourceMap, ShopifyObjectResourceMap, ShopifyFormResourceMap, ShopifyQueryParamsMap
|
|
6
|
+
import type { ThemeGlobals, ThemeSettings, ThemePresetSchema, ThemeEditorSchema, ThemeSectionSchemaData, ThemeLocaleConfig, SwellData, SwellMenu, SwellAppShopifyCompatibilityConfig, SwellSettingsGeo } from '../../types/swell';
|
|
7
|
+
import type { ShopifySettingsData, ShopifySettingsSchema, ShopifySectionSchema, ShopifyPageResourceMap, ShopifyObjectResourceMap, ShopifyFormResourceMap, ShopifyQueryParamsMap } from '../../types/shopify';
|
|
8
8
|
/**
|
|
9
9
|
* This class is meant to be extended by a storefront app to provide compatibility with Shopify's Liquid
|
|
10
10
|
*/
|
|
@@ -17,7 +17,7 @@ export declare class ShopifyCompatibility {
|
|
|
17
17
|
formResourceMap: ShopifyFormResourceMap;
|
|
18
18
|
queryParamsMap: ShopifyQueryParamsMap;
|
|
19
19
|
shopifyCompatibilityConfig?: SwellAppShopifyCompatibilityConfig;
|
|
20
|
-
editorLocaleConfig?: Record<string,
|
|
20
|
+
editorLocaleConfig?: Record<string, ThemeLocaleConfig | undefined>;
|
|
21
21
|
constructor(theme: SwellTheme);
|
|
22
22
|
initGlobals(globals: ThemeGlobals): void;
|
|
23
23
|
adaptGlobals(globals: Partial<ThemeGlobals>, prevGlobals: ThemeGlobals): void;
|
|
@@ -85,10 +85,9 @@ export declare class ShopifyCompatibility {
|
|
|
85
85
|
getPresetsConfig(settingsData: ShopifySettingsData): ThemePresetSchema[];
|
|
86
86
|
getEditorConfig(settingsSchema: ShopifySettingsSchema): ThemeEditorSchema;
|
|
87
87
|
getSectionConfigSchema(sectionSchema: ShopifySectionSchema): ThemeSectionSchemaData;
|
|
88
|
-
|
|
89
|
-
getEditorLocaleConfig(theme: SwellTheme, localeCode: string): Promise<ShopifyLocalizationConfig>;
|
|
88
|
+
getEditorLocaleConfig(theme: SwellTheme, localeCode: string): Promise<ThemeLocaleConfig>;
|
|
90
89
|
renderSchemaTranslations<T>(theme: SwellTheme, schema: T, localeCode?: string): Promise<T>;
|
|
91
|
-
renderSchemaTranslationValue<T>(theme: SwellTheme, schemaValue: T, localCode: string, editorLocaleConfig:
|
|
90
|
+
renderSchemaTranslationValue<T>(theme: SwellTheme, schemaValue: T, localCode: string, editorLocaleConfig: ThemeLocaleConfig): Promise<T>;
|
|
92
91
|
getPageType(pageId: string): string;
|
|
93
92
|
getPageRouteUrl(pageId: string): string;
|
|
94
93
|
getPageRoutes(): {
|
|
@@ -17,4 +17,6 @@ interface PageSectionComponentProps {
|
|
|
17
17
|
[key: string]: unknown;
|
|
18
18
|
}
|
|
19
19
|
export declare function getSectionSettingsFromProps(props: PageSectionComponentProps, sectionSchema?: ThemeSectionSchema): ThemeSectionBase | undefined;
|
|
20
|
+
export declare function toEasyblocksFieldId(fieldId?: string): string;
|
|
21
|
+
export declare function toSchemaFieldId(fieldId?: string): string;
|
|
20
22
|
export {};
|
package/dist/src/theme.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { ShopifyCompatibility } from './compatibility/shopify';
|
|
|
3
3
|
import { LiquidSwell, ThemeFont, ThemeForm } from './liquid';
|
|
4
4
|
import { ThemeLoader } from './theme/theme-loader';
|
|
5
5
|
import type { FormatInput } from 'swell-js';
|
|
6
|
-
import type { ThemeGlobals, ThemeConfigs, ThemeSettings, ThemeResources, ThemeFormConfig, ThemeFormErrorMessages, ThemePresetSchema, ThemeSectionGroup, ThemeSectionGroupInfo, ThemeSectionSchema, ThemeSectionConfig, ThemeSectionSettings, ThemeSettingFieldSchema, ThemeSettingSectionSchema, ThemePageSectionSchema, ThemePageTemplateConfig, ThemeLayoutSectionGroupConfig, SwellData, SwellMenu, SwellRecord, SwellAppConfig, SwellThemeConfig, SwellThemeVersion, SwellAppStorefrontThemeProps, SwellAppShopifyCompatibilityConfig, ThemePage, SwellPageRequest, SwellSettingsGeo } from '../types/swell';
|
|
6
|
+
import type { ThemeGlobals, ThemeConfigs, ThemeSettings, ThemeResources, ThemeFormConfig, ThemeFormErrorMessages, ThemeLocaleConfig, ThemePresetSchema, ThemeSectionGroup, ThemeSectionGroupInfo, ThemeSectionSchema, ThemeSectionConfig, ThemeSectionSettings, ThemeSettingFieldSchema, ThemeSettingSectionSchema, ThemePageSectionSchema, ThemePageTemplateConfig, ThemeLayoutSectionGroupConfig, SwellData, SwellMenu, SwellRecord, SwellAppConfig, SwellThemeConfig, SwellThemeVersion, SwellAppStorefrontThemeProps, SwellAppShopifyCompatibilityConfig, ThemePage, SwellPageRequest, SwellSettingsGeo } from '../types/swell';
|
|
7
7
|
export declare class SwellTheme {
|
|
8
8
|
swell: Swell;
|
|
9
9
|
props: SwellAppStorefrontThemeProps;
|
|
@@ -91,9 +91,10 @@ export declare class SwellTheme {
|
|
|
91
91
|
updateSettings(form: Record<string, {
|
|
92
92
|
value: unknown;
|
|
93
93
|
} | undefined>, config: Record<string, unknown>): ThemeSettings;
|
|
94
|
-
resolveTranslationLocale(
|
|
94
|
+
resolveTranslationLocale(languageConfig: ThemeSettings, locale?: string): ThemeSettings;
|
|
95
95
|
setCompatibilityConfigs(configs: ThemeConfigs): Promise<void>;
|
|
96
96
|
setCompatibilityData(pageData: SwellData): void;
|
|
97
|
+
getLocaleConfig(localeCode?: string, suffix?: string): Promise<ThemeLocaleConfig>;
|
|
97
98
|
resolveLookupSetting(setting: ThemeSettingFieldSchema, value: any): SwellData | SwellStorefrontRecord | SwellStorefrontCollection | null;
|
|
98
99
|
resolveLookupResource(collection: string, id: string): StorefrontResource<SwellRecord>;
|
|
99
100
|
resolveMenuSettings(): Promise<Record<string, SwellMenu | undefined>>;
|
package/dist/types/shopify.d.ts
CHANGED
|
@@ -128,10 +128,4 @@ export interface ShopifyQueryParams {
|
|
|
128
128
|
to: string | ((param: string, value: string) => SwellData);
|
|
129
129
|
}
|
|
130
130
|
export type ShopifyQueryParamsMap = ShopifyQueryParams[];
|
|
131
|
-
export interface ShopifyLocalizationSection {
|
|
132
|
-
[key: string]: string | ShopifyLocalizationSection;
|
|
133
|
-
}
|
|
134
|
-
export interface ShopifyLocalizationConfig {
|
|
135
|
-
[key: string]: ShopifyLocalizationSection;
|
|
136
|
-
}
|
|
137
131
|
export {};
|
package/dist/types/swell.d.ts
CHANGED
|
@@ -263,7 +263,7 @@ export interface ThemeGlobals extends SwellData {
|
|
|
263
263
|
customer?: SwellStorefrontSingleton | null;
|
|
264
264
|
geo: SwellSettingsGeo;
|
|
265
265
|
configs: ThemeConfigs;
|
|
266
|
-
|
|
266
|
+
language: Record<string, unknown>;
|
|
267
267
|
canonical_url: string;
|
|
268
268
|
shopify_compatibility: boolean;
|
|
269
269
|
[key: string]: any;
|
|
@@ -272,7 +272,7 @@ export interface ThemeConfigs {
|
|
|
272
272
|
editor: ThemeEditorSchema;
|
|
273
273
|
theme: ThemeSettings;
|
|
274
274
|
presets: ThemePresetSchema[];
|
|
275
|
-
|
|
275
|
+
language: ThemeSettings;
|
|
276
276
|
[key: string]: any;
|
|
277
277
|
settings_schema?: ShopifySettingsSchema;
|
|
278
278
|
settings_data?: ShopifySettingsData;
|
|
@@ -290,6 +290,12 @@ export interface ThemeResources {
|
|
|
290
290
|
};
|
|
291
291
|
records?: Record<string, ThemeLookupResourceFactory>;
|
|
292
292
|
}
|
|
293
|
+
export interface ThemeLocaleSection {
|
|
294
|
+
[key: string]: string | ThemeLocaleSection;
|
|
295
|
+
}
|
|
296
|
+
export interface ThemeLocaleConfig {
|
|
297
|
+
[key: string]: ThemeLocaleSection;
|
|
298
|
+
}
|
|
293
299
|
export interface ThemeEditorSchema {
|
|
294
300
|
settings?: ThemeSettingSectionSchema[];
|
|
295
301
|
menus?: any;
|