@silexlabs/silex 3.0.1-alpha.0 → 3.0.1

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 (323) hide show
  1. package/.env.default +20 -0
  2. package/.silex.js +67 -8
  3. package/LICENSE +661 -203
  4. package/README.md +37 -35
  5. package/dist/client/client/api.d.ts +90 -0
  6. package/dist/client/client/assetUrl.d.ts +54 -0
  7. package/dist/client/client/config.d.ts +102 -0
  8. package/dist/client/client/events.d.ts +23 -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 +73 -0
  12. package/dist/client/client/grapesjs/PublicationUi.d.ts +59 -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/css-props.d.ts +6 -0
  16. package/dist/client/client/grapesjs/footer.d.ts +2 -0
  17. package/dist/client/client/grapesjs/img.d.ts +6 -0
  18. package/dist/client/client/grapesjs/index.d.ts +9 -0
  19. package/dist/client/client/grapesjs/internal-links.d.ts +1 -0
  20. package/dist/client/client/grapesjs/keymaps.d.ts +123 -0
  21. package/dist/client/client/grapesjs/new-page-dialog.d.ts +2 -0
  22. package/dist/client/client/grapesjs/openImport.d.ts +9 -0
  23. package/dist/client/client/grapesjs/page-panel.d.ts +9 -0
  24. package/dist/client/client/grapesjs/project-bar.d.ts +21 -0
  25. package/dist/client/client/grapesjs/resize-panel.d.ts +1 -0
  26. package/dist/client/client/grapesjs/rich-text.d.ts +4 -0
  27. package/dist/client/client/grapesjs/semantic.d.ts +1 -0
  28. package/dist/client/client/grapesjs/settings-sections.d.ts +16 -0
  29. package/dist/client/client/grapesjs/settings.d.ts +4 -0
  30. package/dist/client/client/grapesjs/storage.d.ts +2 -0
  31. package/dist/client/client/grapesjs/symbolDialogs.d.ts +3 -0
  32. package/dist/client/client/grapesjs/view-buttons.d.ts +1 -0
  33. package/dist/client/client/index.d.ts +10 -0
  34. package/dist/client/client/publication-transformers.d.ts +42 -0
  35. package/dist/client/client/publish-custom-code-block.d.ts +4 -0
  36. package/dist/client/client/publish-fonts.d.ts +4 -0
  37. package/dist/client/client/utils.d.ts +22 -0
  38. package/dist/client/constants.d.ts +32 -0
  39. package/dist/client/css/admin.css +1114 -328
  40. package/dist/client/css/admin.css.map +1 -0
  41. package/dist/client/grapesjs-filter-styles/dist/index.d.ts +4 -0
  42. package/dist/client/grapesjs-fonts/dist/index.d.ts +4 -0
  43. package/dist/client/grapesjs-fonts/src/commands.d.ts +3 -0
  44. package/dist/client/grapesjs-fonts/src/fonts.d.ts +4 -0
  45. package/dist/client/grapesjs-storage-rate-limit/dist/index.d.ts +4 -0
  46. package/dist/client/grapesjs-ui-suggest-classes/dist/index.d.ts +4 -0
  47. package/dist/client/index.html +3 -2
  48. package/dist/client/js/main.js +356 -131
  49. package/dist/client/js/main.js.LICENSE.txt +15 -1
  50. package/dist/client/page.d.ts +2 -0
  51. package/dist/client/silex-lib/src/ts/client/api.d.ts +90 -0
  52. package/dist/client/silex-lib/src/ts/client/assetUrl.d.ts +54 -0
  53. package/dist/client/silex-lib/src/ts/client/config.d.ts +102 -0
  54. package/dist/client/silex-lib/src/ts/client/events.d.ts +23 -0
  55. package/dist/client/silex-lib/src/ts/client/expose.d.ts +8 -0
  56. package/dist/client/silex-lib/src/ts/client/grapesjs/LoginDialog.d.ts +15 -0
  57. package/dist/client/silex-lib/src/ts/client/grapesjs/PublicationManager.d.ts +73 -0
  58. package/dist/client/silex-lib/src/ts/client/grapesjs/PublicationUi.d.ts +59 -0
  59. package/dist/client/silex-lib/src/ts/client/grapesjs/blocks.d.ts +1 -0
  60. package/dist/client/silex-lib/src/ts/client/grapesjs/breadcrumbs.d.ts +1 -0
  61. package/dist/client/silex-lib/src/ts/client/grapesjs/css-props.d.ts +6 -0
  62. package/dist/client/silex-lib/src/ts/client/grapesjs/footer.d.ts +2 -0
  63. package/dist/client/silex-lib/src/ts/client/grapesjs/img.d.ts +6 -0
  64. package/dist/client/silex-lib/src/ts/client/grapesjs/index.d.ts +9 -0
  65. package/dist/client/silex-lib/src/ts/client/grapesjs/internal-links.d.ts +1 -0
  66. package/dist/client/silex-lib/src/ts/client/grapesjs/keymaps.d.ts +123 -0
  67. package/dist/client/silex-lib/src/ts/client/grapesjs/new-page-dialog.d.ts +2 -0
  68. package/dist/client/silex-lib/src/ts/client/grapesjs/openImport.d.ts +9 -0
  69. package/dist/client/silex-lib/src/ts/client/grapesjs/page-panel.d.ts +9 -0
  70. package/dist/client/silex-lib/src/ts/client/grapesjs/project-bar.d.ts +21 -0
  71. package/dist/client/silex-lib/src/ts/client/grapesjs/resize-panel.d.ts +1 -0
  72. package/dist/client/silex-lib/src/ts/client/grapesjs/rich-text.d.ts +4 -0
  73. package/dist/client/silex-lib/src/ts/client/grapesjs/semantic.d.ts +1 -0
  74. package/dist/client/silex-lib/src/ts/client/grapesjs/settings-sections.d.ts +16 -0
  75. package/dist/client/silex-lib/src/ts/client/grapesjs/settings.d.ts +4 -0
  76. package/dist/client/silex-lib/src/ts/client/grapesjs/storage.d.ts +2 -0
  77. package/dist/client/silex-lib/src/ts/client/grapesjs/symbolDialogs.d.ts +3 -0
  78. package/dist/client/silex-lib/src/ts/client/grapesjs/view-buttons.d.ts +1 -0
  79. package/dist/client/silex-lib/src/ts/client/index.d.ts +10 -0
  80. package/dist/client/silex-lib/src/ts/client/publication-transformers.d.ts +42 -0
  81. package/dist/client/silex-lib/src/ts/client/publish-custom-code-block.d.ts +4 -0
  82. package/dist/client/silex-lib/src/ts/client/publish-fonts.d.ts +4 -0
  83. package/dist/client/silex-lib/src/ts/client/utils.d.ts +22 -0
  84. package/dist/client/silex-lib/src/ts/constants.d.ts +32 -0
  85. package/dist/client/silex-lib/src/ts/page.d.ts +2 -0
  86. package/dist/client/silex-lib/src/ts/types.d.ts +339 -0
  87. package/dist/client/types.d.ts +339 -0
  88. package/dist/plugins/client/client/events.d.ts +23 -0
  89. package/dist/plugins/client/client/events.js +43 -0
  90. package/dist/plugins/client/client/events.js.map +1 -0
  91. package/dist/plugins/client/plugins/client/template.d.ts +2 -0
  92. package/dist/plugins/client/plugins/client/template.js +234 -0
  93. package/dist/plugins/client/plugins/client/template.js.map +1 -0
  94. package/dist/plugins/client/plugins/client/website-info.d.ts +1 -0
  95. package/dist/plugins/client/plugins/client/website-info.js +72 -0
  96. package/dist/plugins/client/plugins/client/website-info.js.map +1 -0
  97. package/dist/plugins/client/types.d.ts +339 -0
  98. package/dist/plugins/client/types.js +80 -0
  99. package/dist/plugins/client/types.js.map +1 -0
  100. package/dist/plugins/server/constants.d.ts +32 -0
  101. package/dist/plugins/server/constants.js +76 -0
  102. package/dist/plugins/server/constants.js.map +1 -0
  103. package/dist/plugins/server/plugins/server/Cache.d.ts +2 -0
  104. package/dist/plugins/server/plugins/server/Cache.js +36 -0
  105. package/dist/plugins/server/plugins/server/Cache.js.map +1 -0
  106. package/dist/plugins/server/plugins/server/DownloadConnector.d.ts +29 -0
  107. package/dist/plugins/server/plugins/server/DownloadConnector.js +127 -0
  108. package/dist/plugins/server/plugins/server/DownloadConnector.js.map +1 -0
  109. package/dist/plugins/server/plugins/server/FtpConnector.d.ts +86 -0
  110. package/dist/plugins/server/plugins/server/FtpConnector.js +536 -0
  111. package/dist/plugins/server/plugins/server/FtpConnector.js.map +1 -0
  112. package/dist/plugins/server/plugins/server/GitlabConnector.d.ts +135 -0
  113. package/dist/plugins/server/plugins/server/GitlabConnector.js +649 -0
  114. package/dist/plugins/server/plugins/server/GitlabConnector.js.map +1 -0
  115. package/dist/plugins/server/plugins/server/GitlabHostingConnector.d.ts +16 -0
  116. package/dist/plugins/server/plugins/server/GitlabHostingConnector.js +209 -0
  117. package/dist/plugins/server/plugins/server/GitlabHostingConnector.js.map +1 -0
  118. package/dist/plugins/server/plugins/server/PublicationOptimizer.d.ts +0 -0
  119. package/dist/plugins/server/plugins/server/PublicationOptimizer.js +14 -0
  120. package/dist/plugins/server/plugins/server/PublicationOptimizer.js.map +1 -0
  121. package/dist/plugins/server/plugins/server/SslPlugin.d.ts +1 -0
  122. package/dist/plugins/server/plugins/server/SslPlugin.js +86 -0
  123. package/dist/plugins/server/plugins/server/SslPlugin.js.map +1 -0
  124. package/dist/plugins/server/plugins/server/StaticPlugin.d.ts +8 -0
  125. package/dist/plugins/server/plugins/server/StaticPlugin.js +45 -0
  126. package/dist/plugins/server/plugins/server/StaticPlugin.js.map +1 -0
  127. package/dist/plugins/server/server/config.d.ts +59 -0
  128. package/dist/plugins/server/server/config.js +181 -0
  129. package/dist/plugins/server/server/config.js.map +1 -0
  130. package/dist/plugins/server/server/connectors/FsHosting.d.ts +14 -0
  131. package/dist/plugins/server/server/connectors/FsHosting.js +66 -0
  132. package/dist/plugins/server/server/connectors/FsHosting.js.map +1 -0
  133. package/dist/plugins/server/server/connectors/FsStorage.d.ts +44 -0
  134. package/dist/plugins/server/server/connectors/FsStorage.js +261 -0
  135. package/dist/plugins/server/server/connectors/FsStorage.js.map +1 -0
  136. package/dist/plugins/server/server/connectors/connectors.d.ts +86 -0
  137. package/dist/plugins/server/server/connectors/connectors.js +126 -0
  138. package/dist/plugins/server/server/connectors/connectors.js.map +1 -0
  139. package/dist/plugins/server/server/events.d.ts +26 -0
  140. package/dist/plugins/server/server/events.js +31 -0
  141. package/dist/plugins/server/server/events.js.map +1 -0
  142. package/dist/plugins/server/server/jobs.d.ts +12 -0
  143. package/dist/plugins/server/server/jobs.js +79 -0
  144. package/dist/plugins/server/server/jobs.js.map +1 -0
  145. package/dist/plugins/server/server/utils/validation.d.ts +7 -0
  146. package/dist/plugins/server/server/utils/validation.js +37 -0
  147. package/dist/plugins/server/server/utils/validation.js.map +1 -0
  148. package/dist/plugins/server/types.d.ts +339 -0
  149. package/dist/plugins/server/types.js +84 -0
  150. package/dist/plugins/server/types.js.map +1 -0
  151. package/dist/server/constants.js +55 -0
  152. package/dist/server/plugins/server/Cache.js +19 -0
  153. package/dist/server/server/api/api.js +20 -0
  154. package/dist/server/server/api/connectorApi.js +334 -0
  155. package/dist/server/server/api/publicationApi.js +106 -0
  156. package/dist/server/server/api/websiteApi.js +315 -0
  157. package/dist/server/server/cli.js +71 -0
  158. package/dist/server/server/config.js +120 -0
  159. package/dist/server/server/connectors/FsHosting.js +47 -0
  160. package/dist/server/server/connectors/FsStorage.js +228 -0
  161. package/dist/server/server/connectors/connectors.js +88 -0
  162. package/dist/server/server/events.js +14 -0
  163. package/dist/server/server/expose.js +27 -0
  164. package/dist/server/server/express.js +46 -0
  165. package/dist/server/server/index.js +94 -0
  166. package/dist/server/server/jobs.js +50 -0
  167. package/dist/server/server/utils/validation.js +14 -0
  168. package/dist/server/types.js +40 -0
  169. package/package.json +99 -49
  170. package/public/assets/download.png +0 -0
  171. package/public/assets/favicon.ico +0 -0
  172. package/public/assets/favicon.png +0 -0
  173. package/public/assets/ftp.png +0 -0
  174. package/public/assets/gitlab.png +0 -0
  175. package/public/assets/gitlab2.png +0 -0
  176. package/public/assets/laptop.png +0 -0
  177. package/public/assets/logo-silex-small.png +0 -0
  178. package/public/silex.js +22 -23
  179. package/src/css/_variables.scss +24 -20
  180. package/src/css/dialog.scss +35 -2
  181. package/src/css/fonts.scss +31 -0
  182. package/src/css/footer.scss +12 -0
  183. package/src/css/grapesjs-light.scss +180 -0
  184. package/src/css/grapesjs-plugins.scss +227 -0
  185. package/src/css/grapesjs.scss +159 -1
  186. package/src/css/index.scss +12 -1
  187. package/src/css/light.scss +7 -0
  188. package/src/css/loader.scss +2 -0
  189. package/src/css/project-bar.scss +32 -16
  190. package/src/css/silex.scss +79 -5
  191. package/src/css/website-info.scss +14 -0
  192. package/src/html/index.pug +3 -3
  193. package/src/html/templates/includes.pug +0 -1
  194. package/src/ts/client/api.ts +156 -0
  195. package/src/ts/client/assetUrl.test.ts +164 -0
  196. package/src/ts/client/assetUrl.ts +254 -0
  197. package/src/ts/client/config.ts +175 -13
  198. package/src/ts/client/events.ts +43 -0
  199. package/src/ts/client/expose.ts +27 -1
  200. package/src/ts/client/grapesjs/LoginDialog.ts +204 -0
  201. package/src/ts/client/grapesjs/PublicationManager.ts +433 -0
  202. package/src/ts/client/grapesjs/PublicationUi.ts +366 -0
  203. package/src/ts/client/grapesjs/blocks.ts +17 -0
  204. package/src/ts/client/grapesjs/breadcrumbs.ts +79 -0
  205. package/src/ts/client/grapesjs/css-props.ts +910 -0
  206. package/src/ts/client/grapesjs/eleventy.ts +30 -7
  207. package/src/ts/client/grapesjs/footer.ts +42 -0
  208. package/src/ts/client/grapesjs/img.ts +147 -0
  209. package/src/ts/client/grapesjs/index.ts +311 -122
  210. package/src/ts/client/grapesjs/internal-links.test.ts +19 -1
  211. package/src/ts/client/grapesjs/internal-links.ts +31 -7
  212. package/src/ts/client/grapesjs/keymaps.ts +207 -0
  213. package/src/ts/client/grapesjs/new-page-dialog.ts +19 -3
  214. package/src/ts/client/grapesjs/openImport.ts +22 -0
  215. package/src/ts/client/grapesjs/page-panel.ts +109 -7
  216. package/src/ts/client/grapesjs/project-bar.ts +133 -72
  217. package/src/ts/client/grapesjs/resize-panel.ts +20 -0
  218. package/src/ts/client/grapesjs/rich-text.ts +38 -13
  219. package/src/ts/client/grapesjs/semantic.ts +20 -3
  220. package/src/ts/client/grapesjs/settings-sections.ts +117 -0
  221. package/src/ts/client/grapesjs/settings.ts +191 -96
  222. package/src/ts/client/grapesjs/storage.ts +187 -0
  223. package/src/ts/client/grapesjs/symbolDialogs.ts +21 -5
  224. package/src/ts/client/grapesjs/view-buttons.ts +42 -0
  225. package/src/ts/client/index.ts +80 -21
  226. package/src/ts/client/publication-transformers.test.ts +207 -0
  227. package/src/ts/client/publication-transformers.ts +280 -0
  228. package/src/ts/client/publish-custom-code-block.ts +31 -0
  229. package/src/ts/client/publish-fonts.ts +36 -0
  230. package/src/ts/client/utils.ts +70 -1
  231. package/src/ts/constants.ts +78 -0
  232. package/src/ts/externs.ts +17 -0
  233. package/src/ts/page.ts +20 -3
  234. package/src/ts/plugins/client/template.ts +246 -0
  235. package/src/ts/plugins/client/website-info.ts +84 -0
  236. package/src/ts/plugins/server/Cache.ts +32 -0
  237. package/src/ts/plugins/server/DownloadConnector.ts +146 -0
  238. package/src/ts/plugins/server/FtpConnector.test.ts +82 -0
  239. package/src/ts/plugins/server/FtpConnector.ts +621 -0
  240. package/src/ts/plugins/server/GitlabConnector.ts +749 -0
  241. package/src/ts/plugins/server/GitlabHostingConnector.ts +215 -0
  242. package/src/ts/plugins/server/PublicationOptimizer.ts +14 -0
  243. package/src/ts/plugins/server/SslPlugin.ts +84 -0
  244. package/src/ts/plugins/server/StaticPlugin.ts +45 -0
  245. package/src/ts/server/api/api.ts +19 -0
  246. package/src/ts/server/api/connectorApi.ts +464 -0
  247. package/src/ts/server/api/publicationApi.ts +159 -0
  248. package/src/ts/server/api/websiteApi.ts +462 -0
  249. package/src/ts/server/cli.ts +48 -14
  250. package/src/ts/server/config.ts +158 -60
  251. package/src/ts/server/connectors/FsHosting.ts +66 -0
  252. package/src/ts/server/connectors/FsStorage.test.ts +51 -0
  253. package/src/ts/server/connectors/FsStorage.ts +290 -0
  254. package/src/ts/server/connectors/connectors.ts +203 -0
  255. package/src/ts/server/events.ts +37 -0
  256. package/src/ts/server/expose.ts +19 -0
  257. package/src/ts/server/express.ts +57 -5
  258. package/src/ts/server/index.ts +79 -16
  259. package/src/ts/server/jobs.test.ts +75 -0
  260. package/src/ts/server/jobs.ts +89 -0
  261. package/src/ts/server/utils/BackwardCompat.ts +546 -528
  262. package/src/ts/server/utils/validation.ts +34 -0
  263. package/src/ts/types.ts +295 -85
  264. package/.dockerignore +0 -5
  265. package/.editorconfig +0 -14
  266. package/.eslintrc.json +0 -43
  267. package/.github/FUNDING.yml +0 -13
  268. package/.github/workflows/docker-hub-publish.yml +0 -36
  269. package/.github/workflows/npm-publish.yml +0 -19
  270. package/.github/workflows/test.yml +0 -26
  271. package/.nvmrc +0 -1
  272. package/.silex/default/.silex.data.json +0 -1
  273. package/CODE_OF_CONDUCT.md +0 -128
  274. package/CONTRIBUTING.md +0 -131
  275. package/Dockerfile +0 -15
  276. package/directus.silex.js +0 -7
  277. package/dist/constants.js +0 -4
  278. package/dist/events.js +0 -5
  279. package/dist/page.js +0 -15
  280. package/dist/server/cli.js +0 -43
  281. package/dist/server/config.js +0 -70
  282. package/dist/server/express.js +0 -18
  283. package/dist/server/index.js +0 -58
  284. package/dist/types.js +0 -34
  285. package/jest.config.js +0 -10
  286. package/logos/logo_by_ceubri/silex-icon-2018@200px.png +0 -0
  287. package/logos/logo_by_ceubri/silex-icon-2018@4x.png +0 -0
  288. package/logos/logo_by_ceubri/silex-logo-2018-white-transp.pdf +0 -0
  289. package/logos/logo_by_ceubri/silex-logo-2018-white.jpg +0 -0
  290. package/logos/logo_by_ceubri/silex-logo-2018-white.pdf +0 -0
  291. package/logos/logo_by_ceubri/silex-logo-2018-white.png +0 -0
  292. package/logos/logo_by_ceubri/silex-logo-2018-white@0.5x.png +0 -0
  293. package/logos/logo_by_ceubri/silex-logo-2018-white@0.75x.png +0 -0
  294. package/logos/logo_by_ceubri/silex-logo-2018-white@4x.jpg +0 -0
  295. package/logos/logo_by_ceubri/silex-logo-2018-white@4x.png +0 -0
  296. package/logos/logo_by_ceubri/silex-logo-2018.ai +5 -2521
  297. package/logos/logo_by_ceubri/silex-logo-2018.jpg +0 -0
  298. package/logos/logo_by_ceubri/silex-logo-2018.pdf +0 -0
  299. package/logos/logo_by_ceubri/silex-logo-2018.png +0 -0
  300. package/logos/logo_by_ceubri/silex-logo-2018@0.5x.png +0 -0
  301. package/logos/logo_by_ceubri/silex-logo-2018@0.75x.png +0 -0
  302. package/logos/logo_by_ceubri/silex-logo-2018@4x.jpg +0 -0
  303. package/logos/logo_by_ceubri/silex-logo-2018@4x.png +0 -0
  304. package/logos/silexlabs.png +0 -0
  305. package/src/example-client-config.js +0 -47
  306. package/src/plugins/AuthPlugin.js +0 -21
  307. package/src/plugins/Cache.js +0 -11
  308. package/src/plugins/DefaultBackend.js +0 -149
  309. package/src/plugins/ExpressPlugin.js +0 -39
  310. package/src/plugins/HooksPlugin.js +0 -58
  311. package/src/plugins/PublishPlugin.js +0 -69
  312. package/src/plugins/SslPlugin.js +0 -66
  313. package/src/plugins/StaticPlugin.js +0 -48
  314. package/src/plugins/WebsitePlugin.js +0 -207
  315. package/src/ts/client/grapesjs/publish.ts +0 -386
  316. package/src/ts/client/grapesjs/template.ts +0 -166
  317. package/src/ts/events.ts +0 -2
  318. package/tsconfig-server-debug.json +0 -19
  319. package/tsconfig-server-release.json +0 -19
  320. package/tsconfig.jest.json +0 -9
  321. package/tsconfig.json +0 -26
  322. package/webpack.config.js +0 -28
  323. package/webpack.debug.config.js +0 -8
