@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.
- package/.env.default +19 -0
- package/.silex.js +37 -0
- package/LICENSE +661 -0
- package/README.md +96 -0
- package/dist/client/client/api.d.ts +85 -0
- package/dist/client/client/assetUrl.d.ts +51 -0
- package/dist/client/client/config.d.ts +58 -0
- package/dist/client/client/events.d.ts +14 -0
- package/dist/client/client/expose.d.ts +8 -0
- package/dist/client/client/grapesjs/LoginDialog.d.ts +15 -0
- package/dist/client/client/grapesjs/PublicationManager.d.ts +72 -0
- package/dist/client/client/grapesjs/PublicationUi.d.ts +62 -0
- package/dist/client/client/grapesjs/blocks.d.ts +1 -0
- package/dist/client/client/grapesjs/breadcrumbs.d.ts +1 -0
- package/dist/client/client/grapesjs/footer.d.ts +2 -0
- package/dist/client/client/grapesjs/index.d.ts +5 -0
- package/dist/client/client/grapesjs/internal-links.d.ts +1 -0
- package/dist/client/client/grapesjs/new-page-dialog.d.ts +2 -0
- package/dist/client/client/grapesjs/openImport.d.ts +9 -0
- package/dist/client/client/grapesjs/page-panel.d.ts +3 -0
- package/dist/client/client/grapesjs/project-bar.d.ts +1 -0
- package/dist/client/client/grapesjs/rich-text.d.ts +1 -0
- package/dist/client/client/grapesjs/semantic.d.ts +1 -0
- package/dist/client/client/grapesjs/settings.d.ts +2 -0
- package/dist/client/client/grapesjs/storage.d.ts +1 -0
- package/dist/client/client/grapesjs/symbolDialogs.d.ts +3 -0
- package/dist/client/client/index.d.ts +5 -0
- package/dist/client/client/publication-transformers.d.ts +41 -0
- package/dist/client/client/utils.d.ts +2 -0
- package/dist/client/constants.d.ts +29 -0
- package/dist/client/css/admin.css +4491 -0
- package/dist/client/index.html +9 -0
- package/dist/client/js/main.js +321 -0
- package/dist/client/js/main.js.LICENSE.txt +24 -0
- package/dist/client/page.d.ts +2 -0
- package/dist/client/types.d.ts +334 -0
- package/dist/plugins/client/client/api.d.ts +85 -0
- package/dist/plugins/client/client/api.js +114 -0
- package/dist/plugins/client/client/api.js.map +1 -0
- package/dist/plugins/client/client/assetUrl.d.ts +51 -0
- package/dist/plugins/client/client/assetUrl.js +224 -0
- package/dist/plugins/client/client/assetUrl.js.map +1 -0
- package/dist/plugins/client/client/config.d.ts +58 -0
- package/dist/plugins/client/client/config.js +90 -0
- package/dist/plugins/client/client/config.js.map +1 -0
- package/dist/plugins/client/client/events.d.ts +14 -0
- package/dist/plugins/client/client/events.js +34 -0
- package/dist/plugins/client/client/events.js.map +1 -0
- package/dist/plugins/client/client/grapesjs/LoginDialog.d.ts +15 -0
- package/dist/plugins/client/client/grapesjs/LoginDialog.js +195 -0
- package/dist/plugins/client/client/grapesjs/LoginDialog.js.map +1 -0
- package/dist/plugins/client/client/grapesjs/PublicationManager.d.ts +72 -0
- package/dist/plugins/client/client/grapesjs/PublicationManager.js +356 -0
- package/dist/plugins/client/client/grapesjs/PublicationManager.js.map +1 -0
- package/dist/plugins/client/client/grapesjs/PublicationUi.d.ts +62 -0
- package/dist/plugins/client/client/grapesjs/PublicationUi.js +336 -0
- package/dist/plugins/client/client/grapesjs/PublicationUi.js.map +1 -0
- package/dist/plugins/client/client/grapesjs/blocks.d.ts +1 -0
- package/dist/plugins/client/client/grapesjs/blocks.js +37 -0
- package/dist/plugins/client/client/grapesjs/blocks.js.map +1 -0
- package/dist/plugins/client/client/grapesjs/breadcrumbs.d.ts +1 -0
- package/dist/plugins/client/client/grapesjs/breadcrumbs.js +75 -0
- package/dist/plugins/client/client/grapesjs/breadcrumbs.js.map +1 -0
- package/dist/plugins/client/client/grapesjs/footer.d.ts +2 -0
- package/dist/plugins/client/client/grapesjs/footer.js +28 -0
- package/dist/plugins/client/client/grapesjs/footer.js.map +1 -0
- package/dist/plugins/client/client/grapesjs/index.d.ts +5 -0
- package/dist/plugins/client/client/grapesjs/index.js +313 -0
- package/dist/plugins/client/client/grapesjs/index.js.map +1 -0
- package/dist/plugins/client/client/grapesjs/internal-links.d.ts +1 -0
- package/dist/plugins/client/client/grapesjs/internal-links.js +219 -0
- package/dist/plugins/client/client/grapesjs/internal-links.js.map +1 -0
- package/dist/plugins/client/client/grapesjs/new-page-dialog.d.ts +2 -0
- package/dist/plugins/client/client/grapesjs/new-page-dialog.js +83 -0
- package/dist/plugins/client/client/grapesjs/new-page-dialog.js.map +1 -0
- package/dist/plugins/client/client/grapesjs/openImport.d.ts +9 -0
- package/dist/plugins/client/client/grapesjs/openImport.js +74 -0
- package/dist/plugins/client/client/grapesjs/openImport.js.map +1 -0
- package/dist/plugins/client/client/grapesjs/page-panel.d.ts +3 -0
- package/dist/plugins/client/client/grapesjs/page-panel.js +113 -0
- package/dist/plugins/client/client/grapesjs/page-panel.js.map +1 -0
- package/dist/plugins/client/client/grapesjs/project-bar.d.ts +1 -0
- package/dist/plugins/client/client/grapesjs/project-bar.js +104 -0
- package/dist/plugins/client/client/grapesjs/project-bar.js.map +1 -0
- package/dist/plugins/client/client/grapesjs/rich-text.d.ts +1 -0
- package/dist/plugins/client/client/grapesjs/rich-text.js +31 -0
- package/dist/plugins/client/client/grapesjs/rich-text.js.map +1 -0
- package/dist/plugins/client/client/grapesjs/semantic.d.ts +1 -0
- package/dist/plugins/client/client/grapesjs/semantic.js +110 -0
- package/dist/plugins/client/client/grapesjs/semantic.js.map +1 -0
- package/dist/plugins/client/client/grapesjs/settings.d.ts +2 -0
- package/dist/plugins/client/client/grapesjs/settings.js +198 -0
- package/dist/plugins/client/client/grapesjs/settings.js.map +1 -0
- package/dist/plugins/client/client/grapesjs/storage.d.ts +1 -0
- package/dist/plugins/client/client/grapesjs/storage.js +126 -0
- package/dist/plugins/client/client/grapesjs/storage.js.map +1 -0
- package/dist/plugins/client/client/grapesjs/symbolDialogs.d.ts +3 -0
- package/dist/plugins/client/client/grapesjs/symbolDialogs.js +36 -0
- package/dist/plugins/client/client/grapesjs/symbolDialogs.js.map +1 -0
- package/dist/plugins/client/client/publication-transformers.d.ts +41 -0
- package/dist/plugins/client/client/publication-transformers.js +238 -0
- package/dist/plugins/client/client/publication-transformers.js.map +1 -0
- package/dist/plugins/client/client/utils.d.ts +2 -0
- package/dist/plugins/client/client/utils.js +25 -0
- package/dist/plugins/client/client/utils.js.map +1 -0
- package/dist/plugins/client/constants.d.ts +29 -0
- package/dist/plugins/client/constants.js +46 -0
- package/dist/plugins/client/constants.js.map +1 -0
- package/dist/plugins/client/page.d.ts +2 -0
- package/dist/plugins/client/page.js +31 -0
- package/dist/plugins/client/page.js.map +1 -0
- package/dist/plugins/client/plugins/client/11ty.d.ts +17 -0
- package/dist/plugins/client/plugins/client/11ty.js +86 -0
- package/dist/plugins/client/plugins/client/11ty.js.map +1 -0
- package/dist/plugins/client/plugins/client/publicationRenderer.d.ts +2 -0
- package/dist/plugins/client/plugins/client/publicationRenderer.js +170 -0
- package/dist/plugins/client/plugins/client/publicationRenderer.js.map +1 -0
- package/dist/plugins/client/plugins/client/template.d.ts +2 -0
- package/dist/plugins/client/plugins/client/template.js +183 -0
- package/dist/plugins/client/plugins/client/template.js.map +1 -0
- package/dist/plugins/client/plugins/client/website-info.d.ts +1 -0
- package/dist/plugins/client/plugins/client/website-info.js +72 -0
- package/dist/plugins/client/plugins/client/website-info.js.map +1 -0
- package/dist/plugins/client/types.d.ts +334 -0
- package/dist/plugins/client/types.js +74 -0
- package/dist/plugins/client/types.js.map +1 -0
- package/dist/plugins/server/constants.d.ts +29 -0
- package/dist/plugins/server/constants.js +49 -0
- package/dist/plugins/server/constants.js.map +1 -0
- package/dist/plugins/server/plugins/server/AuthPlugin.d.ts +1 -0
- package/dist/plugins/server/plugins/server/AuthPlugin.js +40 -0
- package/dist/plugins/server/plugins/server/AuthPlugin.js.map +1 -0
- package/dist/plugins/server/plugins/server/Cache.d.ts +2 -0
- package/dist/plugins/server/plugins/server/Cache.js +32 -0
- package/dist/plugins/server/plugins/server/Cache.js.map +1 -0
- package/dist/plugins/server/plugins/server/DownloadConnector.d.ts +29 -0
- package/dist/plugins/server/plugins/server/DownloadConnector.js +129 -0
- package/dist/plugins/server/plugins/server/DownloadConnector.js.map +1 -0
- package/dist/plugins/server/plugins/server/FtpConnector.d.ts +86 -0
- package/dist/plugins/server/plugins/server/FtpConnector.js +526 -0
- package/dist/plugins/server/plugins/server/FtpConnector.js.map +1 -0
- package/dist/plugins/server/plugins/server/GitlabConnector.d.ts +87 -0
- package/dist/plugins/server/plugins/server/GitlabConnector.js +564 -0
- package/dist/plugins/server/plugins/server/GitlabConnector.js.map +1 -0
- package/dist/plugins/server/plugins/server/PublicationOptimizer.d.ts +0 -0
- package/dist/plugins/server/plugins/server/PublicationOptimizer.js +14 -0
- package/dist/plugins/server/plugins/server/PublicationOptimizer.js.map +1 -0
- package/dist/plugins/server/plugins/server/SslPlugin.d.ts +1 -0
- package/dist/plugins/server/plugins/server/SslPlugin.js +86 -0
- package/dist/plugins/server/plugins/server/SslPlugin.js.map +1 -0
- package/dist/plugins/server/plugins/server/StaticPlugin.d.ts +1 -0
- package/dist/plugins/server/plugins/server/StaticPlugin.js +78 -0
- package/dist/plugins/server/plugins/server/StaticPlugin.js.map +1 -0
- package/dist/plugins/server/server/config.d.ts +59 -0
- package/dist/plugins/server/server/config.js +181 -0
- package/dist/plugins/server/server/config.js.map +1 -0
- package/dist/plugins/server/server/connectors/FsHosting.d.ts +13 -0
- package/dist/plugins/server/server/connectors/FsHosting.js +54 -0
- package/dist/plugins/server/server/connectors/FsHosting.js.map +1 -0
- package/dist/plugins/server/server/connectors/FsStorage.d.ts +43 -0
- package/dist/plugins/server/server/connectors/FsStorage.js +257 -0
- package/dist/plugins/server/server/connectors/FsStorage.js.map +1 -0
- package/dist/plugins/server/server/connectors/connectors.d.ts +87 -0
- package/dist/plugins/server/server/connectors/connectors.js +127 -0
- package/dist/plugins/server/server/connectors/connectors.js.map +1 -0
- package/dist/plugins/server/server/events.d.ts +26 -0
- package/dist/plugins/server/server/events.js +31 -0
- package/dist/plugins/server/server/events.js.map +1 -0
- package/dist/plugins/server/server/jobs.d.ts +12 -0
- package/dist/plugins/server/server/jobs.js +77 -0
- package/dist/plugins/server/server/jobs.js.map +1 -0
- package/dist/plugins/server/server/utils/validation.d.ts +7 -0
- package/dist/plugins/server/server/utils/validation.js +38 -0
- package/dist/plugins/server/server/utils/validation.js.map +1 -0
- package/dist/plugins/server/types.d.ts +334 -0
- package/dist/plugins/server/types.js +78 -0
- package/dist/plugins/server/types.js.map +1 -0
- package/dist/server/constants.js +29 -0
- package/dist/server/plugins/server/Cache.js +15 -0
- package/dist/server/server/api/api.js +20 -0
- package/dist/server/server/api/connectorApi.js +216 -0
- package/dist/server/server/api/publicationApi.js +108 -0
- package/dist/server/server/api/websiteApi.js +296 -0
- package/dist/server/server/cli.js +68 -0
- package/dist/server/server/config.js +120 -0
- package/dist/server/server/connectors/FsHosting.js +35 -0
- package/dist/server/server/connectors/FsStorage.js +225 -0
- package/dist/server/server/connectors/connectors.js +89 -0
- package/dist/server/server/events.js +14 -0
- package/dist/server/server/expose.js +27 -0
- package/dist/server/server/express.js +47 -0
- package/dist/server/server/index.js +90 -0
- package/dist/server/server/jobs.js +48 -0
- package/dist/server/server/utils/validation.js +15 -0
- package/dist/server/types.js +34 -0
- package/package.json +209 -0
- package/public/assets/container.png +0 -0
- package/public/assets/favicon.png +0 -0
- package/public/assets/logo-silex-small.png +0 -0
- package/public/robots.txt +2 -0
- package/public/silex.js +24 -0
- package/src/css/_mixins.scss +8 -0
- package/src/css/_variables.scss +33 -0
- package/src/css/dialog.scss +41 -0
- package/src/css/footer.scss +12 -0
- package/src/css/grapesjs-light.scss +180 -0
- package/src/css/grapesjs.scss +152 -0
- package/src/css/index.scss +32 -0
- package/src/css/light.scss +7 -0
- package/src/css/loader.scss +12 -0
- package/src/css/page-panel.scss +65 -0
- package/src/css/project-bar.scss +102 -0
- package/src/css/silex.scss +189 -0
- package/src/css/website-info.scss +14 -0
- package/src/html/debug.pug +8 -0
- package/src/html/index.pug +39 -0
- package/src/html/templates/includes.pug +1 -0
- package/src/html/templates/workspace.pug +2 -0
- package/src/ts/client/api.ts +144 -0
- package/src/ts/client/assetUrl.test.ts +125 -0
- package/src/ts/client/assetUrl.ts +235 -0
- package/src/ts/client/config.ts +105 -0
- package/src/ts/client/events.ts +34 -0
- package/src/ts/client/expose.ts +30 -0
- package/src/ts/client/grapesjs/LoginDialog.ts +204 -0
- package/src/ts/client/grapesjs/PublicationManager.ts +370 -0
- package/src/ts/client/grapesjs/PublicationUi.ts +342 -0
- package/src/ts/client/grapesjs/blocks.ts +37 -0
- package/src/ts/client/grapesjs/breadcrumbs.ts +79 -0
- package/src/ts/client/grapesjs/eleventy.ts +47 -0
- package/src/ts/client/grapesjs/footer.ts +27 -0
- package/src/ts/client/grapesjs/index.ts +335 -0
- package/src/ts/client/grapesjs/internal-links.test.ts +105 -0
- package/src/ts/client/grapesjs/internal-links.ts +225 -0
- package/src/ts/client/grapesjs/new-page-dialog.ts +90 -0
- package/src/ts/client/grapesjs/openImport.ts +81 -0
- package/src/ts/client/grapesjs/page-panel.ts +118 -0
- package/src/ts/client/grapesjs/project-bar.ts +107 -0
- package/src/ts/client/grapesjs/rich-text.ts +33 -0
- package/src/ts/client/grapesjs/semantic.ts +114 -0
- package/src/ts/client/grapesjs/settings.ts +208 -0
- package/src/ts/client/grapesjs/storage.ts +121 -0
- package/src/ts/client/grapesjs/symbolDialogs.ts +38 -0
- package/src/ts/client/index.ts +98 -0
- package/src/ts/client/publication-transformers.test.ts +199 -0
- package/src/ts/client/publication-transformers.ts +263 -0
- package/src/ts/client/utils.ts +28 -0
- package/src/ts/constants.ts +52 -0
- package/src/ts/externs.ts +18 -0
- package/src/ts/page.ts +31 -0
- package/src/ts/plugins/client/11ty.ts +104 -0
- package/src/ts/plugins/client/publicationRenderer.ts +174 -0
- package/src/ts/plugins/client/template.ts +192 -0
- package/src/ts/plugins/client/website-info.ts +84 -0
- package/src/ts/plugins/server/AuthPlugin.ts +38 -0
- package/src/ts/plugins/server/Cache.ts +28 -0
- package/src/ts/plugins/server/DownloadConnector.ts +148 -0
- package/src/ts/plugins/server/FtpConnector.test.ts +82 -0
- package/src/ts/plugins/server/FtpConnector.ts +609 -0
- package/src/ts/plugins/server/GitlabConnector.ts +644 -0
- package/src/ts/plugins/server/PublicationOptimizer.ts +14 -0
- package/src/ts/plugins/server/SslPlugin.ts +84 -0
- package/src/ts/plugins/server/StaticPlugin.ts +79 -0
- package/src/ts/server/api/api.ts +19 -0
- package/src/ts/server/api/connectorApi.ts +345 -0
- package/src/ts/server/api/publicationApi.ts +159 -0
- package/src/ts/server/api/websiteApi.ts +432 -0
- package/src/ts/server/cli.ts +65 -0
- package/src/ts/server/config.ts +189 -0
- package/src/ts/server/connectors/FsHosting.ts +60 -0
- package/src/ts/server/connectors/FsStorage.test.ts +51 -0
- package/src/ts/server/connectors/FsStorage.ts +261 -0
- package/src/ts/server/connectors/connectors.ts +203 -0
- package/src/ts/server/events.ts +37 -0
- package/src/ts/server/expose.ts +19 -0
- package/src/ts/server/express.ts +70 -0
- package/src/ts/server/index.ts +100 -0
- package/src/ts/server/jobs.test.ts +75 -0
- package/src/ts/server/jobs.ts +87 -0
- package/src/ts/server/utils/BackwardCompat.ts +552 -0
- package/src/ts/server/utils/validation.ts +34 -0
- package/src/ts/types.ts +339 -0
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
[](https://editor.silex.me)
|
|
2
|
+
|
|
3
|
+

|
|
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.
|
|
14
|
+
|
|
15
|
+
Useful links
|
|
16
|
+
|
|
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)
|
|
19
|
+
* [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.
|
|
36
|
+
|
|
37
|
+
## Getting Started
|
|
38
|
+
|
|
39
|
+
### Online Version
|
|
40
|
+
|
|
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.
|
|
42
|
+
|
|
43
|
+
### Desktop App (beta)
|
|
44
|
+
|
|
45
|
+
There is a desktop application that you can install on your computer which may be faster since it uses your local files and it works offline. You can download the desktop app from the [Silex desktop repository](https://github.com/silexlabs/silex-desktop/releases/latest).
|
|
46
|
+
|
|
47
|
+
### Local or Server Installation
|
|
48
|
+
|
|
49
|
+
You can also run Silex locally or on your server using `npx`, `npm`, or `Docker`.
|
|
50
|
+
|
|
51
|
+
#### Using npx
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npx @silexlabs/silex
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
This command will run Silex with the entry point being `src/ts/server/cli.ts`.
|
|
58
|
+
|
|
59
|
+
#### Using Docker
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
docker run -p 6805:6805 silexlabs/silex
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
This command will run Silex in a Docker container with the entry point being `src/ts/server/index.ts`.
|
|
66
|
+
|
|
67
|
+
#### Using npm
|
|
68
|
+
|
|
69
|
+
First, install Silex as a dev dependency in your project:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npm install --save-dev @silexlabs/silex
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Then, you can run Silex with the `silex` command. The entry point is `src/ts/server/cli.ts`.
|
|
76
|
+
|
|
77
|
+
## Configuration
|
|
78
|
+
|
|
79
|
+
You can configure Silex using environment variables and command-line options. All available options can be found in `src/ts/server/cli.ts`.
|
|
80
|
+
|
|
81
|
+
## Contributing
|
|
82
|
+
|
|
83
|
+
Contributions are welcome! Please read our [contributing guidelines](CONTRIBUTING.md) for details on how to contribute to Silex.
|
|
84
|
+
|
|
85
|
+
## License
|
|
86
|
+
|
|
87
|
+
Silex is free and open-source software licensed under the [GPL-3.0](LICENSE.md).
|
|
88
|
+
|
|
89
|
+
## Dependencies
|
|
90
|
+
|
|
91
|
+
The upstream projects we use in Silex are all listed in [Silex meta package](https://github.com/silexlabs/silex-meta)
|
|
92
|
+
|
|
93
|
+
## Github stars history
|
|
94
|
+
|
|
95
|
+
[](https://star-history.com/#silexlabs/Silex&Timeline)
|
|
96
|
+
|
|
@@ -0,0 +1,85 @@
|
|
|
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_CREATE = "/api/website/",
|
|
12
|
+
WEBSITE_LIST = "/api/website/",
|
|
13
|
+
WEBSITE_ASSETS_READ = "/api/website/assets",
|
|
14
|
+
WEBSITE_ASSETS_WRITE = "/api/website/assets",
|
|
15
|
+
WEBSITE_META_READ = "/api/website/meta",
|
|
16
|
+
WEBSITE_META_WRITE = "/api/website/meta"
|
|
17
|
+
}
|
|
18
|
+
export declare function setServerUrl(url: string): void;
|
|
19
|
+
export declare function getServerUrl(): string;
|
|
20
|
+
export declare function getUser({ type, connectorId }: {
|
|
21
|
+
type: ConnectorType;
|
|
22
|
+
connectorId?: ConnectorId;
|
|
23
|
+
}): Promise<ConnectorUser>;
|
|
24
|
+
export declare function logout({ type, connectorId }: {
|
|
25
|
+
type: ConnectorType;
|
|
26
|
+
connectorId?: ConnectorId;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
export declare function publish({ websiteId, hostingId, storageId, data, options }: {
|
|
29
|
+
websiteId: WebsiteId;
|
|
30
|
+
hostingId: ConnectorId;
|
|
31
|
+
storageId: ConnectorId;
|
|
32
|
+
data: PublicationData;
|
|
33
|
+
options: ConnectorOptions;
|
|
34
|
+
}): Promise<[url: string, job: PublicationJobData]>;
|
|
35
|
+
export declare function publicationStatus({ jobId }: {
|
|
36
|
+
jobId: JobId;
|
|
37
|
+
}): Promise<PublicationJobData>;
|
|
38
|
+
export declare function connectorList({ type }: {
|
|
39
|
+
type: ConnectorType;
|
|
40
|
+
}): Promise<ConnectorData[]>;
|
|
41
|
+
export declare function websiteList({ connectorId }: {
|
|
42
|
+
connectorId?: ConnectorId;
|
|
43
|
+
}): Promise<WebsiteMeta[]>;
|
|
44
|
+
export declare function websiteLoad({ websiteId, connectorId }: {
|
|
45
|
+
websiteId: WebsiteId;
|
|
46
|
+
connectorId?: ConnectorId;
|
|
47
|
+
}): Promise<WebsiteData>;
|
|
48
|
+
export declare function websiteSave({ websiteId, data, connectorId }: {
|
|
49
|
+
websiteId: WebsiteId;
|
|
50
|
+
data: WebsiteData;
|
|
51
|
+
connectorId?: ConnectorId;
|
|
52
|
+
}): Promise<void>;
|
|
53
|
+
export declare function websiteDelete({ websiteId, connectorId }: {
|
|
54
|
+
websiteId: WebsiteId;
|
|
55
|
+
connectorId?: ConnectorId;
|
|
56
|
+
}): Promise<void>;
|
|
57
|
+
export declare function websiteCreate({ websiteId, data, connectorId }: {
|
|
58
|
+
websiteId: WebsiteId;
|
|
59
|
+
data: WebsiteMetaFileContent;
|
|
60
|
+
connectorId?: ConnectorId;
|
|
61
|
+
}): Promise<void>;
|
|
62
|
+
export declare function websiteMetaWrite({ websiteId, data, connectorId }: {
|
|
63
|
+
websiteId: WebsiteId;
|
|
64
|
+
data: WebsiteMetaFileContent;
|
|
65
|
+
connectorId?: ConnectorId;
|
|
66
|
+
}): Promise<void>;
|
|
67
|
+
export declare function websiteMetaRead({ websiteId, connectorId }: {
|
|
68
|
+
websiteId: WebsiteId;
|
|
69
|
+
connectorId?: ConnectorId;
|
|
70
|
+
}): Promise<WebsiteMeta>;
|
|
71
|
+
export declare function websiteAssetsLoad({ path, websiteId, connectorId }: {
|
|
72
|
+
path: string;
|
|
73
|
+
websiteId: WebsiteId;
|
|
74
|
+
connectorId: ConnectorId;
|
|
75
|
+
}): Promise<string>;
|
|
76
|
+
/**
|
|
77
|
+
* Not used directly, grapesjs handles the upload
|
|
78
|
+
* @see assetManager in src/ts/client/grapesjs/index.ts
|
|
79
|
+
*/
|
|
80
|
+
export declare function websiteAssetsSave({ websiteId, connectorId, files }: {
|
|
81
|
+
websiteId: WebsiteId;
|
|
82
|
+
connectorId: ConnectorId;
|
|
83
|
+
files: ClientSideFile[];
|
|
84
|
+
}): Promise<string[]>;
|
|
85
|
+
export declare function api<ReqQuery, ReqBody, ResBody>(route: ApiRoute | string, method: string, query?: ReqQuery, payload?: ReqBody): Promise<ResBody>;
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
*/
|
|
47
|
+
export declare function addTempDataToStyles(styles: Style[], websiteId: WebsiteId, storageId: ConnectorId): Style[];
|
|
48
|
+
/**
|
|
49
|
+
* Remove temp data from stylesheets
|
|
50
|
+
*/
|
|
51
|
+
export declare function removeTempDataFromStyles(styles: Style[]): Style[];
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
/**
|
|
7
|
+
* @fileoverview Silex client side config
|
|
8
|
+
*/
|
|
9
|
+
export declare class ClientConfig extends Config {
|
|
10
|
+
api: typeof api;
|
|
11
|
+
/**
|
|
12
|
+
* The website to load
|
|
13
|
+
* This is the id of the website in the storage connector
|
|
14
|
+
*/
|
|
15
|
+
websiteId: WebsiteId;
|
|
16
|
+
/**
|
|
17
|
+
* The storage connector to use
|
|
18
|
+
* If not found in the URL and the user is not logged in to any storage, use the first storage
|
|
19
|
+
*/
|
|
20
|
+
storageId: ConnectorId;
|
|
21
|
+
/**
|
|
22
|
+
* language for I18n module
|
|
23
|
+
*/
|
|
24
|
+
lang: string;
|
|
25
|
+
/**
|
|
26
|
+
* root url of Silex app
|
|
27
|
+
*/
|
|
28
|
+
rootUrl: string;
|
|
29
|
+
/**
|
|
30
|
+
* debug mode
|
|
31
|
+
*/
|
|
32
|
+
debug: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Grapesjs config
|
|
35
|
+
*/
|
|
36
|
+
grapesJsConfig: EditorConfig;
|
|
37
|
+
/**
|
|
38
|
+
* Client config url
|
|
39
|
+
* This is the url of the config file which is a plugin
|
|
40
|
+
*/
|
|
41
|
+
clientConfigUrl: string;
|
|
42
|
+
/**
|
|
43
|
+
* Init GrapesJS config which depend on the config file properties
|
|
44
|
+
*/
|
|
45
|
+
initGrapesConfig(): void;
|
|
46
|
+
/**
|
|
47
|
+
* Get grapesjs editor
|
|
48
|
+
*/
|
|
49
|
+
getEditor(): Editor;
|
|
50
|
+
/**
|
|
51
|
+
* Publication transformers let plugins change files before they are published
|
|
52
|
+
*/
|
|
53
|
+
publicationTransformers: Array<PublicationTransformer>;
|
|
54
|
+
/**
|
|
55
|
+
* Add a publication transformer(s)
|
|
56
|
+
*/
|
|
57
|
+
addPublicationTransformers(transformers: PublicationTransformer | PublicationTransformer[]): void;
|
|
58
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare enum ClientEvent {
|
|
2
|
+
STARTUP_START = "silex:startup:start",
|
|
3
|
+
STARTUP_END = "silex:startup:end",
|
|
4
|
+
GRAPESJS_START = "silex:grapesjs:start",
|
|
5
|
+
GRAPESJS_END = "silex:grapesjs:end",
|
|
6
|
+
PUBLISH_START = "silex:publish:start",
|
|
7
|
+
PUBLISH_DATA = "silex:publish:data",
|
|
8
|
+
PUBLISH_END = "silex:publish:end",
|
|
9
|
+
PUBLISH_ERROR = "silex:publish:error",
|
|
10
|
+
PUBLISH_LOGIN_START = "silex:publish:login:start",
|
|
11
|
+
PUBLISH_LOGIN_END = "silex:publish:login:end",
|
|
12
|
+
ASSET_WRITE_END = "silex:asset:write:end",
|
|
13
|
+
WRITE_END = "silex:write:end"
|
|
14
|
+
}
|
|
@@ -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,72 @@
|
|
|
1
|
+
import { ConnectorData, 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<unknown>;
|
|
62
|
+
goLogout(): Promise<void>;
|
|
63
|
+
/**
|
|
64
|
+
* Start the publication process
|
|
65
|
+
* This is the command "publish"
|
|
66
|
+
*/
|
|
67
|
+
startPublication(): Promise<void>;
|
|
68
|
+
getHtmlFiles(siteSettings: WebsiteSettings): Promise<WebsiteFile[]>;
|
|
69
|
+
trackProgress(): Promise<void>;
|
|
70
|
+
private setPublicationTransformers;
|
|
71
|
+
private resetPublicationTransformers;
|
|
72
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
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): boolean;
|
|
43
|
+
isPending(status: PublicationStatus): boolean;
|
|
44
|
+
isError(status: PublicationStatus): boolean;
|
|
45
|
+
isLoggedOut(status: PublicationStatus): boolean;
|
|
46
|
+
isReady(status: PublicationStatus): boolean;
|
|
47
|
+
getDialogElements(): {
|
|
48
|
+
el: HTMLElement;
|
|
49
|
+
primary: HTMLElement;
|
|
50
|
+
secondary: HTMLElement;
|
|
51
|
+
};
|
|
52
|
+
createDialogElements(): HTMLElement;
|
|
53
|
+
move(rect: any): void;
|
|
54
|
+
private renderDialog;
|
|
55
|
+
renderOpenDialog(job: PublicationJobData, status: PublicationStatus): Promise<TemplateResult>;
|
|
56
|
+
renderLoginDialog(status: PublicationStatus): Promise<TemplateResult>;
|
|
57
|
+
displayPending(job: PublicationJobData, status: PublicationStatus): void;
|
|
58
|
+
displayError(message: string, job: PublicationJobData, status: PublicationStatus): void;
|
|
59
|
+
closeDialog(): Promise<void>;
|
|
60
|
+
toggleDialog(): Promise<void>;
|
|
61
|
+
openDialog(): Promise<void>;
|
|
62
|
+
}
|
|
@@ -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,5 @@
|
|
|
1
|
+
import { Editor, EditorConfig } from 'grapesjs';
|
|
2
|
+
import { ConnectorId, WebsiteId } from '../../types';
|
|
3
|
+
export declare function getEditorConfig(id: WebsiteId, connectorId: ConnectorId, rootUrl: string): EditorConfig;
|
|
4
|
+
export declare function initEditor(config: EditorConfig): Promise<Editor>;
|
|
5
|
+
export declare function getEditor(): Editor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const internalLinksPlugin: (editor: any, opts: any) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const projectBarPlugin: (editor: any, opts: any) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const richTextPlugin: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const semanticPlugin: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const storagePlugin: (editor: any) => void;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Component, CssRule, Editor, ObjectStrings } from 'grapesjs';
|
|
2
|
+
import { ClientSideFile, ClientSideFileType, PublicationData } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Interface for publication transformers
|
|
5
|
+
* They are added to the config object with config.addPublicationTransformer()
|
|
6
|
+
*/
|
|
7
|
+
export interface PublicationTransformer {
|
|
8
|
+
renderComponent?(component: Component, toHtml: () => string): string | undefined;
|
|
9
|
+
renderCssRule?(rule: CssRule, initialRule: () => ObjectStrings): ObjectStrings | undefined;
|
|
10
|
+
transformFile?(file: ClientSideFile): ClientSideFile;
|
|
11
|
+
transformPermalink?(link: string, type: ClientSideFileType): string;
|
|
12
|
+
transformPath?(path: string, type: ClientSideFileType): string;
|
|
13
|
+
}
|
|
14
|
+
export declare function validatePublicationTransformer(transformer: PublicationTransformer): void;
|
|
15
|
+
/**
|
|
16
|
+
* Alter the components rendering
|
|
17
|
+
* Exported for unit tests
|
|
18
|
+
*/
|
|
19
|
+
export declare function renderComponents(editor: Editor): void;
|
|
20
|
+
/**
|
|
21
|
+
* Alter the styles rendering
|
|
22
|
+
* Exported for unit tests
|
|
23
|
+
*/
|
|
24
|
+
export declare function renderCssRules(editor: Editor): void;
|
|
25
|
+
/**
|
|
26
|
+
* Transform background image url according to the transformed path of assets
|
|
27
|
+
*/
|
|
28
|
+
export declare function transformBgImage(editor: Editor, style: ObjectStrings): ObjectStrings;
|
|
29
|
+
/**
|
|
30
|
+
* Transform files
|
|
31
|
+
* Exported for unit tests
|
|
32
|
+
*/
|
|
33
|
+
export declare function transformFiles(editor: Editor, data: PublicationData): void;
|
|
34
|
+
/**
|
|
35
|
+
* Transform files paths
|
|
36
|
+
* Exported for unit tests
|
|
37
|
+
*/
|
|
38
|
+
export declare function transformPermalink(editor: Editor, path: string, type: ClientSideFileType): string;
|
|
39
|
+
export declare function transformPath(editor: Editor, path: string, type: ClientSideFileType): string;
|
|
40
|
+
export declare function resetRenderComponents(editor: Editor): void;
|
|
41
|
+
export declare function resetRenderCssRules(editor: Editor): void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview define constants for Silex client and server
|
|
3
|
+
*/
|
|
4
|
+
export declare const WEBSITE_DATA_FILE = "website.json";
|
|
5
|
+
export declare const WEBSITE_META_DATA_FILE = "meta.json";
|
|
6
|
+
export declare const DEFAULT_WEBSITE_ID = "default";
|
|
7
|
+
export declare const DEFAULT_LANGUAGE = "en";
|
|
8
|
+
export declare const CLIENT_CONFIG_FILE_NAME = "silex.js";
|
|
9
|
+
export declare const API_PATH = "/api";
|
|
10
|
+
export declare const API_CONNECTOR_PATH = "/connector";
|
|
11
|
+
export declare const API_CONNECTOR_USER = "/user";
|
|
12
|
+
export declare const API_CONNECTOR_LIST = "/";
|
|
13
|
+
export declare const API_CONNECTOR_LOGOUT = "/logout";
|
|
14
|
+
export declare const API_CONNECTOR_LOGIN = "/login";
|
|
15
|
+
export declare const API_CONNECTOR_SETTINGS = "/settings";
|
|
16
|
+
export declare const API_CONNECTOR_LOGIN_CALLBACK = "/login/callback";
|
|
17
|
+
export declare const API_PUBLICATION_PATH = "/publication";
|
|
18
|
+
export declare const API_PUBLICATION_PUBLISH = "/";
|
|
19
|
+
export declare const API_PUBLICATION_STATUS = "/publication/status";
|
|
20
|
+
export declare const API_WEBSITE_PATH = "/website";
|
|
21
|
+
export declare const API_WEBSITE_READ = "/";
|
|
22
|
+
export declare const API_WEBSITE_WRITE = "/";
|
|
23
|
+
export declare const API_WEBSITE_CREATE = "/";
|
|
24
|
+
export declare const API_WEBSITE_DELETE = "/";
|
|
25
|
+
export declare const API_WEBSITE_LIST = "/";
|
|
26
|
+
export declare const API_WEBSITE_ASSET_READ = "/assets";
|
|
27
|
+
export declare const API_WEBSITE_ASSETS_WRITE = "/assets";
|
|
28
|
+
export declare const API_WEBSITE_META_READ = "/meta";
|
|
29
|
+
export declare const API_WEBSITE_META_WRITE = "/meta";
|