@swell/apps-sdk 1.0.101 → 1.0.103

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,12 @@
1
+ import { Drop } from 'liquidjs';
2
+ import { ShopifyResource } from '../shopify-objects';
3
+ import type { ShopifyCompatibility } from '../shopify';
4
+ export default class CollectionsDrop extends Drop {
5
+ #private;
6
+ constructor(instance: ShopifyCompatibility);
7
+ liquidMethodMissing(key: unknown): unknown;
8
+ getCollection(slug: string): ShopifyResource;
9
+ get size(): Promise<number> | number;
10
+ [Symbol.iterator](): Promise<ArrayIterator<ShopifyResource>>;
11
+ iterator(): Promise<ArrayIterator<ShopifyResource>>;
12
+ }
@@ -1,4 +1,4 @@
1
1
  import { ShopifyCompatibility } from '../shopify';
2
2
  import { ShopifyResource } from './resource';
3
3
  import type { SwellData } from 'types/swell';
4
- export default function ShopifyLocalization(_instance: ShopifyCompatibility, store: SwellData, request: SwellData): ShopifyResource;
4
+ export default function ShopifyLocalization(instance: ShopifyCompatibility, store: SwellData, request: SwellData): ShopifyResource;
@@ -1,4 +1,3 @@
1
- import { LiquidSwell, ThemeColor } from '..';
2
- type ColorField = 'red' | 'green' | 'blue' | 'alpha' | 'hue' | 'saturation' | 'lightness';
3
- export default function bind(_liquidSwell: LiquidSwell): (color: string | ThemeColor, field: ColorField, value: number) => string;
4
- export {};
1
+ import { type LiquidSwell } from '..';
2
+ import type { FilterHandler } from 'liquidjs/dist/template';
3
+ export default function bind(_liquidSwell: LiquidSwell): FilterHandler;
@@ -1,2 +1,3 @@
1
- import { LiquidSwell } from '..';
2
- export default function bind(_liquidSwell: LiquidSwell): (imageUrl: string, ...params: any[]) => string;
1
+ import type { LiquidSwell } from '..';
2
+ import type { FilterHandler } from 'liquidjs/dist/template';
3
+ export default function bind(_liquidSwell: LiquidSwell): FilterHandler;
@@ -1,2 +1,3 @@
1
- import { LiquidSwell } from '..';
2
- export default function bind(_liquidSwell: LiquidSwell): <T extends object>(this: any, arr: T[], property: string, expected?: any) => IterableIterator<unknown>;
1
+ import type { FilterHandler } from 'liquidjs/dist/template';
2
+ import type { LiquidSwell } from '..';
3
+ export default function bind(_liquidSwell: LiquidSwell): FilterHandler;
@@ -41,7 +41,7 @@ export declare class LiquidSwell extends Liquid {
41
41
  sectionsDir: string;
42
42
  lastSchema: ThemeSectionSchema | undefined;
43
43
  constructor({ theme, getThemeConfig, getThemeTemplateConfigByType, getAssetUrl, renderTemplate, renderTemplateString, renderPageSections, renderTranslation, renderCurrency, isEditor, locale, currency, layoutName, extName, componentsDir, sectionsDir, }: LiquidSwellOptions);
44
- parseAndRender(template: string, data: any): Promise<string>;
44
+ parseAndRender(template: string, data?: object): Promise<string>;
45
45
  resolveFilePathByType(type: string, name: string): Promise<string | undefined>;
46
46
  getComponentPath(componentName: string): Promise<string>;
47
47
  getSectionPath(sectionName: string): Promise<string>;
@@ -0,0 +1,3 @@
1
+ import type { TagClass } from 'liquidjs/dist/template';
2
+ import type { LiquidSwell } from '..';
3
+ export default function bind(_liquidSwell: LiquidSwell): TagClass;
@@ -0,0 +1,4 @@
1
+ import type { TagClass } from 'liquidjs/dist/template';
2
+ import type { LiquidSwell } from '..';
3
+ export default function bind(_liquidSwell: LiquidSwell): TagClass;
4
+ export declare function assertEmpty<T>(predicate: T | null | undefined, message?: string): void;
@@ -1,7 +1,9 @@
1
- import { LiquidSwell } from '..';
2
- import { default as caseTag } from './case';
3
- import { default as forTag } from './for';
1
+ import type { LiquidSwell } from '..';
2
+ import assignTag from './assign';
3
+ import caseTag from './case';
4
+ import forTag from './for';
4
5
  import form from './form';
6
+ import ifTag from './if';
5
7
  import javascript from './javascript';
6
8
  import layout from './layout';
7
9
  import paginate from './paginate';
@@ -13,9 +15,11 @@ import include from './shopify/include';
13
15
  import schema from './shopify/schema';
14
16
  import inline_editable from './inline_editable';
15
17
  export declare const tags: {
18
+ assign: typeof assignTag;
16
19
  case: typeof caseTag;
17
20
  for: typeof forTag;
18
21
  form: typeof form;
22
+ if: typeof ifTag;
19
23
  javascript: typeof javascript;
20
24
  layout: typeof layout;
21
25
  paginate: typeof paginate;
@@ -1,3 +1,6 @@
1
1
  import type { LiquidSwell } from '..';
2
+ import type { Context, Liquid } from 'liquidjs';
2
3
  import type { TagClass } from 'liquidjs/dist/template';
4
+ import type { ParsedFileName } from 'liquidjs/dist/tags/render';
3
5
  export default function bind(liquidSwell: LiquidSwell): TagClass;
6
+ export declare function renderFilePath(file: ParsedFileName, ctx: Context, liquid: Liquid): IterableIterator<unknown>;
@@ -37,6 +37,7 @@ export interface Comparable {
37
37
  export declare function isComparable(arg: unknown): arg is Comparable;
38
38
  export declare function toArray<T>(val: unknown): T[];
39
39
  export declare function toEnumerable<T>(val: unknown): T[];
40
+ export declare function resolveEnumerable<T>(val: unknown): Promise<T[]>;
40
41
  export declare function stringify(value: unknown): string;
41
42
  export declare function paramsToProps(params: (string | [string, unknown])[] | Record<string, string>): Record<string, unknown>;
42
43
  export declare function jsonStringifyAsync(input: unknown, space?: number): Promise<string>;
@@ -1,5 +1,5 @@
1
- import { Swell } from './api';
2
- import { ShopifyCompatibility } from './compatibility/shopify';
1
+ import type { Swell } from './api';
2
+ import type { ShopifyCompatibility } from './compatibility/shopify';
3
3
  import type { SwellData, SwellRecord, SwellCollection, InferSwellCollection, SwellCollectionPages, StorefrontResourceGetter } from '../types/swell';
4
4
  export declare const MAX_QUERY_PAGE_LIMIT = 100;
5
5
  export declare const DEFAULT_QUERY_PAGE_LIMIT = 15;
@@ -21,6 +21,7 @@ export declare class StorefrontResource<T extends SwellData = SwellData> {
21
21
  toJSON(): {} | null;
22
22
  valueOf(): Promise<unknown>;
23
23
  setCompatibilityProps(props: SwellData): void;
24
+ [Symbol.toPrimitive](_type: string): unknown;
24
25
  getCompatibilityProp<T extends keyof StorefrontResource['_compatibilityProps']>(prop: T): StorefrontResource['_compatibilityProps'][T];
25
26
  }
26
27
  export declare class SwellStorefrontResource<T extends SwellData = SwellData> extends StorefrontResource<T> {
@@ -51,8 +52,8 @@ export declare class SwellStorefrontCollection<T extends SwellCollection = Swell
51
52
  _initQuery(query: SwellData): SwellData;
52
53
  _defaultGetter(): StorefrontResourceGetter<T>;
53
54
  _get(query?: SwellData): Promise<T | null | undefined>;
54
- [Symbol.iterator](): Generator<InferSwellCollection<T>, void, unknown>;
55
- iterator(): Generator<InferSwellCollection<T>, void, unknown>;
55
+ [Symbol.iterator](): ArrayIterator<InferSwellCollection<T>>;
56
+ iterator(): ArrayIterator<InferSwellCollection<T>>;
56
57
  _clone(newProps?: SwellData): SwellStorefrontCollection<T>;
57
58
  _cloneWithCompatibilityResult(compatibilityGetter: (result: T) => SwellData): SwellStorefrontCollection<T>;
58
59
  }
@@ -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, 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;
@@ -129,7 +129,7 @@ export declare class SwellTheme {
129
129
  getContentForHeader(): string;
130
130
  renderFontHeaderLinks(): string;
131
131
  getTemplateSchema(config: SwellThemeConfig): Promise<ThemeSectionSchema | undefined>;
132
- resolveSectionDefaultSettings(sectionSchema: ThemeSectionSchema, presetSchema?: ThemePresetSchema): Promise<SwellData>;
132
+ resolveStaticSectionSettings(sectionSchema: ThemeSectionSchema, presetSchema?: ThemePresetSchema): SwellData;
133
133
  getAllSections(): Promise<ThemePageSectionSchema[]>;
134
134
  getPageSections(sectionGroup: ThemeSectionGroup, resolveSettings?: boolean): Promise<ThemeSectionConfig[]>;
135
135
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@swell/apps-sdk",
3
3
  "type": "module",
4
- "version": "1.0.101",
4
+ "version": "1.0.103",
5
5
  "description": "Swell SDK for building isomorphic apps.",
6
6
  "author": "Swell",
7
7
  "license": "MIT",