package/README.md CHANGED
@@ -1,44 +1,24 @@
1
- [![status of silex.me instance](https://monitoshi.lexoyo.me/badge/1525963562293-6552)](https://editor.silex.me)
1
+ ## Silex core library
2
2
 
3
- ![Silex UI](https://github.com/silexlabs/www.silex.me/raw/gh-pages/assets/silex-ui.gif)
4
-
5
- Brought to you by [Alex Hoyau](https://www.patreon.com/lexoyo) and [Silex contributors](https://github.com/silexlabs/Silex/graphs/contributors).
6
-
7
- You can help make Silex sustainable by being part of the community, contributing documentation or making a financial contribution. [Let's chat - every little bit helps!](https://github.com/silexlabs/Silex/discussions)
8
-
9
- ## About Silex, live web creation.
10
-
11
- Silex is a no-code tool for building websites. It also lets you code when needed. It can be used online, offline or in a JAMStack project.
12
-
13
- Silex lets you create websites without coding, but it also has built-in editors for HTML, CSS, and JavaScript for when you need more control. It is used by freelancers and web studios to make real websites for real clients. Also Silex can generate templates or be integrated in a nodejs project, it has a plugin system and can integrate with headleass CMS and static site generators, it is part of the JSAMStack ecosystem since the v3.
3
+ This repository is the core library of Silex, it is a nodejs server which serves the Silex editor and the websites created with Silex. The core library is used in the online version of Silex, in the desktop app, and in the nodejs integration. It is available as a npx cli, as a docker image, and as a npm/nodejs library.
14
4
 
15
5
  Useful links
16
6
 
7
+ * [npm package for this repo](https://www.npmjs.com/package/@silexlabs/silex)
8
+ * [Docker image for this repo](https://hub.docker.com/r/silexlabs/silex)
17
9
  * [Official website](https://www.silex.me/)
18
- * [Road map (please help defining tasks and prioritising)](https://github.com/orgs/silexlabs/projects/1/views/7)
10
+ * [Road map (please help defining tasks and prioritising)](https://roadmap.silex.me)
19
11
  * [Bug report in Github issues](https://github.com/silexlabs/Silex/issues)
20
- * [Forums in Github discussions](https://github.com/silexlabs/Silex/discussions)
21
- * [Silex meta package with more source code](https://github.com/silexlabs/silex-meta)
22
-
23
- Here are the main features of Silex website builder:
24
-
25
- * Free and Open Source, open to contributions
26
- * Visual Editor: Silex offers a visual editor that allows users to create websites without needing to write code. It supports drag-and-drop functionality for easy website creation.
27
- * Online CSS Editor: Alongside the visual editor, Silex also provides an online CSS editor for more advanced customization.
28
- * Static HTML Websites: Silex is designed to create static HTML websites, which are fast, secure, and easy to host.
29
- * SEO Features: Silex includes SEO features to help improve the visibility of websites on search engines.
30
- * Editor UI: Silex offers features like fonts, visual CSS editor, publication...
31
- * Self-hosting Option: Users can choose to host their Silex website builder on their own server.
32
- * Community Support: Being an open-source project, Silex has a community of developers who contribute to its development and provide support.
33
- * Silex v3 > Silex is based on [GrapesJs](https://grapesjs.com/)
34
- * Silex v2 > Sync with Dropbox and FTP: Users can sync their Silex projects with Dropbox and FTP, allowing for easy access and management of files.
35
- * Silex v2 > Templates: Silex comes with a growing number of templates (both free and paid) that users can use as a starting point for their websites.
12
+ * [Forums in Github discussions](https://community.silex.me)
13
+ * [Silex meta package with more source code](https://github.com/silexlabs/Silex)
14
+
15
+ Help make Silex sustainable by being [part of the community](https://community.silex.me/), [contributing documentation](https://docs.silex.me/), [making a financial contribution](https://opencollective.com/silex), [report bugs](https://github.com/silexlabs/Silex/issues).
36
16
 
37
17
  ## Getting Started
38
18
 
39
19
  ### Online Version
40
20
 
41
- The easiest way to start using Silex is by using the online version provided by [Silex Labs foundation](https://www.silexlabs.org). Simply visit [editor.silex.me](https://editor.silex.me) and start building your website right away.
21
+ The easiest way to start using Silex is by using the online version provided by [Silex Labs foundation](https://www.silexlabs.org). Simply visit [v3.silex.me](https://v3.silex.me) and start building your website right away.
42
22
 
43
23
  ### Desktop App (beta)
44
24
 
@@ -48,13 +28,15 @@ There is a desktop application that you can install on your computer which may b
48
28
 
49
29
  You can also run Silex locally or on your server using `npx`, `npm`, or `Docker`.
50
30
 
31
+ Check the [developer docs](https://docs.silex.me/en/dev) for configuration options and integration with your js projects.
32
+
51
33
  #### Using npx
52
34
 
53
35
  ```bash
54
36
  npx @silexlabs/silex
55
37
  ```
56
38
 
57
- This command will run Silex with the entry point being `src/ts/server/cli.ts`.
39
+ This command will run Silex with default config.
58
40
 
59
41
  #### Using Docker
60
42
 
@@ -62,7 +44,7 @@ This command will run Silex with the entry point being `src/ts/server/cli.ts`.
62
44
  docker run -p 6805:6805 silexlabs/silex
63
45
  ```
64
46
 
65
- This command will run Silex in a Docker container with the entry point being `src/ts/server/index.ts`.
47
+ This command will run Silex in a Docker container.
66
48
 
67
49
  #### Using npm
68
50
 
@@ -72,11 +54,31 @@ First, install Silex as a dev dependency in your project:
72
54
  npm install --save-dev @silexlabs/silex
73
55
  ```
74
56
 
75
- Then, you can run Silex with the `silex` command. The entry point is `src/ts/server/cli.ts`.
57
+ Then, you can run Silex with the `silex` command in your `package.json` scripts:
58
+
59
+ ```json
60
+ {
61
+ "scripts": {
62
+ "start": "silex"
63
+ }
64
+ }
65
+ ```
76
66
 
77
67
  ## Configuration
78
68
 
79
- You can configure Silex using environment variables and command-line options. All available options can be found in `src/ts/server/cli.ts`.
69
+ You can configure Silex using environment variables and command-line options. All available options can be found in the [developer docs](https://docs.silex.me/en/dev) as well as in the code: [`src/ts/server/cli.ts`](./src/ts/server/cli.ts).
70
+
71
+ Check the example config files - which are the same as plugins in Silex, in the [`examples/`](./examples/) folder. To test these configs, start Silex locally like this:
72
+
73
+ ```sh
74
+ $ npx silex --client-config=./examples/client-config-transformers.js --server-config=`pwd`/examples/server-config-plugins.js
75
+ ```
76
+
77
+ Or like this:
78
+
79
+ ```sh
80
+ $ SILEX_CLIENT_CONFIG=./examples/client-config-transformers.js SILEX_SERVER_CONFIG=`pwd`/examples/server-config-plugins.js npm run start:debug
81
+ ```
80
82
 
81
83
  ## Contributing
82
84
 
@@ -88,7 +90,7 @@ Silex is free and open-source software licensed under the [GPL-3.0](LICENSE.md).
88
90
 
89
91
  ## Dependencies
90
92
 
91
- The upstream projects we use in Silex are all listed in [Silex meta package](https://github.com/silexlabs/silex-meta)
93
+ The upstream projects we use in Silex are all listed in [Silex meta package](https://github.com/silexlabs/Silex)
92
94
 
93
95
  ## Github stars history
94
96
 
@@ -0,0 +1,90 @@
1
+ import { ConnectorId, JobId, PublicationJobData, WebsiteId, ConnectorData, ConnectorType, WebsiteData, ClientSideFile, PublicationData, ConnectorUser, WebsiteMeta, WebsiteMetaFileContent, ConnectorOptions } from '../types';
2
+ export declare enum ApiRoute {
3
+ PUBLICATION_PUBLISH = "/api/publication/",
4
+ PUBLICATION_STATUS = "/api/publication/publication/status",
5
+ CONNECTOR_USER = "/api/connector/user",
6
+ CONNECTOR_LOGOUT = "/api/connector/logout",
7
+ CONNECTOR_LIST = "/api/connector/",
8
+ WEBSITE_READ = "/api/website/",
9
+ WEBSITE_WRITE = "/api/website/",
10
+ WEBSITE_DELETE = "/api/website/",
11
+ WEBSITE_DUPLICATE = "/api/website/duplicate",
12
+ WEBSITE_CREATE = "/api/website/",
13
+ WEBSITE_LIST = "/api/website/",
14
+ WEBSITE_ASSETS_READ = "/api/website/assets",
15
+ WEBSITE_ASSETS_WRITE = "/api/website/assets",
16
+ WEBSITE_META_READ = "/api/website/meta",
17
+ WEBSITE_META_WRITE = "/api/website/meta"
18
+ }
19
+ export declare function setServerUrl(url: string): void;
20
+ export declare function getServerUrl(): string;
21
+ export declare function getUser({ type, connectorId }: {
22
+ type: ConnectorType;
23
+ connectorId?: ConnectorId;
24
+ }): Promise<ConnectorUser>;
25
+ export declare function logout({ type, connectorId }: {
26
+ type: ConnectorType;
27
+ connectorId?: ConnectorId;
28
+ }): Promise<void>;
29
+ export declare function publish({ websiteId, hostingId, storageId, data, options }: {
30
+ websiteId: WebsiteId;
31
+ hostingId: ConnectorId;
32
+ storageId: ConnectorId;
33
+ data: PublicationData;
34
+ options: ConnectorOptions;
35
+ }): Promise<[url: string, job: PublicationJobData]>;
36
+ export declare function publicationStatus({ jobId }: {
37
+ jobId: JobId;
38
+ }): Promise<PublicationJobData>;
39
+ export declare function connectorList({ type }: {
40
+ type: ConnectorType;
41
+ }): Promise<ConnectorData[]>;
42
+ export declare function websiteList({ connectorId }: {
43
+ connectorId?: ConnectorId;
44
+ }): Promise<WebsiteMeta[]>;
45
+ export declare function websiteLoad({ websiteId, connectorId }: {
46
+ websiteId: WebsiteId;
47
+ connectorId?: ConnectorId;
48
+ }): Promise<WebsiteData>;
49
+ export declare function websiteSave({ websiteId, data, connectorId }: {
50
+ websiteId: WebsiteId;
51
+ data: WebsiteData;
52
+ connectorId?: ConnectorId;
53
+ }): Promise<void>;
54
+ export declare function websiteDelete({ websiteId, connectorId }: {
55
+ websiteId: WebsiteId;
56
+ connectorId?: ConnectorId;
57
+ }): Promise<void>;
58
+ export declare function websiteDuplicate({ websiteId, connectorId }: {
59
+ websiteId: WebsiteId;
60
+ connectorId?: ConnectorId;
61
+ }): Promise<void>;
62
+ export declare function websiteCreate({ websiteId, data, connectorId }: {
63
+ websiteId: WebsiteId;
64
+ data: WebsiteMetaFileContent;
65
+ connectorId?: ConnectorId;
66
+ }): Promise<void>;
67
+ export declare function websiteMetaWrite({ websiteId, data, connectorId }: {
68
+ websiteId: WebsiteId;
69
+ data: WebsiteMetaFileContent;
70
+ connectorId?: ConnectorId;
71
+ }): Promise<void>;
72
+ export declare function websiteMetaRead({ websiteId, connectorId }: {
73
+ websiteId: WebsiteId;
74
+ connectorId?: ConnectorId;
75
+ }): Promise<WebsiteMeta>;
76
+ export declare function websiteAssetsLoad({ path, websiteId, connectorId }: {
77
+ path: string;
78
+ websiteId: WebsiteId;
79
+ connectorId: ConnectorId;
80
+ }): Promise<string>;
81
+ /**
82
+ * Not used directly, grapesjs handles the upload
83
+ * @see assetManager in src/ts/client/grapesjs/index.ts
84
+ */
85
+ export declare function websiteAssetsSave({ websiteId, connectorId, files }: {
86
+ websiteId: WebsiteId;
87
+ connectorId: ConnectorId;
88
+ files: ClientSideFile[];
89
+ }): Promise<string[]>;
90
+ export declare function api<ReqQuery, ReqBody, ResBody>(route: ApiRoute | string, method: string, query?: ReqQuery, payload?: ReqBody): Promise<ResBody>;
@@ -0,0 +1,54 @@
1
+ import { Asset, ClientSideFileType, ConnectorId, Page, Style, WebsiteId } from '../types';
2
+ /**
3
+ * Function to convert a path from it stored version to the displayed version
4
+ * Stored version is like `/assets/image.webp`
5
+ * Grapesjs version is like `/api/website/assets/image.webp?websiteId=47868975&connectorId=gitlab`
6
+ * Exported for unit tests
7
+ */
8
+ export declare function storedToDisplayed(path: string, websiteId: WebsiteId, storageId: ConnectorId): string;
9
+ /**
10
+ * Function to convert a path from the one we give to grapesjs to the stored version
11
+ * Grapesjs version is like `/api/website/assets/image.webp?websiteId=47868975&connectorId=gitlab`
12
+ * Stored version is like `/assets/image.webp`
13
+ * @param path the path to convert
14
+ * @returns the converted path
15
+ * Exported for unit tests
16
+ */
17
+ export declare function displayedToStored(path: string): string;
18
+ /**
19
+ * Publication transformer to convert the asset URL during publication
20
+ */
21
+ export declare const assetsPublicationTransformer: {
22
+ transformPath(path: string, type: ClientSideFileType): string;
23
+ transformPermalink(path: string, type: ClientSideFileType): string;
24
+ };
25
+ /**
26
+ * Update asset URL to use the current storage connector and website ID
27
+ * Assets URLs are stored in the project data in the form `/assets/image.webp`
28
+ * This function adds the API path and the connectorId and websiteId like so: `/api/website/assets/image.webp?websiteId=47868975&connectorId=gitlab`
29
+ */
30
+ export declare function addTempDataToAssetUrl(assets: Asset[], websiteId: WebsiteId, storageId: ConnectorId): Asset[];
31
+ /**
32
+ * Remove the temporary data from the asset URL
33
+ * Remove the API path and the connectorId and websiteId like so: `/assets/image.webp`
34
+ */
35
+ export declare function removeTempDataFromAssetUrl(assets: Asset[]): Asset[];
36
+ /**
37
+ * Add temp data to pages
38
+ */
39
+ export declare function addTempDataToPages(pages: Page[], websiteId: WebsiteId, storageId: ConnectorId): Page[];
40
+ /**
41
+ * Remove temp data from asset URL in the components
42
+ */
43
+ export declare function removeTempDataFromPages(pages: Page[]): Page[];
44
+ /**
45
+ * Add data to stylesheets
46
+ * e.g. linear-gradient(to right, #1fb101 0%, #df1313 67%, rgba(234, 97, 97, 255) 78%, white 100%), url('/assets/qIg7JPRc.webp'), linear-gradient(#0ca311 0%, #0ca311 100%)
47
+ */
48
+ export declare function addTempDataToStyles(styles: Style[], websiteId: WebsiteId, storageId: ConnectorId): Style[];
49
+ /**
50
+ * Remove temp data from stylesheets
51
+ * The property `background-image` contains the URLs of the assets and other values,
52
+ * e.g. `linear-gradient(to right, #1fb101 0%, #df1313 67%, rgba(234, 97, 97, 255) 78%, white 100%), url('/api/website/assets/qIg7JPRc.webp?websiteId=default&connectorId=fs-storage'), linear-gradient(#0ca311 0%, #0ca311 100%)`
53
+ */
54
+ export declare function removeTempDataFromStyles(styles: Style[]): Style[];
@@ -0,0 +1,102 @@
1
+ import { Config } from '@silexlabs/silex-plugins';
2
+ import { ConnectorId, WebsiteId } from '../types';
3
+ import { Editor, EditorConfig } from 'grapesjs';
4
+ import { PublicationTransformer } from './publication-transformers';
5
+ import * as api from './api';
6
+ import { SettingsSection } from './grapesjs/settings-sections';
7
+ /**
8
+ * @fileoverview Silex client side config
9
+ */
10
+ export declare class ClientConfig extends Config {
11
+ api: typeof api;
12
+ /**
13
+ * The website to load
14
+ * This is the id of the website in the storage connector
15
+ */
16
+ websiteId: WebsiteId;
17
+ /**
18
+ * The storage connector to use
19
+ * If not found in the URL and the user is not logged in to any storage, use the first storage
20
+ */
21
+ storageId: ConnectorId;
22
+ /**
23
+ * language for I18n module
24
+ */
25
+ lang: string;
26
+ /**
27
+ * root url of Silex app
28
+ */
29
+ rootUrl: string;
30
+ /**
31
+ * debug mode
32
+ */
33
+ debug: boolean;
34
+ /**
35
+ * Add hash in the file name of CSS at the time of publication
36
+ * If true, CSS files of generated pages will look like `page-name.123456.css` instead of `page-name.css`
37
+ * This is useful to avoid caching issues
38
+ * @default true
39
+ */
40
+ addHashInCssFileName: boolean;
41
+ /**
42
+ * Replaced elements
43
+ * This is a list of elements which support the object-fit and object-position CSS properties
44
+ * https://developer.mozilla.org/en-US/docs/Web/CSS/Replaced_element
45
+ * When selected, Silex will show the object-fit and object-position properties in the style panel
46
+ */
47
+ replacedElements: string[];
48
+ /**
49
+ * Grapesjs config
50
+ */
51
+ grapesJsConfig: EditorConfig;
52
+ /**
53
+ * Client config url
54
+ * This is the url of the config file which is a plugin
55
+ */
56
+ clientConfigUrl: string;
57
+ /**
58
+ * Google fonts API key, see this doc to get an API key: https://developers.google.com/fonts/docs/developer_api#APIKey
59
+ * @default Test key for local dev
60
+ */
61
+ fontsApiKey: string;
62
+ /**
63
+ * Google fonts server or a free privacy-friendly drop-in replacement for Google Fonts or a proxy server to speed up the load and protect privacy
64
+ * @see https://github.com/coollabsio/fonts
65
+ * @see https://fontlay.com/
66
+ * @default Google Fonts
67
+ */
68
+ fontsServerUrl: string;
69
+ fontsApiUrl: string;
70
+ /**
71
+ * Init GrapesJS config which depend on the config file properties
72
+ */
73
+ initGrapesConfig(): void;
74
+ /**
75
+ * Get grapesjs editor
76
+ */
77
+ getEditor(): Editor;
78
+ /**
79
+ * Publication transformers let plugins change files before they are published
80
+ */
81
+ publicationTransformers: Array<PublicationTransformer>;
82
+ /**
83
+ * Reset publication transformers
84
+ */
85
+ resetPublicationTransformers(): void;
86
+ /**
87
+ * Add a publication transformer(s)
88
+ */
89
+ addPublicationTransformers(transformers: PublicationTransformer | PublicationTransformer[]): void;
90
+ /**
91
+ * Add a section to the settings dialog
92
+ */
93
+ addSettings(section: SettingsSection, siteOrPage: 'site' | 'page', position?: 'first' | 'last' | number): void;
94
+ /**
95
+ * Remove a section from the settings dialog
96
+ */
97
+ removeSettings(id: string, siteOrPage: 'site' | 'page'): void;
98
+ /**
99
+ * Add default plugins
100
+ */
101
+ addDefaultPlugins(): Promise<void>;
102
+ }
@@ -0,0 +1,23 @@
1
+ export declare enum ClientEvent {
2
+ STARTUP_START = "silex:startup:start",/* Loading is over and Silex is starting */
3
+ STARTUP_END = "silex:startup:end",/* Silex is ready to be used */
4
+ GRAPESJS_START = "silex:grapesjs:start",/* GrapesJS is about to be initialized, it is time to edit config.grapesJsConfig */
5
+ GRAPESJS_END = "silex:grapesjs:end",/* GrapesJS is ready to be used, `editor` is passed as an argument */
6
+ PUBLICATION_UI_OPEN = "silex:publication-ui:open",/* The publication UI is opened, you can access it with { publicationUi } */
7
+ PUBLICATION_UI_CLOSE = "silex:publication-ui:close",/* The publication UI is closed, you can access it with { publicationUi } */
8
+ PUBLISH_BEFORE = "silex:publish:before",/* Publication is about to start, you can read+write {projectData, siteSettings} */
9
+ PUBLISH_START = "silex:publish:start",/* Publication starts, you can read+write project data/settings, use publication manager/ui, prevent publication {projectData, siteSettings, publicationManager, prenventDefault} */
10
+ PUBLISH_PAGE = "silex:publish:page",/* Publication of a page, read+write settings and page data, use publication manager and prevent publication { siteSettings, pageSettings, page, publicationManager, preventDefault } */
11
+ PUBLISH_DATA = "silex:publish:data",/* Just before we send the published data to the server, read+write all publication data, check PublicationData type in types.ts { data, publicationManager } */
12
+ PUBLISH_END = "silex:publish:end",/* Publication is over, the argument is the publication result with {success: boolean, message: string} */
13
+ PUBLISH_ERROR = "silex:publish:error",/* Publication failed, the argument is the publication result with {success: boolean, message: string} */
14
+ PUBLISH_LOGIN_START = "silex:publish:login:start",/* The user is about to login before publication, you can read+write connector data and use publication manager and prevent publication {connector, publicationManager, preventDefault} */
15
+ PUBLISH_LOGIN_END = "silex:publish:login:end",
16
+ ASSET_WRITE_END = "silex:asset:write:end",
17
+ WRITE_END = "silex:write:end",
18
+ SETTINGS_OPEN = "silex:settings:open",/* The settings dialog is opened */
19
+ SETTINGS_CLOSE = "silex:settings:close",/* The settings dialog is closed */
20
+ SETTINGS_SAVE_START = "silex:settings:save:start",/* The settings dialog is closed and the settings are about to be saved */
21
+ SETTINGS_SAVE_END = "silex:settings:save:end",/* The settings dialog is closed and the settings are saved */
22
+ SETTINGS_SECTION_CHANGE = "silex:settings:section-change"
23
+ }
@@ -0,0 +1,8 @@
1
+ export * from './grapesjs/index';
2
+ export * from './config';
3
+ export * as constants from '../constants';
4
+ export * as utils from './utils';
5
+ export * as api from './api';
6
+ export * as events from './events';
7
+ export * as page from '../page';
8
+ export * as types from '../types';
@@ -0,0 +1,15 @@
1
+ import { Editor } from 'grapesjs';
2
+ import { ConnectorId, ConnectorType, ConnectorUser } from '../../types';
3
+ import { WebsiteId } from '../../types';
4
+ export declare const cmdLogin = "silex:auth:login";
5
+ export declare const cmdLogout = "silex:auth:logout";
6
+ export declare const eventLoggingIn = "silex:auth:logging-in";
7
+ export declare const eventLoggedIn = "silex:auth:logged-in";
8
+ export declare const eventLoginFailed = "silex:auth:login-failed";
9
+ export declare const eventLoggedOut = "silex:auth:logged-out";
10
+ export interface LoginDialogOptions {
11
+ id: WebsiteId;
12
+ }
13
+ export declare function getCurrentUser(editor: Editor): Promise<ConnectorUser>;
14
+ export declare function updateUser(editor: Editor, type: ConnectorType, connectorId?: ConnectorId): Promise<ConnectorUser>;
15
+ export default function loginDialogPlugin(editor: any, opts: any): void;
@@ -0,0 +1,73 @@
1
+ import { ConnectorData, PublicationData, PublicationJobData, PublicationSettings, WebsiteFile, 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
+ get settings(): PublicationSettings;
45
+ set settings(newSettings: PublicationSettings);
46
+ /**
47
+ * Plugin options
48
+ * This is the data which is passed to the plugin by grapesjs
49
+ */
50
+ options: PublicationManagerOptions;
51
+ /**
52
+ * Publication job during the publication process
53
+ */
54
+ job: PublicationJobData | null;
55
+ /**
56
+ * Publication state
57
+ * This is the state of the publication process
58
+ */
59
+ status: PublicationStatus;
60
+ constructor(editor: PublishableEditor, opts: PublicationManagerOptions);
61
+ goLogin(connector: ConnectorData): Promise<void>;
62
+ goLogout(): Promise<void>;
63
+ getPublicationData(projectData: any, siteSettings: any, preventDefault: () => void): Promise<PublicationData>;
64
+ /**
65
+ * Start the publication process
66
+ * This is the command "publish"
67
+ */
68
+ startPublication(): Promise<void>;
69
+ getHtmlFiles(siteSettings: WebsiteSettings, preventDefault: any): Promise<WebsiteFile[]>;
70
+ trackProgress(): Promise<void>;
71
+ private setPublicationTransformers;
72
+ private resetPublicationTransformers;
73
+ }
@@ -0,0 +1,59 @@
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 connector 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
+ * @TODO Use publication events instead of calls from the PublicationManager
12
+ */
13
+ export declare const cmdPublish = "publish-open-dialog";
14
+ export type PublicationDialogOptions = {
15
+ appendTo: string;
16
+ };
17
+ /**
18
+ * Class to manage the publication dialog
19
+ */
20
+ export declare class PublicationUi {
21
+ private editor;
22
+ private options;
23
+ /**
24
+ * Dialog state
25
+ */
26
+ isOpen: boolean;
27
+ /**
28
+ * Dialog content
29
+ */
30
+ private errorMessage;
31
+ /**
32
+ * Dialog element
33
+ * This is the DOM element of the dialog
34
+ */
35
+ private el;
36
+ settings: PublicationSettings;
37
+ private sender;
38
+ /**
39
+ * Initialize the dialog and the publish button
40
+ */
41
+ constructor(editor: PublishableEditor, options: PublicationDialogOptions);
42
+ isSuccess(status: PublicationStatus): status is PublicationStatus.STATUS_SUCCESS;
43
+ isPending(status: PublicationStatus): status is PublicationStatus.STATUS_PENDING;
44
+ isError(status: PublicationStatus): status is PublicationStatus.STATUS_ERROR;
45
+ isLoggedOut(status: PublicationStatus): status is PublicationStatus.STATUS_LOGGED_OUT;
46
+ isReady(status: PublicationStatus): status is PublicationStatus.STATUS_NONE;
47
+ userContent: TemplateResult | null;
48
+ setUserContent(content: TemplateResult): void;
49
+ createDialogElements(): HTMLElement;
50
+ move(rect: any): void;
51
+ private renderDialog;
52
+ renderOpenDialog(job: PublicationJobData, status: PublicationStatus): Promise<TemplateResult>;
53
+ renderLoginDialog(status: PublicationStatus): Promise<TemplateResult>;
54
+ displayPending(job: PublicationJobData, status: PublicationStatus): void;
55
+ displayError(message: string, job: PublicationJobData, status: PublicationStatus): void;
56
+ closeDialog(): Promise<void>;
57
+ toggleDialog(): Promise<void>;
58
+ openDialog(): Promise<void>;
59
+ }
@@ -0,0 +1 @@
1
+ export declare const blocksPlugin: (editor: any, opts: any) => void;
@@ -0,0 +1 @@
1
+ export default function (editor: any, options: any): void;
@@ -0,0 +1,6 @@
1
+ import { Editor } from 'grapesjs';
2
+ /**
3
+ * @fileoverview Adds various css properties
4
+ */
5
+ declare const _default: (editor: Editor, opts: any) => void;
6
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export default function (editor: any, options: any): void;
2
+ export declare function onFooter(fn: any): void;
@@ -0,0 +1,6 @@
1
+ import { Editor } from 'grapesjs';
2
+ /**
3
+ * @fileoverview This plugin adds CSS properties object-fit and object-position to the image component.
4
+ */
5
+ declare const _default: (editor: Editor, opts: any) => void;
6
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { Editor, EditorConfig } from 'grapesjs';
2
+ import { ClientConfig } from '../config';
3
+ export declare const cmdToggleLayers = "open-layers";
4
+ export declare const cmdToggleBlocks = "open-blocks";
5
+ export declare const cmdToggleSymbols = "open-symbols";
6
+ export declare const cmdToggleNotifications = "open-notifications";
7
+ export declare function getEditorConfig(config: ClientConfig): EditorConfig;
8
+ export declare function initEditor(config: EditorConfig): Promise<Editor>;
9
+ export declare function getEditor(): Editor;
@@ -0,0 +1 @@
1
+ export declare const internalLinksPlugin: (editor: any, opts: any) => void;