@silexlabs/silex 3.0.0-alpha.100

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 (282) hide show
  1. package/.env.default +19 -0
  2. package/.silex.js +37 -0
  3. package/LICENSE +661 -0
  4. package/README.md +96 -0
  5. package/dist/client/client/api.d.ts +85 -0
  6. package/dist/client/client/assetUrl.d.ts +51 -0
  7. package/dist/client/client/config.d.ts +58 -0
  8. package/dist/client/client/events.d.ts +14 -0
  9. package/dist/client/client/expose.d.ts +8 -0
  10. package/dist/client/client/grapesjs/LoginDialog.d.ts +15 -0
  11. package/dist/client/client/grapesjs/PublicationManager.d.ts +72 -0
  12. package/dist/client/client/grapesjs/PublicationUi.d.ts +62 -0
  13. package/dist/client/client/grapesjs/blocks.d.ts +1 -0
  14. package/dist/client/client/grapesjs/breadcrumbs.d.ts +1 -0
  15. package/dist/client/client/grapesjs/footer.d.ts +2 -0
  16. package/dist/client/client/grapesjs/index.d.ts +5 -0
  17. package/dist/client/client/grapesjs/internal-links.d.ts +1 -0
  18. package/dist/client/client/grapesjs/new-page-dialog.d.ts +2 -0
  19. package/dist/client/client/grapesjs/openImport.d.ts +9 -0
  20. package/dist/client/client/grapesjs/page-panel.d.ts +3 -0
  21. package/dist/client/client/grapesjs/project-bar.d.ts +1 -0
  22. package/dist/client/client/grapesjs/rich-text.d.ts +1 -0
  23. package/dist/client/client/grapesjs/semantic.d.ts +1 -0
  24. package/dist/client/client/grapesjs/settings.d.ts +2 -0
  25. package/dist/client/client/grapesjs/storage.d.ts +1 -0
  26. package/dist/client/client/grapesjs/symbolDialogs.d.ts +3 -0
  27. package/dist/client/client/index.d.ts +5 -0
  28. package/dist/client/client/publication-transformers.d.ts +41 -0
  29. package/dist/client/client/utils.d.ts +2 -0
  30. package/dist/client/constants.d.ts +29 -0
  31. package/dist/client/css/admin.css +4491 -0
  32. package/dist/client/index.html +9 -0
  33. package/dist/client/js/main.js +321 -0
  34. package/dist/client/js/main.js.LICENSE.txt +24 -0
  35. package/dist/client/page.d.ts +2 -0
  36. package/dist/client/types.d.ts +334 -0
  37. package/dist/plugins/client/client/api.d.ts +85 -0
  38. package/dist/plugins/client/client/api.js +114 -0
  39. package/dist/plugins/client/client/api.js.map +1 -0
  40. package/dist/plugins/client/client/assetUrl.d.ts +51 -0
  41. package/dist/plugins/client/client/assetUrl.js +224 -0
  42. package/dist/plugins/client/client/assetUrl.js.map +1 -0
  43. package/dist/plugins/client/client/config.d.ts +58 -0
  44. package/dist/plugins/client/client/config.js +90 -0
  45. package/dist/plugins/client/client/config.js.map +1 -0
  46. package/dist/plugins/client/client/events.d.ts +14 -0
  47. package/dist/plugins/client/client/events.js +34 -0
  48. package/dist/plugins/client/client/events.js.map +1 -0
  49. package/dist/plugins/client/client/grapesjs/LoginDialog.d.ts +15 -0
  50. package/dist/plugins/client/client/grapesjs/LoginDialog.js +195 -0
  51. package/dist/plugins/client/client/grapesjs/LoginDialog.js.map +1 -0
  52. package/dist/plugins/client/client/grapesjs/PublicationManager.d.ts +72 -0
  53. package/dist/plugins/client/client/grapesjs/PublicationManager.js +356 -0
  54. package/dist/plugins/client/client/grapesjs/PublicationManager.js.map +1 -0
  55. package/dist/plugins/client/client/grapesjs/PublicationUi.d.ts +62 -0
  56. package/dist/plugins/client/client/grapesjs/PublicationUi.js +336 -0
  57. package/dist/plugins/client/client/grapesjs/PublicationUi.js.map +1 -0
  58. package/dist/plugins/client/client/grapesjs/blocks.d.ts +1 -0
  59. package/dist/plugins/client/client/grapesjs/blocks.js +37 -0
  60. package/dist/plugins/client/client/grapesjs/blocks.js.map +1 -0
  61. package/dist/plugins/client/client/grapesjs/breadcrumbs.d.ts +1 -0
  62. package/dist/plugins/client/client/grapesjs/breadcrumbs.js +75 -0
  63. package/dist/plugins/client/client/grapesjs/breadcrumbs.js.map +1 -0
  64. package/dist/plugins/client/client/grapesjs/footer.d.ts +2 -0
  65. package/dist/plugins/client/client/grapesjs/footer.js +28 -0
  66. package/dist/plugins/client/client/grapesjs/footer.js.map +1 -0
  67. package/dist/plugins/client/client/grapesjs/index.d.ts +5 -0
  68. package/dist/plugins/client/client/grapesjs/index.js +313 -0
  69. package/dist/plugins/client/client/grapesjs/index.js.map +1 -0
  70. package/dist/plugins/client/client/grapesjs/internal-links.d.ts +1 -0
  71. package/dist/plugins/client/client/grapesjs/internal-links.js +219 -0
  72. package/dist/plugins/client/client/grapesjs/internal-links.js.map +1 -0
  73. package/dist/plugins/client/client/grapesjs/new-page-dialog.d.ts +2 -0
  74. package/dist/plugins/client/client/grapesjs/new-page-dialog.js +83 -0
  75. package/dist/plugins/client/client/grapesjs/new-page-dialog.js.map +1 -0
  76. package/dist/plugins/client/client/grapesjs/openImport.d.ts +9 -0
  77. package/dist/plugins/client/client/grapesjs/openImport.js +74 -0
  78. package/dist/plugins/client/client/grapesjs/openImport.js.map +1 -0
  79. package/dist/plugins/client/client/grapesjs/page-panel.d.ts +3 -0
  80. package/dist/plugins/client/client/grapesjs/page-panel.js +113 -0
  81. package/dist/plugins/client/client/grapesjs/page-panel.js.map +1 -0
  82. package/dist/plugins/client/client/grapesjs/project-bar.d.ts +1 -0
  83. package/dist/plugins/client/client/grapesjs/project-bar.js +104 -0
  84. package/dist/plugins/client/client/grapesjs/project-bar.js.map +1 -0
  85. package/dist/plugins/client/client/grapesjs/rich-text.d.ts +1 -0
  86. package/dist/plugins/client/client/grapesjs/rich-text.js +31 -0
  87. package/dist/plugins/client/client/grapesjs/rich-text.js.map +1 -0
  88. package/dist/plugins/client/client/grapesjs/semantic.d.ts +1 -0
  89. package/dist/plugins/client/client/grapesjs/semantic.js +110 -0
  90. package/dist/plugins/client/client/grapesjs/semantic.js.map +1 -0
  91. package/dist/plugins/client/client/grapesjs/settings.d.ts +2 -0
  92. package/dist/plugins/client/client/grapesjs/settings.js +198 -0
  93. package/dist/plugins/client/client/grapesjs/settings.js.map +1 -0
  94. package/dist/plugins/client/client/grapesjs/storage.d.ts +1 -0
  95. package/dist/plugins/client/client/grapesjs/storage.js +126 -0
  96. package/dist/plugins/client/client/grapesjs/storage.js.map +1 -0
  97. package/dist/plugins/client/client/grapesjs/symbolDialogs.d.ts +3 -0
  98. package/dist/plugins/client/client/grapesjs/symbolDialogs.js +36 -0
  99. package/dist/plugins/client/client/grapesjs/symbolDialogs.js.map +1 -0
  100. package/dist/plugins/client/client/publication-transformers.d.ts +41 -0
  101. package/dist/plugins/client/client/publication-transformers.js +238 -0
  102. package/dist/plugins/client/client/publication-transformers.js.map +1 -0
  103. package/dist/plugins/client/client/utils.d.ts +2 -0
  104. package/dist/plugins/client/client/utils.js +25 -0
  105. package/dist/plugins/client/client/utils.js.map +1 -0
  106. package/dist/plugins/client/constants.d.ts +29 -0
  107. package/dist/plugins/client/constants.js +46 -0
  108. package/dist/plugins/client/constants.js.map +1 -0
  109. package/dist/plugins/client/page.d.ts +2 -0
  110. package/dist/plugins/client/page.js +31 -0
  111. package/dist/plugins/client/page.js.map +1 -0
  112. package/dist/plugins/client/plugins/client/11ty.d.ts +17 -0
  113. package/dist/plugins/client/plugins/client/11ty.js +86 -0
  114. package/dist/plugins/client/plugins/client/11ty.js.map +1 -0
  115. package/dist/plugins/client/plugins/client/publicationRenderer.d.ts +2 -0
  116. package/dist/plugins/client/plugins/client/publicationRenderer.js +170 -0
  117. package/dist/plugins/client/plugins/client/publicationRenderer.js.map +1 -0
  118. package/dist/plugins/client/plugins/client/template.d.ts +2 -0
  119. package/dist/plugins/client/plugins/client/template.js +183 -0
  120. package/dist/plugins/client/plugins/client/template.js.map +1 -0
  121. package/dist/plugins/client/plugins/client/website-info.d.ts +1 -0
  122. package/dist/plugins/client/plugins/client/website-info.js +72 -0
  123. package/dist/plugins/client/plugins/client/website-info.js.map +1 -0
  124. package/dist/plugins/client/types.d.ts +334 -0
  125. package/dist/plugins/client/types.js +74 -0
  126. package/dist/plugins/client/types.js.map +1 -0
  127. package/dist/plugins/server/constants.d.ts +29 -0
  128. package/dist/plugins/server/constants.js +49 -0
  129. package/dist/plugins/server/constants.js.map +1 -0
  130. package/dist/plugins/server/plugins/server/AuthPlugin.d.ts +1 -0
  131. package/dist/plugins/server/plugins/server/AuthPlugin.js +40 -0
  132. package/dist/plugins/server/plugins/server/AuthPlugin.js.map +1 -0
  133. package/dist/plugins/server/plugins/server/Cache.d.ts +2 -0
  134. package/dist/plugins/server/plugins/server/Cache.js +32 -0
  135. package/dist/plugins/server/plugins/server/Cache.js.map +1 -0
  136. package/dist/plugins/server/plugins/server/DownloadConnector.d.ts +29 -0
  137. package/dist/plugins/server/plugins/server/DownloadConnector.js +129 -0
  138. package/dist/plugins/server/plugins/server/DownloadConnector.js.map +1 -0
  139. package/dist/plugins/server/plugins/server/FtpConnector.d.ts +86 -0
  140. package/dist/plugins/server/plugins/server/FtpConnector.js +526 -0
  141. package/dist/plugins/server/plugins/server/FtpConnector.js.map +1 -0
  142. package/dist/plugins/server/plugins/server/GitlabConnector.d.ts +87 -0
  143. package/dist/plugins/server/plugins/server/GitlabConnector.js +564 -0
  144. package/dist/plugins/server/plugins/server/GitlabConnector.js.map +1 -0
  145. package/dist/plugins/server/plugins/server/PublicationOptimizer.d.ts +0 -0
  146. package/dist/plugins/server/plugins/server/PublicationOptimizer.js +14 -0
  147. package/dist/plugins/server/plugins/server/PublicationOptimizer.js.map +1 -0
  148. package/dist/plugins/server/plugins/server/SslPlugin.d.ts +1 -0
  149. package/dist/plugins/server/plugins/server/SslPlugin.js +86 -0
  150. package/dist/plugins/server/plugins/server/SslPlugin.js.map +1 -0
  151. package/dist/plugins/server/plugins/server/StaticPlugin.d.ts +1 -0
  152. package/dist/plugins/server/plugins/server/StaticPlugin.js +78 -0
  153. package/dist/plugins/server/plugins/server/StaticPlugin.js.map +1 -0
  154. package/dist/plugins/server/server/config.d.ts +59 -0
  155. package/dist/plugins/server/server/config.js +181 -0
  156. package/dist/plugins/server/server/config.js.map +1 -0
  157. package/dist/plugins/server/server/connectors/FsHosting.d.ts +13 -0
  158. package/dist/plugins/server/server/connectors/FsHosting.js +54 -0
  159. package/dist/plugins/server/server/connectors/FsHosting.js.map +1 -0
  160. package/dist/plugins/server/server/connectors/FsStorage.d.ts +43 -0
  161. package/dist/plugins/server/server/connectors/FsStorage.js +257 -0
  162. package/dist/plugins/server/server/connectors/FsStorage.js.map +1 -0
  163. package/dist/plugins/server/server/connectors/connectors.d.ts +87 -0
  164. package/dist/plugins/server/server/connectors/connectors.js +127 -0
  165. package/dist/plugins/server/server/connectors/connectors.js.map +1 -0
  166. package/dist/plugins/server/server/events.d.ts +26 -0
  167. package/dist/plugins/server/server/events.js +31 -0
  168. package/dist/plugins/server/server/events.js.map +1 -0
  169. package/dist/plugins/server/server/jobs.d.ts +12 -0
  170. package/dist/plugins/server/server/jobs.js +77 -0
  171. package/dist/plugins/server/server/jobs.js.map +1 -0
  172. package/dist/plugins/server/server/utils/validation.d.ts +7 -0
  173. package/dist/plugins/server/server/utils/validation.js +38 -0
  174. package/dist/plugins/server/server/utils/validation.js.map +1 -0
  175. package/dist/plugins/server/types.d.ts +334 -0
  176. package/dist/plugins/server/types.js +78 -0
  177. package/dist/plugins/server/types.js.map +1 -0
  178. package/dist/server/constants.js +29 -0
  179. package/dist/server/plugins/server/Cache.js +15 -0
  180. package/dist/server/server/api/api.js +20 -0
  181. package/dist/server/server/api/connectorApi.js +216 -0
  182. package/dist/server/server/api/publicationApi.js +108 -0
  183. package/dist/server/server/api/websiteApi.js +296 -0
  184. package/dist/server/server/cli.js +68 -0
  185. package/dist/server/server/config.js +120 -0
  186. package/dist/server/server/connectors/FsHosting.js +35 -0
  187. package/dist/server/server/connectors/FsStorage.js +225 -0
  188. package/dist/server/server/connectors/connectors.js +89 -0
  189. package/dist/server/server/events.js +14 -0
  190. package/dist/server/server/expose.js +27 -0
  191. package/dist/server/server/express.js +47 -0
  192. package/dist/server/server/index.js +90 -0
  193. package/dist/server/server/jobs.js +48 -0
  194. package/dist/server/server/utils/validation.js +15 -0
  195. package/dist/server/types.js +34 -0
  196. package/package.json +209 -0
  197. package/public/assets/container.png +0 -0
  198. package/public/assets/favicon.png +0 -0
  199. package/public/assets/logo-silex-small.png +0 -0
  200. package/public/robots.txt +2 -0
  201. package/public/silex.js +24 -0
  202. package/src/css/_mixins.scss +8 -0
  203. package/src/css/_variables.scss +33 -0
  204. package/src/css/dialog.scss +41 -0
  205. package/src/css/footer.scss +12 -0
  206. package/src/css/grapesjs-light.scss +180 -0
  207. package/src/css/grapesjs.scss +152 -0
  208. package/src/css/index.scss +32 -0
  209. package/src/css/light.scss +7 -0
  210. package/src/css/loader.scss +12 -0
  211. package/src/css/page-panel.scss +65 -0
  212. package/src/css/project-bar.scss +102 -0
  213. package/src/css/silex.scss +189 -0
  214. package/src/css/website-info.scss +14 -0
  215. package/src/html/debug.pug +8 -0
  216. package/src/html/index.pug +39 -0
  217. package/src/html/templates/includes.pug +1 -0
  218. package/src/html/templates/workspace.pug +2 -0
  219. package/src/ts/client/api.ts +144 -0
  220. package/src/ts/client/assetUrl.test.ts +125 -0
  221. package/src/ts/client/assetUrl.ts +235 -0
  222. package/src/ts/client/config.ts +105 -0
  223. package/src/ts/client/events.ts +34 -0
  224. package/src/ts/client/expose.ts +30 -0
  225. package/src/ts/client/grapesjs/LoginDialog.ts +204 -0
  226. package/src/ts/client/grapesjs/PublicationManager.ts +370 -0
  227. package/src/ts/client/grapesjs/PublicationUi.ts +342 -0
  228. package/src/ts/client/grapesjs/blocks.ts +37 -0
  229. package/src/ts/client/grapesjs/breadcrumbs.ts +79 -0
  230. package/src/ts/client/grapesjs/eleventy.ts +47 -0
  231. package/src/ts/client/grapesjs/footer.ts +27 -0
  232. package/src/ts/client/grapesjs/index.ts +335 -0
  233. package/src/ts/client/grapesjs/internal-links.test.ts +105 -0
  234. package/src/ts/client/grapesjs/internal-links.ts +225 -0
  235. package/src/ts/client/grapesjs/new-page-dialog.ts +90 -0
  236. package/src/ts/client/grapesjs/openImport.ts +81 -0
  237. package/src/ts/client/grapesjs/page-panel.ts +118 -0
  238. package/src/ts/client/grapesjs/project-bar.ts +107 -0
  239. package/src/ts/client/grapesjs/rich-text.ts +33 -0
  240. package/src/ts/client/grapesjs/semantic.ts +114 -0
  241. package/src/ts/client/grapesjs/settings.ts +208 -0
  242. package/src/ts/client/grapesjs/storage.ts +121 -0
  243. package/src/ts/client/grapesjs/symbolDialogs.ts +38 -0
  244. package/src/ts/client/index.ts +98 -0
  245. package/src/ts/client/publication-transformers.test.ts +199 -0
  246. package/src/ts/client/publication-transformers.ts +263 -0
  247. package/src/ts/client/utils.ts +28 -0
  248. package/src/ts/constants.ts +52 -0
  249. package/src/ts/externs.ts +18 -0
  250. package/src/ts/page.ts +31 -0
  251. package/src/ts/plugins/client/11ty.ts +104 -0
  252. package/src/ts/plugins/client/publicationRenderer.ts +174 -0
  253. package/src/ts/plugins/client/template.ts +192 -0
  254. package/src/ts/plugins/client/website-info.ts +84 -0
  255. package/src/ts/plugins/server/AuthPlugin.ts +38 -0
  256. package/src/ts/plugins/server/Cache.ts +28 -0
  257. package/src/ts/plugins/server/DownloadConnector.ts +148 -0
  258. package/src/ts/plugins/server/FtpConnector.test.ts +82 -0
  259. package/src/ts/plugins/server/FtpConnector.ts +609 -0
  260. package/src/ts/plugins/server/GitlabConnector.ts +644 -0
  261. package/src/ts/plugins/server/PublicationOptimizer.ts +14 -0
  262. package/src/ts/plugins/server/SslPlugin.ts +84 -0
  263. package/src/ts/plugins/server/StaticPlugin.ts +79 -0
  264. package/src/ts/server/api/api.ts +19 -0
  265. package/src/ts/server/api/connectorApi.ts +345 -0
  266. package/src/ts/server/api/publicationApi.ts +159 -0
  267. package/src/ts/server/api/websiteApi.ts +432 -0
  268. package/src/ts/server/cli.ts +65 -0
  269. package/src/ts/server/config.ts +189 -0
  270. package/src/ts/server/connectors/FsHosting.ts +60 -0
  271. package/src/ts/server/connectors/FsStorage.test.ts +51 -0
  272. package/src/ts/server/connectors/FsStorage.ts +261 -0
  273. package/src/ts/server/connectors/connectors.ts +203 -0
  274. package/src/ts/server/events.ts +37 -0
  275. package/src/ts/server/expose.ts +19 -0
  276. package/src/ts/server/express.ts +70 -0
  277. package/src/ts/server/index.ts +100 -0
  278. package/src/ts/server/jobs.test.ts +75 -0
  279. package/src/ts/server/jobs.ts +87 -0
  280. package/src/ts/server/utils/BackwardCompat.ts +552 -0
  281. package/src/ts/server/utils/validation.ts +34 -0
  282. package/src/ts/types.ts +339 -0
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
+ };
28
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
31
+ Object.defineProperty(exports, "__esModule", { value: true });
32
+ const silexApp = __importStar(require("./express"));
33
+ const api_1 = __importDefault(require("./api/api"));
34
+ const config_1 = require("./config");
35
+ const dotenv_1 = __importDefault(require("dotenv"));
36
+ const path_1 = require("path");
37
+ __exportStar(require("./expose"), exports);
38
+ async function silex() {
39
+ const curDirEnv = dotenv_1.default.config();
40
+ if (curDirEnv.error) {
41
+ if (curDirEnv.error['code'] === 'ENOENT') {
42
+ console.info('> No .env file found in current directory');
43
+ }
44
+ else {
45
+ throw curDirEnv.error;
46
+ }
47
+ }
48
+ else {
49
+ console.info('> Env vars loaded from .env file');
50
+ }
51
+ const DEFAULT_ENV_FILE = (0, path_1.join)(__dirname, '../../../.env.default');
52
+ const rootDirEnv = dotenv_1.default.config({ path: DEFAULT_ENV_FILE });
53
+ if (rootDirEnv.error) {
54
+ if (rootDirEnv.error['code'] === 'ENOENT') {
55
+ throw new Error(`\n\nFailed to load default env vars. File not found ${DEFAULT_ENV_FILE}\n\n`);
56
+ }
57
+ else {
58
+ throw new Error(`\n\nFailed to load default env vars. Error in ${DEFAULT_ENV_FILE}: ${rootDirEnv.error.message}\n\n`);
59
+ }
60
+ }
61
+ console.info('> Default env vars loaded');
62
+ const config = new config_1.ServerConfig();
63
+ const app = silexApp.create(config);
64
+ await config.addRoutes(app);
65
+ await config.loadConfigFiles();
66
+ await config.initDefaultConnectors();
67
+ app.use('/api', (0, api_1.default)(config));
68
+ await silexApp.start(app);
69
+ console.info(`
70
+ I'm ready, listening to port ${config.port}
71
+ `);
72
+ if (config.debug) {
73
+ startLiverReload();
74
+ }
75
+ }
76
+ exports.default = silex;
77
+ async function startLiverReload() {
78
+ const { createServer } = await Promise.resolve().then(() => __importStar(require('livereload')));
79
+ const { resolve } = await Promise.resolve().then(() => __importStar(require('path')));
80
+ const dist = resolve(__dirname, '../../client');
81
+ const server = createServer({
82
+ delay: 0,
83
+ }, () => {
84
+ console.info(`\n> Debug mode\n> Live reload server is running.\n> Watching ${dist}`);
85
+ });
86
+ server.watch(dist);
87
+ }
88
+ if (require.main === module) {
89
+ silex();
90
+ }
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.jobManager = exports.killJob = exports.jobError = exports.jobSuccess = exports.getJob = exports.startJob = void 0;
4
+ const types_1 = require("../types");
5
+ const TIME_TO_KEEP_AFTER_STOP = 60 * 10 * 1000;
6
+ const jobs = new Array();
7
+ const processKey = Math.ceil(Math.random() * 1000000);
8
+ let nextJobId = 0;
9
+ function startJob(message = '') {
10
+ const jobId = `${processKey}_${++nextJobId}`;
11
+ const job = {
12
+ jobId,
13
+ status: types_1.JobStatus.IN_PROGRESS,
14
+ message: message
15
+ };
16
+ jobs.push(job);
17
+ return job;
18
+ }
19
+ exports.startJob = startJob;
20
+ function getJob(id) {
21
+ return jobs.find(job => job.jobId === id);
22
+ }
23
+ exports.getJob = getJob;
24
+ function jobSuccess(id, message = '') {
25
+ return end(id, types_1.JobStatus.SUCCESS, message);
26
+ }
27
+ exports.jobSuccess = jobSuccess;
28
+ function jobError(id, message = '') {
29
+ return end(id, types_1.JobStatus.ERROR, message);
30
+ }
31
+ exports.jobError = jobError;
32
+ function killJob(job) {
33
+ clearTimeout(job._timeout);
34
+ jobs.splice(jobs.findIndex(j => job.jobId === j.jobId), 1);
35
+ }
36
+ exports.killJob = killJob;
37
+ function end(id, status, message = '') {
38
+ const job = getJob(id);
39
+ if (job) {
40
+ job.status = status;
41
+ if (message)
42
+ job.message = message;
43
+ job._timeout = setTimeout(() => killJob(job), TIME_TO_KEEP_AFTER_STOP);
44
+ return true;
45
+ }
46
+ return false;
47
+ }
48
+ exports.jobManager = { startJob, jobSuccess, jobError };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.requiredParam = void 0;
4
+ function requiredParam(value, name, defaultValue) {
5
+ if (value === undefined) {
6
+ if (defaultValue !== undefined) {
7
+ return defaultValue;
8
+ }
9
+ const error = new Error(`Missing required parameter ${name}`);
10
+ console.error(`Missing required parameter ${name}`, error);
11
+ throw error;
12
+ }
13
+ return value;
14
+ }
15
+ exports.requiredParam = requiredParam;
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JobStatus = exports.ConnectorType = exports.ClientSideFileType = exports.Unit = exports.defaultWebsiteData = exports.ApiError = void 0;
4
+ class ApiError extends Error {
5
+ httpStatusCode;
6
+ constructor(message, httpStatusCode) {
7
+ super(message);
8
+ this.httpStatusCode = httpStatusCode;
9
+ console.info('API error', httpStatusCode, message);
10
+ }
11
+ }
12
+ exports.ApiError = ApiError;
13
+ exports.defaultWebsiteData = {};
14
+ var Unit;
15
+ (function (Unit) {
16
+ Unit["PX"] = "px";
17
+ })(Unit || (exports.Unit = Unit = {}));
18
+ var ClientSideFileType;
19
+ (function (ClientSideFileType) {
20
+ ClientSideFileType["HTML"] = "html";
21
+ ClientSideFileType["ASSET"] = "asset";
22
+ ClientSideFileType["CSS"] = "css";
23
+ })(ClientSideFileType || (exports.ClientSideFileType = ClientSideFileType = {}));
24
+ var ConnectorType;
25
+ (function (ConnectorType) {
26
+ ConnectorType["STORAGE"] = "STORAGE";
27
+ ConnectorType["HOSTING"] = "HOSTING";
28
+ })(ConnectorType || (exports.ConnectorType = ConnectorType = {}));
29
+ var JobStatus;
30
+ (function (JobStatus) {
31
+ JobStatus["IN_PROGRESS"] = "IN_PROGRESS";
32
+ JobStatus["SUCCESS"] = "SUCCESS";
33
+ JobStatus["ERROR"] = "ERROR";
34
+ })(JobStatus || (exports.JobStatus = JobStatus = {}));
package/package.json ADDED
@@ -0,0 +1,209 @@
1
+ {
2
+ "name": "@silexlabs/silex",
3
+ "description": "Free and easy website builder for everyone.",
4
+ "version": "3.0.0-alpha.100",
5
+ "version:backwardcompat": "3.0.0",
6
+ "author": {
7
+ "name": "Alex Hoyau",
8
+ "url": "https://lexoyo.me/"
9
+ },
10
+ "main": "dist/server/server/index.js",
11
+ "bin": {
12
+ "silex": "./dist/server/server/cli.js"
13
+ },
14
+ "files": [
15
+ "dist/",
16
+ "src/",
17
+ "public",
18
+ ".silex.js",
19
+ ".silex",
20
+ ".env.default",
21
+ "package.json",
22
+ "package-lock.json",
23
+ "README.md",
24
+ "LICENSE"
25
+ ],
26
+ "license": "AGPL-3.0-or-later",
27
+ "engines": {
28
+ "node": ">=18"
29
+ },
30
+ "watch": {
31
+ "build:css:debug": {
32
+ "patterns": [
33
+ "src/css/"
34
+ ],
35
+ "extensions": "scss"
36
+ },
37
+ "build:html:debug": {
38
+ "patterns": [
39
+ "src/html/"
40
+ ],
41
+ "extensions": "pug"
42
+ },
43
+ "build:client:debug": {
44
+ "patterns": [
45
+ "src/ts/client/",
46
+ "src/ts/plugins/client/"
47
+ ],
48
+ "extensions": [
49
+ "ts"
50
+ ]
51
+ },
52
+ "build:server:debug": {
53
+ "patterns": [
54
+ "src/ts/server/",
55
+ "src/ts/plugins/server/"
56
+ ],
57
+ "extensions": [
58
+ "ts"
59
+ ]
60
+ },
61
+ "build:plugins:server": {
62
+ "patterns": [
63
+ "src/ts/plugins/server/"
64
+ ],
65
+ "extensions": [
66
+ "ts"
67
+ ]
68
+ },
69
+ "build:plugins:client": {
70
+ "patterns": [
71
+ "src/ts/plugins/client/"
72
+ ],
73
+ "extensions": [
74
+ "ts"
75
+ ]
76
+ }
77
+ },
78
+ "scripts": {
79
+ "release": "",
80
+ "watch": "npm-watch",
81
+ "start": "node dist/server/server/",
82
+ "start:debug": "cross-env SILEX_FS_ROOT=`pwd`/.silex cross-env SILEX_DEBUG=true nodemon --watch dist/server dist/server/server/",
83
+ "prepublishOnly": "$npm_execpath run lint && $npm_execpath test && $npm_execpath run build",
84
+ "preversion": "$npm_execpath run prepublishOnly",
85
+ "build": "run-s build:css:release build:html build:client:release build:server:release build:plugins:client build:plugins:server",
86
+ "webpack": "webpack --config webpack.config.js",
87
+ "build:css:release": "sass --load-path ../../node_modules --load-path node_modules --no-source-map src/css/index.scss dist/client/css/admin.css",
88
+ "build:css:debug": "sass --load-path ../../node_modules --load-path node_modules src/css/index.scss dist/client/css/admin.css",
89
+ "build:html": "pug src/html/index.pug --out dist/client/ --no-debug",
90
+ "build:html:debug": "pug src/html/debug.pug --pretty --out dist/client/ && mv dist/client/debug.html dist/client/index.html",
91
+ "build:client:release": "webpack --config webpack.config.js",
92
+ "build:client:debug": "webpack --config webpack.debug.config.js",
93
+ "build:server:release": "tsc -p tsconfig-server-release.json",
94
+ "build:server:debug": "SILEX_DEBUG=true tsc -p tsconfig-server-debug.json",
95
+ "build:plugins:server": "tsc -p tsconfig-plugins-server.json",
96
+ "build:plugins:client": "tsc -p tsconfig-plugins-client.json",
97
+ "lint": "eslint 'src/ts/**/*.ts'",
98
+ "lint:fix": "$npm_execpath run lint -- --fix",
99
+ "test": "node --experimental-vm-modules `node_modules jest`/jest/bin/jest.js",
100
+ "test:watch": "$npm_execpath test -- --watch"
101
+ },
102
+ "dependencies": {
103
+ "@fontsource/ubuntu": "^5.0.5",
104
+ "@fortawesome/fontawesome-free": "6.4.0",
105
+ "@gitbeaker/rest": "^39.7.0",
106
+ "@silexlabs/grapesjs-fonts": "1.0.12",
107
+ "@silexlabs/grapesjs-loading": "1.0.8",
108
+ "@silexlabs/grapesjs-storage-rate-limit": "^1.0.8",
109
+ "@silexlabs/grapesjs-symbols": "1.0.37",
110
+ "@silexlabs/grapesjs-ui-suggest-classes": "1.0.23",
111
+ "@silexlabs/silex-plugins": "1.0.10",
112
+ "@types/archiver": "^5.3.2",
113
+ "adm-zip": "0.5.10",
114
+ "archiver": "^5.3.1",
115
+ "basic-ftp": "^5.0.3",
116
+ "body-parser": "1.20.2",
117
+ "cli": "1.0.1",
118
+ "compression": "1.7.4",
119
+ "cookie-parser": "1.4.6",
120
+ "cookie-session": "2.0.0",
121
+ "cors": "2.8.5",
122
+ "cross-env": "7.0.3",
123
+ "crypto": "^1.0.1",
124
+ "dotenv": "^16.3.1",
125
+ "express": "4.18.2",
126
+ "express-force-ssl": "0.3.2",
127
+ "formidable": "2.1.1",
128
+ "fs-extra": "^11.1.1",
129
+ "grapesjs": "0.21.2",
130
+ "grapesjs-blocks-basic": "1.0.2",
131
+ "grapesjs-custom-code": "1.0.2",
132
+ "grapesjs-plugin-forms": "2.0.6",
133
+ "grapesjs-style-filter": "1.0.2",
134
+ "html-minifier": "^4.0.0",
135
+ "lit-html": "2.7.4",
136
+ "mkdirp": "3.0.1",
137
+ "node_modules-path": "2.0.7",
138
+ "node-fetch": "2.6.9",
139
+ "normalize.css": "8.0.1",
140
+ "object-path": "0.11.8",
141
+ "promise-sequential": "1.1.1",
142
+ "sass": "1.63.6",
143
+ "serve-static": "1.15.0",
144
+ "uuid": "^9.0.0"
145
+ },
146
+ "devDependencies": {
147
+ "@types/express": "4.17.17",
148
+ "@types/jest": "^29.5.2",
149
+ "@types/node": "20.3.1",
150
+ "@typescript-eslint/eslint-plugin": "5.60.0",
151
+ "@typescript-eslint/parser": "5.60.0",
152
+ "css-loader": "6.8.1",
153
+ "eslint": "8.43.0",
154
+ "file-loader": "6.2.0",
155
+ "jest": "29.5.0",
156
+ "jest-environment-jsdom": "29.5.0",
157
+ "livereload": "0.9.3",
158
+ "nodemon": "2.0.22",
159
+ "npm-run-all": "4.1.5",
160
+ "npm-watch": "0.11.0",
161
+ "pug-cli": "1.0.0-alpha6",
162
+ "style-loader": "3.3.3",
163
+ "ts-jest": "29.1.0",
164
+ "ts-loader": "9.4.3",
165
+ "typescript": "5.1.3",
166
+ "webpack": "5.88.0",
167
+ "webpack-cli": "5.1.4"
168
+ },
169
+ "repository": {
170
+ "type": "git",
171
+ "url": "https://github.com/silexlabs/Silex.git"
172
+ },
173
+ "keywords": [
174
+ "page builder",
175
+ "cloud",
176
+ "SaaS",
177
+ "template builder",
178
+ "web page editor",
179
+ "html5 editor",
180
+ "free",
181
+ "open source",
182
+ "online editor",
183
+ "silex website",
184
+ "free",
185
+ "website builder",
186
+ "online",
187
+ "silex website builder",
188
+ "silex.me",
189
+ "silex",
190
+ "html editor",
191
+ "free website builder",
192
+ "silex cms",
193
+ "online website builder open source",
194
+ "Create a free website",
195
+ "Wix.com open source alternative",
196
+ "designer",
197
+ "webdesigner",
198
+ "web master",
199
+ "webmaster",
200
+ "open source CMS",
201
+ "CSS3",
202
+ "HTML5",
203
+ "Javascript",
204
+ "WYSIWYG",
205
+ "github",
206
+ "silex",
207
+ "jekyll"
208
+ ]
209
+ }
Binary file
Binary file
@@ -0,0 +1,2 @@
1
+ User-agent: *
2
+ Disallow: /
@@ -0,0 +1,24 @@
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
+ /**
19
+ * This file is loaded by Silex when the user opens the editor
20
+ * Unless you override the default config with the environment variable SILEX_CLIENT_CONFIG or the CLI option --client-config
21
+ */
22
+
23
+ export default async function (config) {
24
+ }
@@ -0,0 +1,8 @@
1
+ @mixin silex-ui-full {
2
+ position: absolute;
3
+ top: 0;
4
+ left: 0;
5
+ width: 100%;
6
+ height: 100%;
7
+ }
8
+
@@ -0,0 +1,33 @@
1
+ // All colors
2
+ // /!\ Duplicated in the grapesjs/index.ts too => keep in sync
3
+ $primaryColor: #333333;
4
+ $secondaryColor: #ddd;
5
+ $tertiaryColor: #8873FE;
6
+ $quaternaryColor: #A291FF;;
7
+ $darkerPrimaryColor: #292929;
8
+ $lighterPrimaryColor: #575757;
9
+
10
+ $topBarHeight: 40px;
11
+ $projectBarWidth: 35px;
12
+ $projectPanelWidth: 13%;
13
+ $projectPanelMinWidth: 150px;
14
+ $viewsPanelWidth: 15%; // 15% is grapesjs default
15
+ $footerHeight: 30px;
16
+ $transitionSpeedMedium: .35s;
17
+ $transitionSpeedSlow: .5s;
18
+ $prefix: 'gjs-';
19
+ $pn-prefix: '#{$prefix}pn-';
20
+ $cv-prefix: '#{$prefix}cv-';
21
+ $z-dialog-inline: 10;
22
+ $z-loader: 10;
23
+
24
+ $fontFamily: 'Ubuntu', sans-serif;
25
+
26
+ :root {
27
+ --primaryColor: #{$primaryColor};
28
+ --secondaryColor: #{$secondaryColor};
29
+ --tertiaryColor: #{$tertiaryColor};
30
+ --quaternaryColor: #{$quaternaryColor};
31
+ --darkerPrimaryColor: #{$darkerPrimaryColor};
32
+ --lighterPrimaryColor: #{$lighterPrimaryColor};
33
+ }
@@ -0,0 +1,41 @@
1
+ @use "variables";
2
+ @use "mixins";
3
+
4
+ .silex-main {
5
+ transition: opacity variables.$transitionSpeedMedium .5s ease;
6
+ }
7
+ .silex-dialog {
8
+ transition: opacity variables.$transitionSpeedMedium ease;
9
+ }
10
+ .silex-dialog-hide {
11
+ opacity: 0;
12
+ visibility: hidden;
13
+ transition: opacity variables.$transitionSpeedMedium ease, visibility variables.$transitionSpeedSlow 1s ease;
14
+ }
15
+
16
+ .silex-dialog-inline {
17
+ position: absolute;
18
+ background-color: variables.$primaryColor;
19
+ z-index: variables.$z-dialog-inline;
20
+ border-radius: 3px;
21
+ border: 2px solid rgba(0, 0, 0, 0.25);
22
+ display: flex;
23
+ flex-direction: column;
24
+ header {
25
+ padding: 10px;
26
+ }
27
+ main {
28
+ flex-grow: 1;
29
+ padding: 10px;
30
+ }
31
+ footer {
32
+ padding: 10px;
33
+ text-align: right;
34
+ }
35
+ a {
36
+ color: variables.$quaternaryColor;
37
+ }
38
+ header > * {
39
+ margin: 0;
40
+ }
41
+ }
@@ -0,0 +1,12 @@
1
+ @use "variables" as *;
2
+ // Footer is sticky at the bottom of the stage
3
+ .gjs-pn-footer {
4
+ bottom: 0;
5
+ left: $projectBarWidth;
6
+ right: $viewsPanelWidth;
7
+ display: flex;
8
+ justify-content: space-between;
9
+ align-items: center;
10
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
11
+ height: $footerHeight;
12
+ }