@silexlabs/silex 3.0.0-alpha.39 → 3.0.0-alpha.41

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.
Files changed (110) hide show
  1. package/.silex.js +38 -8
  2. package/dist/client/client/config.d.ts +11 -41
  3. package/dist/client/client/grapesjs/LoginDialog.d.ts +13 -0
  4. package/dist/client/client/grapesjs/PublicationManager.d.ts +69 -0
  5. package/dist/client/client/grapesjs/PublicationUi.d.ts +58 -0
  6. package/dist/client/client/grapesjs/index.d.ts +18 -44
  7. package/dist/client/client/grapesjs/storage.d.ts +1 -0
  8. package/dist/client/client/services.d.ts +35 -0
  9. package/dist/client/constants.d.ts +17 -0
  10. package/dist/client/css/admin.css +86 -3
  11. package/dist/client/js/main.js +201 -90
  12. package/dist/client/js/main.js.LICENSE.txt +6 -0
  13. package/dist/client/types.d.ts +200 -29
  14. package/dist/constants.d.ts +21 -0
  15. package/dist/constants.js +38 -1
  16. package/dist/constants.js.map +1 -0
  17. package/dist/events.d.ts +2 -0
  18. package/dist/events.js +17 -0
  19. package/dist/events.js.map +1 -0
  20. package/dist/plugins/AuthPlugin.d.ts +1 -0
  21. package/dist/plugins/AuthPlugin.js +38 -0
  22. package/dist/plugins/AuthPlugin.js.map +1 -0
  23. package/dist/plugins/Cache.d.ts +2 -0
  24. package/dist/plugins/Cache.js +32 -0
  25. package/dist/plugins/Cache.js.map +1 -0
  26. package/dist/plugins/FtpBackend.d.ts +92 -0
  27. package/dist/plugins/FtpBackend.js +604 -0
  28. package/dist/plugins/FtpBackend.js.map +1 -0
  29. package/dist/plugins/HooksPlugin.d.ts +7 -0
  30. package/dist/plugins/HooksPlugin.js +76 -0
  31. package/dist/plugins/HooksPlugin.js.map +1 -0
  32. package/dist/plugins/PublicationPlugin.d.ts +17 -0
  33. package/dist/plugins/PublicationPlugin.js +170 -0
  34. package/dist/plugins/PublicationPlugin.js.map +1 -0
  35. package/dist/plugins/SslPlugin.d.ts +1 -0
  36. package/dist/plugins/SslPlugin.js +86 -0
  37. package/dist/plugins/SslPlugin.js.map +1 -0
  38. package/dist/plugins/StaticPlugin.d.ts +1 -0
  39. package/dist/plugins/StaticPlugin.js +66 -0
  40. package/dist/plugins/StaticPlugin.js.map +1 -0
  41. package/dist/plugins/WebsitePlugin.d.ts +14 -0
  42. package/dist/plugins/WebsitePlugin.js +302 -0
  43. package/dist/plugins/WebsitePlugin.js.map +1 -0
  44. package/dist/server/backends/FsBackend.d.ts +42 -0
  45. package/dist/server/backends/FsBackend.js +269 -0
  46. package/dist/server/backends/FsBackend.js.map +1 -0
  47. package/dist/server/backends/index.d.ts +95 -0
  48. package/dist/server/backends/index.js +255 -0
  49. package/dist/server/backends/index.js.map +1 -0
  50. package/dist/server/cli.js +0 -1
  51. package/dist/server/config.d.ts +58 -0
  52. package/dist/server/config.js +128 -24
  53. package/dist/server/config.js.map +1 -0
  54. package/dist/server/express.js +31 -3
  55. package/dist/server/index.js +9 -20
  56. package/dist/server/jobs.d.ts +6 -0
  57. package/dist/server/jobs.js +75 -0
  58. package/dist/server/jobs.js.map +1 -0
  59. package/dist/server/utils/validation.d.ts +7 -0
  60. package/dist/server/utils/validation.js +37 -0
  61. package/dist/server/utils/validation.js.map +1 -0
  62. package/dist/types.d.ts +270 -0
  63. package/dist/types.js +35 -28
  64. package/dist/types.js.map +1 -0
  65. package/package.json +19 -8
  66. package/public/silex.js +17 -0
  67. package/src/css/dialog.scss +9 -2
  68. package/src/css/grapesjs.scss +79 -0
  69. package/src/css/project-bar.scss +2 -2
  70. package/src/example-client-config.js +17 -0
  71. package/src/html/templates/includes.pug +0 -1
  72. package/src/ts/client/config.ts +7 -6
  73. package/src/ts/client/grapesjs/LoginDialog.ts +190 -0
  74. package/src/ts/client/grapesjs/PublicationManager.ts +333 -0
  75. package/src/ts/client/grapesjs/PublicationUi.ts +320 -0
  76. package/src/ts/client/grapesjs/index.ts +88 -85
  77. package/src/ts/client/grapesjs/storage.ts +110 -0
  78. package/src/ts/client/index.ts +5 -7
  79. package/src/ts/client/services.ts +129 -0
  80. package/src/ts/constants.ts +21 -0
  81. package/src/ts/plugins/AuthPlugin.ts +38 -0
  82. package/src/ts/plugins/Cache.ts +28 -0
  83. package/src/ts/plugins/FtpBackend.ts +689 -0
  84. package/src/ts/plugins/HooksPlugin.ts +79 -0
  85. package/src/ts/plugins/PublicationPlugin.ts +170 -0
  86. package/src/{plugins/SslPlugin.js → ts/plugins/SslPlugin.ts} +24 -6
  87. package/src/ts/plugins/StaticPlugin.ts +68 -0
  88. package/src/ts/plugins/WebsitePlugin.ts +318 -0
  89. package/src/ts/server/backends/FsBackend.ts +266 -0
  90. package/src/ts/server/backends/index.ts +309 -0
  91. package/src/ts/server/cli.ts +0 -2
  92. package/src/ts/server/config.ts +103 -33
  93. package/src/ts/server/express.ts +37 -3
  94. package/src/ts/server/index.ts +24 -14
  95. package/src/ts/server/jobs.test.ts +74 -0
  96. package/src/ts/server/jobs.ts +77 -0
  97. package/src/ts/server/utils/validation.ts +33 -0
  98. package/src/ts/types.ts +167 -59
  99. package/dist/client/client/grapesjs/publish.d.ts +0 -18
  100. package/dist/page.js +0 -15
  101. package/src/plugins/AuthPlugin.js +0 -21
  102. package/src/plugins/Cache.js +0 -11
  103. package/src/plugins/DefaultBackend.js +0 -149
  104. package/src/plugins/ExpressPlugin.js +0 -39
  105. package/src/plugins/HooksPlugin.js +0 -58
  106. package/src/plugins/PublishPlugin.js +0 -69
  107. package/src/plugins/StaticPlugin.js +0 -48
  108. package/src/plugins/WebsitePlugin.js +0 -207
  109. package/src/ts/client/grapesjs/publish.ts +0 -403
  110. /package/.silex/default/{.silex.data.json → website.json} +0 -0
