@swell/apps-sdk 1.0.123 → 1.0.125
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 +138 -116
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +138 -116
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +73 -51
- package/dist/index.mjs.map +4 -4
- package/dist/src/compatibility/drops/render.d.ts +6 -0
- package/dist/src/theme.d.ts +4 -9
- package/dist/types/swell.d.ts +1 -0
- package/package.json +1 -1
package/dist/src/theme.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export declare class SwellTheme {
|
|
|
21
21
|
formData: Record<string, ThemeForm>;
|
|
22
22
|
globalData: SwellData;
|
|
23
23
|
themeSettingFilePath: string;
|
|
24
|
+
private pageSectionGroups;
|
|
24
25
|
constructor(swell: Swell, options?: {
|
|
25
26
|
forms?: ThemeFormConfig[];
|
|
26
27
|
resources?: ThemeResources;
|
|
@@ -131,25 +132,19 @@ export declare class SwellTheme {
|
|
|
131
132
|
isShopify1HomePage(pageId: string, pageContent: unknown): pageContent is string;
|
|
132
133
|
renderAllSections(sectionsIds: string | Array<string>, pageData?: SwellData): Promise<Record<string, string | undefined>>;
|
|
133
134
|
renderSection(sectionId: string, pageData?: SwellData): Promise<string | ThemePageTemplateConfig>;
|
|
134
|
-
renderLayout(data?: SwellData): Promise<string>;
|
|
135
|
+
renderLayout(layoutName?: string, data?: SwellData): Promise<string>;
|
|
135
136
|
getContentForHeader(): string;
|
|
136
137
|
renderFontHeaderLinks(): string;
|
|
137
138
|
getTemplateSchema(config: SwellThemeConfig): Promise<ThemeSectionSchema | undefined>;
|
|
138
139
|
resolveStaticSectionSettings(sectionSchema: ThemeSectionSchema, presetSchema?: ThemePresetSchema): SwellData;
|
|
139
140
|
getAllSections(): Promise<ThemePageSectionSchema[]>;
|
|
140
141
|
getPageSections(sectionGroup: ThemeSectionGroup, resolveSettings?: boolean): Promise<ThemeSectionConfig[]>;
|
|
142
|
+
addPageSection(sectionFileName: string, group: boolean): Promise<void>;
|
|
141
143
|
/**
|
|
142
144
|
* Get a list of sections and section groups in a page layout.
|
|
143
|
-
*
|
|
144
|
-
* Basically we should get these section groups: `header`, `content` and `footer`.
|
|
145
|
-
* For now, section groups are searched for using regex in the page layout.
|
|
146
|
-
* There may be cases where section groups can be nested in other files,
|
|
147
|
-
* in which case they will not be visible to this function.
|
|
148
|
-
*
|
|
149
|
-
* In the future, we may use a dummy page renderer and thus extract all section groups.
|
|
150
145
|
*/
|
|
151
146
|
getPageSectionGroups(pageId: string): Promise<ThemeSectionGroupInfo[]>;
|
|
152
|
-
getLayoutSectionGroups(resolveSettings?: boolean): Promise<ThemeLayoutSectionGroupConfig[]>;
|
|
147
|
+
getLayoutSectionGroups(sectionGroups: ThemeSectionGroupInfo[], resolveSettings?: boolean): Promise<ThemeLayoutSectionGroupConfig[]>;
|
|
153
148
|
renderPageSections(sectionGroup: ThemeSectionGroup, data?: SwellData): Promise<ThemeSectionConfig[]>;
|
|
154
149
|
renderSectionConfigs(sectionConfigs: ThemeSectionConfig[], data?: SwellData): Promise<ThemeSectionConfig[]>;
|
|
155
150
|
renderTranslation(key: string, data?: unknown, fallback?: string): Promise<string>;
|
package/dist/types/swell.d.ts
CHANGED