@silexlabs/silex 3.0.0-alpha.96 → 3.0.0

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 (206) hide show
  1. package/.env.default +2 -1
  2. package/README.md +31 -9
  3. package/dist/client/client/api.d.ts +5 -0
  4. package/dist/client/client/assetUrl.d.ts +3 -0
  5. package/dist/client/client/config.d.ts +31 -0
  6. package/dist/client/client/events.d.ts +7 -1
  7. package/dist/client/client/grapesjs/PublicationManager.d.ts +2 -1
  8. package/dist/client/client/grapesjs/css-props.d.ts +6 -0
  9. package/dist/client/client/grapesjs/img.d.ts +6 -0
  10. package/dist/client/client/grapesjs/index.d.ts +2 -2
  11. package/dist/client/client/grapesjs/new-page-dialog.d.ts +1 -1
  12. package/dist/client/client/grapesjs/page-panel.d.ts +1 -1
  13. package/dist/client/client/grapesjs/project-bar.d.ts +16 -0
  14. package/dist/client/client/grapesjs/resize-panel.d.ts +1 -0
  15. package/dist/client/client/grapesjs/rich-text.d.ts +4 -1
  16. package/dist/client/client/grapesjs/semantic.d.ts +1 -1
  17. package/dist/client/client/grapesjs/settings-sections.d.ts +15 -0
  18. package/dist/client/client/grapesjs/settings.d.ts +3 -1
  19. package/dist/client/client/grapesjs/symbolDialogs.d.ts +1 -1
  20. package/dist/client/client/grapesjs/view-buttons.d.ts +1 -0
  21. package/dist/client/client/index.d.ts +10 -0
  22. package/dist/client/client/publication-transformers.d.ts +4 -3
  23. package/dist/client/client/publish-custom-code-block.d.ts +4 -0
  24. package/dist/client/client/publish-fonts.d.ts +4 -0
  25. package/dist/client/client/utils.d.ts +4 -0
  26. package/dist/client/constants.d.ts +1 -0
  27. package/dist/client/css/admin.css +273 -32
  28. package/dist/client/index.html +2 -1
  29. package/dist/client/js/main.js +164 -123
  30. package/dist/client/js/main.js.LICENSE.txt +15 -1
  31. package/dist/client/types.d.ts +12 -7
  32. package/dist/plugins/client/client/events.d.ts +7 -1
  33. package/dist/plugins/client/client/events.js +7 -1
  34. package/dist/plugins/client/client/events.js.map +1 -1
  35. package/dist/plugins/client/plugins/client/template.js +108 -58
  36. package/dist/plugins/client/plugins/client/template.js.map +1 -1
  37. package/dist/plugins/client/types.d.ts +12 -7
  38. package/dist/plugins/client/types.js +6 -0
  39. package/dist/plugins/client/types.js.map +1 -1
  40. package/dist/plugins/server/constants.d.ts +1 -0
  41. package/dist/plugins/server/constants.js +2 -1
  42. package/dist/plugins/server/constants.js.map +1 -1
  43. package/dist/plugins/server/plugins/server/FtpConnector.d.ts +1 -0
  44. package/dist/plugins/server/plugins/server/FtpConnector.js +12 -1
  45. package/dist/plugins/server/plugins/server/FtpConnector.js.map +1 -1
  46. package/dist/plugins/server/plugins/server/GitlabConnector.d.ts +3 -0
  47. package/dist/plugins/server/plugins/server/GitlabConnector.js +72 -35
  48. package/dist/plugins/server/plugins/server/GitlabConnector.js.map +1 -1
  49. package/dist/plugins/server/server/config.js +3 -3
  50. package/dist/plugins/server/server/config.js.map +1 -1
  51. package/dist/plugins/server/server/connectors/FsHosting.d.ts +1 -0
  52. package/dist/plugins/server/server/connectors/FsHosting.js +13 -1
  53. package/dist/plugins/server/server/connectors/FsHosting.js.map +1 -1
  54. package/dist/plugins/server/server/connectors/FsStorage.d.ts +2 -1
  55. package/dist/plugins/server/server/connectors/FsStorage.js +29 -25
  56. package/dist/plugins/server/server/connectors/FsStorage.js.map +1 -1
  57. package/dist/plugins/server/server/connectors/connectors.d.ts +1 -0
  58. package/dist/plugins/server/server/jobs.js +4 -2
  59. package/dist/plugins/server/server/jobs.js.map +1 -1
  60. package/dist/plugins/server/types.d.ts +12 -7
  61. package/dist/plugins/server/types.js +7 -1
  62. package/dist/plugins/server/types.js.map +1 -1
  63. package/dist/server/constants.js +2 -1
  64. package/dist/server/server/api/publicationApi.js +3 -5
  65. package/dist/server/server/api/websiteApi.js +26 -7
  66. package/dist/server/server/cli.js +9 -6
  67. package/dist/server/server/config.js +3 -3
  68. package/dist/server/server/connectors/FsHosting.js +13 -1
  69. package/dist/server/server/connectors/FsStorage.js +28 -25
  70. package/dist/server/server/jobs.js +4 -2
  71. package/dist/server/types.js +7 -1
  72. package/package.json +35 -31
  73. package/public/assets/favicon.ico +0 -0
  74. package/public/assets/favicon.png +0 -0
  75. package/public/assets/logo-silex-small.png +0 -0
  76. package/src/css/_variables.scss +5 -3
  77. package/src/css/dialog.scss +22 -1
  78. package/src/css/fonts.scss +31 -0
  79. package/src/css/footer.scss +1 -1
  80. package/src/css/grapesjs-plugins.scss +34 -0
  81. package/src/css/grapesjs.scss +26 -11
  82. package/src/css/index.scss +1 -0
  83. package/src/css/project-bar.scss +11 -7
  84. package/src/css/silex.scss +58 -5
  85. package/src/html/index.pug +2 -2
  86. package/src/ts/client/api.ts +14 -9
  87. package/src/ts/client/assetUrl.test.ts +145 -42
  88. package/src/ts/client/assetUrl.ts +29 -10
  89. package/src/ts/client/config.ts +85 -4
  90. package/src/ts/client/events.ts +15 -9
  91. package/src/ts/client/grapesjs/PublicationManager.ts +71 -38
  92. package/src/ts/client/grapesjs/PublicationUi.ts +13 -11
  93. package/src/ts/client/grapesjs/css-props.ts +544 -0
  94. package/src/ts/client/grapesjs/eleventy.ts +2 -5
  95. package/src/ts/client/grapesjs/footer.ts +24 -9
  96. package/src/ts/client/grapesjs/img.ts +147 -0
  97. package/src/ts/client/grapesjs/index.ts +63 -25
  98. package/src/ts/client/grapesjs/internal-links.test.ts +2 -1
  99. package/src/ts/client/grapesjs/internal-links.ts +0 -1
  100. package/src/ts/client/grapesjs/new-page-dialog.ts +2 -3
  101. package/src/ts/client/grapesjs/page-panel.ts +28 -3
  102. package/src/ts/client/grapesjs/project-bar.ts +83 -64
  103. package/src/ts/client/grapesjs/resize-panel.ts +20 -0
  104. package/src/ts/client/grapesjs/rich-text.ts +21 -13
  105. package/src/ts/client/grapesjs/semantic.ts +3 -3
  106. package/src/ts/client/grapesjs/settings-sections.ts +117 -0
  107. package/src/ts/client/grapesjs/settings.ts +120 -77
  108. package/src/ts/client/grapesjs/symbolDialogs.ts +2 -3
  109. package/src/ts/client/grapesjs/view-buttons.ts +42 -0
  110. package/src/ts/client/index.ts +13 -6
  111. package/src/ts/client/publication-transformers.test.ts +13 -5
  112. package/src/ts/client/publication-transformers.ts +60 -47
  113. package/{dist/plugins/client/client/utils.js → src/ts/client/publish-custom-code-block.ts} +14 -8
  114. package/{dist/plugins/client/page.js → src/ts/client/publish-fonts.ts} +19 -14
  115. package/src/ts/client/utils.ts +18 -0
  116. package/src/ts/constants.ts +1 -0
  117. package/src/ts/plugins/client/template.ts +112 -60
  118. package/src/ts/plugins/server/FtpConnector.ts +14 -2
  119. package/src/ts/plugins/server/GitlabConnector.ts +71 -32
  120. package/src/ts/server/api/publicationApi.ts +5 -5
  121. package/src/ts/server/api/websiteApi.ts +51 -17
  122. package/src/ts/server/cli.ts +7 -5
  123. package/src/ts/server/config.ts +4 -4
  124. package/src/ts/server/connectors/FsHosting.ts +11 -5
  125. package/src/ts/server/connectors/FsStorage.ts +33 -4
  126. package/src/ts/server/connectors/connectors.ts +1 -1
  127. package/src/ts/server/jobs.ts +4 -2
  128. package/src/ts/types.ts +10 -7
  129. package/dist/plugins/client/client/api.d.ts +0 -85
  130. package/dist/plugins/client/client/api.js +0 -114
  131. package/dist/plugins/client/client/api.js.map +0 -1
  132. package/dist/plugins/client/client/assetUrl.d.ts +0 -51
  133. package/dist/plugins/client/client/assetUrl.js +0 -224
  134. package/dist/plugins/client/client/assetUrl.js.map +0 -1
  135. package/dist/plugins/client/client/config.d.ts +0 -58
  136. package/dist/plugins/client/client/config.js +0 -90
  137. package/dist/plugins/client/client/config.js.map +0 -1
  138. package/dist/plugins/client/client/grapesjs/LoginDialog.d.ts +0 -15
  139. package/dist/plugins/client/client/grapesjs/LoginDialog.js +0 -195
  140. package/dist/plugins/client/client/grapesjs/LoginDialog.js.map +0 -1
  141. package/dist/plugins/client/client/grapesjs/PublicationManager.d.ts +0 -72
  142. package/dist/plugins/client/client/grapesjs/PublicationManager.js +0 -356
  143. package/dist/plugins/client/client/grapesjs/PublicationManager.js.map +0 -1
  144. package/dist/plugins/client/client/grapesjs/PublicationUi.d.ts +0 -62
  145. package/dist/plugins/client/client/grapesjs/PublicationUi.js +0 -336
  146. package/dist/plugins/client/client/grapesjs/PublicationUi.js.map +0 -1
  147. package/dist/plugins/client/client/grapesjs/blocks.d.ts +0 -1
  148. package/dist/plugins/client/client/grapesjs/blocks.js +0 -37
  149. package/dist/plugins/client/client/grapesjs/blocks.js.map +0 -1
  150. package/dist/plugins/client/client/grapesjs/breadcrumbs.d.ts +0 -1
  151. package/dist/plugins/client/client/grapesjs/breadcrumbs.js +0 -75
  152. package/dist/plugins/client/client/grapesjs/breadcrumbs.js.map +0 -1
  153. package/dist/plugins/client/client/grapesjs/footer.d.ts +0 -2
  154. package/dist/plugins/client/client/grapesjs/footer.js +0 -28
  155. package/dist/plugins/client/client/grapesjs/footer.js.map +0 -1
  156. package/dist/plugins/client/client/grapesjs/index.d.ts +0 -5
  157. package/dist/plugins/client/client/grapesjs/index.js +0 -313
  158. package/dist/plugins/client/client/grapesjs/index.js.map +0 -1
  159. package/dist/plugins/client/client/grapesjs/internal-links.d.ts +0 -1
  160. package/dist/plugins/client/client/grapesjs/internal-links.js +0 -219
  161. package/dist/plugins/client/client/grapesjs/internal-links.js.map +0 -1
  162. package/dist/plugins/client/client/grapesjs/new-page-dialog.d.ts +0 -2
  163. package/dist/plugins/client/client/grapesjs/new-page-dialog.js +0 -83
  164. package/dist/plugins/client/client/grapesjs/new-page-dialog.js.map +0 -1
  165. package/dist/plugins/client/client/grapesjs/openImport.d.ts +0 -9
  166. package/dist/plugins/client/client/grapesjs/openImport.js +0 -74
  167. package/dist/plugins/client/client/grapesjs/openImport.js.map +0 -1
  168. package/dist/plugins/client/client/grapesjs/page-panel.d.ts +0 -3
  169. package/dist/plugins/client/client/grapesjs/page-panel.js +0 -113
  170. package/dist/plugins/client/client/grapesjs/page-panel.js.map +0 -1
  171. package/dist/plugins/client/client/grapesjs/project-bar.d.ts +0 -1
  172. package/dist/plugins/client/client/grapesjs/project-bar.js +0 -104
  173. package/dist/plugins/client/client/grapesjs/project-bar.js.map +0 -1
  174. package/dist/plugins/client/client/grapesjs/rich-text.d.ts +0 -1
  175. package/dist/plugins/client/client/grapesjs/rich-text.js +0 -31
  176. package/dist/plugins/client/client/grapesjs/rich-text.js.map +0 -1
  177. package/dist/plugins/client/client/grapesjs/semantic.d.ts +0 -1
  178. package/dist/plugins/client/client/grapesjs/semantic.js +0 -110
  179. package/dist/plugins/client/client/grapesjs/semantic.js.map +0 -1
  180. package/dist/plugins/client/client/grapesjs/settings.d.ts +0 -2
  181. package/dist/plugins/client/client/grapesjs/settings.js +0 -198
  182. package/dist/plugins/client/client/grapesjs/settings.js.map +0 -1
  183. package/dist/plugins/client/client/grapesjs/storage.d.ts +0 -1
  184. package/dist/plugins/client/client/grapesjs/storage.js +0 -126
  185. package/dist/plugins/client/client/grapesjs/storage.js.map +0 -1
  186. package/dist/plugins/client/client/grapesjs/symbolDialogs.d.ts +0 -3
  187. package/dist/plugins/client/client/grapesjs/symbolDialogs.js +0 -36
  188. package/dist/plugins/client/client/grapesjs/symbolDialogs.js.map +0 -1
  189. package/dist/plugins/client/client/publication-transformers.d.ts +0 -41
  190. package/dist/plugins/client/client/publication-transformers.js +0 -238
  191. package/dist/plugins/client/client/publication-transformers.js.map +0 -1
  192. package/dist/plugins/client/client/utils.d.ts +0 -2
  193. package/dist/plugins/client/client/utils.js.map +0 -1
  194. package/dist/plugins/client/constants.d.ts +0 -29
  195. package/dist/plugins/client/constants.js +0 -46
  196. package/dist/plugins/client/constants.js.map +0 -1
  197. package/dist/plugins/client/page.d.ts +0 -2
  198. package/dist/plugins/client/page.js.map +0 -1
  199. package/dist/plugins/client/plugins/client/11ty.d.ts +0 -17
  200. package/dist/plugins/client/plugins/client/11ty.js +0 -86
  201. package/dist/plugins/client/plugins/client/11ty.js.map +0 -1
  202. package/dist/plugins/client/plugins/client/publicationRenderer.d.ts +0 -2
  203. package/dist/plugins/client/plugins/client/publicationRenderer.js +0 -170
  204. package/dist/plugins/client/plugins/client/publicationRenderer.js.map +0 -1
  205. package/src/ts/plugins/client/11ty.ts +0 -104
  206. package/src/ts/plugins/client/publicationRenderer.ts +0 -174
