@silexlabs/silex 3.5.0 → 3.5.1-2
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/.silex.js +0 -3
- package/dist/client/client/config.d.ts +8 -0
- package/dist/client/client/grapesjs/PublicationManager.d.ts +43 -0
- package/dist/client/client/grapesjs/cms/DataSource.d.ts +43 -0
- package/dist/client/client/grapesjs/cms/blocks.d.ts +2 -0
- package/dist/client/client/grapesjs/cms/buttons.d.ts +2 -0
- package/dist/client/client/grapesjs/cms/collection-pages.d.ts +4 -0
- package/dist/client/client/grapesjs/cms/config.d.ts +9 -0
- package/dist/client/client/grapesjs/cms/filters.d.ts +3 -0
- package/dist/client/client/grapesjs/cms/index.d.ts +44 -0
- package/dist/client/client/grapesjs/cms/liquid.d.ts +59 -0
- package/dist/client/client/grapesjs/cms/page-settings.d.ts +6 -0
- package/dist/client/client/grapesjs/cms/publication.d.ts +60 -0
- package/dist/client/client/grapesjs/cms/site-settings.d.ts +3 -0
- package/dist/client/client/grapesjs/cms/states.d.ts +8 -0
- package/dist/client/client/grapesjs/cms/traits.d.ts +8 -0
- package/dist/client/client/grapesjs/settings.d.ts +12 -3
- package/dist/client/client/grapesjs/view-buttons.d.ts +2 -1
- package/dist/client/client/utils.d.ts +1 -0
- package/dist/client/constants.d.ts +2 -1
- package/dist/client/css/admin.css +117 -19
- package/dist/client/index.html +2 -2
- package/dist/client/js/main.js +1974 -267
- package/dist/client/types.d.ts +3 -1
- package/dist/plugins/client/plugins/client/template.js +1 -1
- package/dist/plugins/client/plugins/client/template.js.map +1 -1
- package/dist/plugins/client/types.d.ts +3 -1
- package/dist/plugins/client/types.js +11 -8
- package/dist/plugins/client/types.js.map +1 -1
- package/dist/plugins/server/constants.d.ts +2 -1
- package/dist/plugins/server/constants.js +3 -2
- package/dist/plugins/server/constants.js.map +1 -1
- package/dist/plugins/server/plugins/server/FtpConnector.js +15 -20
- package/dist/plugins/server/plugins/server/FtpConnector.js.map +1 -1
- package/dist/plugins/server/plugins/server/GitlabConnector.js +34 -7
- package/dist/plugins/server/plugins/server/GitlabConnector.js.map +1 -1
- package/dist/plugins/server/server/connectors/FsStorage.js +16 -20
- package/dist/plugins/server/server/connectors/FsStorage.js.map +1 -1
- package/dist/plugins/server/server/utils/websiteDataSerialization.d.ts +4 -0
- package/dist/plugins/server/server/utils/websiteDataSerialization.js +21 -12
- package/dist/plugins/server/server/utils/websiteDataSerialization.js.map +1 -1
- package/dist/plugins/server/types.d.ts +3 -1
- package/dist/plugins/server/types.js +12 -9
- package/dist/plugins/server/types.js.map +1 -1
- package/dist/server/constants.js +3 -2
- package/dist/server/server/connectors/FsStorage.js +14 -18
- package/dist/server/server/utils/websiteDataSerialization.js +16 -11
- package/dist/server/types.js +6 -2
- package/package.json +16 -11
- package/src/css/_variables.scss +2 -1
- package/src/css/grapesjs-plugins.scss +31 -0
- package/src/css/grapesjs.scss +20 -0
- package/src/css/page-panel.scss +25 -6
- package/src/css/silex.scss +64 -5
- package/src/ts/client/config.ts +23 -0
- package/src/ts/client/grapesjs/PublicationManager.ts +159 -1
- package/src/ts/client/grapesjs/breadcrumbs.ts +3 -2
- package/src/ts/client/grapesjs/cms/DataSource.ts +333 -0
- package/src/ts/client/grapesjs/cms/blocks.ts +124 -0
- package/src/ts/client/grapesjs/cms/buttons.ts +163 -0
- package/src/ts/client/grapesjs/cms/collection-pages.ts +214 -0
- package/src/ts/client/grapesjs/cms/config.ts +47 -0
- package/src/ts/client/grapesjs/cms/filters.ts +53 -0
- package/src/ts/client/grapesjs/cms/index.ts +130 -0
- package/src/ts/client/grapesjs/cms/liquid.mock.ts +181 -0
- package/src/ts/client/grapesjs/cms/liquid.test.ts +239 -0
- package/src/ts/client/grapesjs/cms/liquid.ts +325 -0
- package/src/ts/client/grapesjs/cms/page-settings.ts +285 -0
- package/src/ts/client/grapesjs/cms/publication.test.ts +300 -0
- package/src/ts/client/grapesjs/cms/publication.ts +708 -0
- package/src/ts/client/grapesjs/cms/site-settings.ts +79 -0
- package/src/ts/client/grapesjs/cms/states.ts +125 -0
- package/src/ts/client/grapesjs/cms/traits.ts +95 -0
- package/src/ts/client/grapesjs/css-props.ts +15 -16
- package/src/ts/client/grapesjs/flex.ts +59 -39
- package/src/ts/client/grapesjs/img.ts +1 -1
- package/src/ts/client/grapesjs/index.ts +77 -4
- package/src/ts/client/grapesjs/internal-links.ts +4 -2
- package/src/ts/client/grapesjs/page-panel.ts +126 -11
- package/src/ts/client/grapesjs/sectors.ts +18 -10
- package/src/ts/client/grapesjs/semantic.ts +4 -0
- package/src/ts/client/grapesjs/settings.ts +252 -101
- package/src/ts/client/grapesjs/storage.ts +12 -3
- package/src/ts/client/grapesjs/view-buttons.ts +39 -3
- package/src/ts/client/utils.ts +15 -2
- package/src/ts/constants.ts +2 -1
- package/src/ts/plugins/client/template.ts +1 -1
- package/src/ts/plugins/server/FtpConnector.test.ts +1 -0
- package/src/ts/plugins/server/FtpConnector.ts +20 -23
- package/src/ts/plugins/server/GitlabConnector.ts +40 -10
- package/src/ts/server/connectors/FsStorage.test.ts +3 -2
- package/src/ts/server/connectors/FsStorage.ts +21 -23
- package/src/ts/server/utils/websiteDataSerialization.test.ts +45 -13
- package/src/ts/server/utils/websiteDataSerialization.ts +23 -14
- package/src/ts/types.ts +6 -2
package/.silex.js
CHANGED
|
@@ -56,9 +56,6 @@ module.exports = async function(config, options) {
|
|
|
56
56
|
.concat(config.debug ? [{
|
|
57
57
|
route: '/',
|
|
58
58
|
path: './',
|
|
59
|
-
}, {
|
|
60
|
-
route: '/js/',
|
|
61
|
-
path: nodeModules('@silexlabs/silex-cms') + '/@silexlabs/silex-cms/',
|
|
62
59
|
}, {
|
|
63
60
|
// why is this needed when running locally?
|
|
64
61
|
route: '/css/',
|
|
@@ -4,6 +4,7 @@ import { Editor, EditorConfig } from 'grapesjs';
|
|
|
4
4
|
import { PublicationTransformer } from './publication-transformers';
|
|
5
5
|
import * as api from './api';
|
|
6
6
|
import { SettingsSection } from './grapesjs/settings-sections';
|
|
7
|
+
import { EleventyPluginOptions } from './grapesjs/cms';
|
|
7
8
|
/**
|
|
8
9
|
* @fileoverview Silex client side config
|
|
9
10
|
*/
|
|
@@ -67,6 +68,13 @@ export declare class ClientConfig extends Config {
|
|
|
67
68
|
*/
|
|
68
69
|
fontsServerUrl: string;
|
|
69
70
|
fontsApiUrl: string;
|
|
71
|
+
/**
|
|
72
|
+
* CMS configuration options
|
|
73
|
+
* @default Default CMS configuration with enabled: true
|
|
74
|
+
*/
|
|
75
|
+
cmsConfig: Partial<EleventyPluginOptions> & {
|
|
76
|
+
enabled?: boolean;
|
|
77
|
+
};
|
|
70
78
|
/**
|
|
71
79
|
* Init GrapesJS config which depend on the config file properties
|
|
72
80
|
*/
|
|
@@ -67,6 +67,49 @@ export declare class PublicationManager {
|
|
|
67
67
|
*/
|
|
68
68
|
startPublication(): Promise<void>;
|
|
69
69
|
getHtmlFiles(siteSettings: WebsiteSettings, preventDefault: any): Promise<WebsiteFile[]>;
|
|
70
|
+
/**
|
|
71
|
+
* Helper function to check if a viewport meta tag exists in the head content
|
|
72
|
+
* @param headContent - HTML content from head settings
|
|
73
|
+
* @returns true if viewport meta tag is found
|
|
74
|
+
*/
|
|
75
|
+
private hasViewportMeta;
|
|
76
|
+
/**
|
|
77
|
+
* Get the default viewport meta tag if no viewport is present
|
|
78
|
+
* @param siteHead - Head content from site settings
|
|
79
|
+
* @param pageHead - Head content from page settings
|
|
80
|
+
* @returns viewport meta tag or empty string if already present
|
|
81
|
+
*/
|
|
82
|
+
private ensureViewportMeta;
|
|
83
|
+
/**
|
|
84
|
+
* Helper function to check if a generator meta tag exists in the head content
|
|
85
|
+
* @param headContent - HTML content from head settings
|
|
86
|
+
* @returns true if generator meta tag is found
|
|
87
|
+
*/
|
|
88
|
+
private hasGeneratorMeta;
|
|
89
|
+
/**
|
|
90
|
+
* Get the default generator meta tag if no generator is present
|
|
91
|
+
* @param siteHead - Head content from site settings
|
|
92
|
+
* @param pageHead - Head content from page settings
|
|
93
|
+
* @returns generator meta tag or empty string if already present
|
|
94
|
+
*/
|
|
95
|
+
private ensureGeneratorMeta;
|
|
96
|
+
/**
|
|
97
|
+
* Helper function to check if a canonical link exists in the head content
|
|
98
|
+
* @param headContent - HTML content from head settings
|
|
99
|
+
* @returns true if canonical link is found
|
|
100
|
+
*/
|
|
101
|
+
private hasCanonicalLink;
|
|
102
|
+
/**
|
|
103
|
+
* Helper function to check if alternate links exist in the head content
|
|
104
|
+
* @param headContent - HTML content from head settings
|
|
105
|
+
* @returns true if alternate links are found
|
|
106
|
+
*/
|
|
107
|
+
private hasAlternateLinks;
|
|
108
|
+
/**
|
|
109
|
+
* Check for missing SEO tags and emit warnings
|
|
110
|
+
* @param siteSettings - Site settings
|
|
111
|
+
*/
|
|
112
|
+
private checkSeoTags;
|
|
70
113
|
getHtmlFilesYield(siteSettings: WebsiteSettings, preventDefault: any): AsyncGenerator<WebsiteFile | undefined>;
|
|
71
114
|
trackProgress(): Promise<void>;
|
|
72
115
|
private setPublicationTransformers;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { DataSourceType, Field, IDataSource, Type } from '@silexlabs/grapesjs-data-source';
|
|
2
|
+
import { EleventyPluginOptions } from './index';
|
|
3
|
+
import { Editor } from 'grapesjs';
|
|
4
|
+
export default function (editor: Editor, opts: EleventyPluginOptions): void;
|
|
5
|
+
export declare const EleventyDataSourceId = "eleventy";
|
|
6
|
+
export declare class EleventyDataSource implements IDataSource {
|
|
7
|
+
/**
|
|
8
|
+
* Unique identifier of the data source
|
|
9
|
+
* This is used to retrieve the data source from the editor
|
|
10
|
+
*/
|
|
11
|
+
id: string;
|
|
12
|
+
label: string;
|
|
13
|
+
url: string;
|
|
14
|
+
type: DataSourceType;
|
|
15
|
+
method: string;
|
|
16
|
+
headers: {};
|
|
17
|
+
hidden: boolean;
|
|
18
|
+
readonly: boolean;
|
|
19
|
+
private eventListeners;
|
|
20
|
+
on(event: string, callback: (...args: unknown[]) => void): void;
|
|
21
|
+
off(event: string, callback?: (...args: unknown[]) => void): void;
|
|
22
|
+
trigger(event: string, ...args: unknown[]): void;
|
|
23
|
+
/**
|
|
24
|
+
* Implement IDatasource
|
|
25
|
+
*/
|
|
26
|
+
connect(): Promise<void>;
|
|
27
|
+
isConnected(): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Implement IDatasource
|
|
30
|
+
*/
|
|
31
|
+
getQuery(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Implement IDatasource
|
|
34
|
+
*/
|
|
35
|
+
getTypes(): Type[];
|
|
36
|
+
/**
|
|
37
|
+
* Implement IDatasource
|
|
38
|
+
*/
|
|
39
|
+
getQueryables(): Field[];
|
|
40
|
+
fetchValues(query: string): Promise<unknown>;
|
|
41
|
+
}
|
|
42
|
+
export declare class EleventyDataSourceTest extends EleventyDataSource {
|
|
43
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview DataSource configuration with defaults
|
|
3
|
+
*/
|
|
4
|
+
import { EleventyPluginOptions } from './index';
|
|
5
|
+
import { Editor } from 'grapesjs';
|
|
6
|
+
/**
|
|
7
|
+
* Default for the data source plugin to work without config
|
|
8
|
+
*/
|
|
9
|
+
export declare function getZeroConfig(editor: Editor): EleventyPluginOptions;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { DataSourceEditorOptions } from '@silexlabs/grapesjs-data-source';
|
|
2
|
+
import { WebsiteSettings } from '../../../types';
|
|
3
|
+
import { Editor } from 'grapesjs';
|
|
4
|
+
export declare const CMS_SETTINGS_SECTION_ID = "CMS_SETTINGS_SECTION_ID";
|
|
5
|
+
export interface EleventyPluginOptions extends DataSourceEditorOptions {
|
|
6
|
+
esModule?: boolean;
|
|
7
|
+
enable11ty?: boolean;
|
|
8
|
+
cacheBuster?: boolean;
|
|
9
|
+
fetchPluginSettings?: object | false;
|
|
10
|
+
i18nPlugin?: boolean;
|
|
11
|
+
dir?: {
|
|
12
|
+
input?: string;
|
|
13
|
+
html?: string;
|
|
14
|
+
assets?: string;
|
|
15
|
+
css?: string;
|
|
16
|
+
};
|
|
17
|
+
urls?: {
|
|
18
|
+
css?: string;
|
|
19
|
+
assets?: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export interface Silex11tyPluginWebsiteSettings extends WebsiteSettings {
|
|
23
|
+
eleventyPageData?: string;
|
|
24
|
+
eleventyPermalink?: string;
|
|
25
|
+
eleventyPageSize?: string;
|
|
26
|
+
eleventyPageReverse?: boolean;
|
|
27
|
+
silexLanguagesList?: string;
|
|
28
|
+
silexLanguagesDefault?: string;
|
|
29
|
+
eleventyNavigationKey?: string;
|
|
30
|
+
eleventyNavigationTitle?: string;
|
|
31
|
+
eleventyNavigationOrder?: string;
|
|
32
|
+
eleventyNavigationParent?: string;
|
|
33
|
+
eleventyNavigationUrl?: string;
|
|
34
|
+
eleventySeoTitle?: string;
|
|
35
|
+
eleventySeoDescription?: string;
|
|
36
|
+
eleventyFavicon?: string;
|
|
37
|
+
eleventyOGImage?: string;
|
|
38
|
+
eleventyOGTitle?: string;
|
|
39
|
+
eleventyOGDescription?: string;
|
|
40
|
+
eleventyI18n?: boolean;
|
|
41
|
+
eleventyFetch?: boolean;
|
|
42
|
+
eleventyImage?: boolean;
|
|
43
|
+
}
|
|
44
|
+
export default function (editor: Editor, options?: Partial<EleventyPluginOptions>): Editor;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Expression, Filter, Property, State, StateId, UnariOperator, BinaryOperator } from '@silexlabs/grapesjs-data-source';
|
|
2
|
+
import { Component } from 'grapesjs';
|
|
3
|
+
export interface BinaryCondition {
|
|
4
|
+
operator: BinaryOperator;
|
|
5
|
+
expression: Expression;
|
|
6
|
+
expression2: Expression;
|
|
7
|
+
}
|
|
8
|
+
export interface UnaryCondition {
|
|
9
|
+
operator: UnariOperator;
|
|
10
|
+
expression: Expression;
|
|
11
|
+
}
|
|
12
|
+
export type Condition = BinaryCondition | UnaryCondition;
|
|
13
|
+
/**
|
|
14
|
+
* Generate liquid instructions which echo the value of an expression
|
|
15
|
+
*/
|
|
16
|
+
export declare function echoBlock(component: Component, expression: Expression): string;
|
|
17
|
+
/**
|
|
18
|
+
* Generate liquid instructions which echo the value of an expression, on 1 line
|
|
19
|
+
*/
|
|
20
|
+
export declare function echoBlock1line(component: Component, expression: Expression): string;
|
|
21
|
+
/**
|
|
22
|
+
* Generate liquid instructions which define a variable for later use
|
|
23
|
+
* This is used for components states
|
|
24
|
+
*/
|
|
25
|
+
export declare function assignBlock(stateId: StateId, component: Component, expression: Expression): string;
|
|
26
|
+
/**
|
|
27
|
+
* Generate liquid instructions which start and end a loop over the provided expression
|
|
28
|
+
* This is used for components states
|
|
29
|
+
*/
|
|
30
|
+
export declare function loopBlock(component: Component, expression: Expression): [start: string, end: string];
|
|
31
|
+
/**
|
|
32
|
+
* Generate liquid instructions which define a variable for later use
|
|
33
|
+
* This is used for components states
|
|
34
|
+
*/
|
|
35
|
+
export declare function ifBlock(component: Component, condition: Condition): [start: string, end: string];
|
|
36
|
+
/**
|
|
37
|
+
* Pagination data has no filter and no states in it
|
|
38
|
+
*/
|
|
39
|
+
export declare function getPaginationData(expression: Property[]): string;
|
|
40
|
+
/**
|
|
41
|
+
* Convert an expression to liquid code
|
|
42
|
+
*/
|
|
43
|
+
export declare function getLiquidBlock(component: Component, expression: Expression): {
|
|
44
|
+
variableName: string;
|
|
45
|
+
liquid: string;
|
|
46
|
+
}[];
|
|
47
|
+
export declare function getNextVariableName(component: Component, numNextVar: number): string;
|
|
48
|
+
/**
|
|
49
|
+
* Get the liquid assign statement for the expression
|
|
50
|
+
* The expression must
|
|
51
|
+
* - start with a property or state
|
|
52
|
+
* - once it has a filter it canot have a property again
|
|
53
|
+
* - state can only be the first token
|
|
54
|
+
*
|
|
55
|
+
* Example of return value: `countries.continent.countries | first.name`
|
|
56
|
+
*/
|
|
57
|
+
export declare function getLiquidStatement(expression: Expression, variableName: string, lastVariableName?: string): string;
|
|
58
|
+
export declare function getLiquidStatementProperties(properties: (Property | State)[]): string;
|
|
59
|
+
export declare function getLiquidStatementFilters(filters: Filter[]): string;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Page, Editor } from 'grapesjs';
|
|
2
|
+
import { IDataSource, StateId, Token } from '@silexlabs/grapesjs-data-source';
|
|
3
|
+
import { EleventyPluginOptions, Silex11tyPluginWebsiteSettings } from './index';
|
|
4
|
+
import { ClientConfig } from '../../config';
|
|
5
|
+
import { WebsiteSettings, PublicationData } from '../../../types';
|
|
6
|
+
export default function (editor: Editor, options: EleventyPluginOptions): void;
|
|
7
|
+
export declare function getPermalink(page: Page, permalink: Token[], isCollectionPage: boolean, slug: string): string | null;
|
|
8
|
+
/**
|
|
9
|
+
* Get the front matter for a given page
|
|
10
|
+
*/
|
|
11
|
+
export declare function getFrontMatter(page: Page, settings: Silex11tyPluginWebsiteSettings, slug: string, collection: string, lang?: string): string;
|
|
12
|
+
/**
|
|
13
|
+
* Get the body states for a given page
|
|
14
|
+
*/
|
|
15
|
+
export declare function getBodyStates(page: Page): string;
|
|
16
|
+
export declare function transformPage(editor: Editor, data: {
|
|
17
|
+
page: Page;
|
|
18
|
+
siteSettings: WebsiteSettings;
|
|
19
|
+
pageSettings: Silex11tyPluginWebsiteSettings;
|
|
20
|
+
}): void;
|
|
21
|
+
/**
|
|
22
|
+
* Transform the files to be published
|
|
23
|
+
* This hook is called just before the files are written to the file system
|
|
24
|
+
* Exported for unit tests
|
|
25
|
+
*/
|
|
26
|
+
export declare function transformFiles(editor: Editor, options: EleventyPluginOptions, data: PublicationData, config: ClientConfig): void;
|
|
27
|
+
/**
|
|
28
|
+
* Exported for unit tests
|
|
29
|
+
*/
|
|
30
|
+
export declare function queryToDataFile(dataSource: IDataSource, queryStr: string, options: EleventyPluginOptions, page: Page, lang: string | null, fetchPlugin: object | false): string;
|
|
31
|
+
export declare function makeFetchCall(options: {
|
|
32
|
+
key: string;
|
|
33
|
+
url: string;
|
|
34
|
+
method: string;
|
|
35
|
+
headers: string;
|
|
36
|
+
query: string;
|
|
37
|
+
}): string;
|
|
38
|
+
export declare function makeFetchCallEleventy(options: {
|
|
39
|
+
key: string;
|
|
40
|
+
url: string;
|
|
41
|
+
method: string;
|
|
42
|
+
headers: string;
|
|
43
|
+
query: string;
|
|
44
|
+
}, fetchPlugin: object): string;
|
|
45
|
+
/**
|
|
46
|
+
* Check if a state is an attribute
|
|
47
|
+
* Exported for unit tests
|
|
48
|
+
*/
|
|
49
|
+
export declare function isAttribute(label: string): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Build the attributes string for a given component
|
|
52
|
+
* Handle attributes which appear multiple times (class, style)
|
|
53
|
+
* Append to the original attributes
|
|
54
|
+
* Exported for unit tests
|
|
55
|
+
*/
|
|
56
|
+
export declare function buildAttributes(originalAttributes: Record<string, string>, attributeStates: {
|
|
57
|
+
stateId: StateId;
|
|
58
|
+
label: string;
|
|
59
|
+
value: string;
|
|
60
|
+
}[]): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Editor } from 'grapesjs';
|
|
2
|
+
export default function (editor: Editor): void;
|
|
3
|
+
/**
|
|
4
|
+
* Update pagination states for a page with the ability to control which page index to show
|
|
5
|
+
* @param editor - The GrapesJS editor instance
|
|
6
|
+
* @param pageIndex - The current page index (0-based) for pagination preview. Use 0 for publication.
|
|
7
|
+
*/
|
|
8
|
+
export declare function updatePaginationStates(editor: Editor, pageIndex?: number, preventTrigger?: boolean): void;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
+
import { SettingsSection } from './settings-sections';
|
|
2
|
+
import { Editor } from 'grapesjs';
|
|
1
3
|
export declare const cmdOpenSettings = "open-settings";
|
|
2
|
-
export declare const
|
|
3
|
-
export declare
|
|
4
|
-
export
|
|
4
|
+
export declare const cmdAddSection = "settings:add-section";
|
|
5
|
+
export declare const cmdRemoveSection = "settings:remove-section";
|
|
6
|
+
export interface AddSectionOption {
|
|
7
|
+
section: SettingsSection;
|
|
8
|
+
siteOrPage: 'site' | 'page';
|
|
9
|
+
position: 'first' | 'last' | number;
|
|
10
|
+
}
|
|
11
|
+
export declare const settingsDialog: (editor: Editor, opts: Record<string, unknown>) => void;
|
|
12
|
+
export declare function addSection(section: SettingsSection, siteOrPage: 'site' | 'page', position: 'first' | 'last' | number): void;
|
|
13
|
+
export declare function removeSection(id: string, siteOrPage: 'site' | 'page'): void;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { Editor } from 'grapesjs';
|
|
2
|
+
export default function (editor: Editor): void;
|
|
@@ -20,3 +20,4 @@ export declare function isTextOrInputField(element: HTMLElement): boolean;
|
|
|
20
20
|
* @param sep The separator between words.
|
|
21
21
|
*/
|
|
22
22
|
export declare function titleCase(str: string, sep?: string): string;
|
|
23
|
+
export declare function debounce<T extends (...args: any[]) => any>(func: T, wait?: number): (...args: Parameters<T>) => void;
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare const WEBSITE_DATA_FILE = "website.json";
|
|
5
5
|
export declare const WEBSITE_META_DATA_FILE = "meta.json";
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const LEGACY_WEBSITE_PAGES_FOLDER = "src";
|
|
7
|
+
export declare const WEBSITE_PAGES_FOLDER = "pages";
|
|
7
8
|
export declare const DEFAULT_WEBSITE_ID = "default";
|
|
8
9
|
export declare const DEFAULT_LANGUAGE = "en";
|
|
9
10
|
export declare const CLIENT_CONFIG_FILE_NAME = "silex.js";
|
|
@@ -322,6 +322,7 @@ template {
|
|
|
322
322
|
--lighterPrimaryColor: #575757;
|
|
323
323
|
--viewsPanelWidth: 25%;
|
|
324
324
|
--viewsProjectPanelWidth: 13%;
|
|
325
|
+
--footerHeight: 30px;
|
|
325
326
|
}
|
|
326
327
|
|
|
327
328
|
/* stylelint-disable */
|
|
@@ -3991,25 +3992,83 @@ See http://bgrins.github.io/spectrum/themes/ for instructions.
|
|
|
3991
3992
|
overflow: hidden;
|
|
3992
3993
|
}
|
|
3993
3994
|
|
|
3994
|
-
.settings-dialog
|
|
3995
|
-
|
|
3996
|
-
|
|
3995
|
+
.settings-dialog {
|
|
3996
|
+
position: fixed;
|
|
3997
|
+
top: 0;
|
|
3998
|
+
left: 0;
|
|
3999
|
+
width: 100vw;
|
|
3997
4000
|
height: 100vh;
|
|
4001
|
+
z-index: 10;
|
|
4002
|
+
pointer-events: auto;
|
|
3998
4003
|
overflow: auto;
|
|
4004
|
+
display: flex;
|
|
4005
|
+
flex-direction: column;
|
|
4006
|
+
}
|
|
4007
|
+
.settings-dialog .settings-content {
|
|
4008
|
+
flex: 1;
|
|
4009
|
+
display: flex;
|
|
4010
|
+
flex-direction: column;
|
|
4011
|
+
background-color: var(--primaryColor);
|
|
4012
|
+
overflow: hidden;
|
|
4013
|
+
}
|
|
4014
|
+
.settings-dialog .settings-header {
|
|
4015
|
+
display: flex;
|
|
4016
|
+
align-items: center;
|
|
4017
|
+
justify-content: space-between;
|
|
4018
|
+
padding: 16px 20px;
|
|
4019
|
+
border-bottom: 1px solid var(--gjs-border-color, #ddd);
|
|
3999
4020
|
}
|
|
4000
|
-
.settings-dialog
|
|
4021
|
+
.settings-dialog .settings-header h3 {
|
|
4022
|
+
margin: 0;
|
|
4023
|
+
font-size: 18px;
|
|
4024
|
+
}
|
|
4025
|
+
.settings-dialog .settings-close {
|
|
4026
|
+
color: inherit;
|
|
4027
|
+
background: none;
|
|
4028
|
+
border: none;
|
|
4029
|
+
font-size: 24px;
|
|
4030
|
+
cursor: pointer;
|
|
4031
|
+
padding: 0;
|
|
4032
|
+
width: 30px;
|
|
4033
|
+
height: 30px;
|
|
4034
|
+
display: flex;
|
|
4035
|
+
align-items: center;
|
|
4036
|
+
justify-content: center;
|
|
4037
|
+
}
|
|
4038
|
+
.settings-dialog .settings-body {
|
|
4039
|
+
flex: 1;
|
|
4040
|
+
overflow: auto;
|
|
4041
|
+
padding: 0;
|
|
4042
|
+
}
|
|
4043
|
+
.settings-dialog .settings-body .silex-form {
|
|
4044
|
+
height: 100%;
|
|
4045
|
+
display: flex;
|
|
4046
|
+
flex-direction: column;
|
|
4047
|
+
}
|
|
4048
|
+
.settings-dialog .settings-body .silex-sidebar-dialog {
|
|
4049
|
+
flex: 1;
|
|
4050
|
+
}
|
|
4051
|
+
.settings-dialog footer {
|
|
4052
|
+
position: fixed;
|
|
4053
|
+
z-index: 10;
|
|
4054
|
+
bottom: 0;
|
|
4055
|
+
left: 0;
|
|
4056
|
+
width: 100%;
|
|
4057
|
+
padding: 20px 0;
|
|
4058
|
+
}
|
|
4059
|
+
.settings-dialog form.silex-form {
|
|
4001
4060
|
padding-bottom: 100px;
|
|
4002
4061
|
}
|
|
4003
|
-
.settings-dialog
|
|
4062
|
+
.settings-dialog form.silex-form textarea {
|
|
4004
4063
|
min-height: 250px;
|
|
4005
4064
|
}
|
|
4006
|
-
.settings-dialog
|
|
4065
|
+
.settings-dialog .silex-form__element {
|
|
4007
4066
|
padding: 10px 5px;
|
|
4008
4067
|
border: 1px solid #575757;
|
|
4009
4068
|
margin: 10px 0;
|
|
4010
4069
|
width: 98%;
|
|
4011
4070
|
}
|
|
4012
|
-
.settings-dialog
|
|
4071
|
+
.settings-dialog footer {
|
|
4013
4072
|
position: fixed;
|
|
4014
4073
|
z-index: 10;
|
|
4015
4074
|
bottom: 0;
|
|
@@ -4018,15 +4077,15 @@ See http://bgrins.github.io/spectrum/themes/ for instructions.
|
|
|
4018
4077
|
padding: 20px 0;
|
|
4019
4078
|
background-color: #333333;
|
|
4020
4079
|
}
|
|
4021
|
-
.settings-dialog
|
|
4080
|
+
.settings-dialog footer > *:last-child {
|
|
4022
4081
|
margin-right: 30px;
|
|
4023
4082
|
}
|
|
4024
|
-
.settings-dialog
|
|
4083
|
+
.settings-dialog footer .silex-version {
|
|
4025
4084
|
float: left;
|
|
4026
4085
|
padding: 0 15px;
|
|
4027
|
-
font-size:
|
|
4086
|
+
font-size: small;
|
|
4028
4087
|
}
|
|
4029
|
-
.settings-dialog
|
|
4088
|
+
.settings-dialog .CodeMirror {
|
|
4030
4089
|
min-height: 400px;
|
|
4031
4090
|
height: auto;
|
|
4032
4091
|
}
|
|
@@ -4102,7 +4161,7 @@ input.silex-button[type=submit]:hover {
|
|
|
4102
4161
|
}
|
|
4103
4162
|
.silex-sidebar-dialog main,
|
|
4104
4163
|
.silex-bar main {
|
|
4105
|
-
width:
|
|
4164
|
+
width: 93%;
|
|
4106
4165
|
}
|
|
4107
4166
|
|
|
4108
4167
|
ol.silex-list,
|
|
@@ -4208,7 +4267,7 @@ form.silex-form .silex-form__group.col2 {
|
|
|
4208
4267
|
justify-content: center;
|
|
4209
4268
|
align-items: center;
|
|
4210
4269
|
background-color: #333333;
|
|
4211
|
-
z-index:
|
|
4270
|
+
z-index: 11;
|
|
4212
4271
|
opacity: 1;
|
|
4213
4272
|
font-size: 1.25rem;
|
|
4214
4273
|
letter-spacing: 0.025em;
|
|
@@ -4473,10 +4532,10 @@ form.silex-form .silex-form__group.col2 {
|
|
|
4473
4532
|
.page-panel-container .pages {
|
|
4474
4533
|
display: flex;
|
|
4475
4534
|
flex-direction: column;
|
|
4535
|
+
margin-bottom: 30px;
|
|
4476
4536
|
}
|
|
4477
4537
|
.page-panel-container .pages .pages__main {
|
|
4478
4538
|
flex: 1;
|
|
4479
|
-
border: 1px solid #292929;
|
|
4480
4539
|
background-color: #333333;
|
|
4481
4540
|
min-height: 20vh;
|
|
4482
4541
|
}
|
|
@@ -4485,7 +4544,8 @@ form.silex-form .silex-form__group.col2 {
|
|
|
4485
4544
|
align-items: center;
|
|
4486
4545
|
background-color: #292929;
|
|
4487
4546
|
border-bottom: 1px solid rgba(0, 0, 0, 0.25);
|
|
4488
|
-
cursor:
|
|
4547
|
+
cursor: cursor;
|
|
4548
|
+
transition: opacity 0.2s ease, background-color 0.2s ease;
|
|
4489
4549
|
}
|
|
4490
4550
|
.page-panel-container .pages .pages__page:hover {
|
|
4491
4551
|
background-color: #333333;
|
|
@@ -4493,6 +4553,13 @@ form.silex-form .silex-form__group.col2 {
|
|
|
4493
4553
|
.page-panel-container .pages .pages__page:hover .pages__page-name {
|
|
4494
4554
|
color: #A291FF;
|
|
4495
4555
|
}
|
|
4556
|
+
.page-panel-container .pages .pages__page:active {
|
|
4557
|
+
cursor: grabbing;
|
|
4558
|
+
}
|
|
4559
|
+
.page-panel-container .pages .pages__page-dragging {
|
|
4560
|
+
opacity: 0.4;
|
|
4561
|
+
cursor: grabbing !important;
|
|
4562
|
+
}
|
|
4496
4563
|
.page-panel-container .pages .pages__page-selected {
|
|
4497
4564
|
background-color: #575757;
|
|
4498
4565
|
cursor: default;
|
|
@@ -4507,20 +4574,31 @@ form.silex-form .silex-form__group.col2 {
|
|
|
4507
4574
|
white-space: nowrap;
|
|
4508
4575
|
overflow: hidden;
|
|
4509
4576
|
text-overflow: ellipsis;
|
|
4510
|
-
|
|
4511
|
-
font-size: initial;
|
|
4577
|
+
font-size: 13px;
|
|
4512
4578
|
text-transform: capitalize;
|
|
4513
|
-
padding:
|
|
4579
|
+
padding: 6px;
|
|
4514
4580
|
flex: 1;
|
|
4515
4581
|
text-align: left;
|
|
4582
|
+
display: flex;
|
|
4583
|
+
align-items: center;
|
|
4584
|
+
gap: 4px;
|
|
4516
4585
|
}
|
|
4517
4586
|
.page-panel-container .pages .pages__icon {
|
|
4518
|
-
padding:
|
|
4587
|
+
padding: 6px;
|
|
4519
4588
|
cursor: pointer;
|
|
4589
|
+
font-size: 12px;
|
|
4520
4590
|
}
|
|
4521
4591
|
.page-panel-container .pages .pages__icon:hover {
|
|
4522
4592
|
color: #A291FF;
|
|
4523
4593
|
}
|
|
4594
|
+
.page-panel-container .pages .pages__drag-handle {
|
|
4595
|
+
cursor: grab;
|
|
4596
|
+
opacity: 0.6;
|
|
4597
|
+
flex-shrink: 0;
|
|
4598
|
+
}
|
|
4599
|
+
.page-panel-container .pages .pages__drag-handle:hover {
|
|
4600
|
+
opacity: 1;
|
|
4601
|
+
}
|
|
4524
4602
|
.page-panel-container .gjs-pn-buttons {
|
|
4525
4603
|
flex-direction: column;
|
|
4526
4604
|
}
|
|
@@ -4927,6 +5005,10 @@ form.silex-form .silex-form__group.col2 {
|
|
|
4927
5005
|
outline: 1px solid #8873FE;
|
|
4928
5006
|
}
|
|
4929
5007
|
|
|
5008
|
+
.gjs-cv-canvas {
|
|
5009
|
+
height: calc(100% - var(--gjs-canvas-top) - var(--footerHeight));
|
|
5010
|
+
}
|
|
5011
|
+
|
|
4930
5012
|
.gjs-pn-buttons {
|
|
4931
5013
|
justify-content: unset;
|
|
4932
5014
|
}
|
|
@@ -5066,12 +5148,28 @@ form.silex-form .silex-form__group.col2 {
|
|
|
5066
5148
|
|
|
5067
5149
|
.fa-diamond:before {
|
|
5068
5150
|
content: "\f3a5";
|
|
5151
|
+
font-weight: 900;
|
|
5152
|
+
}
|
|
5153
|
+
|
|
5154
|
+
.fa-rotate-left:before {
|
|
5155
|
+
content: "\f2ea";
|
|
5156
|
+
font-weight: 900;
|
|
5157
|
+
}
|
|
5158
|
+
|
|
5159
|
+
.fa-rotate-right:before {
|
|
5160
|
+
content: "\f2f9";
|
|
5161
|
+
font-weight: 900;
|
|
5069
5162
|
}
|
|
5070
5163
|
|
|
5071
5164
|
.gjs-sm-sector .gjs-sm-sector-label {
|
|
5072
5165
|
margin-right: 0.3em;
|
|
5073
5166
|
}
|
|
5074
5167
|
|
|
5168
|
+
.fa-grip-vertical:before {
|
|
5169
|
+
content: "\f58e";
|
|
5170
|
+
font-weight: 900;
|
|
5171
|
+
}
|
|
5172
|
+
|
|
5075
5173
|
.gjs-sm-sector .gjs-sm-sector-title::before,
|
|
5076
5174
|
.gjs-sm-sector .gjs-sm-sector-title::after {
|
|
5077
5175
|
content: "o";
|
package/dist/client/index.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en" translate="no"><head><title>Silex</title><meta name="description" content="This is a public instance of Silex website builder. Build websites in the browser"><link rel="shortcut icon" href="assets/favicon.png?
|
|
1
|
+
<!DOCTYPE html><html lang="en" translate="no"><head><title>Silex</title><meta name="description" content="This is a public instance of Silex website builder. Build websites in the browser"><link rel="shortcut icon" href="assets/favicon.png?401143"><style>body {
|
|
2
2
|
background-color: #444444;
|
|
3
3
|
font-family: "Ubuntu", "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
4
4
|
}
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
transition: opacity 0.25s 0.25s ease-in-out;
|
|
8
8
|
}
|
|
9
9
|
</style></head><body class="silex-loading"><div class="silex-loader silex-dialog" role="status" aria-live="polite" aria-busy="true">Loading
|
|
10
|
-
</div><link rel="stylesheet" type="text/css" href="css/admin.css?
|
|
10
|
+
</div><link rel="stylesheet" type="text/css" href="css/admin.css?687300"><main class="silex-workspace"><div class="silex-main silex-dialog-hide silex-ui-full" id="gjs"></div></main><script src="js/main.js?687300"></script><script>silex.start()
|
|
11
11
|
// From here silex.config is available and Silex is getting started</script></body></html>
|