@silexlabs/silex 3.0.0-alpha.41 → 3.0.0-alpha.43
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 +2 -11
- package/dist/client/client/api.d.ts +83 -0
- package/dist/client/client/config.d.ts +3 -3
- package/dist/client/client/events.d.ts +12 -0
- package/dist/client/client/expose.d.ts +6 -0
- package/dist/client/client/grapesjs/LoginDialog.d.ts +3 -2
- package/dist/client/client/grapesjs/PublicationManager.d.ts +9 -3
- package/dist/client/client/grapesjs/PublicationUi.d.ts +9 -6
- package/dist/client/client/grapesjs/index.d.ts +4 -4
- package/dist/client/client/grapesjs/openImport.d.ts +5 -0
- package/dist/client/constants.d.ts +23 -14
- package/dist/client/css/admin.css +5 -0
- package/dist/client/js/main.js +90 -111
- package/dist/client/js/main.js.LICENSE.txt +0 -6
- package/dist/client/page.d.ts +1 -1
- package/dist/client/types.d.ts +125 -86
- package/dist/plugins/client/client/events.d.ts +12 -0
- package/dist/plugins/client/client/events.js +30 -0
- package/dist/plugins/client/client/events.js.map +1 -0
- package/dist/plugins/client/client/utils.d.ts +1 -0
- package/{src/ts/events.ts → dist/plugins/client/client/utils.js} +9 -3
- package/dist/plugins/client/client/utils.js.map +1 -0
- package/dist/plugins/client/constants.d.ts +30 -0
- package/dist/plugins/client/constants.js +47 -0
- package/dist/plugins/client/constants.js.map +1 -0
- package/dist/plugins/client/page.d.ts +2 -0
- package/dist/plugins/client/page.js +31 -0
- package/dist/plugins/client/page.js.map +1 -0
- package/dist/plugins/client/plugins/client/publicationRenderer.d.ts +2 -0
- package/dist/plugins/client/plugins/client/publicationRenderer.js +128 -0
- package/dist/plugins/client/plugins/client/publicationRenderer.js.map +1 -0
- package/dist/plugins/client/plugins/client/template.d.ts +2 -0
- package/dist/plugins/client/plugins/client/template.js +186 -0
- package/dist/plugins/client/plugins/client/template.js.map +1 -0
- package/dist/plugins/client/server/config.d.ts +59 -0
- package/dist/plugins/client/server/config.js +178 -0
- package/dist/plugins/client/server/config.js.map +1 -0
- package/dist/plugins/client/server/connectors/FsHosting.d.ts +13 -0
- package/dist/plugins/client/server/connectors/FsHosting.js +51 -0
- package/dist/plugins/client/server/connectors/FsHosting.js.map +1 -0
- package/dist/plugins/client/server/connectors/FsStorage.d.ts +41 -0
- package/dist/plugins/client/server/connectors/FsStorage.js +220 -0
- package/dist/plugins/client/server/connectors/FsStorage.js.map +1 -0
- package/dist/plugins/client/server/connectors/connectors.d.ts +83 -0
- package/dist/plugins/client/server/connectors/connectors.js +91 -0
- package/dist/plugins/client/server/connectors/connectors.js.map +1 -0
- package/dist/plugins/client/server/events.d.ts +26 -0
- package/dist/plugins/client/server/events.js +12 -0
- package/dist/plugins/client/server/events.js.map +1 -0
- package/dist/plugins/client/server/jobs.js +67 -0
- package/dist/plugins/client/server/jobs.js.map +1 -0
- package/dist/plugins/client/server/utils/validation.js +34 -0
- package/dist/plugins/client/server/utils/validation.js.map +1 -0
- package/dist/plugins/client/types.d.ts +309 -0
- package/dist/plugins/client/types.js +49 -0
- package/dist/plugins/client/types.js.map +1 -0
- package/dist/plugins/server/constants.d.ts +30 -0
- package/dist/plugins/server/constants.js +50 -0
- package/dist/plugins/server/constants.js.map +1 -0
- package/dist/plugins/server/plugins/server/AuthPlugin.js.map +1 -0
- package/dist/plugins/server/plugins/server/Cache.js.map +1 -0
- package/dist/plugins/server/plugins/server/FtpConnector.d.ts +94 -0
- package/dist/plugins/server/plugins/server/FtpConnector.js +521 -0
- package/dist/plugins/server/plugins/server/FtpConnector.js.map +1 -0
- package/dist/plugins/{HooksPlugin.d.ts → server/plugins/server/HooksPlugin.d.ts} +1 -1
- package/dist/plugins/{HooksPlugin.js → server/plugins/server/HooksPlugin.js} +8 -10
- package/dist/plugins/server/plugins/server/HooksPlugin.js.map +1 -0
- package/dist/plugins/server/plugins/server/PublicationOptimizer.d.ts +0 -0
- package/dist/plugins/server/plugins/server/PublicationOptimizer.js +14 -0
- package/dist/plugins/server/plugins/server/PublicationOptimizer.js.map +1 -0
- package/dist/plugins/{SslPlugin.js → server/plugins/server/SslPlugin.js} +8 -8
- package/dist/plugins/server/plugins/server/SslPlugin.js.map +1 -0
- package/dist/plugins/{StaticPlugin.js → server/plugins/server/StaticPlugin.js} +9 -4
- package/dist/plugins/server/plugins/server/StaticPlugin.js.map +1 -0
- package/dist/plugins/server/server/config.d.ts +59 -0
- package/dist/plugins/server/server/config.js +182 -0
- package/dist/plugins/server/server/config.js.map +1 -0
- package/dist/plugins/server/server/connectors/FsHosting.d.ts +13 -0
- package/dist/plugins/server/server/connectors/FsHosting.js +55 -0
- package/dist/plugins/server/server/connectors/FsHosting.js.map +1 -0
- package/dist/plugins/server/server/connectors/FsStorage.d.ts +41 -0
- package/dist/{server/backends/FsBackend.js → plugins/server/server/connectors/FsStorage.js} +103 -125
- package/dist/plugins/server/server/connectors/FsStorage.js.map +1 -0
- package/dist/plugins/server/server/connectors/connectors.d.ts +83 -0
- package/dist/plugins/server/server/connectors/connectors.js +99 -0
- package/dist/plugins/server/server/connectors/connectors.js.map +1 -0
- package/dist/plugins/server/server/events.d.ts +26 -0
- package/dist/plugins/server/server/events.js +15 -0
- package/dist/plugins/server/server/events.js.map +1 -0
- package/dist/plugins/server/server/jobs.d.ts +6 -0
- package/dist/plugins/server/server/jobs.js.map +1 -0
- package/dist/plugins/server/server/utils/validation.d.ts +7 -0
- package/dist/{server → plugins/server/server}/utils/validation.js +3 -2
- package/dist/plugins/server/server/utils/validation.js.map +1 -0
- package/dist/plugins/server/types.d.ts +309 -0
- package/dist/{types.js → plugins/server/types.js} +18 -7
- package/dist/plugins/server/types.js.map +1 -0
- package/dist/server/constants.js +30 -0
- package/dist/server/plugins/server/Cache.js +15 -0
- package/dist/server/server/api/api.js +20 -0
- package/dist/server/server/api/connectorApi.js +200 -0
- package/dist/server/server/api/publicationApi.js +116 -0
- package/dist/server/server/api/websiteApi.js +297 -0
- package/dist/server/{cli.js → server/cli.js} +6 -5
- package/dist/server/server/config.js +121 -0
- package/dist/server/server/connectors/FsHosting.js +37 -0
- package/dist/server/server/connectors/FsStorage.js +218 -0
- package/dist/server/server/connectors/connectors.js +65 -0
- package/dist/server/server/events.js +14 -0
- package/dist/server/{express.js → server/express.js} +4 -3
- package/dist/server/{index.js → server/index.js} +14 -7
- package/dist/server/server/jobs.js +47 -0
- package/dist/server/server/utils/validation.js +15 -0
- package/dist/server/types.js +19 -0
- package/package.json +26 -15
- package/src/css/grapesjs.scss +5 -0
- package/src/ts/client/api.ts +135 -0
- package/src/ts/client/config.ts +3 -3
- package/{dist/events.js → src/ts/client/events.ts} +13 -6
- package/src/ts/client/expose.ts +11 -0
- package/src/ts/client/grapesjs/LoginDialog.ts +33 -32
- package/src/ts/client/grapesjs/PublicationManager.ts +86 -112
- package/src/ts/client/grapesjs/PublicationUi.ts +43 -33
- package/src/ts/client/grapesjs/eleventy.ts +4 -1
- package/src/ts/client/grapesjs/index.ts +6 -19
- package/src/ts/client/grapesjs/openImport.ts +5 -0
- package/src/ts/client/grapesjs/storage.ts +18 -14
- package/src/ts/client/index.ts +21 -15
- package/src/ts/constants.ts +24 -14
- package/src/ts/page.ts +1 -1
- package/src/ts/plugins/client/publicationRenderer.ts +128 -0
- package/src/ts/plugins/client/template.ts +196 -0
- package/src/ts/plugins/server/FtpConnector.ts +602 -0
- package/src/ts/plugins/{HooksPlugin.ts → server/HooksPlugin.ts} +9 -12
- package/src/ts/plugins/server/PublicationOptimizer.ts +14 -0
- package/src/ts/plugins/{SslPlugin.ts → server/SslPlugin.ts} +8 -8
- package/src/ts/plugins/{StaticPlugin.ts → server/StaticPlugin.ts} +8 -4
- package/src/ts/server/api/api.ts +19 -0
- package/src/ts/server/api/connectorApi.ts +322 -0
- package/src/ts/server/api/publicationApi.ts +166 -0
- package/src/ts/server/api/websiteApi.ts +420 -0
- package/src/ts/server/cli.ts +7 -5
- package/src/ts/server/config.ts +107 -95
- package/src/ts/server/connectors/FsHosting.ts +60 -0
- package/src/ts/server/connectors/FsStorage.ts +247 -0
- package/src/ts/server/connectors/connectors.ts +173 -0
- package/src/ts/server/events.ts +20 -0
- package/src/ts/server/express.ts +4 -3
- package/src/ts/server/index.ts +19 -15
- package/src/ts/server/jobs.test.ts +1 -0
- package/src/ts/server/utils/BackwardCompat.ts +1 -1
- package/src/ts/server/utils/validation.ts +3 -2
- package/src/ts/types.ts +93 -61
- package/.silex/default/website.json +0 -1
- package/dist/client/client/grapesjs/eleventy.d.ts +0 -1
- package/dist/client/client/grapesjs/template.d.ts +0 -1
- package/dist/client/client/services.d.ts +0 -35
- package/dist/client/events.d.ts +0 -2
- package/dist/constants.d.ts +0 -21
- package/dist/constants.js +0 -41
- package/dist/constants.js.map +0 -1
- package/dist/events.d.ts +0 -2
- package/dist/events.js.map +0 -1
- package/dist/plugins/AuthPlugin.js.map +0 -1
- package/dist/plugins/Cache.js.map +0 -1
- package/dist/plugins/FtpBackend.d.ts +0 -92
- package/dist/plugins/FtpBackend.js +0 -604
- package/dist/plugins/FtpBackend.js.map +0 -1
- package/dist/plugins/HooksPlugin.js.map +0 -1
- package/dist/plugins/PublicationPlugin.d.ts +0 -17
- package/dist/plugins/PublicationPlugin.js +0 -170
- package/dist/plugins/PublicationPlugin.js.map +0 -1
- package/dist/plugins/SslPlugin.js.map +0 -1
- package/dist/plugins/StaticPlugin.js.map +0 -1
- package/dist/plugins/WebsitePlugin.d.ts +0 -14
- package/dist/plugins/WebsitePlugin.js +0 -302
- package/dist/plugins/WebsitePlugin.js.map +0 -1
- package/dist/server/backends/FsBackend.d.ts +0 -42
- package/dist/server/backends/FsBackend.js.map +0 -1
- package/dist/server/backends/index.d.ts +0 -95
- package/dist/server/backends/index.js +0 -255
- package/dist/server/backends/index.js.map +0 -1
- package/dist/server/config.d.ts +0 -58
- package/dist/server/config.js +0 -174
- package/dist/server/config.js.map +0 -1
- package/dist/server/jobs.js.map +0 -1
- package/dist/server/utils/validation.js.map +0 -1
- package/dist/types.d.ts +0 -270
- package/dist/types.js.map +0 -1
- package/src/ts/client/grapesjs/template.ts +0 -183
- package/src/ts/client/services.ts +0 -129
- package/src/ts/plugins/FtpBackend.ts +0 -689
- package/src/ts/plugins/PublicationPlugin.ts +0 -170
- package/src/ts/plugins/WebsitePlugin.ts +0 -318
- package/src/ts/server/backends/FsBackend.ts +0 -266
- package/src/ts/server/backends/index.ts +0 -309
- /package/dist/{server → plugins/client/server}/jobs.d.ts +0 -0
- /package/dist/{server → plugins/client/server}/utils/validation.d.ts +0 -0
- /package/dist/plugins/{AuthPlugin.d.ts → server/plugins/server/AuthPlugin.d.ts} +0 -0
- /package/dist/plugins/{AuthPlugin.js → server/plugins/server/AuthPlugin.js} +0 -0
- /package/dist/plugins/{Cache.d.ts → server/plugins/server/Cache.d.ts} +0 -0
- /package/dist/plugins/{Cache.js → server/plugins/server/Cache.js} +0 -0
- /package/dist/plugins/{SslPlugin.d.ts → server/plugins/server/SslPlugin.d.ts} +0 -0
- /package/dist/plugins/{StaticPlugin.d.ts → server/plugins/server/StaticPlugin.d.ts} +0 -0
- /package/dist/{server → plugins/server/server}/jobs.js +0 -0
- /package/src/ts/plugins/{AuthPlugin.ts → server/AuthPlugin.ts} +0 -0
- /package/src/ts/plugins/{Cache.ts → server/Cache.ts} +0 -0
package/dist/client/page.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function getPageSlug(pageName
|
|
1
|
+
export declare function getPageSlug(pageName: any): any;
|
|
2
2
|
export declare function getPageLink(pageName?: string): string;
|
package/dist/client/types.d.ts
CHANGED
|
@@ -1,24 +1,11 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
/**
|
|
3
2
|
* @fileoverview define types for Silex client and server
|
|
4
3
|
*/
|
|
5
4
|
export interface PublicationSettings {
|
|
6
|
-
|
|
5
|
+
connector?: ConnectorData;
|
|
6
|
+
options?: ConnectorOptions;
|
|
7
7
|
url?: string;
|
|
8
8
|
autoHomePage?: boolean;
|
|
9
|
-
assets?: {
|
|
10
|
-
path?: string;
|
|
11
|
-
url?: string;
|
|
12
|
-
};
|
|
13
|
-
html?: {
|
|
14
|
-
path?: string;
|
|
15
|
-
ext?: string;
|
|
16
|
-
};
|
|
17
|
-
css?: {
|
|
18
|
-
path?: string;
|
|
19
|
-
url?: string;
|
|
20
|
-
ext?: string;
|
|
21
|
-
};
|
|
22
9
|
}
|
|
23
10
|
export interface WebsiteFile {
|
|
24
11
|
html: string;
|
|
@@ -26,89 +13,129 @@ export interface WebsiteFile {
|
|
|
26
13
|
htmlPath: string;
|
|
27
14
|
cssPath: string;
|
|
28
15
|
}
|
|
29
|
-
export type
|
|
16
|
+
export type ApiError = {
|
|
30
17
|
message: string;
|
|
31
18
|
};
|
|
32
|
-
export type
|
|
33
|
-
export type
|
|
34
|
-
|
|
19
|
+
export type ApiPublicationPublishBody = WebsiteData;
|
|
20
|
+
export type ApiPublicationPublishQuery = {
|
|
21
|
+
websiteId: WebsiteId;
|
|
22
|
+
hostingId: ConnectorId;
|
|
23
|
+
storageId: ConnectorId;
|
|
24
|
+
options: ConnectorOptions;
|
|
35
25
|
};
|
|
36
26
|
export type ApiPublicationPublishResponse = {
|
|
37
27
|
url: string;
|
|
38
28
|
job: PublicationJobData;
|
|
39
29
|
};
|
|
40
|
-
export type
|
|
30
|
+
export type ApiPublicationStatusQuery = {
|
|
41
31
|
jobId: JobId;
|
|
42
32
|
};
|
|
43
33
|
export type ApiPublicationStatusResponse = PublicationJobData;
|
|
44
|
-
export type
|
|
45
|
-
|
|
46
|
-
|
|
34
|
+
export type ApiWebsiteReadQuery = {
|
|
35
|
+
websiteId: WebsiteId;
|
|
36
|
+
connectorId?: ConnectorId;
|
|
47
37
|
};
|
|
48
|
-
export type ApiWebsiteReadResponse =
|
|
49
|
-
export type
|
|
50
|
-
|
|
51
|
-
backendId?: BackendId;
|
|
38
|
+
export type ApiWebsiteReadResponse = WebsiteData;
|
|
39
|
+
export type ApiWebsiteListQuery = {
|
|
40
|
+
connectorId?: ConnectorId;
|
|
52
41
|
};
|
|
53
|
-
export type
|
|
42
|
+
export type ApiWebsiteListResponse = WebsiteMeta[];
|
|
43
|
+
export type ApiWebsiteWriteQuery = {
|
|
44
|
+
websiteId: WebsiteId;
|
|
45
|
+
connectorId?: ConnectorId;
|
|
46
|
+
};
|
|
47
|
+
export type ApiWebsiteWriteBody = WebsiteData;
|
|
54
48
|
export type ApiWebsiteWriteResponse = {
|
|
55
49
|
message: string;
|
|
56
50
|
};
|
|
57
|
-
export type
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
export type ApiWebsiteCreateQuery = {
|
|
52
|
+
connectorId?: ConnectorId;
|
|
53
|
+
};
|
|
54
|
+
export type ApiWebsiteCreateBody = WebsiteMetaFileContent;
|
|
55
|
+
export type ApiWebsiteCreateResponse = {
|
|
56
|
+
message: string;
|
|
57
|
+
};
|
|
58
|
+
export type ApiWebsiteDeleteQuery = {
|
|
59
|
+
websiteId: WebsiteId;
|
|
60
|
+
connectorId?: ConnectorId;
|
|
60
61
|
};
|
|
61
|
-
export type
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
export type ApiWebsiteMetaReadQuery = {
|
|
63
|
+
websiteId: WebsiteId;
|
|
64
|
+
connectorId?: ConnectorId;
|
|
65
|
+
};
|
|
66
|
+
export type ApiWebsiteMetaReadResponse = WebsiteMetaFileContent;
|
|
67
|
+
export type ApiWebsiteMetaWriteQuery = {
|
|
68
|
+
websiteId: WebsiteId;
|
|
69
|
+
connectorId?: ConnectorId;
|
|
70
|
+
};
|
|
71
|
+
export type ApiWebsiteMetaWriteBody = WebsiteMetaFileContent;
|
|
72
|
+
export type ApiWebsiteMetaWriteResponse = {
|
|
73
|
+
message: string;
|
|
74
|
+
};
|
|
75
|
+
export type ApiWebsiteAssetsReadQuery = {
|
|
76
|
+
websiteId: WebsiteId;
|
|
77
|
+
connectorId?: ConnectorId;
|
|
64
78
|
};
|
|
65
|
-
export type
|
|
79
|
+
export type ApiWebsiteAssetsReadParams = {
|
|
66
80
|
path: string;
|
|
67
81
|
};
|
|
68
82
|
export type ApiWebsiteAssetsReadResponse = string;
|
|
69
|
-
export type
|
|
70
|
-
|
|
71
|
-
|
|
83
|
+
export type ApiWebsiteAssetsWriteQuery = {
|
|
84
|
+
websiteId: WebsiteId;
|
|
85
|
+
connectorId?: ConnectorId;
|
|
72
86
|
};
|
|
73
|
-
export type
|
|
87
|
+
export type ApiWebsiteAssetsWriteBody = ClientSideFile[];
|
|
74
88
|
export type ApiWebsiteAssetsWriteResponse = {
|
|
75
89
|
data: string[];
|
|
76
90
|
};
|
|
77
|
-
export type
|
|
78
|
-
type:
|
|
91
|
+
export type ApiConnectorListQuery = {
|
|
92
|
+
type: ConnectorType;
|
|
79
93
|
};
|
|
80
|
-
export type
|
|
81
|
-
export type
|
|
82
|
-
|
|
83
|
-
type:
|
|
84
|
-
options?: string;
|
|
85
|
-
error?: string;
|
|
94
|
+
export type ApiConnectorListResponse = ConnectorData[];
|
|
95
|
+
export type ApiConnectorLoginQuery = {
|
|
96
|
+
connectorId: ConnectorId;
|
|
97
|
+
type: ConnectorType;
|
|
86
98
|
};
|
|
87
|
-
export type
|
|
99
|
+
export type ApiConnectorLoggedInPostMessage = {
|
|
88
100
|
type: string;
|
|
89
101
|
error: boolean;
|
|
90
102
|
message: string;
|
|
91
|
-
|
|
103
|
+
connectorId: ConnectorId;
|
|
104
|
+
options: ConnectorOptions;
|
|
92
105
|
};
|
|
93
|
-
export type
|
|
94
|
-
|
|
95
|
-
type:
|
|
106
|
+
export type ApiConnectorLoginCbkQuery = {
|
|
107
|
+
connectorId?: ConnectorId;
|
|
108
|
+
type: ConnectorType;
|
|
109
|
+
error?: string;
|
|
96
110
|
};
|
|
97
|
-
export type
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
type:
|
|
111
|
+
export type ApiConnectorLoginCbkBody = object;
|
|
112
|
+
export type ApiConnectorSettingsQuery = {
|
|
113
|
+
connectorId?: ConnectorId;
|
|
114
|
+
type: ConnectorType;
|
|
101
115
|
};
|
|
102
|
-
export type
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
116
|
+
export type ApiConnectorSettingsResponse = string;
|
|
117
|
+
export type ApiConnectorSettingsPostQuery = {
|
|
118
|
+
connectorId?: ConnectorId;
|
|
119
|
+
type: ConnectorType;
|
|
120
|
+
};
|
|
121
|
+
export type ApiConnectorSettingsPostBody = ConnectorUserSettings;
|
|
122
|
+
export type ApiConnectorSettingsPostResponse = {
|
|
123
|
+
message: string;
|
|
106
124
|
};
|
|
125
|
+
export type ApiConnectorLogoutQuery = {
|
|
126
|
+
connectorId?: ConnectorId;
|
|
127
|
+
type: ConnectorType;
|
|
128
|
+
};
|
|
129
|
+
export type ApiConnectorUserQuery = {
|
|
130
|
+
connectorId?: ConnectorId;
|
|
131
|
+
type: ConnectorType;
|
|
132
|
+
};
|
|
133
|
+
export type ApiConnectorUserResponse = ConnectorUser;
|
|
134
|
+
export declare const defaultWebsiteData: WebsiteData;
|
|
107
135
|
export interface WebsiteData {
|
|
108
136
|
pages: Page[];
|
|
109
137
|
assets: Asset[];
|
|
110
138
|
styles: Style[];
|
|
111
|
-
name: string;
|
|
112
139
|
settings: WebsiteSettings;
|
|
113
140
|
fonts: Font[];
|
|
114
141
|
symbols: symbol[];
|
|
@@ -118,14 +145,14 @@ export interface PublicationData extends WebsiteData {
|
|
|
118
145
|
files?: WebsiteFile[];
|
|
119
146
|
}
|
|
120
147
|
export interface WebsiteSettings {
|
|
121
|
-
description
|
|
122
|
-
title
|
|
123
|
-
lang
|
|
124
|
-
head
|
|
125
|
-
favicon
|
|
126
|
-
'og:title'
|
|
127
|
-
'og:description'
|
|
128
|
-
'og:image'
|
|
148
|
+
description?: string;
|
|
149
|
+
title?: string;
|
|
150
|
+
lang?: string;
|
|
151
|
+
head?: string;
|
|
152
|
+
favicon?: string;
|
|
153
|
+
'og:title'?: string;
|
|
154
|
+
'og:description'?: string;
|
|
155
|
+
'og:image'?: string;
|
|
129
156
|
}
|
|
130
157
|
export interface Font {
|
|
131
158
|
name: string;
|
|
@@ -140,6 +167,7 @@ export interface Page {
|
|
|
140
167
|
settings?: WebsiteSettings;
|
|
141
168
|
cssExt?: string;
|
|
142
169
|
htmlExt?: string;
|
|
170
|
+
slug?: string;
|
|
143
171
|
}
|
|
144
172
|
export interface Frame {
|
|
145
173
|
component: {
|
|
@@ -166,6 +194,7 @@ export interface Asset {
|
|
|
166
194
|
height: number;
|
|
167
195
|
width: number;
|
|
168
196
|
name: string;
|
|
197
|
+
path?: string;
|
|
169
198
|
}
|
|
170
199
|
export interface Style {
|
|
171
200
|
selectors: Selector[];
|
|
@@ -178,16 +207,17 @@ export type Selector = string | {
|
|
|
178
207
|
type: number;
|
|
179
208
|
};
|
|
180
209
|
/**
|
|
181
|
-
* Type for a
|
|
210
|
+
* Type for a connector id
|
|
182
211
|
*/
|
|
183
|
-
export type
|
|
212
|
+
export type ConnectorId = string;
|
|
213
|
+
export type ConnectorOptions = object;
|
|
184
214
|
/**
|
|
185
215
|
* Type for a client side file
|
|
186
|
-
* @see
|
|
216
|
+
* @see connector/File
|
|
187
217
|
*/
|
|
188
218
|
export interface ClientSideFile {
|
|
189
219
|
path: string;
|
|
190
|
-
content:
|
|
220
|
+
content: string;
|
|
191
221
|
}
|
|
192
222
|
/**
|
|
193
223
|
* Type for file listing
|
|
@@ -201,9 +231,9 @@ export interface FileMeta {
|
|
|
201
231
|
metadata?: object;
|
|
202
232
|
}
|
|
203
233
|
/**
|
|
204
|
-
* Enum to express if the
|
|
234
|
+
* Enum to express if the connector is a storage or a hosting
|
|
205
235
|
*/
|
|
206
|
-
export declare enum
|
|
236
|
+
export declare enum ConnectorType {
|
|
207
237
|
STORAGE = "STORAGE",
|
|
208
238
|
HOSTING = "HOSTING"
|
|
209
239
|
}
|
|
@@ -212,35 +242,45 @@ export declare enum BackendType {
|
|
|
212
242
|
*/
|
|
213
243
|
export type WebsiteId = string;
|
|
214
244
|
/**
|
|
215
|
-
* Back end data
|
|
245
|
+
* Back end data shared with the front end
|
|
216
246
|
*/
|
|
217
|
-
export interface
|
|
218
|
-
|
|
219
|
-
type:
|
|
247
|
+
export interface ConnectorData {
|
|
248
|
+
connectorId: ConnectorId;
|
|
249
|
+
type: ConnectorType;
|
|
220
250
|
displayName: string;
|
|
221
251
|
icon: string;
|
|
222
252
|
disableLogout: boolean;
|
|
223
253
|
isLoggedIn: boolean;
|
|
224
|
-
|
|
254
|
+
oauthUrl: string | null;
|
|
225
255
|
}
|
|
226
256
|
/**
|
|
227
|
-
*
|
|
257
|
+
* User settings for a connector and for a given website
|
|
228
258
|
*/
|
|
229
|
-
export
|
|
259
|
+
export type ConnectorUserSettings = {
|
|
260
|
+
[websiteId: string]: object;
|
|
261
|
+
};
|
|
262
|
+
/**
|
|
263
|
+
* Back end data shared with the front end
|
|
264
|
+
*/
|
|
265
|
+
export interface ConnectorUser {
|
|
230
266
|
name: string;
|
|
231
267
|
email?: string;
|
|
232
268
|
picture?: string;
|
|
233
|
-
|
|
269
|
+
storage: ConnectorData;
|
|
270
|
+
}
|
|
271
|
+
export interface WebsiteMetaFileContent {
|
|
272
|
+
name: string;
|
|
273
|
+
imageUrl?: string;
|
|
274
|
+
connectorUserSettings: ConnectorUserSettings;
|
|
234
275
|
}
|
|
235
276
|
/**
|
|
236
277
|
* Back end data sent to the front end
|
|
237
278
|
* Meta data can be the root path of the websites, or the bucket name, etc.
|
|
238
279
|
*/
|
|
239
|
-
export interface WebsiteMeta {
|
|
280
|
+
export interface WebsiteMeta extends WebsiteMetaFileContent {
|
|
240
281
|
websiteId: WebsiteId;
|
|
241
282
|
createdAt: Date;
|
|
242
283
|
updatedAt: Date;
|
|
243
|
-
metadata?: object;
|
|
244
284
|
}
|
|
245
285
|
/**
|
|
246
286
|
* Enum to express if the job is in progress or finished or errored
|
|
@@ -261,7 +301,6 @@ export interface JobData {
|
|
|
261
301
|
jobId: JobId;
|
|
262
302
|
status: JobStatus;
|
|
263
303
|
message: string;
|
|
264
|
-
url?: string;
|
|
265
304
|
_timeout?: ReturnType<typeof setTimeout>;
|
|
266
305
|
}
|
|
267
306
|
export interface PublicationJobData extends JobData {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare enum ClientEvent {
|
|
2
|
+
STARTUP_START = "silex:startup:start",
|
|
3
|
+
STARTUP_END = "silex:startup:end",
|
|
4
|
+
PUBLISH_START = "silex:publish:start",
|
|
5
|
+
PUBLISH_DATA = "silex:publish:data",
|
|
6
|
+
PUBLISH_END = "silex:publish:end",
|
|
7
|
+
PUBLISH_ERROR = "silex:publish:error",
|
|
8
|
+
PUBLISH_LOGIN_START = "silex:publish:login:start",
|
|
9
|
+
PUBLISH_LOGIN_END = "silex:publish:login:end",
|
|
10
|
+
ASSET_WRITE_END = "silex:asset:write:end",
|
|
11
|
+
WRITE_END = "silex:write:end"
|
|
12
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Silex website builder, free/libre no-code tool for makers.
|
|
3
|
+
* Copyright (c) 2023 lexoyo and Silex Labs foundation
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
* the Free Software Foundation, either version 3 of the License, or any later version.
|
|
8
|
+
*
|
|
9
|
+
* This program is distributed in the hope that it will be useful,
|
|
10
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
* GNU Affero General Public License for more details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
export var ClientEvent;
|
|
18
|
+
(function (ClientEvent) {
|
|
19
|
+
ClientEvent["STARTUP_START"] = "silex:startup:start";
|
|
20
|
+
ClientEvent["STARTUP_END"] = "silex:startup:end";
|
|
21
|
+
ClientEvent["PUBLISH_START"] = "silex:publish:start";
|
|
22
|
+
ClientEvent["PUBLISH_DATA"] = "silex:publish:data";
|
|
23
|
+
ClientEvent["PUBLISH_END"] = "silex:publish:end";
|
|
24
|
+
ClientEvent["PUBLISH_ERROR"] = "silex:publish:error";
|
|
25
|
+
ClientEvent["PUBLISH_LOGIN_START"] = "silex:publish:login:start";
|
|
26
|
+
ClientEvent["PUBLISH_LOGIN_END"] = "silex:publish:login:end";
|
|
27
|
+
ClientEvent["ASSET_WRITE_END"] = "silex:asset:write:end";
|
|
28
|
+
ClientEvent["WRITE_END"] = "silex:write:end";
|
|
29
|
+
})(ClientEvent || (ClientEvent = {}));
|
|
30
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../../src/ts/client/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,CAAN,IAAY,WAWX;AAXD,WAAY,WAAW;IACrB,oDAAqC,CAAA;IACrC,gDAAiC,CAAA;IACjC,oDAAqC,CAAA;IACrC,kDAAmC,CAAA;IACnC,gDAAiC,CAAA;IACjC,oDAAqC,CAAA;IACrC,gEAAiD,CAAA;IACjD,4DAA6C,CAAA;IAC7C,wDAAyC,CAAA;IACzC,4CAA6B,CAAA;AAC/B,CAAC,EAXW,WAAW,KAAX,WAAW,QAWtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function onAll(editor: any, cbk: any): void;
|
|
@@ -14,6 +14,12 @@
|
|
|
14
14
|
* You should have received a copy of the GNU Affero General Public License
|
|
15
15
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
16
16
|
*/
|
|
17
|
-
|
|
18
|
-
export
|
|
19
|
-
|
|
17
|
+
// Browse all elements of all pages
|
|
18
|
+
export function onAll(editor, cbk) {
|
|
19
|
+
editor.Pages.getAll()
|
|
20
|
+
.forEach(page => {
|
|
21
|
+
page.getMainComponent()
|
|
22
|
+
.onAll(c => cbk(c));
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/ts/client/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,mCAAmC;AACnC,MAAM,UAAU,KAAK,CAAC,MAAM,EAAE,GAAG;IAC/B,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE;SAClB,OAAO,CAAC,IAAI,CAAC,EAAE;QACd,IAAI,CAAC,gBAAgB,EAAE;aACpB,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;IACvB,CAAC,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview define constants for Silex client and server
|
|
3
|
+
*/
|
|
4
|
+
export declare const WEBSITE_DATA_FILE = "website.json";
|
|
5
|
+
export declare const WEBSITE_META_DATA_FILE = "meta.json";
|
|
6
|
+
export declare const DEFAULT_WEBSITE_ID = "default";
|
|
7
|
+
export declare const DEFAULT_CONNECTOR_ID = "";
|
|
8
|
+
export declare const DEFAULT_LANGUAGE = "en";
|
|
9
|
+
export declare const CLIENT_CONFIG_FILE_NAME = "silex.js";
|
|
10
|
+
export declare const API_PATH = "/api";
|
|
11
|
+
export declare const API_CONNECTOR_PATH = "/connector";
|
|
12
|
+
export declare const API_CONNECTOR_USER = "/user";
|
|
13
|
+
export declare const API_CONNECTOR_LIST = "/";
|
|
14
|
+
export declare const API_CONNECTOR_LOGOUT = "/logout";
|
|
15
|
+
export declare const API_CONNECTOR_LOGIN = "/login";
|
|
16
|
+
export declare const API_CONNECTOR_SETTINGS = "/settings";
|
|
17
|
+
export declare const API_CONNECTOR_LOGIN_CALLBACK = "/login/callback";
|
|
18
|
+
export declare const API_PUBLICATION_PATH = "/publication";
|
|
19
|
+
export declare const API_PUBLICATION_PUBLISH = "/";
|
|
20
|
+
export declare const API_PUBLICATION_STATUS = "/publication/status";
|
|
21
|
+
export declare const API_WEBSITE_PATH = "/website";
|
|
22
|
+
export declare const API_WEBSITE_READ = "/";
|
|
23
|
+
export declare const API_WEBSITE_WRITE = "/";
|
|
24
|
+
export declare const API_WEBSITE_CREATE = "/";
|
|
25
|
+
export declare const API_WEBSITE_DELETE = "/";
|
|
26
|
+
export declare const API_WEBSITE_LIST = "/";
|
|
27
|
+
export declare const API_WEBSITE_ASSETS_READ = "assets/:path";
|
|
28
|
+
export declare const API_WEBSITE_ASSETS_WRITE = "assets";
|
|
29
|
+
export declare const API_WEBSITE_META_READ = "/meta";
|
|
30
|
+
export declare const API_WEBSITE_META_WRITE = "/meta";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Silex website builder, free/libre no-code tool for makers.
|
|
3
|
+
* Copyright (c) 2023 lexoyo and Silex Labs foundation
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
* the Free Software Foundation, either version 3 of the License, or any later version.
|
|
8
|
+
*
|
|
9
|
+
* This program is distributed in the hope that it will be useful,
|
|
10
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
* GNU Affero General Public License for more details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* @fileoverview define constants for Silex client and server
|
|
19
|
+
*/
|
|
20
|
+
export const WEBSITE_DATA_FILE = 'website.json';
|
|
21
|
+
export const WEBSITE_META_DATA_FILE = 'meta.json';
|
|
22
|
+
export const DEFAULT_WEBSITE_ID = 'default';
|
|
23
|
+
export const DEFAULT_CONNECTOR_ID = '';
|
|
24
|
+
export const DEFAULT_LANGUAGE = 'en';
|
|
25
|
+
export const CLIENT_CONFIG_FILE_NAME = 'silex.js';
|
|
26
|
+
export const API_PATH = '/api';
|
|
27
|
+
export const API_CONNECTOR_PATH = '/connector';
|
|
28
|
+
export const API_CONNECTOR_USER = '/user';
|
|
29
|
+
export const API_CONNECTOR_LIST = '/';
|
|
30
|
+
export const API_CONNECTOR_LOGOUT = '/logout';
|
|
31
|
+
export const API_CONNECTOR_LOGIN = '/login';
|
|
32
|
+
export const API_CONNECTOR_SETTINGS = '/settings';
|
|
33
|
+
export const API_CONNECTOR_LOGIN_CALLBACK = '/login/callback';
|
|
34
|
+
export const API_PUBLICATION_PATH = '/publication';
|
|
35
|
+
export const API_PUBLICATION_PUBLISH = '/';
|
|
36
|
+
export const API_PUBLICATION_STATUS = '/publication/status';
|
|
37
|
+
export const API_WEBSITE_PATH = '/website';
|
|
38
|
+
export const API_WEBSITE_READ = '/';
|
|
39
|
+
export const API_WEBSITE_WRITE = '/';
|
|
40
|
+
export const API_WEBSITE_CREATE = '/';
|
|
41
|
+
export const API_WEBSITE_DELETE = '/';
|
|
42
|
+
export const API_WEBSITE_LIST = '/';
|
|
43
|
+
export const API_WEBSITE_ASSETS_READ = 'assets/:path';
|
|
44
|
+
export const API_WEBSITE_ASSETS_WRITE = 'assets';
|
|
45
|
+
export const API_WEBSITE_META_READ = '/meta';
|
|
46
|
+
export const API_WEBSITE_META_WRITE = '/meta';
|
|
47
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/ts/constants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;GAEG;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAG,cAAc,CAAA;AAC/C,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAA;AAEjD,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAAA;AAC3C,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAA;AACtC,MAAM,CAAC,MAAM,gBAAgB,GAAG,IAAI,CAAA;AACpC,MAAM,CAAC,MAAM,uBAAuB,GAAG,UAAU,CAAA;AAEjD,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAA;AAE9B,MAAM,CAAC,MAAM,kBAAkB,GAAG,YAAY,CAAA;AAC9C,MAAM,CAAC,MAAM,kBAAkB,GAAG,OAAO,CAAA;AACzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA;AACrC,MAAM,CAAC,MAAM,oBAAoB,GAAG,SAAS,CAAA;AAC7C,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CAAA;AAC3C,MAAM,CAAC,MAAM,sBAAsB,GAAG,WAAW,CAAA;AACjD,MAAM,CAAC,MAAM,4BAA4B,GAAG,iBAAiB,CAAA;AAE7D,MAAM,CAAC,MAAM,oBAAoB,GAAG,cAAc,CAAA;AAClD,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAA;AAC1C,MAAM,CAAC,MAAM,sBAAsB,GAAG,qBAAqB,CAAA;AAE3D,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAA;AAC1C,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAA;AACnC,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;AACpC,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA;AACrC,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAA;AACrC,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAA;AACnC,MAAM,CAAC,MAAM,uBAAuB,GAAG,cAAc,CAAA;AACrD,MAAM,CAAC,MAAM,wBAAwB,GAAG,QAAQ,CAAA;AAChD,MAAM,CAAC,MAAM,qBAAqB,GAAG,OAAO,CAAA;AAC5C,MAAM,CAAC,MAAM,sBAAsB,GAAG,OAAO,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Silex website builder, free/libre no-code tool for makers.
|
|
3
|
+
* Copyright (c) 2023 lexoyo and Silex Labs foundation
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
* the Free Software Foundation, either version 3 of the License, or any later version.
|
|
8
|
+
*
|
|
9
|
+
* This program is distributed in the hope that it will be useful,
|
|
10
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
* GNU Affero General Public License for more details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
// Page related functions
|
|
18
|
+
// This is used on the client and the server
|
|
19
|
+
export function getPageSlug(pageName) {
|
|
20
|
+
return pageName
|
|
21
|
+
.toLowerCase()
|
|
22
|
+
.replace(/[^a-z0-9 -]/g, '')
|
|
23
|
+
// Collapse whitespace and replace by -
|
|
24
|
+
.replace(/\s+/g, '-')
|
|
25
|
+
// Collapse dashes
|
|
26
|
+
.replace(/-+/g, '-');
|
|
27
|
+
}
|
|
28
|
+
export function getPageLink(pageName = 'index') {
|
|
29
|
+
return `./${getPageSlug(pageName)}.html`;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=page.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../src/ts/page.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,yBAAyB;AACzB,4CAA4C;AAC5C,MAAM,UAAU,WAAW,CAAC,QAAQ;IAClC,OAAO,QAAQ;SACZ,WAAW,EAAE;SACb,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC;QAC5B,uCAAuC;SACtC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;QACrB,kBAAkB;SACjB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAA;AACxB,CAAC;AACD,MAAM,UAAU,WAAW,CAAC,QAAQ,GAAG,OAAO;IAC5C,OAAO,KAAK,WAAW,CAAC,QAAQ,CAAC,OAAO,CAAA;AAC1C,CAAC"}
|