package/.silex.js CHANGED
@@ -1,11 +1,41 @@
1
- module.exports = function (silexConfig, options) {
2
- silexConfig.addPlugin([
3
- __dirname + '/src/plugins/ExpressPlugin.js',
4
- __dirname + '/src/plugins/SslPlugin.js',
5
- __dirname + '/src/plugins/StaticPlugin.js',
6
- __dirname + '/src/plugins/WebsitePlugin.js',
7
- __dirname + '/src/plugins/PublishPlugin.js',
8
- ])
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
+ const SslPlugin = require('./dist/plugins/SslPlugin').default
19
+ const StaticPlugin = require('./dist/plugins/StaticPlugin').default
20
+ const WebsitePlugin = require('./dist/plugins/WebsitePlugin').default
21
+ const PublicationPlugin = require('./dist/plugins/PublicationPlugin').default
22
+
23
+ module.exports = async function(config, options) {
24
+ try {
25
+ if(!SslPlugin) throw new Error('SslPlugin not found')
26
+ if(!StaticPlugin) throw new Error('StaticPlugin not found')
27
+ if(!WebsitePlugin) throw new Error('WebsitePlugin not found')
28
+ if(!PublicationPlugin) throw new Error('PublicationPlugin not found')
29
+
30
+ await config.addPlugin([
31
+ SslPlugin,
32
+ StaticPlugin,
33
+ WebsitePlugin,
34
+ PublicationPlugin,
35
+ ])
36
+ } catch(e) {
37
+ console.error(e)
38
+ }
9
39
 
10
40
  // Return an object to be merged with Silex config
11
41
  return {}
@@ -29,23 +29,22 @@ export declare class SilexConfig extends Config {
29
29
  autoload: boolean;
30
30
  type: string;
31
31
  options: {
32
- remote: {
33
- urlStore: string;
34
- urlLoad: string;
32
+ backend: {
33
+ id: string;
34
+ backendId: string;
35
35
  };
36
36
  };
37
37
  };
38
+ cssIcons: string;
38
39
  plugins: any[];
39
40
  pluginsOpts: {
40
- [x: number]: {
41
+ [x: number]: import("./grapesjs/PublicationManager").PublicationManagerOptions | import("./grapesjs/LoginDialog").LoginDialogOptions | {
41
42
  blocks: string[];
42
43
  category: string;
43
44
  panels?: undefined;
44
- appendTo?: undefined;
45
- rootUrl?: undefined;
46
- id?: undefined;
47
45
  cmdOpenNewPageDialog?: undefined;
48
46
  cmdOpenSettings?: undefined;
47
+ appendTo?: undefined;
49
48
  enableCount?: undefined;
50
49
  enablePerformance?: undefined;
51
50
  onError?: undefined;
@@ -125,26 +124,9 @@ export declare class SilexConfig extends Config {
125
124
  })[];
126
125
  blocks?: undefined;
127
126
  category?: undefined;
128
- appendTo?: undefined;
129
- rootUrl?: undefined;
130
- id?: undefined;
131
- cmdOpenNewPageDialog?: undefined;
132
- cmdOpenSettings?: undefined;
133
- enableCount?: undefined;
134
- enablePerformance?: undefined;
135
- onError?: undefined;
136
- blockLabel?: undefined;
137
- blockCustomCode?: undefined;
138
- api_key?: undefined;
139
- } | {
140
- appendTo: string;
141
- rootUrl: string;
142
- id: string;
143
- blocks?: undefined;
144
- category?: undefined;
145
- panels?: undefined;
146
127
  cmdOpenNewPageDialog?: undefined;
147
128
  cmdOpenSettings?: undefined;
129
+ appendTo?: undefined;
148
130
  enableCount?: undefined;
149
131
  enablePerformance?: undefined;
150
132
  onError?: undefined;
@@ -158,8 +140,6 @@ export declare class SilexConfig extends Config {
158
140
  blocks?: undefined;
159
141
  category?: undefined;
160
142
  panels?: undefined;
161
- rootUrl?: undefined;
162
- id?: undefined;
163
143
  enableCount?: undefined;
164
144
  enablePerformance?: undefined;
165
145
  onError?: undefined;
@@ -172,11 +152,9 @@ export declare class SilexConfig extends Config {
172
152
  blocks?: undefined;
173
153
  category?: undefined;
174
154
  panels?: undefined;
175
- appendTo?: undefined;
176
- rootUrl?: undefined;
177
- id?: undefined;
178
155
  cmdOpenNewPageDialog?: undefined;
179
156
  cmdOpenSettings?: undefined;
157
+ appendTo?: undefined;
180
158
  onError?: undefined;
181
159
  blockLabel?: undefined;
182
160
  blockCustomCode?: undefined;
@@ -186,11 +164,9 @@ export declare class SilexConfig extends Config {
186
164
  blocks?: undefined;
187
165
  category?: undefined;
188
166
  panels?: undefined;
189
- appendTo?: undefined;
190
- rootUrl?: undefined;
191
- id?: undefined;
192
167
  cmdOpenNewPageDialog?: undefined;
193
168
  cmdOpenSettings?: undefined;
169
+ appendTo?: undefined;
194
170
  enableCount?: undefined;
195
171
  enablePerformance?: undefined;
196
172
  blockLabel?: undefined;
@@ -204,11 +180,9 @@ export declare class SilexConfig extends Config {
204
180
  blocks?: undefined;
205
181
  category?: undefined;
206
182
  panels?: undefined;
207
- appendTo?: undefined;
208
- rootUrl?: undefined;
209
- id?: undefined;
210
183
  cmdOpenNewPageDialog?: undefined;
211
184
  cmdOpenSettings?: undefined;
185
+ appendTo?: undefined;
212
186
  enableCount?: undefined;
213
187
  enablePerformance?: undefined;
214
188
  onError?: undefined;
@@ -218,8 +192,6 @@ export declare class SilexConfig extends Config {
218
192
  blocks?: undefined;
219
193
  category?: undefined;
220
194
  panels?: undefined;
221
- rootUrl?: undefined;
222
- id?: undefined;
223
195
  cmdOpenNewPageDialog?: undefined;
224
196
  cmdOpenSettings?: undefined;
225
197
  enableCount?: undefined;
@@ -233,11 +205,9 @@ export declare class SilexConfig extends Config {
233
205
  blocks?: undefined;
234
206
  category?: undefined;
235
207
  panels?: undefined;
236
- appendTo?: undefined;
237
- rootUrl?: undefined;
238
- id?: undefined;
239
208
  cmdOpenNewPageDialog?: undefined;
240
209
  cmdOpenSettings?: undefined;
210
+ appendTo?: undefined;
241
211
  enableCount?: undefined;
242
212
  enablePerformance?: undefined;
243
213
  onError?: undefined;
@@ -0,0 +1,13 @@
1
+ import { Editor } from 'grapesjs';
2
+ import { LoginStatus } from '../services';
3
+ import { WebsiteId } from '../../types';
4
+ export declare const cmdLogin = "silex:auth:login";
5
+ export declare const eventLoggingIn = "silex:auth:logging-in";
6
+ export declare const eventLoggedIn = "silex:auth:logged-in";
7
+ export declare const eventLoginFailed = "silex:auth:login-failed";
8
+ export declare const eventLoggedOut = "silex:auth:logged-out";
9
+ export interface LoginDialogOptions {
10
+ id: WebsiteId;
11
+ }
12
+ export declare function getCurrentLoginStatus(editor: Editor): Promise<LoginStatus>;
13
+ export default function loginDialogPlugin(editor: any, opts: any): void;
@@ -0,0 +1,69 @@
1
+ import { BackendData, PublicationJobData, PublicationSettings, WebsiteId, WebsiteSettings } from '../../types';
2
+ import { Editor } from 'grapesjs';
3
+ import { PublicationUi } from './PublicationUi';
4
+ /**
5
+ * @fileoverview Publication manager for Silex
6
+ * This plugin adds a publication feature to Silex
7
+ * It lets the user publish the website to a hosting service
8
+ * It can optionally display a button and a dialog
9
+ * Useful commands:
10
+ * - publish: starts the publication process and optionally open the dialog
11
+ * - publish-login: open the login dialog
12
+ * - publish-logout: logout from the hosting service and let the user choose a hosting service again
13
+ */
14
+ export declare const cmdPublicationStart = "publish";
15
+ export declare const cmdPublicationLogin = "publish-login";
16
+ export declare const cmdPublicationLogout = "publish-logout";
17
+ export type PublishableEditor = Editor & {
18
+ PublicationManager: PublicationManager;
19
+ };
20
+ export declare enum PublicationStatus {
21
+ STATUS_NONE = "STATUS_NONE",
22
+ STATUS_PENDING = "STATUS_PENDING",
23
+ STATUS_ERROR = "STATUS_ERROR",
24
+ STATUS_SUCCESS = "STATUS_SUCCESS",
25
+ STATUS_LOGGED_OUT = "STATUS_AUTH_ERROR"
26
+ }
27
+ export type PublicationManagerOptions = {
28
+ appendTo?: string;
29
+ websiteId: WebsiteId;
30
+ };
31
+ export default function publishPlugin(editor: any, opts: any): void;
32
+ export declare class PublicationManager {
33
+ private editor;
34
+ /**
35
+ * Publication dialog
36
+ * This class is responsible for the UI
37
+ */
38
+ dialog?: PublicationUi;
39
+ /**
40
+ * Publication settings
41
+ * This is the data which is stored in the website settings
42
+ */
43
+ settings: PublicationSettings;
44
+ /**
45
+ * Plugin options
46
+ * This is the data which is passed to the plugin by grapesjs
47
+ */
48
+ options: PublicationManagerOptions;
49
+ /**
50
+ * Publication job during the publication process
51
+ */
52
+ job: PublicationJobData | null;
53
+ /**
54
+ * Publication state
55
+ * This is the state of the publication process
56
+ */
57
+ status: PublicationStatus;
58
+ constructor(editor: PublishableEditor, opts: PublicationManagerOptions);
59
+ goLogin(provider: BackendData): Promise<unknown>;
60
+ goLogout(): Promise<void>;
61
+ startPublication(): Promise<void>;
62
+ getFiles(siteSettings: WebsiteSettings): Promise<{
63
+ html: string;
64
+ css: string;
65
+ cssPath: string;
66
+ htmlPath: string;
67
+ }[]>;
68
+ trackProgress(): Promise<void>;
69
+ }
@@ -0,0 +1,58 @@
1
+ import { TemplateResult } from 'lit-html';
2
+ import { PublicationStatus, PublishableEditor } from './PublicationManager';
3
+ import { PublicationJobData, PublicationSettings } from '../../types';
4
+ /**
5
+ * @fileoverview define the publication dialog
6
+ * This is the UI of the publication feature
7
+ * It is a dialog which allows the user to login to a backend and publish the website
8
+ * It also displays the publication status and logs during the publication process
9
+ * This class is used by the PublicationManager
10
+ * This is optional, you can use the PublicationManager without this UI
11
+ */
12
+ export declare const cmdPublish = "publish-open-dialog";
13
+ export type PublicationDialogOptions = {
14
+ appendTo: string;
15
+ };
16
+ /**
17
+ * Class to manage the publication dialog
18
+ */
19
+ export declare class PublicationUi {
20
+ private editor;
21
+ private options;
22
+ /**
23
+ * Dialog state
24
+ */
25
+ private isOpen;
26
+ /**
27
+ * Dialog content
28
+ */
29
+ private errorMessage;
30
+ /**
31
+ * Dialog element
32
+ * This is the DOM element of the dialog
33
+ */
34
+ private el;
35
+ /**
36
+ * Initialize the dialog and the publish button
37
+ */
38
+ constructor(editor: PublishableEditor, options: PublicationDialogOptions);
39
+ isSuccess(status: PublicationStatus): boolean;
40
+ isPending(status: PublicationStatus): boolean;
41
+ isError(status: PublicationStatus): boolean;
42
+ isLoggedOut(status: PublicationStatus): boolean;
43
+ getDialogElements(): {
44
+ el: HTMLElement;
45
+ primary: HTMLElement;
46
+ secondary: HTMLElement;
47
+ };
48
+ createDialogElements(): HTMLElement;
49
+ move(rect: any): void;
50
+ private renderDialog;
51
+ renderOpenDialog(job: PublicationJobData, status: PublicationStatus, settings: PublicationSettings): Promise<TemplateResult>;
52
+ renderLoginDialog(status: PublicationStatus, settings: PublicationSettings): Promise<TemplateResult>;
53
+ displayPending(job: PublicationJobData, status: PublicationStatus, settings: PublicationSettings): void;
54
+ displayError(message: string, job: PublicationJobData, status: PublicationStatus, settings: PublicationSettings): void;
55
+ closeDialog(): Promise<void>;
56
+ toggleDialog(): Promise<void>;
57
+ openDialog(): Promise<void>;
58
+ }
@@ -1,4 +1,8 @@
1
- export declare function getEditorConfig(id: string, rootUrl: string): {
1
+ import { Editor } from 'grapesjs';
2
+ import { LoginDialogOptions } from './LoginDialog';
3
+ import { PublicationManagerOptions } from './PublicationManager';
4
+ import { BackendId, WebsiteId } from '../../types';
5
+ export declare function getEditorConfig(id: WebsiteId, backendId: BackendId, rootUrl: string): {
2
6
  container: string;
3
7
  height: string;
4
8
  showOffsets: boolean;
@@ -16,23 +20,22 @@ export declare function getEditorConfig(id: string, rootUrl: string): {
16
20
  autoload: boolean;
17
21
  type: string;
18
22
  options: {
19
- remote: {
20
- urlStore: string;
21
- urlLoad: string;
23
+ backend: {
24
+ id: string;
25
+ backendId: string;
22
26
  };
23
27
  };
24
28
  };
29
+ cssIcons: string;
25
30
  plugins: any[];
26
31
  pluginsOpts: {
27
- [x: number]: {
32
+ [x: number]: PublicationManagerOptions | LoginDialogOptions | {
28
33
  blocks: string[];
29
34
  category: string;
30
35
  panels?: undefined;
31
- appendTo?: undefined;
32
- rootUrl?: undefined;
33
- id?: undefined;
34
36
  cmdOpenNewPageDialog?: undefined;
35
37
  cmdOpenSettings?: undefined;
38
+ appendTo?: undefined;
36
39
  enableCount?: undefined;
37
40
  enablePerformance?: undefined;
38
41
  onError?: undefined;
@@ -112,26 +115,9 @@ export declare function getEditorConfig(id: string, rootUrl: string): {
112
115
  })[];
113
116
  blocks?: undefined;
114
117
  category?: undefined;
115
- appendTo?: undefined;
116
- rootUrl?: undefined;
117
- id?: undefined;
118
- cmdOpenNewPageDialog?: undefined;
119
- cmdOpenSettings?: undefined;
120
- enableCount?: undefined;
121
- enablePerformance?: undefined;
122
- onError?: undefined;
123
- blockLabel?: undefined;
124
- blockCustomCode?: undefined;
125
- api_key?: undefined;
126
- } | {
127
- appendTo: string;
128
- rootUrl: string;
129
- id: string;
130
- blocks?: undefined;
131
- category?: undefined;
132
- panels?: undefined;
133
118
  cmdOpenNewPageDialog?: undefined;
134
119
  cmdOpenSettings?: undefined;
120
+ appendTo?: undefined;
135
121
  enableCount?: undefined;
136
122
  enablePerformance?: undefined;
137
123
  onError?: undefined;
@@ -145,8 +131,6 @@ export declare function getEditorConfig(id: string, rootUrl: string): {
145
131
  blocks?: undefined;
146
132
  category?: undefined;
147
133
  panels?: undefined;
148
- rootUrl?: undefined;
149
- id?: undefined;
150
134
  enableCount?: undefined;
151
135
  enablePerformance?: undefined;
152
136
  onError?: undefined;
@@ -159,11 +143,9 @@ export declare function getEditorConfig(id: string, rootUrl: string): {
159
143
  blocks?: undefined;
160
144
  category?: undefined;
161
145
  panels?: undefined;
162
- appendTo?: undefined;
163
- rootUrl?: undefined;
164
- id?: undefined;
165
146
  cmdOpenNewPageDialog?: undefined;
166
147
  cmdOpenSettings?: undefined;
148
+ appendTo?: undefined;
167
149
  onError?: undefined;
168
150
  blockLabel?: undefined;
169
151
  blockCustomCode?: undefined;
@@ -173,11 +155,9 @@ export declare function getEditorConfig(id: string, rootUrl: string): {
173
155
  blocks?: undefined;
174
156
  category?: undefined;
175
157
  panels?: undefined;
176
- appendTo?: undefined;
177
- rootUrl?: undefined;
178
- id?: undefined;
179
158
  cmdOpenNewPageDialog?: undefined;
180
159
  cmdOpenSettings?: undefined;
160
+ appendTo?: undefined;
181
161
  enableCount?: undefined;
182
162
  enablePerformance?: undefined;
183
163
  blockLabel?: undefined;
@@ -191,11 +171,9 @@ export declare function getEditorConfig(id: string, rootUrl: string): {
191
171
  blocks?: undefined;
192
172
  category?: undefined;
193
173
  panels?: undefined;
194
- appendTo?: undefined;
195
- rootUrl?: undefined;
196
- id?: undefined;
197
174
  cmdOpenNewPageDialog?: undefined;
198
175
  cmdOpenSettings?: undefined;
176
+ appendTo?: undefined;
199
177
  enableCount?: undefined;
200
178
  enablePerformance?: undefined;
201
179
  onError?: undefined;
@@ -205,8 +183,6 @@ export declare function getEditorConfig(id: string, rootUrl: string): {
205
183
  blocks?: undefined;
206
184
  category?: undefined;
207
185
  panels?: undefined;
208
- rootUrl?: undefined;
209
- id?: undefined;
210
186
  cmdOpenNewPageDialog?: undefined;
211
187
  cmdOpenSettings?: undefined;
212
188
  enableCount?: undefined;
@@ -220,11 +196,9 @@ export declare function getEditorConfig(id: string, rootUrl: string): {
220
196
  blocks?: undefined;
221
197
  category?: undefined;
222
198
  panels?: undefined;
223
- appendTo?: undefined;
224
- rootUrl?: undefined;
225
- id?: undefined;
226
199
  cmdOpenNewPageDialog?: undefined;
227
200
  cmdOpenSettings?: undefined;
201
+ appendTo?: undefined;
228
202
  enableCount?: undefined;
229
203
  enablePerformance?: undefined;
230
204
  onError?: undefined;
@@ -233,5 +207,5 @@ export declare function getEditorConfig(id: string, rootUrl: string): {
233
207
  };
234
208
  };
235
209
  };
236
- export declare function initEditor(config: any, grapesJsPlugins: any): void;
237
- export declare function getEditor(): any;
210
+ export declare function initEditor(config: any, grapesJsPlugins: any): Promise<Editor>;
211
+ export declare function getEditor(): Editor;
@@ -0,0 +1 @@
1
+ export declare const storagePlugin: (editor: any) => void;
@@ -0,0 +1,35 @@
1
+ import { BackendId, JobId, PublicationJobData, WebsiteId, BackendData, BackendType, WebsiteData, ClientSideFile, PublicationData, BackendUser, WebsiteMeta } from '../types';
2
+ export declare enum ApiRoute {
3
+ PUBLICATION_PUBLISH = "api/publication/",
4
+ PUBLICATION_STATUS = "/api/publication/status/",
5
+ BACKEND_LOGOUT = "api/backend/logout/",
6
+ BACKEND_LIST = "api/backend/",
7
+ BACKEND_LOGIN_STATUS = "api/backend/login/status/",
8
+ WEBSITE_READ = "api/website/",
9
+ WEBSITE_WRITE = "api/website/",
10
+ WEBSITE_DELETE = "api/website/",
11
+ WEBSITE_LIST = "api/website/",
12
+ WEBSITE_ASSETS_READ = "assets/:path",
13
+ WEBSITE_ASSETS_WRITE = "assets/"
14
+ }
15
+ export interface LoginStatus {
16
+ backend: BackendData;
17
+ user: BackendUser;
18
+ websiteMeta?: WebsiteMeta;
19
+ }
20
+ export declare class ApiError extends Error {
21
+ readonly code: number;
22
+ constructor(message: string, code: number);
23
+ }
24
+ export declare function loginStatus(backendId: BackendId, type: BackendType, id?: WebsiteId): Promise<LoginStatus>;
25
+ export declare function logout(backendId: BackendId, type: BackendType): Promise<void>;
26
+ export declare function publish(websiteId: WebsiteId, data: PublicationData): Promise<[url: string, job: PublicationJobData]>;
27
+ export declare function publicationStatus(jobId: JobId): Promise<PublicationJobData>;
28
+ export declare function backendList(type: BackendType): Promise<BackendData[]>;
29
+ export declare function websiteList(backendId: BackendId): Promise<WebsiteMeta[]>;
30
+ export declare function websiteLoad(id: WebsiteId, backendId: BackendId): Promise<WebsiteData>;
31
+ export declare function websiteSave(id: WebsiteId, backendId: BackendId, data: WebsiteData): Promise<void>;
32
+ export declare function websiteDelete(id: WebsiteId, backendId: BackendId): Promise<void>;
33
+ export declare function websiteAssetsLoad(path: string, id: WebsiteId, backendId: BackendId): Promise<string>;
34
+ export declare function websiteAssetsSave(id: WebsiteId, backendId: BackendId, files: ClientSideFile[]): Promise<string[]>;
35
+ export declare function api<ReqQuery, ReqBody, ResBody>(route: ApiRoute | string, method: string, query?: ReqQuery, payload?: ReqBody): Promise<ResBody>;
@@ -1,4 +1,21 @@
1
1
  /**
2
2
  * @fileoverview define constants for Silex client and server
3
3
  */
4
+ export declare const WEBSITE_DATA_FILE_NAME = "website.json";
5
+ export declare const DEFAULT_WEBSITE_ID = "default";
6
+ export declare const DEFAULT_BACKEND_ID = "";
7
+ export declare const DEFAULT_LANGUAGE = "en";
4
8
  export declare const CLIENT_CONFIG_FILE_NAME = "silex.js";
9
+ export declare const API_BACKEND_LOGIN_STATUS = "api/backend/login/status/";
10
+ export declare const API_BACKEND_LIST = "api/backend/";
11
+ export declare const API_BACKEND_LOGOUT = "api/backend/logout/";
12
+ export declare const API_BACKEND_LOGIN = "api/backend/login/";
13
+ export declare const API_BACKEND_LOGIN_CALLBACK = "api/backend/login/";
14
+ export declare const API_PUBLICATION_PUBLISH = "api/publication/";
15
+ export declare const API_PUBLICATION_STATUS = "/api/publication/status/";
16
+ export declare const API_WEBSITE_READ = "api/website/";
17
+ export declare const API_WEBSITE_WRITE = "api/website/";
18
+ export declare const API_WEBSITE_DELETE = "api/website/";
19
+ export declare const API_WEBSITE_LIST = "api/website/";
20
+ export declare const API_WEBSITE_ASSETS_READ = "assets/:path";
21
+ export declare const API_WEBSITE_ASSETS_WRITE = "assets/";
@@ -4042,20 +4042,27 @@ form.silex-form .silex-form__group.col2 {
4042
4042
  background-color: #444;
4043
4043
  z-index: 10;
4044
4044
  border-radius: 3px;
4045
+ border: 2px solid rgba(0, 0, 0, 0.25);
4045
4046
  display: flex;
4046
4047
  flex-direction: column;
4048
+ }
4049
+ .silex-dialog-inline header {
4047
4050
  padding: 10px;
4048
4051
  }
4049
4052
  .silex-dialog-inline main {
4050
4053
  flex-grow: 1;
4054
+ padding: 10px;
4051
4055
  }
4052
4056
  .silex-dialog-inline footer {
4053
- padding: 5px;
4057
+ padding: 10px;
4054
4058
  text-align: right;
4055
4059
  }
4056
4060
  .silex-dialog-inline a {
4057
4061
  color: #7bc0ff;
4058
4062
  }
4063
+ .silex-dialog-inline header > * {
4064
+ margin: 0;
4065
+ }
4059
4066
 
4060
4067
  #gjs {
4061
4068
  flex: 1 1 auto;
@@ -4119,6 +4126,82 @@ form.silex-form .silex-form__group.col2 {
4119
4126
  display: none;
4120
4127
  }
4121
4128
 
4129
+ /*
4130
+ */
4131
+ .gjs-editor-cont .fa {
4132
+ font-weight: 400;
4133
+ }
4134
+
4135
+ .fa-square-o:before {
4136
+ content: "\f0c8";
4137
+ }
4138
+
4139
+ .fa-trash-o:before {
4140
+ content: "\f1f8";
4141
+ }
4142
+
4143
+ .fa-map-o:before {
4144
+ content: "\f279";
4145
+ }
4146
+
4147
+ .fa-youtube-play:before {
4148
+ content: "\f04b";
4149
+ }
4150
+
4151
+ /* Fix: open close chevrons: FA5 has the tags in different order ?!!? */
4152
+ .fa-chevron-right:before {
4153
+ content: "\f054";
4154
+ }
4155
+
4156
+ .fa-chevron-down:before {
4157
+ content: "\f078";
4158
+ }
4159
+
4160
+ .fa-cog:before {
4161
+ font-weight: 900;
4162
+ }
4163
+
4164
+ .fa-paint-brush:before {
4165
+ font-weight: 900;
4166
+ }
4167
+
4168
+ .fa-arrows-alt:before {
4169
+ content: "\f065";
4170
+ font-weight: 900;
4171
+ }
4172
+
4173
+ .fa-caret-down:before {
4174
+ content: "\f0d7";
4175
+ font-weight: 900;
4176
+ }
4177
+
4178
+ .fa-caret-right:before {
4179
+ content: "\f0da";
4180
+ font-weight: 900;
4181
+ }
4182
+
4183
+ .fa-trash:before {
4184
+ content: "\f2ed";
4185
+ font-weight: 900;
4186
+ }
4187
+
4188
+ .fa-list:before {
4189
+ content: "\f03a";
4190
+ font-weight: 900;
4191
+ }
4192
+
4193
+ /*
4194
+ .fa-plus:before {
4195
+ content: "+";
4196
+ font-size: 35px;
4197
+ }
4198
+ .fa-diamond:before {
4199
+ content: "\f3a5";
4200
+ }
4201
+ // .fa-plus {
4202
+ // background-image: svg(<svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--! Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32V224H48c-17.7 0-32 14.3-32 32s14.3 32 32 32H192V432c0 17.7 14.3 32 32 32s32-14.3 32-32V288H400c17.7 0 32-14.3 32-32s-14.3-32-32-32H256V80z"/></svg>);
4203
+ // }
4204
+ */
4122
4205
  iframe.enable-squeeze.gjs-frame {
4123
4206
  transition: width 0.35s, height 0.35s, left 0.35s;
4124
4207
  }
@@ -4206,8 +4289,8 @@ iframe.enable-squeeze.silex-squeeze-left {
4206
4289
  }
4207
4290
  .gjs-pn-project-bar-container .project-bar__panel-header .project-bar__panel-header-button span {
4208
4291
  position: relative;
4209
- left: -6px;
4210
- top: 6px;
4292
+ left: -2px;
4293
+ top: -11px;
4211
4294
  font-weight: bolder;
4212
4295
  background-color: #444;
4213
4296
  border-radius: 100%;