@swell/apps-sdk 1.0.14 → 1.0.16

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.
@@ -1,5 +1,5 @@
1
- import { SwellTheme } from '../theme';
2
1
  import type { Backend } from '@swell/easyblocks-core';
2
+ import { SwellTheme } from '../theme';
3
3
  import type { SwellThemeConfig, ThemeGlobals, ThemeLayoutSectionGroupConfig, ThemePageSectionSchema, ThemeSectionConfig } from 'types/swell';
4
4
  export declare function getEasyblocksPropsFromThemeConfigs(theme: SwellTheme, themeConfigs: SwellThemeConfig[], pageId: string): Promise<{
5
5
  pageTemplate: string | import("types/swell").ThemePageTemplateConfig;
@@ -9,8 +9,8 @@ export declare function getEasyblocksPropsFromThemeConfigs(theme: SwellTheme, th
9
9
  }>;
10
10
  export declare function getEasyblocksPagePropsWithConfigs(themeGlobals: ThemeGlobals, allSections: ThemePageSectionSchema[], pageSections: ThemeSectionConfig[], layoutSectionGroups: ThemeLayoutSectionGroupConfig[], pageId: string): {
11
11
  easyblocksConfig: {
12
- components: any[];
13
- templates: any[];
12
+ components: unknown[];
13
+ templates: unknown[];
14
14
  backend: Backend;
15
15
  hideCloseButton: boolean;
16
16
  allowSave: boolean;
@@ -129,8 +129,5 @@ export declare function getEasyblocksPagePropsWithConfigs(themeGlobals: ThemeGlo
129
129
  };
130
130
  };
131
131
  };
132
- export declare function getEasyblocksComponentDefinitions(props: {
133
- allSections: ThemePageSectionSchema[];
134
- layoutSectionGroups: ThemeLayoutSectionGroupConfig[];
135
- }, getComponent: (type: string, data?: any) => any): any;
132
+ export declare function getEasyblocksComponentDefinitions(allSections: ThemePageSectionSchema[], layoutSectionGroups: ThemeLayoutSectionGroupConfig[], getComponent: (type: string, data?: any) => any): any;
136
133
  export declare function getEasyblocksBackend(): Backend;
@@ -6,10 +6,10 @@ export declare function getPageSections(theme: SwellTheme, sectionGroup: ThemeSe
6
6
  export declare function getLayoutSectionGroups(theme: SwellTheme, themeConfigs: SwellThemeConfig[]): Promise<ThemeLayoutSectionGroupConfig[]>;
7
7
  export declare function getSectionSchema(theme: SwellTheme, sectionName: string): Promise<ThemeSectionSchema | undefined>;
8
8
  export declare function renderTemplateSchema(theme: SwellTheme, config: SwellThemeConfig): Promise<any>;
9
- export declare function filterSectionConfig(config: SwellRecord, themeConfigs: SwellThemeConfig[]): boolean;
10
- export declare function filterAllLayoutSectionGroupConfigs(config: SwellRecord, themeConfigs: SwellThemeConfig[]): any;
11
- export declare function filterLayoutSectionGroupConfig(config: SwellRecord, themeConfigs: SwellThemeConfig[], type: string): boolean;
12
- export declare function isJsonOrLiquidConfig(config: SwellRecord, themeConfigs: SwellThemeConfig[]): boolean;
9
+ export declare function filterSectionConfig(config: SwellThemeConfig, themeConfigs: SwellThemeConfig[]): boolean;
10
+ export declare function filterAllLayoutSectionGroupConfigs(config: SwellThemeConfig, themeConfigs: SwellThemeConfig[]): boolean;
11
+ export declare function filterLayoutSectionGroupConfig(config: SwellThemeConfig, themeConfigs: SwellThemeConfig[], type: string): boolean;
12
+ export declare function isJsonOrLiquidConfig(config: SwellThemeConfig, themeConfigs: SwellThemeConfig[]): boolean;
13
13
  export declare function schemaToEasyblocksProps(field: ThemeSettingFieldSchema): {
14
14
  type: string;
15
15
  description: string | undefined;
@@ -26,7 +26,7 @@ export declare function schemaToEasyblocksProps(field: ThemeSettingFieldSchema):
26
26
  params: ThemeSettingFieldSchema;
27
27
  };
28
28
  export declare function schemaToEasyblocksValue(fields: ThemeSettingFieldSchema[] | undefined, fieldId: string, value: any): any;
29
- export declare function getThemeSettingsFromProps(props: any, editorSchema: any): any;
29
+ export declare function getThemeSettingsFromProps(props: any, editorSchema: any[]): any;
30
30
  export declare function getSectionSettingsFromProps(props: any, sectionSchema: any): {
31
31
  settings: any;
32
32
  blocks: any;
@@ -34,6 +34,7 @@ import hex_to_rgba from './shopify/hex_to_rgba';
34
34
  import payment_button from './shopify/payment_button';
35
35
  import payment_terms from './shopify/payment_terms';
36
36
  import placeholder_svg_tag from './shopify/placeholder_svg_tag';
37
+ import inline_editable from './inline_editable';
37
38
  export declare const filters: {
38
39
  asset_url: typeof asset_url;
39
40
  brightness_difference: typeof brightness_difference;
@@ -83,6 +84,7 @@ export declare const filters: {
83
84
  payment_button: typeof payment_button;
84
85
  payment_terms: typeof payment_terms;
85
86
  placeholder_svg_tag: typeof placeholder_svg_tag;
87
+ inline_editable: typeof inline_editable;
86
88
  };
87
89
  export declare function bindFilters(liquidSwell: LiquidSwell): void;
88
90
  export declare function resolveAsyncProps(propArg: any, resolveProps: boolean | Array<string>): Promise<any>;
@@ -0,0 +1,4 @@
1
+ import { LiquidSwell } from '..';
2
+ export default function bind(_liquidSwell: LiquidSwell): (value: string | {
3
+ value: string;
4
+ }, key?: string) => string;
@@ -11,6 +11,7 @@ import sections from './sections';
11
11
  import style from './style';
12
12
  import include from './shopify/include';
13
13
  import schema from './shopify/schema';
14
+ import inline_editable from './inline_editable';
14
15
  export declare const tags: {
15
16
  case: typeof caseTag;
16
17
  for: typeof forTag;
@@ -24,5 +25,6 @@ export declare const tags: {
24
25
  style: typeof style;
25
26
  include: typeof include;
26
27
  schema: typeof schema;
28
+ inline_editable: typeof inline_editable;
27
29
  };
28
30
  export declare function bindTags(liquidSwell: LiquidSwell): void;
@@ -0,0 +1,3 @@
1
+ import { LiquidSwell } from '..';
2
+ import type { TagClass } from 'liquidjs/dist/template';
3
+ export default function bind(_liquidSwell: LiquidSwell): TagClass;
@@ -9,7 +9,7 @@ export declare class SwellTheme {
9
9
  forms?: ThemeFormConfig[];
10
10
  resources?: ThemeResources;
11
11
  liquidSwell: LiquidSwell;
12
- themeConfigs: SwellThemeConfig[] | null;
12
+ themeConfigs: Map<string, SwellThemeConfig> | null;
13
13
  page: any;
14
14
  pageId: string | undefined;
15
15
  shopifyCompatibility: ShopifyCompatibility | null;
@@ -67,10 +67,10 @@ export declare class SwellTheme {
67
67
  resolveUrlSetting(value: string): string;
68
68
  themeConfigQuery(): Record<string, unknown>;
69
69
  getGeoSettings(): Promise<SwellRecord>;
70
- getAllThemeConfigs(): Promise<SwellThemeConfig[]>;
70
+ getAllThemeConfigs(): Promise<Map<string, SwellThemeConfig>>;
71
71
  getThemeConfig(filePath: string): Promise<SwellThemeConfig | null>;
72
72
  getThemeTemplateConfig(filePath: string): Promise<SwellThemeConfig | null>;
73
- getThemeTemplateConfigByType(type: string, name: string): Promise<SwellThemeConfig | null | undefined>;
73
+ getThemeTemplateConfigByType(type: string, name: string): Promise<SwellThemeConfig | null>;
74
74
  getAssetUrl(filePath: string): Promise<string | null>;
75
75
  renderTemplate(config: SwellThemeConfig | null, data?: SwellData): Promise<string>;
76
76
  renderTemplateString(templateString: string, data?: SwellData): Promise<string>;
@@ -1,8 +1,8 @@
1
1
  import type { SwellData, SwellRecord, SwellThemeConfig, ThemeLayoutSectionGroupConfig, ThemePageSectionSchema, ThemeSectionConfig, ThemeSectionGroup, ThemeSectionSchema } from 'types/swell';
2
2
  export * from './md5';
3
3
  export declare function themeConfigQuery(swellHeaders: Record<string, unknown>): Record<string, unknown>;
4
- export declare function getAllSections(themeConfigs: SwellThemeConfig[], renderTemplateSchema: (config: SwellThemeConfig) => Promise<Partial<ThemeSectionSchema> | undefined>): Promise<ThemePageSectionSchema[]>;
5
- export declare function getLayoutSectionGroups(allSections: SwellThemeConfig[], renderTemplateSchema: (config: SwellThemeConfig) => Promise<Partial<ThemeSectionSchema> | undefined>): Promise<ThemeLayoutSectionGroupConfig[]>;
4
+ export declare function getAllSections(themeConfigs: Map<string, SwellThemeConfig>, renderTemplateSchema: (config: SwellThemeConfig) => Promise<Partial<ThemeSectionSchema> | undefined>): Promise<ThemePageSectionSchema[]>;
5
+ export declare function getLayoutSectionGroups(allSections: Map<string, SwellThemeConfig>, renderTemplateSchema: (config: SwellThemeConfig) => Promise<Partial<ThemeSectionSchema> | undefined>): Promise<ThemeLayoutSectionGroupConfig[]>;
6
6
  export declare function getPageSections(sectionGroup: ThemeSectionGroup | SwellRecord, getSchema: (type: string) => Promise<Partial<ThemeSectionSchema> | undefined>): Promise<ThemeSectionConfig[]>;
7
7
  export declare function isArray(value: any): boolean;
8
8
  export declare function isObject(value: any): boolean;
@@ -277,7 +277,7 @@ export interface ThemePresetSchema {
277
277
  blocks?: ThemeSettingsBlock[];
278
278
  }
279
279
  export interface ThemeSectionEnabledDisabled {
280
- templates?: string[];
280
+ templates?: string[] | '*';
281
281
  groups?: string[];
282
282
  }
283
283
  export type GetThemeConfig = (fileName: string) => Promise<SwellThemeConfig | null>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@swell/apps-sdk",
3
3
  "type": "module",
4
- "version": "1.0.14",
4
+ "version": "1.0.16",
5
5
  "description": "Swell SDK for building isomorphic apps.",
6
6
  "author": "Swell",
7
7
  "license": "MIT",