@swell/apps-sdk 1.0.186 → 1.0.187
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 +471 -236
- package/dist/index.cjs.map +4 -4
- package/dist/index.js +471 -236
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +424 -189
- package/dist/index.mjs.map +4 -4
- package/dist/src/liquid/color.d.ts +1 -1
- package/dist/src/liquid/filters/index.d.ts +2 -0
- package/dist/src/liquid/filters/preload_tag.d.ts +3 -0
- package/dist/src/liquid/hash.d.ts +5 -0
- package/dist/src/liquid/index.d.ts +4 -1
- package/dist/src/liquid/tags/content_for.d.ts +3 -0
- package/dist/src/liquid/tags/doc.d.ts +2 -0
- package/dist/src/liquid/tags/index.d.ts +4 -0
- package/dist/src/liquid/tokens/identifier-token.d.ts +9 -0
- package/dist/src/liquid/tokens/index.d.ts +2 -0
- package/dist/src/liquid/tokienizer.d.ts +5 -0
- package/dist/src/theme.d.ts +5 -1
- package/dist/types/swell.d.ts +1 -1
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@ export declare class ThemeColor extends Drop {
|
|
|
15
15
|
lighten(percent: number): string;
|
|
16
16
|
darken(percent: number): string;
|
|
17
17
|
rgb(): string;
|
|
18
|
-
rgba(alpha
|
|
18
|
+
rgba(alpha?: number): string;
|
|
19
19
|
hsl(): string;
|
|
20
20
|
hex(): string;
|
|
21
21
|
saturate(value: number): string;
|
|
@@ -33,6 +33,7 @@ import money from './money';
|
|
|
33
33
|
import money_with_currency from './money_with_currency';
|
|
34
34
|
import money_without_currency from './money_without_currency';
|
|
35
35
|
import money_without_trailing_zeros from './money_without_trailing_zeros';
|
|
36
|
+
import preload_tag from './preload_tag';
|
|
36
37
|
import script_tag from './script_tag';
|
|
37
38
|
import stylesheet_tag from './stylesheet_tag';
|
|
38
39
|
import time_tag from './time_tag';
|
|
@@ -94,6 +95,7 @@ export declare const filters: {
|
|
|
94
95
|
money_with_currency: typeof money_with_currency;
|
|
95
96
|
money_without_currency: typeof money_without_currency;
|
|
96
97
|
money_without_trailing_zeros: typeof money_without_trailing_zeros;
|
|
98
|
+
preload_tag: typeof preload_tag;
|
|
97
99
|
script_tag: typeof script_tag;
|
|
98
100
|
stylesheet_tag: typeof stylesheet_tag;
|
|
99
101
|
time_tag: typeof time_tag;
|
|
@@ -21,6 +21,7 @@ interface LiquidSwellOptions {
|
|
|
21
21
|
extName?: string;
|
|
22
22
|
componentsDir?: string;
|
|
23
23
|
sectionsDir?: string;
|
|
24
|
+
blocksDir?: string;
|
|
24
25
|
}
|
|
25
26
|
export declare class LiquidSwell extends Liquid {
|
|
26
27
|
theme: SwellTheme;
|
|
@@ -39,11 +40,13 @@ export declare class LiquidSwell extends Liquid {
|
|
|
39
40
|
extName: string;
|
|
40
41
|
componentsDir: string;
|
|
41
42
|
sectionsDir: string;
|
|
43
|
+
blocksDir: string;
|
|
42
44
|
lastSchema: ThemeSectionSchema | undefined;
|
|
43
|
-
constructor({ theme, getThemeConfig, getThemeTemplateConfigByType, getAssetUrl, renderTemplate, renderTemplateString, renderPageSections, renderTranslation, renderCurrency, isEditor, locale, currency, layoutName, extName, componentsDir, sectionsDir, }: LiquidSwellOptions);
|
|
45
|
+
constructor({ theme, getThemeConfig, getThemeTemplateConfigByType, getAssetUrl, renderTemplate, renderTemplateString, renderPageSections, renderTranslation, renderCurrency, isEditor, locale, currency, layoutName, extName, componentsDir, sectionsDir, blocksDir, }: LiquidSwellOptions);
|
|
44
46
|
parseAndRender(template: string, data?: object): Promise<string>;
|
|
45
47
|
resolveFilePathByType(type: string, name: string): Promise<string | undefined>;
|
|
46
48
|
getComponentPath(componentName: string): Promise<string>;
|
|
47
49
|
getSectionPath(sectionName: string): Promise<string>;
|
|
48
50
|
getSectionGroupPath(sectionName: string): Promise<string>;
|
|
51
|
+
getThemeBlockPath(blockName: string): Promise<string>;
|
|
49
52
|
}
|
|
@@ -2,6 +2,8 @@ import type { LiquidSwell } from '..';
|
|
|
2
2
|
import assignTag from './assign';
|
|
3
3
|
import caseTag from './case';
|
|
4
4
|
import comment from './comment';
|
|
5
|
+
import contentFor from './content_for';
|
|
6
|
+
import doc from './doc';
|
|
5
7
|
import forTag from './for';
|
|
6
8
|
import form from './form';
|
|
7
9
|
import ifTag from './if';
|
|
@@ -20,6 +22,8 @@ export declare const tags: {
|
|
|
20
22
|
assign: typeof assignTag;
|
|
21
23
|
case: typeof caseTag;
|
|
22
24
|
comment: typeof comment;
|
|
25
|
+
content_for: typeof contentFor;
|
|
26
|
+
doc: typeof doc;
|
|
23
27
|
for: typeof forTag;
|
|
24
28
|
form: typeof form;
|
|
25
29
|
if: typeof ifTag;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Token } from 'liquidjs';
|
|
2
|
+
export default class IdentifierToken extends Token {
|
|
3
|
+
input: string;
|
|
4
|
+
begin: number;
|
|
5
|
+
end: number;
|
|
6
|
+
file?: string | undefined;
|
|
7
|
+
content: string;
|
|
8
|
+
constructor(input: string, begin: number, end: number, file?: string | undefined);
|
|
9
|
+
}
|
package/dist/src/theme.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { LiquidSwell, ThemeFont, ThemeForm } from './liquid';
|
|
|
4
4
|
import { ThemeLoader } from './theme/theme-loader';
|
|
5
5
|
import type { PutFilesResult } from './cache';
|
|
6
6
|
import type { FormatInput } from 'swell-js';
|
|
7
|
-
import type { ThemeGlobals, ThemeConfigs, ThemeSettings, ThemeResources, ThemeFormConfig, ThemeInitGlobalsOptions, ThemeFormErrorMessages, ThemeLocaleConfig, ThemePresetSchema, ThemeSectionGroup, ThemeSectionGroupInfo, ThemeSectionSchema, ThemeSectionConfig, ThemeSectionSettings, ThemeSettingFieldSchema, ThemeSettingSectionSchema, ThemePage, ThemePageSectionSchema, ThemePageTemplateConfig, ThemeLayoutSectionGroupConfig, SwellData, SwellMenu, SwellRecord, SwellAppConfig, SwellThemeConfig, SwellThemePreload, SwellAppStorefrontThemeProps, SwellAppShopifyCompatibilityConfig, SwellPageRequest, SwellSettingsGeo, SwellThemeRecord } from '../types/swell';
|
|
7
|
+
import type { ThemeGlobals, ThemeConfigs, ThemeSettings, ThemeResources, ThemeFormConfig, ThemeInitGlobalsOptions, ThemeFormErrorMessages, ThemeLocaleConfig, ThemePresetSchema, ThemeSectionGroup, ThemeSectionGroupInfo, ThemeSectionSchema, ThemeSectionConfig, ThemeSectionSettings, ThemeBlockSchema, ThemeSettingFieldSchema, ThemeSettingSectionSchema, ThemePage, ThemePageSectionSchema, ThemePageTemplateConfig, ThemeLayoutSectionGroupConfig, SwellData, SwellMenu, SwellRecord, SwellAppConfig, SwellThemeConfig, SwellThemePreload, SwellAppStorefrontThemeProps, SwellAppShopifyCompatibilityConfig, SwellPageRequest, SwellSettingsGeo, SwellThemeRecord } from '../types/swell';
|
|
8
8
|
export declare class SwellTheme {
|
|
9
9
|
swell: Swell;
|
|
10
10
|
props: SwellAppStorefrontThemeProps;
|
|
@@ -166,6 +166,10 @@ export declare class SwellTheme {
|
|
|
166
166
|
getTemplateSchema(config: SwellThemeConfig): Promise<ThemeSectionSchema | undefined>;
|
|
167
167
|
resolveStaticSectionSettings(sectionSchema: ThemeSectionSchema, presetSchema?: ThemePresetSchema): SwellData;
|
|
168
168
|
getAllSections(): Promise<ThemePageSectionSchema[]>;
|
|
169
|
+
/**
|
|
170
|
+
* Returns all theme block schemas from /blocks folder.
|
|
171
|
+
*/
|
|
172
|
+
getAllThemeBlockSchemas(): ThemeBlockSchema[];
|
|
169
173
|
getPageSections(sectionGroup: ThemeSectionGroup, resolveSettings?: boolean): Promise<ThemeSectionConfig[]>;
|
|
170
174
|
addPageSection(sectionFileName: string, group: boolean): Promise<void>;
|
|
171
175
|
/**
|
package/dist/types/swell.d.ts
CHANGED
|
@@ -519,7 +519,7 @@ export interface ThemeBlockSchema {
|
|
|
519
519
|
export interface ThemePresetSchema {
|
|
520
520
|
label: string;
|
|
521
521
|
settings?: ThemeSettings;
|
|
522
|
-
blocks?: ThemeSettingsBlock[]
|
|
522
|
+
blocks?: ThemeSettingsBlock[] | Record<string, ThemeSettingsBlock>;
|
|
523
523
|
}
|
|
524
524
|
export interface ThemeSectionEnabledDisabled {
|
|
525
525
|
templates?: string[] | '*';
|