package/.env.default CHANGED
@@ -8,7 +8,7 @@ SILEX_PORT=6805 # 6805 is the date of sexual revolution started in paris france
8
8
  SILEX_HOST=localhost
9
9
  SILEX_PROTOCOL=http
10
10
  SILEX_DEBUG=FALSE
11
- SILEX_CONFIG=
11
+ SILEX_SERVER_CONFIG=
12
12
  SILEX_SSL_PORT=
13
13
  SILEX_FORCE_HTTPS=
14
14
  SILEX_SSL_PRIVATE_KEY=
@@ -17,3 +17,4 @@ SILEX_FORCE_HTTPS_TRUST_XFP_HEADER=
17
17
  SILEX_CORS_URL=
18
18
  SILEX_CLIENT_CONFIG=
19
19
  SILEX_FS_ROOT=
20
+ SILEX_FS_HOSTING_ROOT=
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
- [![status of silex.me instance](https://monitoshi.lexoyo.me/badge/1525963562293-6552)](https://editor.silex.me)
1
+ [![status of silex.me instance](https://monitoshi.lexoyo.me/badge/1525963562293-6552)](https://v3.silex.me)
2
2
 
3
3
  ![Silex UI](https://github.com/silexlabs/www.silex.me/raw/gh-pages/assets/silex-ui.gif)
4
4
 
5
5
  Brought to you by [Alex Hoyau](https://www.patreon.com/lexoyo) and [Silex contributors](https://github.com/silexlabs/Silex/graphs/contributors).
6
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)
7
+ 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).
8
8
 
9
- ## About Silex, live web creation.
9
+ ## Silex
10
10
 
11
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
12
 
@@ -15,9 +15,9 @@ Silex lets you create websites without coding, but it also has built-in editors
15
15
  Useful links
16
16
 
17
17
  * [Official website](https://www.silex.me/)
18
- * [Road map (please help defining tasks and prioritising)](https://github.com/orgs/silexlabs/projects/1/views/7)
18
+ * [Road map (please help defining tasks and prioritising)](https://roadmap.silex.me)
19
19
  * [Bug report in Github issues](https://github.com/silexlabs/Silex/issues)
20
- * [Forums in Github discussions](https://github.com/silexlabs/Silex/discussions)
20
+ * [Forums in Github discussions](https://community.silex.me)
21
21
  * [Silex meta package with more source code](https://github.com/silexlabs/silex-meta)
22
22
 
23
23
  Here are the main features of Silex website builder:
@@ -48,13 +48,15 @@ There is a desktop application that you can install on your computer which may b
48
48
 
49
49
  You can also run Silex locally or on your server using `npx`, `npm`, or `Docker`.
50
50
 
51
+ Check the [developer docs](https://docs.silex.me/en/dev) for configuration options and integration with your js projects.
52
+
51
53
  #### Using npx
52
54
 
53
55
  ```bash
54
56
  npx @silexlabs/silex
55
57
  ```
56
58
 
57
- This command will run Silex with the entry point being `src/ts/server/cli.ts`.
59
+ This command will run Silex with default config.
58
60
 
59
61
  #### Using Docker
60
62
 
@@ -62,7 +64,7 @@ This command will run Silex with the entry point being `src/ts/server/cli.ts`.
62
64
  docker run -p 6805:6805 silexlabs/silex
63
65
  ```
64
66
 
65
- This command will run Silex in a Docker container with the entry point being `src/ts/server/index.ts`.
67
+ This command will run Silex in a Docker container.
66
68
 
67
69
  #### Using npm
68
70
 
@@ -72,11 +74,31 @@ First, install Silex as a dev dependency in your project:
72
74
  npm install --save-dev @silexlabs/silex
73
75
  ```
74
76
 
75
- Then, you can run Silex with the `silex` command. The entry point is `src/ts/server/cli.ts`.
77
+ Then, you can run Silex with the `silex` command in your `package.json` scripts:
78
+
79
+ ```json
80
+ {
81
+ "scripts": {
82
+ "start": "silex"
83
+ }
84
+ }
85
+ ```
76
86
 
77
87
  ## Configuration
78
88
 
79
- You can configure Silex using environment variables and command-line options. All available options can be found in `src/ts/server/cli.ts`.
89
+ 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).
90
+
91
+ 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:
92
+
93
+ ```sh
94
+ $ npx silex --client-config=./examples/client-config-transformers.js --server-config=`pwd`/examples/server-config-plugins.js
95
+ ```
96
+
97
+ Or like this:
98
+
99
+ ```sh
100
+ $ SILEX_CLIENT_CONFIG=./examples/client-config-transformers.js SILEX_SERVER_CONFIG=`pwd`/examples/server-config-plugins.js npm run start:debug
101
+ ```
80
102
 
81
103
  ## Contributing
82
104
 
@@ -8,6 +8,7 @@ export declare enum ApiRoute {
8
8
  WEBSITE_READ = "/api/website/",
9
9
  WEBSITE_WRITE = "/api/website/",
10
10
  WEBSITE_DELETE = "/api/website/",
11
+ WEBSITE_DUPLICATE = "/api/website/duplicate",
11
12
  WEBSITE_CREATE = "/api/website/",
12
13
  WEBSITE_LIST = "/api/website/",
13
14
  WEBSITE_ASSETS_READ = "/api/website/assets",
@@ -54,6 +55,10 @@ export declare function websiteDelete({ websiteId, connectorId }: {
54
55
  websiteId: WebsiteId;
55
56
  connectorId?: ConnectorId;
56
57
  }): Promise<void>;
58
+ export declare function websiteDuplicate({ websiteId, connectorId }: {
59
+ websiteId: WebsiteId;
60
+ connectorId?: ConnectorId;
61
+ }): Promise<void>;
57
62
  export declare function websiteCreate({ websiteId, data, connectorId }: {
58
63
  websiteId: WebsiteId;
59
64
  data: WebsiteMetaFileContent;
@@ -43,9 +43,12 @@ export declare function addTempDataToPages(pages: Page[], websiteId: WebsiteId,
43
43
  export declare function removeTempDataFromPages(pages: Page[]): Page[];
44
44
  /**
45
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%)
46
47
  */
47
48
  export declare function addTempDataToStyles(styles: Style[], websiteId: WebsiteId, storageId: ConnectorId): Style[];
48
49
  /**
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%)`
50
53
  */
51
54
  export declare function removeTempDataFromStyles(styles: Style[]): Style[];
@@ -3,6 +3,7 @@ import { ConnectorId, WebsiteId } from '../types';
3
3
  import { Editor, EditorConfig } from 'grapesjs';
4
4
  import { PublicationTransformer } from './publication-transformers';
5
5
  import * as api from './api';
6
+ import { SettingsSection } from './grapesjs/settings-sections';
6
7
  /**
7
8
  * @fileoverview Silex client side config
8
9
  */
@@ -30,6 +31,20 @@ export declare class ClientConfig extends Config {
30
31
  * debug mode
31
32
  */
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[];
33
48
  /**
34
49
  * Grapesjs config
35
50
  */
@@ -51,8 +66,24 @@ export declare class ClientConfig extends Config {
51
66
  * Publication transformers let plugins change files before they are published
52
67
  */
53
68
  publicationTransformers: Array<PublicationTransformer>;
69
+ /**
70
+ * Reset publication transformers
71
+ */
72
+ resetPublicationTransformers(): void;
54
73
  /**
55
74
  * Add a publication transformer(s)
56
75
  */
57
76
  addPublicationTransformers(transformers: PublicationTransformer | PublicationTransformer[]): void;
77
+ /**
78
+ * Add a section to the settings dialog
79
+ */
80
+ addSettings(section: SettingsSection, siteOrPage: 'site' | 'page', position?: 'first' | 'last' | number): void;
81
+ /**
82
+ * Remove a section from the settings dialog
83
+ */
84
+ removeSettings(id: string, siteOrPage: 'site' | 'page'): void;
85
+ /**
86
+ * Add default plugins
87
+ */
88
+ addDefaultPlugins(): Promise<void>;
58
89
  }
@@ -4,11 +4,17 @@ export declare enum ClientEvent {
4
4
  GRAPESJS_START = "silex:grapesjs:start",
5
5
  GRAPESJS_END = "silex:grapesjs:end",
6
6
  PUBLISH_START = "silex:publish:start",
7
+ PUBLISH_PAGE = "silex:publish:page",
7
8
  PUBLISH_DATA = "silex:publish:data",
8
9
  PUBLISH_END = "silex:publish:end",
9
10
  PUBLISH_ERROR = "silex:publish:error",
10
11
  PUBLISH_LOGIN_START = "silex:publish:login:start",
11
12
  PUBLISH_LOGIN_END = "silex:publish:login:end",
12
13
  ASSET_WRITE_END = "silex:asset:write:end",
13
- WRITE_END = "silex:write:end"
14
+ WRITE_END = "silex:write:end",
15
+ SETTINGS_OPEN = "silex:settings:open",
16
+ SETTINGS_CLOSE = "silex:settings:close",
17
+ SETTINGS_SAVE_START = "silex:settings:save:start",
18
+ SETTINGS_SAVE_END = "silex:settings:save:end",
19
+ SETTINGS_SECTION_CHANGE = "silex:settings:section-change"
14
20
  }
@@ -1,4 +1,4 @@
1
- import { ConnectorData, PublicationJobData, PublicationSettings, WebsiteFile, WebsiteId, WebsiteSettings } from '../../types';
1
+ import { ConnectorData, PublicationData, PublicationJobData, PublicationSettings, WebsiteFile, WebsiteId, WebsiteSettings } from '../../types';
2
2
  import { Editor } from 'grapesjs';
3
3
  import { PublicationUi } from './PublicationUi';
4
4
  /**
@@ -60,6 +60,7 @@ export declare class PublicationManager {
60
60
  constructor(editor: PublishableEditor, opts: PublicationManagerOptions);
61
61
  goLogin(connector: ConnectorData): Promise<unknown>;
62
62
  goLogout(): Promise<void>;
63
+ getPublicationData(projectData: any, siteSettings: any): Promise<PublicationData>;
63
64
  /**
64
65
  * Start the publication process
65
66
  * This is the command "publish"
@@ -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,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;
@@ -1,5 +1,5 @@
1
1
  import { Editor, EditorConfig } from 'grapesjs';
2
- import { ConnectorId, WebsiteId } from '../../types';
3
- export declare function getEditorConfig(id: WebsiteId, connectorId: ConnectorId, rootUrl: string): EditorConfig;
2
+ import { ClientConfig } from '../config';
3
+ export declare function getEditorConfig(config: ClientConfig): EditorConfig;
4
4
  export declare function initEditor(config: EditorConfig): Promise<Editor>;
5
5
  export declare function getEditor(): Editor;
@@ -1,2 +1,2 @@
1
1
  export declare const cmdOpenNewPageDialog = "new-page-dialog";
2
- export declare const newPageDialog: any;
2
+ export declare const newPageDialog: (editor: any, opts: any) => void;
@@ -1,3 +1,3 @@
1
1
  export declare const cmdTogglePages = "pages:open-panel";
2
2
  export declare const cmdAddPage = "pages:add";
3
- export declare const pagePanelPlugin: any;
3
+ export declare const pagePanelPlugin: (editor: any, opts: any) => void;
@@ -1 +1,17 @@
1
+ import { Editor } from 'grapesjs';
2
+ export interface PanelObject {
3
+ command: string | ((editor: Editor) => void);
4
+ text: string;
5
+ className: string;
6
+ attributes: {
7
+ title?: string;
8
+ containerClassName?: string;
9
+ };
10
+ buttons?: {
11
+ command: string;
12
+ text: string;
13
+ className: string;
14
+ }[];
15
+ }
1
16
  export declare const projectBarPlugin: (editor: any, opts: any) => void;
17
+ export declare function addButton(editor: Editor, panel: PanelObject): void;
@@ -0,0 +1 @@
1
+ export default function (editor: any): void;
@@ -1 +1,4 @@
1
- export declare const richTextPlugin: any;
1
+ import { RichTextEditorAction } from 'grapesjs';
2
+ export declare const orderedList: RichTextEditorAction;
3
+ export declare const unorderedList: RichTextEditorAction;
4
+ export declare const richTextPlugin: (editor: any, opts: any) => void;
@@ -1 +1 @@
1
- export declare const semanticPlugin: any;
1
+ export declare const semanticPlugin: (editor: any, opts: any) => void;
@@ -0,0 +1,15 @@
1
+ import { WebsiteSettings } from '../../types';
2
+ export declare const idCodeWrapper = "settings-head-wrapper";
3
+ export declare function isSite(model: any): boolean;
4
+ export interface SettingsSection {
5
+ id: string;
6
+ label: string;
7
+ render: (settings: WebsiteSettings, model: any) => any;
8
+ }
9
+ /**
10
+ * This is the settings dialog default sections
11
+ * Each section has an entry in the sidebar
12
+ * Each section render as part of the settings form
13
+ * The form is submitted to save the settings with all FormData
14
+ */
15
+ export declare const defaultSections: SettingsSection[];
@@ -1,2 +1,4 @@
1
1
  export declare const cmdOpenSettings = "open-settings";
2
- export declare const settingsDialog: any;
2
+ export declare const settingsDialog: (editor: any, opts: any) => void;
3
+ export declare function addSection(section: any, siteOrPage: 'site' | 'page', position: 'first' | 'last' | number): void;
4
+ export declare function removeSection(id: any, siteOrPage: 'site' | 'page'): void;
@@ -1,3 +1,3 @@
1
1
  export declare const cmdPromptAddSymbol = "symbol-prompt-add";
2
- declare const _default: any;
2
+ declare const _default: (editor: any, opts: any) => void;
3
3
  export default _default;
@@ -0,0 +1 @@
1
+ export default function (editor: any): void;
@@ -1,4 +1,14 @@
1
+ /**
2
+ * @fileoverview
3
+ * Defines the entry point of Silex client side application
4
+ *
5
+ */
6
+ import { ClientConfig } from './config';
1
7
  export * from './expose';
8
+ /**
9
+ * Expose the config object
10
+ */
11
+ export declare let config: ClientConfig;
2
12
  /**
3
13
  * Start Silex, called from host HTML page with window.silex.start()
4
14
  */
@@ -1,5 +1,5 @@
1
1
  import { Component, CssRule, Editor, ObjectStrings } from 'grapesjs';
2
- import { ClientSideFile, ClientSideFileType, PublicationData } from '../types';
2
+ import { ClientSideFile, ClientSideFileType, Initiator, PublicationData } from '../types';
3
3
  /**
4
4
  * Interface for publication transformers
5
5
  * They are added to the config object with config.addPublicationTransformer()
@@ -8,9 +8,10 @@ export interface PublicationTransformer {
8
8
  renderComponent?(component: Component, toHtml: () => string): string | undefined;
9
9
  renderCssRule?(rule: CssRule, initialRule: () => ObjectStrings): ObjectStrings | undefined;
10
10
  transformFile?(file: ClientSideFile): ClientSideFile;
11
- transformPermalink?(link: string, type: ClientSideFileType): string;
11
+ transformPermalink?(link: string, type: ClientSideFileType, initiator: Initiator): string;
12
12
  transformPath?(path: string, type: ClientSideFileType): string;
13
13
  }
14
+ export declare const publicationTransformerDefault: PublicationTransformer;
14
15
  export declare function validatePublicationTransformer(transformer: PublicationTransformer): void;
15
16
  /**
16
17
  * Alter the components rendering
@@ -35,7 +36,7 @@ export declare function transformFiles(editor: Editor, data: PublicationData): v
35
36
  * Transform files paths
36
37
  * Exported for unit tests
37
38
  */
38
- export declare function transformPermalink(editor: Editor, path: string, type: ClientSideFileType): string;
39
+ export declare function transformPermalink(editor: Editor, path: string, type: ClientSideFileType, initiator: Initiator): string;
39
40
  export declare function transformPath(editor: Editor, path: string, type: ClientSideFileType): string;
40
41
  export declare function resetRenderComponents(editor: Editor): void;
41
42
  export declare function resetRenderCssRules(editor: Editor): void;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @fileoverview Make sure custom script blocks include script tags when published
3
+ */
4
+ export default function (config: any): Promise<void>;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * @fileoverview Make sure custom script blocks include script tags when published
3
+ */
4
+ export default function (config: any): Promise<void>;
@@ -1,2 +1,6 @@
1
1
  import { Component, Editor } from 'grapesjs';
2
2
  export declare function onAll(editor: Editor, cbk: (c: Component) => void): void;
3
+ /**
4
+ * SHA256 hash a string
5
+ */
6
+ export declare function hashString(str: string): Promise<string>;
@@ -22,6 +22,7 @@ export declare const API_WEBSITE_READ = "/";
22
22
  export declare const API_WEBSITE_WRITE = "/";
23
23
  export declare const API_WEBSITE_CREATE = "/";
24
24
  export declare const API_WEBSITE_DELETE = "/";
25
+ export declare const API_WEBSITE_DUPLICATE = "/duplicate";
25
26
  export declare const API_WEBSITE_LIST = "/";
26
27
  export declare const API_WEBSITE_ASSET_READ = "/assets";
27
28
  export declare const API_WEBSITE_ASSETS_WRITE = "/assets";