@silexlabs/silex 3.0.0-alpha.41 → 3.0.0-alpha.42
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/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/events.d.ts +8 -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/utils.d.ts +1 -0
- package/dist/{events.js → plugins/client/client/utils.js} +9 -6
- package/dist/plugins/client/client/utils.js.map +1 -0
- package/dist/plugins/client/events.d.ts +10 -0
- package/dist/plugins/client/events.js +27 -0
- package/dist/plugins/client/events.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/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/events.d.ts +10 -0
- package/dist/plugins/server/events.js +30 -0
- package/dist/plugins/server/events.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} +4 -6
- package/dist/plugins/server/plugins/server/HooksPlugin.js.map +1 -0
- package/dist/plugins/{SslPlugin.js → server/plugins/server/SslPlugin.js} +7 -7
- package/dist/plugins/server/plugins/server/SslPlugin.js.map +1 -0
- package/dist/plugins/{StaticPlugin.js → server/plugins/server/StaticPlugin.js} +8 -3
- package/dist/plugins/server/plugins/server/StaticPlugin.js.map +1 -0
- package/dist/{server → plugins/server/server}/config.d.ts +13 -12
- package/dist/{server → plugins/server/server}/config.js +44 -34
- 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 +40 -0
- package/dist/{server/backends/FsBackend.js → plugins/server/server/connectors/FsStorage.js} +93 -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 +98 -0
- package/dist/plugins/server/server/connectors/connectors.js.map +1 -0
- package/dist/plugins/server/server/jobs.js.map +1 -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/events.js +13 -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 +288 -0
- package/dist/server/{cli.js → server/cli.js} +2 -1
- package/dist/server/server/config.js +124 -0
- package/dist/server/server/connectors/FsHosting.js +37 -0
- package/dist/server/server/connectors/FsStorage.js +208 -0
- package/dist/server/server/connectors/connectors.js +65 -0
- package/dist/server/{express.js → server/express.js} +1 -0
- package/dist/server/{index.js → server/index.js} +6 -3
- 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 +24 -14
- package/src/ts/client/api.ts +135 -0
- package/src/ts/client/config.ts +3 -3
- 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 +15 -10
- package/src/ts/constants.ts +24 -14
- package/src/ts/events.ts +8 -0
- package/src/ts/page.ts +1 -1
- 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} +2 -4
- package/src/ts/plugins/{SslPlugin.ts → server/SslPlugin.ts} +7 -7
- package/src/ts/plugins/{StaticPlugin.ts → server/StaticPlugin.ts} +7 -3
- 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 +179 -0
- package/src/ts/server/api/websiteApi.ts +397 -0
- package/src/ts/server/cli.ts +3 -1
- package/src/ts/server/config.ts +47 -36
- package/src/ts/server/connectors/FsHosting.ts +60 -0
- package/src/ts/server/connectors/FsStorage.ts +236 -0
- package/src/ts/server/connectors/connectors.ts +171 -0
- package/src/ts/server/express.ts +1 -0
- package/src/ts/server/index.ts +5 -5
- 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/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/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.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/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.d.ts +0 -0
- /package/dist/{server → plugins/server/server}/jobs.js +0 -0
- /package/dist/{server → plugins/server/server}/utils/validation.d.ts +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 @@
|
|
|
1
|
+
export declare function onAll(editor: any, cbk: any): void;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Silex website builder, free/libre no-code tool for makers.
|
|
4
3
|
* Copyright (c) 2023 lexoyo and Silex Labs foundation
|
|
@@ -15,8 +14,12 @@
|
|
|
15
14
|
* You should have received a copy of the GNU Affero General Public License
|
|
16
15
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
16
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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,10 @@
|
|
|
1
|
+
export declare const EVENT_STARTUP_START = "silex:startup:start";
|
|
2
|
+
export declare const EVENT_STARTUP_END = "silex:startup:end";
|
|
3
|
+
export declare const EVENT_PUBLISH_START = "silex:publish:start";
|
|
4
|
+
export declare const EVENT_PUBLISH_DATA = "silex:publish:data";
|
|
5
|
+
export declare const EVENT_PUBLISH_END = "silex:publish:end";
|
|
6
|
+
export declare const EVENT_PUBLISH_ERROR = "silex:publish:error";
|
|
7
|
+
export declare const EVENT_PUBLISH_LOGIN_START = "silex:publish:login:start";
|
|
8
|
+
export declare const EVENT_PUBLISH_LOGIN_END = "silex:publish:login:end";
|
|
9
|
+
export declare const EVENT_ASSET_WRITE_END = "silex:asset:write:end";
|
|
10
|
+
export declare const EVENT_WRITE_END = "silex:write:end";
|
|
@@ -0,0 +1,27 @@
|
|
|
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 const EVENT_STARTUP_START = 'silex:startup:start';
|
|
18
|
+
export const EVENT_STARTUP_END = 'silex:startup:end';
|
|
19
|
+
export const EVENT_PUBLISH_START = 'silex:publish:start';
|
|
20
|
+
export const EVENT_PUBLISH_DATA = 'silex:publish:data';
|
|
21
|
+
export const EVENT_PUBLISH_END = 'silex:publish:end';
|
|
22
|
+
export const EVENT_PUBLISH_ERROR = 'silex:publish:error';
|
|
23
|
+
export const EVENT_PUBLISH_LOGIN_START = 'silex:publish:login:start';
|
|
24
|
+
export const EVENT_PUBLISH_LOGIN_END = 'silex:publish:login:end';
|
|
25
|
+
export const EVENT_ASSET_WRITE_END = 'silex:asset:write:end';
|
|
26
|
+
export const EVENT_WRITE_END = 'silex:write:end';
|
|
27
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/ts/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAA;AACxD,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAA;AACpD,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAA;AACxD,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAA;AACtD,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAA;AACpD,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAA;AACxD,MAAM,CAAC,MAAM,yBAAyB,GAAG,2BAA2B,CAAA;AACpE,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,CAAA;AAChE,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAA;AAC5D,MAAM,CAAC,MAAM,eAAe,GAAG,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,186 @@
|
|
|
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
|
+
//import {html, render} from 'lit-html'
|
|
18
|
+
//import {styleMap} from 'lit-html/directives/style-map.js'
|
|
19
|
+
//import { onAll } from '@silexlabs/silex/dist/client/utils.js'
|
|
20
|
+
import { onAll } from '../../client/utils.js';
|
|
21
|
+
import { EVENT_PUBLISH_END, EVENT_PUBLISH_START, EVENT_STARTUP_END } from '../../events.js';
|
|
22
|
+
//// @ts-ignore
|
|
23
|
+
//import {html, render} from '/node_modules/lit-html/lit-html.js'
|
|
24
|
+
//// @ts-ignore
|
|
25
|
+
//import {styleMap} from '/node_modules/lit-html/directives/style-map.js'
|
|
26
|
+
const silex = window['silex'];
|
|
27
|
+
const pluginName = 'template';
|
|
28
|
+
const templateType = 'templateType';
|
|
29
|
+
const templateKey = 'template';
|
|
30
|
+
export default async (config, opts = {}) => {
|
|
31
|
+
// @ts-ignore
|
|
32
|
+
const { html, render } = await import('/node_modules/lit-html/lit-html.js');
|
|
33
|
+
// @ts-ignore
|
|
34
|
+
const { styleMap } = await import('/node_modules/lit-html/directives/style-map.js');
|
|
35
|
+
config.on(EVENT_STARTUP_END, () => {
|
|
36
|
+
const editor = silex.getEditor();
|
|
37
|
+
// Add the new trait to all component types
|
|
38
|
+
editor.DomComponents.getTypes().map(type => {
|
|
39
|
+
const originalType = editor.DomComponents.getType(type.id);
|
|
40
|
+
editor.DomComponents.addType(type.id, {
|
|
41
|
+
model: {
|
|
42
|
+
defaults: {
|
|
43
|
+
traits: [
|
|
44
|
+
// Keep the type original traits
|
|
45
|
+
...originalType.model.prototype.defaults.traits,
|
|
46
|
+
// Add the new trait
|
|
47
|
+
{
|
|
48
|
+
label: false,
|
|
49
|
+
type: templateType,
|
|
50
|
+
name: pluginName,
|
|
51
|
+
},
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
function doRender(el) {
|
|
58
|
+
const template = editor.getSelected()?.get(templateKey) || {};
|
|
59
|
+
const taStyle = opts.styles?.textarea ?? styleMap({
|
|
60
|
+
backgroundColor: 'var(--darkerPrimaryColor)',
|
|
61
|
+
});
|
|
62
|
+
const sepStyle = opts.styles?.sep ?? styleMap({ height: '10px' });
|
|
63
|
+
const labels = {
|
|
64
|
+
before: html `<strong>Before</strong> the element`,
|
|
65
|
+
replace: html `<strong>Replace</strong> the element's children`,
|
|
66
|
+
after: html `<strong>After</strong> the element`,
|
|
67
|
+
attributes: html `HTML attributes`,
|
|
68
|
+
classname: html `CSS classes`,
|
|
69
|
+
style: html `CSS styles`,
|
|
70
|
+
};
|
|
71
|
+
render(html `
|
|
72
|
+
<div>
|
|
73
|
+
<h3>Template</h3>
|
|
74
|
+
<p>This will be inserted in the published version</p>
|
|
75
|
+
</div>
|
|
76
|
+
${['classname', 'attributes', 'style'].map(id => html `
|
|
77
|
+
<label>
|
|
78
|
+
${labels[id]}
|
|
79
|
+
<input
|
|
80
|
+
id="template-${id}"
|
|
81
|
+
.value=${template[id] || ''}
|
|
82
|
+
style=${taStyle}
|
|
83
|
+
/>
|
|
84
|
+
</label>
|
|
85
|
+
`)}
|
|
86
|
+
${['before', 'replace', 'after'].map(id => html `
|
|
87
|
+
<label
|
|
88
|
+
for="template-${id}"
|
|
89
|
+
>${labels[id]}</label>
|
|
90
|
+
<textarea
|
|
91
|
+
id="template-${id}"
|
|
92
|
+
style=${taStyle}
|
|
93
|
+
.value=${template[id] || ''}
|
|
94
|
+
></textarea>
|
|
95
|
+
`)}
|
|
96
|
+
`, el);
|
|
97
|
+
}
|
|
98
|
+
editor.TraitManager.addType(templateType, {
|
|
99
|
+
createInput({ trait }) {
|
|
100
|
+
// Create a new element container and add some content
|
|
101
|
+
const el = document.createElement('div');
|
|
102
|
+
el.classList.add('gjs-one-bg');
|
|
103
|
+
// update the UI when a page is added/renamed/removed
|
|
104
|
+
editor.on('page', () => doRender(el));
|
|
105
|
+
doRender(el);
|
|
106
|
+
// this will be the element passed to onEvent and onUpdate
|
|
107
|
+
return el;
|
|
108
|
+
},
|
|
109
|
+
// Update the component based on UI changes
|
|
110
|
+
// `elInput` is the result HTMLElement you get from `createInput`
|
|
111
|
+
onEvent({ elInput, component, event }) {
|
|
112
|
+
const template = {
|
|
113
|
+
before: elInput.querySelector('#template-before').value,
|
|
114
|
+
replace: elInput.querySelector('#template-replace').value,
|
|
115
|
+
after: elInput.querySelector('#template-after').value,
|
|
116
|
+
attributes: elInput.querySelector('#template-attributes').value,
|
|
117
|
+
classname: elInput.querySelector('#template-classname').value,
|
|
118
|
+
style: elInput.querySelector('#template-style').value,
|
|
119
|
+
};
|
|
120
|
+
// Store the new template
|
|
121
|
+
if (Object.values(template).filter(val => !!val && !!cleanup(val)).length > 0) {
|
|
122
|
+
component.set(templateKey, template);
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
component.set(templateKey);
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
// Update UI on the component change
|
|
129
|
+
onUpdate({ elInput, component }) {
|
|
130
|
+
doRender(elInput);
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
// Make html attribute
|
|
134
|
+
// Quote strings, no values for boolean
|
|
135
|
+
function makeAttribute(key, value) {
|
|
136
|
+
switch (typeof value) {
|
|
137
|
+
case 'boolean': return value ? key : '';
|
|
138
|
+
default: return `${key}="${value}"`;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
// Remove empty lines in templates
|
|
142
|
+
function cleanup(template) {
|
|
143
|
+
return template
|
|
144
|
+
// split in lines
|
|
145
|
+
.split('\n')
|
|
146
|
+
// remove lines with only spaces
|
|
147
|
+
.map(line => line.trim())
|
|
148
|
+
.filter(line => !!line)
|
|
149
|
+
// put back together
|
|
150
|
+
.join('\n');
|
|
151
|
+
}
|
|
152
|
+
editor.on(EVENT_PUBLISH_START, () => {
|
|
153
|
+
// Insert templates
|
|
154
|
+
onAll(editor, c => {
|
|
155
|
+
const template = c.get(templateKey);
|
|
156
|
+
const toHTML = c.toHTML;
|
|
157
|
+
const classes = c.getClasses();
|
|
158
|
+
const before = cleanup(template?.before || '');
|
|
159
|
+
const replace = cleanup(template?.replace || '');
|
|
160
|
+
const after = cleanup(template?.after || '');
|
|
161
|
+
const classname = cleanup(template?.classname || '');
|
|
162
|
+
const style = cleanup(template?.style || '');
|
|
163
|
+
const attributes = cleanup(template?.attributes || '');
|
|
164
|
+
// Store the initial method
|
|
165
|
+
if (!c.has('tmpHtml'))
|
|
166
|
+
c.set('tmpHtml', toHTML);
|
|
167
|
+
// Override the method
|
|
168
|
+
c.toHTML = () => {
|
|
169
|
+
return `${before}${c.get('tagName') ? `<${c.get('tagName')}
|
|
170
|
+
${Object.entries(c.get('attributes')).map(([key, value]) => makeAttribute(key, value)).join(' ')}
|
|
171
|
+
${classes.length || classname ? `class="${classes.join(' ')} ${classname}"` : ''}
|
|
172
|
+
${attributes}
|
|
173
|
+
${style ? `style="${style}"` : ''}
|
|
174
|
+
>` : ''}${replace || c.getInnerHTML()}${c.get('tagName') ? `</${c.get('tagName')}>` : ''}${after}`;
|
|
175
|
+
};
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
editor.on(EVENT_PUBLISH_END, () => {
|
|
179
|
+
onAll(editor, c => {
|
|
180
|
+
// Restore the original method
|
|
181
|
+
c.toHTML = c.get('tmpHtml');
|
|
182
|
+
});
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
//# sourceMappingURL=template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../../src/ts/plugins/client/template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,uCAAuC;AACvC,2DAA2D;AAC3D,+DAA+D;AAC/D,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,iBAAiB,EAAuB,MAAM,iBAAiB,CAAA;AAEhH,eAAe;AACf,iEAAiE;AACjE,eAAe;AACf,yEAAyE;AAEzE,MAAM,KA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AM,CAAC,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;YAChC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE;gBAChB,8BAA8B;gBAC9B,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;YAC7B,CAAC,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -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";
|