@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.
@@ -0,0 +1,6 @@
1
+ import { Drop } from 'liquidjs';
2
+ export default class RenderDrop extends Drop {
3
+ handler: () => unknown;
4
+ constructor(handler: () => unknown);
5
+ valueOf(): unknown;
6
+ }
@@ -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>;
@@ -428,6 +428,7 @@ export interface ThemeSectionGroupInfo {
428
428
  prop: string;
429
429
  label: string;
430
430
  source: string;
431
+ group: boolean;
431
432
  }
432
433
  export interface ThemePageTemplateSectionConfig {
433
434
  type: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@swell/apps-sdk",
3
3
  "type": "module",
4
- "version": "1.0.123",
4
+ "version": "1.0.125",
5
5
  "description": "Swell SDK for building isomorphic apps.",
6
6
  "author": "Swell",
7
7
  "license": "MIT",