@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.
- package/.env.default +20 -0
- package/.silex.js +67 -8
- package/LICENSE +661 -203
- package/README.md +37 -35
- package/dist/client/client/api.d.ts +90 -0
- package/dist/client/client/assetUrl.d.ts +54 -0
- package/dist/client/client/config.d.ts +102 -0
- package/dist/client/client/events.d.ts +23 -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 +73 -0
- package/dist/client/client/grapesjs/PublicationUi.d.ts +59 -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/css-props.d.ts +6 -0
- package/dist/client/client/grapesjs/footer.d.ts +2 -0
- package/dist/client/client/grapesjs/img.d.ts +6 -0
- package/dist/client/client/grapesjs/index.d.ts +9 -0
- package/dist/client/client/grapesjs/internal-links.d.ts +1 -0
- package/dist/client/client/grapesjs/keymaps.d.ts +123 -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 +9 -0
- package/dist/client/client/grapesjs/project-bar.d.ts +21 -0
- package/dist/client/client/grapesjs/resize-panel.d.ts +1 -0
- package/dist/client/client/grapesjs/rich-text.d.ts +4 -0
- package/dist/client/client/grapesjs/semantic.d.ts +1 -0
- package/dist/client/client/grapesjs/settings-sections.d.ts +16 -0
- package/dist/client/client/grapesjs/settings.d.ts +4 -0
- package/dist/client/client/grapesjs/storage.d.ts +2 -0
- package/dist/client/client/grapesjs/symbolDialogs.d.ts +3 -0
- package/dist/client/client/grapesjs/view-buttons.d.ts +1 -0
- package/dist/client/client/index.d.ts +10 -0
- package/dist/client/client/publication-transformers.d.ts +42 -0
- package/dist/client/client/publish-custom-code-block.d.ts +4 -0
- package/dist/client/client/publish-fonts.d.ts +4 -0
- package/dist/client/client/utils.d.ts +22 -0
- package/dist/client/constants.d.ts +32 -0
- package/dist/client/css/admin.css +1114 -328
- package/dist/client/css/admin.css.map +1 -0
- package/dist/client/grapesjs-filter-styles/dist/index.d.ts +4 -0
- package/dist/client/grapesjs-fonts/dist/index.d.ts +4 -0
- package/dist/client/grapesjs-fonts/src/commands.d.ts +3 -0
- package/dist/client/grapesjs-fonts/src/fonts.d.ts +4 -0
- package/dist/client/grapesjs-storage-rate-limit/dist/index.d.ts +4 -0
- package/dist/client/grapesjs-ui-suggest-classes/dist/index.d.ts +4 -0
- package/dist/client/index.html +3 -2
- package/dist/client/js/main.js +356 -131
- package/dist/client/js/main.js.LICENSE.txt +15 -1
- package/dist/client/page.d.ts +2 -0
- package/dist/client/silex-lib/src/ts/client/api.d.ts +90 -0
- package/dist/client/silex-lib/src/ts/client/assetUrl.d.ts +54 -0
- package/dist/client/silex-lib/src/ts/client/config.d.ts +102 -0
- package/dist/client/silex-lib/src/ts/client/events.d.ts +23 -0
- package/dist/client/silex-lib/src/ts/client/expose.d.ts +8 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/LoginDialog.d.ts +15 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/PublicationManager.d.ts +73 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/PublicationUi.d.ts +59 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/blocks.d.ts +1 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/breadcrumbs.d.ts +1 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/css-props.d.ts +6 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/footer.d.ts +2 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/img.d.ts +6 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/index.d.ts +9 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/internal-links.d.ts +1 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/keymaps.d.ts +123 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/new-page-dialog.d.ts +2 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/openImport.d.ts +9 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/page-panel.d.ts +9 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/project-bar.d.ts +21 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/resize-panel.d.ts +1 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/rich-text.d.ts +4 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/semantic.d.ts +1 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/settings-sections.d.ts +16 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/settings.d.ts +4 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/storage.d.ts +2 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/symbolDialogs.d.ts +3 -0
- package/dist/client/silex-lib/src/ts/client/grapesjs/view-buttons.d.ts +1 -0
- package/dist/client/silex-lib/src/ts/client/index.d.ts +10 -0
- package/dist/client/silex-lib/src/ts/client/publication-transformers.d.ts +42 -0
- package/dist/client/silex-lib/src/ts/client/publish-custom-code-block.d.ts +4 -0
- package/dist/client/silex-lib/src/ts/client/publish-fonts.d.ts +4 -0
- package/dist/client/silex-lib/src/ts/client/utils.d.ts +22 -0
- package/dist/client/silex-lib/src/ts/constants.d.ts +32 -0
- package/dist/client/silex-lib/src/ts/page.d.ts +2 -0
- package/dist/client/silex-lib/src/ts/types.d.ts +339 -0
- package/dist/client/types.d.ts +339 -0
- package/dist/plugins/client/client/events.d.ts +23 -0
- package/dist/plugins/client/client/events.js +43 -0
- package/dist/plugins/client/client/events.js.map +1 -0
- package/dist/plugins/client/plugins/client/template.d.ts +2 -0
- package/dist/plugins/client/plugins/client/template.js +234 -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 +339 -0
- package/dist/plugins/client/types.js +80 -0
- package/dist/plugins/client/types.js.map +1 -0
- package/dist/plugins/server/constants.d.ts +32 -0
- package/dist/plugins/server/constants.js +76 -0
- package/dist/plugins/server/constants.js.map +1 -0
- package/dist/plugins/server/plugins/server/Cache.d.ts +2 -0
- package/dist/plugins/server/plugins/server/Cache.js +36 -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 +127 -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 +536 -0
- package/dist/plugins/server/plugins/server/FtpConnector.js.map +1 -0
- package/dist/plugins/server/plugins/server/GitlabConnector.d.ts +135 -0
- package/dist/plugins/server/plugins/server/GitlabConnector.js +649 -0
- package/dist/plugins/server/plugins/server/GitlabConnector.js.map +1 -0
- package/dist/plugins/server/plugins/server/GitlabHostingConnector.d.ts +16 -0
- package/dist/plugins/server/plugins/server/GitlabHostingConnector.js +209 -0
- package/dist/plugins/server/plugins/server/GitlabHostingConnector.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 +8 -0
- package/dist/plugins/server/plugins/server/StaticPlugin.js +45 -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 +14 -0
- package/dist/plugins/server/server/connectors/FsHosting.js +66 -0
- package/dist/plugins/server/server/connectors/FsHosting.js.map +1 -0
- package/dist/plugins/server/server/connectors/FsStorage.d.ts +44 -0
- package/dist/plugins/server/server/connectors/FsStorage.js +261 -0
- package/dist/plugins/server/server/connectors/FsStorage.js.map +1 -0
- package/dist/plugins/server/server/connectors/connectors.d.ts +86 -0
- package/dist/plugins/server/server/connectors/connectors.js +126 -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 +79 -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 +37 -0
- package/dist/plugins/server/server/utils/validation.js.map +1 -0
- package/dist/plugins/server/types.d.ts +339 -0
- package/dist/plugins/server/types.js +84 -0
- package/dist/plugins/server/types.js.map +1 -0
- package/dist/server/constants.js +55 -0
- package/dist/server/plugins/server/Cache.js +19 -0
- package/dist/server/server/api/api.js +20 -0
- package/dist/server/server/api/connectorApi.js +334 -0
- package/dist/server/server/api/publicationApi.js +106 -0
- package/dist/server/server/api/websiteApi.js +315 -0
- package/dist/server/server/cli.js +71 -0
- package/dist/server/server/config.js +120 -0
- package/dist/server/server/connectors/FsHosting.js +47 -0
- package/dist/server/server/connectors/FsStorage.js +228 -0
- package/dist/server/server/connectors/connectors.js +88 -0
- package/dist/server/server/events.js +14 -0
- package/dist/server/server/expose.js +27 -0
- package/dist/server/server/express.js +46 -0
- package/dist/server/server/index.js +94 -0
- package/dist/server/server/jobs.js +50 -0
- package/dist/server/server/utils/validation.js +14 -0
- package/dist/server/types.js +40 -0
- package/package.json +99 -49
- package/public/assets/download.png +0 -0
- package/public/assets/favicon.ico +0 -0
- package/public/assets/favicon.png +0 -0
- package/public/assets/ftp.png +0 -0
- package/public/assets/gitlab.png +0 -0
- package/public/assets/gitlab2.png +0 -0
- package/public/assets/laptop.png +0 -0
- package/public/assets/logo-silex-small.png +0 -0
- package/public/silex.js +22 -23
- package/src/css/_variables.scss +24 -20
- package/src/css/dialog.scss +35 -2
- package/src/css/fonts.scss +31 -0
- package/src/css/footer.scss +12 -0
- package/src/css/grapesjs-light.scss +180 -0
- package/src/css/grapesjs-plugins.scss +227 -0
- package/src/css/grapesjs.scss +159 -1
- package/src/css/index.scss +12 -1
- package/src/css/light.scss +7 -0
- package/src/css/loader.scss +2 -0
- package/src/css/project-bar.scss +32 -16
- package/src/css/silex.scss +79 -5
- package/src/css/website-info.scss +14 -0
- package/src/html/index.pug +3 -3
- package/src/html/templates/includes.pug +0 -1
- package/src/ts/client/api.ts +156 -0
- package/src/ts/client/assetUrl.test.ts +164 -0
- package/src/ts/client/assetUrl.ts +254 -0
- package/src/ts/client/config.ts +175 -13
- package/src/ts/client/events.ts +43 -0
- package/src/ts/client/expose.ts +27 -1
- package/src/ts/client/grapesjs/LoginDialog.ts +204 -0
- package/src/ts/client/grapesjs/PublicationManager.ts +433 -0
- package/src/ts/client/grapesjs/PublicationUi.ts +366 -0
- package/src/ts/client/grapesjs/blocks.ts +17 -0
- package/src/ts/client/grapesjs/breadcrumbs.ts +79 -0
- package/src/ts/client/grapesjs/css-props.ts +910 -0
- package/src/ts/client/grapesjs/eleventy.ts +30 -7
- package/src/ts/client/grapesjs/footer.ts +42 -0
- package/src/ts/client/grapesjs/img.ts +147 -0
- package/src/ts/client/grapesjs/index.ts +311 -122
- package/src/ts/client/grapesjs/internal-links.test.ts +19 -1
- package/src/ts/client/grapesjs/internal-links.ts +31 -7
- package/src/ts/client/grapesjs/keymaps.ts +207 -0
- package/src/ts/client/grapesjs/new-page-dialog.ts +19 -3
- package/src/ts/client/grapesjs/openImport.ts +22 -0
- package/src/ts/client/grapesjs/page-panel.ts +109 -7
- package/src/ts/client/grapesjs/project-bar.ts +133 -72
- package/src/ts/client/grapesjs/resize-panel.ts +20 -0
- package/src/ts/client/grapesjs/rich-text.ts +38 -13
- package/src/ts/client/grapesjs/semantic.ts +20 -3
- package/src/ts/client/grapesjs/settings-sections.ts +117 -0
- package/src/ts/client/grapesjs/settings.ts +191 -96
- package/src/ts/client/grapesjs/storage.ts +187 -0
- package/src/ts/client/grapesjs/symbolDialogs.ts +21 -5
- package/src/ts/client/grapesjs/view-buttons.ts +42 -0
- package/src/ts/client/index.ts +80 -21
- package/src/ts/client/publication-transformers.test.ts +207 -0
- package/src/ts/client/publication-transformers.ts +280 -0
- package/src/ts/client/publish-custom-code-block.ts +31 -0
- package/src/ts/client/publish-fonts.ts +36 -0
- package/src/ts/client/utils.ts +70 -1
- package/src/ts/constants.ts +78 -0
- package/src/ts/externs.ts +17 -0
- package/src/ts/page.ts +20 -3
- package/src/ts/plugins/client/template.ts +246 -0
- package/src/ts/plugins/client/website-info.ts +84 -0
- package/src/ts/plugins/server/Cache.ts +32 -0
- package/src/ts/plugins/server/DownloadConnector.ts +146 -0
- package/src/ts/plugins/server/FtpConnector.test.ts +82 -0
- package/src/ts/plugins/server/FtpConnector.ts +621 -0
- package/src/ts/plugins/server/GitlabConnector.ts +749 -0
- package/src/ts/plugins/server/GitlabHostingConnector.ts +215 -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 +45 -0
- package/src/ts/server/api/api.ts +19 -0
- package/src/ts/server/api/connectorApi.ts +464 -0
- package/src/ts/server/api/publicationApi.ts +159 -0
- package/src/ts/server/api/websiteApi.ts +462 -0
- package/src/ts/server/cli.ts +48 -14
- package/src/ts/server/config.ts +158 -60
- package/src/ts/server/connectors/FsHosting.ts +66 -0
- package/src/ts/server/connectors/FsStorage.test.ts +51 -0
- package/src/ts/server/connectors/FsStorage.ts +290 -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 +57 -5
- package/src/ts/server/index.ts +79 -16
- package/src/ts/server/jobs.test.ts +75 -0
- package/src/ts/server/jobs.ts +89 -0
- package/src/ts/server/utils/BackwardCompat.ts +546 -528
- package/src/ts/server/utils/validation.ts +34 -0
- package/src/ts/types.ts +295 -85
- package/.dockerignore +0 -5
- package/.editorconfig +0 -14
- package/.eslintrc.json +0 -43
- package/.github/FUNDING.yml +0 -13
- package/.github/workflows/docker-hub-publish.yml +0 -36
- package/.github/workflows/npm-publish.yml +0 -19
- package/.github/workflows/test.yml +0 -26
- package/.nvmrc +0 -1
- package/.silex/default/.silex.data.json +0 -1
- package/CODE_OF_CONDUCT.md +0 -128
- package/CONTRIBUTING.md +0 -131
- package/Dockerfile +0 -15
- package/directus.silex.js +0 -7
- package/dist/constants.js +0 -4
- package/dist/events.js +0 -5
- package/dist/page.js +0 -15
- package/dist/server/cli.js +0 -43
- package/dist/server/config.js +0 -70
- package/dist/server/express.js +0 -18
- package/dist/server/index.js +0 -58
- package/dist/types.js +0 -34
- package/jest.config.js +0 -10
- package/logos/logo_by_ceubri/silex-icon-2018@200px.png +0 -0
- package/logos/logo_by_ceubri/silex-icon-2018@4x.png +0 -0
- package/logos/logo_by_ceubri/silex-logo-2018-white-transp.pdf +0 -0
- package/logos/logo_by_ceubri/silex-logo-2018-white.jpg +0 -0
- package/logos/logo_by_ceubri/silex-logo-2018-white.pdf +0 -0
- package/logos/logo_by_ceubri/silex-logo-2018-white.png +0 -0
- package/logos/logo_by_ceubri/silex-logo-2018-white@0.5x.png +0 -0
- package/logos/logo_by_ceubri/silex-logo-2018-white@0.75x.png +0 -0
- package/logos/logo_by_ceubri/silex-logo-2018-white@4x.jpg +0 -0
- package/logos/logo_by_ceubri/silex-logo-2018-white@4x.png +0 -0
- package/logos/logo_by_ceubri/silex-logo-2018.ai +5 -2521
- package/logos/logo_by_ceubri/silex-logo-2018.jpg +0 -0
- package/logos/logo_by_ceubri/silex-logo-2018.pdf +0 -0
- package/logos/logo_by_ceubri/silex-logo-2018.png +0 -0
- package/logos/logo_by_ceubri/silex-logo-2018@0.5x.png +0 -0
- package/logos/logo_by_ceubri/silex-logo-2018@0.75x.png +0 -0
- package/logos/logo_by_ceubri/silex-logo-2018@4x.jpg +0 -0
- package/logos/logo_by_ceubri/silex-logo-2018@4x.png +0 -0
- package/logos/silexlabs.png +0 -0
- package/src/example-client-config.js +0 -47
- package/src/plugins/AuthPlugin.js +0 -21
- package/src/plugins/Cache.js +0 -11
- package/src/plugins/DefaultBackend.js +0 -149
- package/src/plugins/ExpressPlugin.js +0 -39
- package/src/plugins/HooksPlugin.js +0 -58
- package/src/plugins/PublishPlugin.js +0 -69
- package/src/plugins/SslPlugin.js +0 -66
- package/src/plugins/StaticPlugin.js +0 -48
- package/src/plugins/WebsitePlugin.js +0 -207
- package/src/ts/client/grapesjs/publish.ts +0 -386
- package/src/ts/client/grapesjs/template.ts +0 -166
- package/src/ts/events.ts +0 -2
- package/tsconfig-server-debug.json +0 -19
- package/tsconfig-server-release.json +0 -19
- package/tsconfig.jest.json +0 -9
- package/tsconfig.json +0 -26
- package/webpack.config.js +0 -28
- package/webpack.debug.config.js +0 -8
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Silex website builder, free/libre no-code tool for makers.
|
|
3
|
+
* Copyright (c) 2023 lexoyo and Silex Labs foundation
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
* the Free Software Foundation, either version 3 of the License, or any later version.
|
|
8
|
+
*
|
|
9
|
+
* This program is distributed in the hope that it will be useful,
|
|
10
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
* GNU Affero General Public License for more details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
import { ClientEvent } from '../../client/events.js';
|
|
18
|
+
// Silex plugin
|
|
19
|
+
export default async function (config) {
|
|
20
|
+
let websiteMeta = null;
|
|
21
|
+
config.on(ClientEvent.GRAPESJS_START, async () => {
|
|
22
|
+
// GrapesJs plugin
|
|
23
|
+
const grapesPlugin = (editor, opts) => {
|
|
24
|
+
const options = {
|
|
25
|
+
appendTo: 'commands',
|
|
26
|
+
...opts,
|
|
27
|
+
};
|
|
28
|
+
editor.on('storage:end:load', async () => {
|
|
29
|
+
// Get website meta data
|
|
30
|
+
const { websiteId, connectorId } = options;
|
|
31
|
+
// Get the website meta data
|
|
32
|
+
websiteMeta = await config.api.websiteMetaRead({ websiteId, connectorId });
|
|
33
|
+
displayWebsiteMeta();
|
|
34
|
+
});
|
|
35
|
+
return {};
|
|
36
|
+
};
|
|
37
|
+
// Add the plugin to the GrapeJS
|
|
38
|
+
config.grapesJsConfig.plugins.push(grapesPlugin);
|
|
39
|
+
config.grapesJsConfig.pluginsOpts[grapesPlugin.toString()] = {
|
|
40
|
+
websiteId: config.websiteId,
|
|
41
|
+
connectorId: config.storageId,
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
config.on(ClientEvent.GRAPESJS_END, async ({ editor }) => {
|
|
45
|
+
// Detect when the page changes
|
|
46
|
+
editor.on('page:select', async () => {
|
|
47
|
+
displayWebsiteMeta();
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
// Display the website meta data
|
|
51
|
+
function displayWebsiteMeta() {
|
|
52
|
+
// Get or create the container
|
|
53
|
+
const container = document.querySelector('#gjs-website-meta') ?? (function () {
|
|
54
|
+
const c = document.createElement('div');
|
|
55
|
+
c.id = 'gjs-website-meta';
|
|
56
|
+
c.classList.add('gjs-website-meta');
|
|
57
|
+
// Add the container to the UI
|
|
58
|
+
// Add the name of the website in the top bar
|
|
59
|
+
const topBar = document.querySelector('.gjs-pn-devices-c');
|
|
60
|
+
topBar?.appendChild(c);
|
|
61
|
+
return c;
|
|
62
|
+
})();
|
|
63
|
+
// Get the current page
|
|
64
|
+
const currentPage = config.getEditor().Pages?.getSelected();
|
|
65
|
+
// Display the website meta data
|
|
66
|
+
container.innerHTML = `
|
|
67
|
+
${websiteMeta?.imageUrl ? `<div class="gjs-website-meta-image" style="background: url(${websiteMeta?.imageUrl});"></div>` : ''}
|
|
68
|
+
<div class="gjs-website-meta-name">${websiteMeta?.name ?? 'Unknown'} | ${currentPage.get('name') ?? currentPage.get('type')}</div>
|
|
69
|
+
`;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=website-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"website-info.js","sourceRoot":"","sources":["../../../../../src/ts/plugins/client/website-info.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AASpD,eAAe;AACf,MAAM,CAAC,OAAO,CAAC,KAAK,WAAU,MAAM;IAClC,IAAI,WAAW,GAAuB,IAAI,CAAA;IAC1C,MAAM,CAAC,EAAE,CAAC,WAAW,CAAC,cAAc,EAAE,KAAK,IAAI,EAAE;QAC/C,kBAAkB;QAClB,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,IAAiC,EAAE,EAAE;YACjE,MAAM,OAAO,GAAG;gBACd,QAAQ,EAAE,UAAU;gBACpB,GAAG,IAAI;aACc,CAAA;YACvB,MAAM,CAAC,EAAE,CAAC,kBAAkB,EAAE,KAAK,IAAI,EAAE;gBACvC,wBAAwB;gBACxB,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,OAAO,CAAA;gBAC1C,4BAA4B;gBAC5B,WAAW,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,CAAA;gBAC1E,kBAAkB,EAAE,CAAA;YACtB,CAAC,CAAC,CAAA;YACF,OAAO,EAAE,CAAA;QACX,CAAC,CAAA;QAED,gCAAgC;QAChC,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QAChD,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,GAAG;YAC3D,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,WAAW,EAAE,MAAM,CAAC,SAAS;SAC9B,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,MAAM,CAAC,EAAE,CAAC,WAAW,CAAC,YAAY,EAAE,KAAK,EAAE,EAAC,MAAM,EAAC,EAAE,EAAE;QACrD,+BAA+B;QAC/B,MAAM,CAAC,EAAE,CAAC,aAAa,EAAE,KAAK,IAAI,EAAE;YAClC,kBAAkB,EAAE,CAAA;QACtB,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IAGF,gCAAgC;IAChC,SAAS,kBAAkB;QACzB,8BAA8B;QAC9B,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,mBAAmB,CAAC,IAAI,CAAC;YAChE,MAAM,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;YACvC,CAAC,CAAC,EAAE,GAAG,kBAAkB,CAAA;YACzB,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;YACnC,8BAA8B;YAC9B,6CAA6C;YAC7C,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAA;YAC1D,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,CAAA;YACtB,OAAO,CAAC,CAAA;QACV,CAAC,CAAC,EAAE,CAAA;QACJ,uBAAuB;QACvB,MAAM,WAAW,GAAG,MAAM,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,CAAA;QAC3D,gCAAgC;QAChC,SAAS,CAAC,SAAS,GAAG;UAChB,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,8DAA8D,WAAW,EAAE,QAAQ,YAAY,CAAC,CAAC,CAAC,EAAE;6CACzF,WAAW,EAAE,IAAI,IAAI,SAAS,MAAM,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC;OAC5H,CAAA;IACL,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview define types for Silex client and server
|
|
3
|
+
*/
|
|
4
|
+
export interface PublicationSettings {
|
|
5
|
+
connector?: ConnectorData;
|
|
6
|
+
options?: ConnectorOptions;
|
|
7
|
+
}
|
|
8
|
+
export interface WebsiteFile {
|
|
9
|
+
html: string;
|
|
10
|
+
css: string;
|
|
11
|
+
htmlPath: string;
|
|
12
|
+
cssPath: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class ApiError extends Error {
|
|
15
|
+
readonly httpStatusCode: number;
|
|
16
|
+
constructor(message: string, httpStatusCode: number);
|
|
17
|
+
}
|
|
18
|
+
export type ApiResponseError = {
|
|
19
|
+
message: string;
|
|
20
|
+
};
|
|
21
|
+
export type ApiPublicationPublishBody = WebsiteData;
|
|
22
|
+
export type ApiPublicationPublishQuery = {
|
|
23
|
+
websiteId: WebsiteId;
|
|
24
|
+
hostingId: ConnectorId;
|
|
25
|
+
storageId: ConnectorId;
|
|
26
|
+
options: ConnectorOptions;
|
|
27
|
+
};
|
|
28
|
+
export type ApiPublicationPublishResponse = {
|
|
29
|
+
url: string;
|
|
30
|
+
job: PublicationJobData;
|
|
31
|
+
};
|
|
32
|
+
export type ApiPublicationStatusQuery = {
|
|
33
|
+
jobId: JobId;
|
|
34
|
+
};
|
|
35
|
+
export type ApiPublicationStatusResponse = PublicationJobData;
|
|
36
|
+
export type ApiWebsiteReadQuery = {
|
|
37
|
+
websiteId: WebsiteId;
|
|
38
|
+
connectorId?: ConnectorId;
|
|
39
|
+
};
|
|
40
|
+
export type ApiWebsiteReadResponse = WebsiteData;
|
|
41
|
+
export type ApiWebsiteListQuery = {
|
|
42
|
+
connectorId?: ConnectorId;
|
|
43
|
+
};
|
|
44
|
+
export type ApiWebsiteListResponse = WebsiteMeta[];
|
|
45
|
+
export type ApiWebsiteWriteQuery = {
|
|
46
|
+
websiteId: WebsiteId;
|
|
47
|
+
connectorId?: ConnectorId;
|
|
48
|
+
};
|
|
49
|
+
export type ApiWebsiteWriteBody = WebsiteData;
|
|
50
|
+
export type ApiWebsiteWriteResponse = {
|
|
51
|
+
message: string;
|
|
52
|
+
};
|
|
53
|
+
export type ApiWebsiteCreateQuery = {
|
|
54
|
+
connectorId?: ConnectorId;
|
|
55
|
+
};
|
|
56
|
+
export type ApiWebsiteCreateBody = WebsiteMetaFileContent;
|
|
57
|
+
export type ApiWebsiteCreateResponse = {
|
|
58
|
+
message: string;
|
|
59
|
+
};
|
|
60
|
+
export type ApiWebsiteDeleteQuery = {
|
|
61
|
+
websiteId: WebsiteId;
|
|
62
|
+
connectorId?: ConnectorId;
|
|
63
|
+
};
|
|
64
|
+
export type ApiWebsiteDuplicateQuery = {
|
|
65
|
+
websiteId: WebsiteId;
|
|
66
|
+
connectorId?: ConnectorId;
|
|
67
|
+
};
|
|
68
|
+
export type ApiWebsiteMetaReadQuery = {
|
|
69
|
+
websiteId: WebsiteId;
|
|
70
|
+
connectorId?: ConnectorId;
|
|
71
|
+
};
|
|
72
|
+
export type ApiWebsiteMetaReadResponse = WebsiteMeta;
|
|
73
|
+
export type ApiWebsiteMetaWriteQuery = {
|
|
74
|
+
websiteId: WebsiteId;
|
|
75
|
+
connectorId?: ConnectorId;
|
|
76
|
+
};
|
|
77
|
+
export type ApiWebsiteMetaWriteBody = WebsiteMetaFileContent;
|
|
78
|
+
export type ApiWebsiteMetaWriteResponse = {
|
|
79
|
+
message: string;
|
|
80
|
+
};
|
|
81
|
+
export type ApiWebsiteAssetsReadQuery = {
|
|
82
|
+
websiteId: WebsiteId;
|
|
83
|
+
connectorId?: ConnectorId;
|
|
84
|
+
};
|
|
85
|
+
export type ApiWebsiteAssetsReadParams = {
|
|
86
|
+
path: string;
|
|
87
|
+
};
|
|
88
|
+
export type ApiWebsiteAssetsReadResponse = string;
|
|
89
|
+
export type ApiWebsiteAssetsWriteQuery = {
|
|
90
|
+
websiteId: WebsiteId;
|
|
91
|
+
connectorId?: ConnectorId;
|
|
92
|
+
};
|
|
93
|
+
export type ApiWebsiteAssetsWriteBody = ClientSideFile[];
|
|
94
|
+
export type ApiWebsiteAssetsWriteResponse = {
|
|
95
|
+
data: string[];
|
|
96
|
+
};
|
|
97
|
+
export type ApiConnectorListQuery = {
|
|
98
|
+
type: ConnectorType;
|
|
99
|
+
};
|
|
100
|
+
export type ApiConnectorListResponse = ConnectorData[];
|
|
101
|
+
export type ApiConnectorLoginQuery = {
|
|
102
|
+
connectorId: ConnectorId;
|
|
103
|
+
type: ConnectorType;
|
|
104
|
+
};
|
|
105
|
+
export type ApiConnectorLoggedInPostMessage = {
|
|
106
|
+
type: string;
|
|
107
|
+
error: boolean;
|
|
108
|
+
message: string;
|
|
109
|
+
connectorId: ConnectorId;
|
|
110
|
+
options: ConnectorOptions;
|
|
111
|
+
};
|
|
112
|
+
export type ApiConnectorLoginCbkQuery = {
|
|
113
|
+
connectorId?: ConnectorId;
|
|
114
|
+
type: ConnectorType;
|
|
115
|
+
error?: string;
|
|
116
|
+
};
|
|
117
|
+
export type ApiConnectorLoginCbkBody = object;
|
|
118
|
+
export type ApiConnectorSettingsQuery = {
|
|
119
|
+
connectorId?: ConnectorId;
|
|
120
|
+
type: ConnectorType;
|
|
121
|
+
};
|
|
122
|
+
export type ApiConnectorSettingsResponse = string;
|
|
123
|
+
export type ApiConnectorSettingsPostQuery = {
|
|
124
|
+
connectorId?: ConnectorId;
|
|
125
|
+
type: ConnectorType;
|
|
126
|
+
};
|
|
127
|
+
export type ApiConnectorSettingsPostBody = ConnectorUserSettings;
|
|
128
|
+
export type ApiConnectorSettingsPostResponse = {
|
|
129
|
+
message: string;
|
|
130
|
+
};
|
|
131
|
+
export type ApiConnectorLogoutQuery = {
|
|
132
|
+
connectorId?: ConnectorId;
|
|
133
|
+
type: ConnectorType;
|
|
134
|
+
};
|
|
135
|
+
export type ApiConnectorUserQuery = {
|
|
136
|
+
connectorId?: ConnectorId;
|
|
137
|
+
type: ConnectorType;
|
|
138
|
+
};
|
|
139
|
+
export type ApiConnectorUserResponse = ConnectorUser;
|
|
140
|
+
export declare const defaultWebsiteData: WebsiteData;
|
|
141
|
+
export interface Component {
|
|
142
|
+
type: string;
|
|
143
|
+
content?: string;
|
|
144
|
+
attributes: {
|
|
145
|
+
[key: string]: string;
|
|
146
|
+
};
|
|
147
|
+
components: Component[];
|
|
148
|
+
}
|
|
149
|
+
export interface Page {
|
|
150
|
+
id: string;
|
|
151
|
+
name: string;
|
|
152
|
+
slug: string;
|
|
153
|
+
settings: WebsiteSettings;
|
|
154
|
+
frames: {
|
|
155
|
+
component: Component;
|
|
156
|
+
}[];
|
|
157
|
+
}
|
|
158
|
+
export interface WebsiteData {
|
|
159
|
+
pages: Page[];
|
|
160
|
+
assets: Asset[];
|
|
161
|
+
styles: Style[];
|
|
162
|
+
settings: WebsiteSettings;
|
|
163
|
+
fonts: Font[];
|
|
164
|
+
symbols: symbol[];
|
|
165
|
+
publication: PublicationSettings;
|
|
166
|
+
}
|
|
167
|
+
export interface PublicationData extends WebsiteData {
|
|
168
|
+
files?: ClientSideFile[];
|
|
169
|
+
}
|
|
170
|
+
export interface WebsiteSettings {
|
|
171
|
+
description?: string;
|
|
172
|
+
title?: string;
|
|
173
|
+
lang?: string;
|
|
174
|
+
head?: string;
|
|
175
|
+
favicon?: string;
|
|
176
|
+
'og:title'?: string;
|
|
177
|
+
'og:description'?: string;
|
|
178
|
+
'og:image'?: string;
|
|
179
|
+
}
|
|
180
|
+
export interface Font {
|
|
181
|
+
name: string;
|
|
182
|
+
value: string;
|
|
183
|
+
variants: string[];
|
|
184
|
+
}
|
|
185
|
+
export declare enum Unit {
|
|
186
|
+
PX = "px"
|
|
187
|
+
}
|
|
188
|
+
export interface Asset {
|
|
189
|
+
type: string;
|
|
190
|
+
src: string;
|
|
191
|
+
unitDim: Unit;
|
|
192
|
+
height: number;
|
|
193
|
+
width: number;
|
|
194
|
+
name: string;
|
|
195
|
+
path?: string;
|
|
196
|
+
}
|
|
197
|
+
export interface Style {
|
|
198
|
+
selectors: Selector[];
|
|
199
|
+
style: {
|
|
200
|
+
[key: string]: string;
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
export type Selector = string | {
|
|
204
|
+
name: string;
|
|
205
|
+
type: number;
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* Type for a connector id
|
|
209
|
+
*/
|
|
210
|
+
export type ConnectorId = string;
|
|
211
|
+
export type ConnectorOptions = {
|
|
212
|
+
websiteUrl?: string;
|
|
213
|
+
[key: string]: any;
|
|
214
|
+
};
|
|
215
|
+
export declare enum ClientSideFileType {
|
|
216
|
+
HTML = "html",
|
|
217
|
+
ASSET = "asset",
|
|
218
|
+
CSS = "css",
|
|
219
|
+
OTHER = "other"
|
|
220
|
+
}
|
|
221
|
+
export declare enum Initiator {
|
|
222
|
+
HTML = "html",
|
|
223
|
+
CSS = "css"
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Type for a client side file when the content is not available, used to handle file names and paths and urls
|
|
227
|
+
*/
|
|
228
|
+
export interface ClientSideFileWithPermalink {
|
|
229
|
+
path: string;
|
|
230
|
+
permalink?: string;
|
|
231
|
+
type: ClientSideFileType;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Type for a client side file when the content is available as a string
|
|
235
|
+
*/
|
|
236
|
+
export interface ClientSideFileWithContent extends ClientSideFileWithPermalink {
|
|
237
|
+
content: string;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Type for a client side file when the content is in the connector
|
|
241
|
+
*/
|
|
242
|
+
export interface ClientSideFileWithSrc extends ClientSideFileWithPermalink {
|
|
243
|
+
src: string;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Type for a client side file
|
|
247
|
+
* @see connector/File
|
|
248
|
+
*/
|
|
249
|
+
export type ClientSideFile = ClientSideFileWithContent | ClientSideFileWithSrc;
|
|
250
|
+
/**
|
|
251
|
+
* Type for file listing
|
|
252
|
+
*/
|
|
253
|
+
export interface FileMeta {
|
|
254
|
+
name: string;
|
|
255
|
+
isDir: boolean;
|
|
256
|
+
size: number;
|
|
257
|
+
createdAt: Date;
|
|
258
|
+
updatedAt: Date;
|
|
259
|
+
metadata?: object;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Enum to express if the connector is a storage or a hosting
|
|
263
|
+
*/
|
|
264
|
+
export declare enum ConnectorType {
|
|
265
|
+
STORAGE = "STORAGE",
|
|
266
|
+
HOSTING = "HOSTING"
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Type for a website id
|
|
270
|
+
*/
|
|
271
|
+
export type WebsiteId = string;
|
|
272
|
+
/**
|
|
273
|
+
* Back end data shared with the front end
|
|
274
|
+
*/
|
|
275
|
+
export interface ConnectorData {
|
|
276
|
+
connectorId: ConnectorId;
|
|
277
|
+
type: ConnectorType;
|
|
278
|
+
displayName: string;
|
|
279
|
+
icon: string;
|
|
280
|
+
disableLogout: boolean;
|
|
281
|
+
isLoggedIn: boolean;
|
|
282
|
+
oauthUrl: string | null;
|
|
283
|
+
color: string;
|
|
284
|
+
background: string;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* User settings for a connector and for a given website
|
|
288
|
+
*/
|
|
289
|
+
export type ConnectorUserSettings = {
|
|
290
|
+
[websiteId: string]: object;
|
|
291
|
+
};
|
|
292
|
+
/**
|
|
293
|
+
* Back end data shared with the front end
|
|
294
|
+
*/
|
|
295
|
+
export interface ConnectorUser {
|
|
296
|
+
name: string;
|
|
297
|
+
email?: string;
|
|
298
|
+
picture?: string;
|
|
299
|
+
storage: ConnectorData;
|
|
300
|
+
}
|
|
301
|
+
export interface WebsiteMetaFileContent {
|
|
302
|
+
name: string;
|
|
303
|
+
imageUrl?: string;
|
|
304
|
+
connectorUserSettings: ConnectorUserSettings;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Back end data sent to the front end
|
|
308
|
+
* Meta data can be the root path of the websites, or the bucket name, etc.
|
|
309
|
+
*/
|
|
310
|
+
export interface WebsiteMeta extends WebsiteMetaFileContent {
|
|
311
|
+
websiteId: WebsiteId;
|
|
312
|
+
createdAt?: Date;
|
|
313
|
+
updatedAt?: Date;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Enum to express if the job is in progress or finished or errored
|
|
317
|
+
*/
|
|
318
|
+
export declare enum JobStatus {
|
|
319
|
+
IN_PROGRESS = "IN_PROGRESS",
|
|
320
|
+
SUCCESS = "SUCCESS",
|
|
321
|
+
ERROR = "ERROR"
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Id used to track the progress of a publication
|
|
325
|
+
*/
|
|
326
|
+
export type JobId = string;
|
|
327
|
+
/**
|
|
328
|
+
* Data structure which is sent to the client to display the progress of a job
|
|
329
|
+
*/
|
|
330
|
+
export interface JobData {
|
|
331
|
+
jobId: JobId;
|
|
332
|
+
status: JobStatus;
|
|
333
|
+
message: string;
|
|
334
|
+
_timeout?: ReturnType<typeof setTimeout>;
|
|
335
|
+
}
|
|
336
|
+
export interface PublicationJobData extends JobData {
|
|
337
|
+
logs: string[][];
|
|
338
|
+
errors: string[][];
|
|
339
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Silex website builder, free/libre no-code tool for makers.
|
|
3
|
+
* Copyright (c) 2023 lexoyo and Silex Labs foundation
|
|
4
|
+
*
|
|
5
|
+
* This program is free software: you can redistribute it and/or modify
|
|
6
|
+
* it under the terms of the GNU Affero General Public License as published by
|
|
7
|
+
* the Free Software Foundation, either version 3 of the License, or any later version.
|
|
8
|
+
*
|
|
9
|
+
* This program is distributed in the hope that it will be useful,
|
|
10
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
* GNU Affero General Public License for more details.
|
|
13
|
+
*
|
|
14
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
15
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
export class ApiError extends Error {
|
|
18
|
+
httpStatusCode;
|
|
19
|
+
constructor(message, httpStatusCode) {
|
|
20
|
+
super(message);
|
|
21
|
+
this.httpStatusCode = httpStatusCode;
|
|
22
|
+
console.info('API error', httpStatusCode, message);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
// **
|
|
26
|
+
// Website API
|
|
27
|
+
export const defaultWebsiteData = {
|
|
28
|
+
//pages: [],
|
|
29
|
+
//assets: [],
|
|
30
|
+
//styles: [],
|
|
31
|
+
//settings: {},
|
|
32
|
+
//fonts: [],
|
|
33
|
+
//symbols: [],
|
|
34
|
+
//publication: {},
|
|
35
|
+
};
|
|
36
|
+
//export interface Frame {
|
|
37
|
+
// component: { type: string, stylable: string[] },
|
|
38
|
+
// components: Component[],
|
|
39
|
+
//}
|
|
40
|
+
//
|
|
41
|
+
//export interface Component {
|
|
42
|
+
// type: string,
|
|
43
|
+
// content?: string,
|
|
44
|
+
// attributes: { [key: string]: string },
|
|
45
|
+
// conponents: Component[],
|
|
46
|
+
//}
|
|
47
|
+
export var Unit;
|
|
48
|
+
(function (Unit) {
|
|
49
|
+
Unit["PX"] = "px";
|
|
50
|
+
})(Unit || (Unit = {}));
|
|
51
|
+
export var ClientSideFileType;
|
|
52
|
+
(function (ClientSideFileType) {
|
|
53
|
+
ClientSideFileType["HTML"] = "html";
|
|
54
|
+
ClientSideFileType["ASSET"] = "asset";
|
|
55
|
+
ClientSideFileType["CSS"] = "css";
|
|
56
|
+
ClientSideFileType["OTHER"] = "other";
|
|
57
|
+
})(ClientSideFileType || (ClientSideFileType = {}));
|
|
58
|
+
export var Initiator;
|
|
59
|
+
(function (Initiator) {
|
|
60
|
+
Initiator["HTML"] = "html";
|
|
61
|
+
Initiator["CSS"] = "css";
|
|
62
|
+
})(Initiator || (Initiator = {}));
|
|
63
|
+
/**
|
|
64
|
+
* Enum to express if the connector is a storage or a hosting
|
|
65
|
+
*/
|
|
66
|
+
export var ConnectorType;
|
|
67
|
+
(function (ConnectorType) {
|
|
68
|
+
ConnectorType["STORAGE"] = "STORAGE";
|
|
69
|
+
ConnectorType["HOSTING"] = "HOSTING";
|
|
70
|
+
})(ConnectorType || (ConnectorType = {}));
|
|
71
|
+
/**
|
|
72
|
+
* Enum to express if the job is in progress or finished or errored
|
|
73
|
+
*/
|
|
74
|
+
export var JobStatus;
|
|
75
|
+
(function (JobStatus) {
|
|
76
|
+
JobStatus["IN_PROGRESS"] = "IN_PROGRESS";
|
|
77
|
+
JobStatus["SUCCESS"] = "SUCCESS";
|
|
78
|
+
JobStatus["ERROR"] = "ERROR";
|
|
79
|
+
})(JobStatus || (JobStatus = {}));
|
|
80
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/ts/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAmBH,MAAM,OAAO,QAAS,SAAQ,KAAK;IACY;IAA7C,YAAY,OAAe,EAAkB,cAAsB;QACjE,KAAK,CAAC,OAAO,CAAC,CAAA;QAD6B,mBAAc,GAAd,cAAc,CAAQ;QAEjE,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,cAAc,EAAE,OAAO,CAAC,CAAA;IACpD,CAAC;CACF;AAgDD,KAAK;AACL,cAAc;AACd,MAAM,CAAC,MAAM,kBAAkB,GAAgB;AAC7C,YAAY;AACZ,aAAa;AACb,aAAa;AACb,eAAe;AACf,YAAY;AACZ,cAAc;AACd,kBAAkB;CACJ,CAAA;AAuDhB,0BAA0B;AAC1B,oDAAoD;AACpD,4BAA4B;AAC5B,GAAG;AACH,EAAE;AACF,8BAA8B;AAC9B,iBAAiB;AACjB,qBAAqB;AACrB,0CAA0C;AAC1C,4BAA4B;AAC5B,GAAG;AAEH,MAAM,CAAN,IAAY,IAEX;AAFD,WAAY,IAAI;IACd,iBAAS,CAAA;AACX,CAAC,EAFW,IAAI,KAAJ,IAAI,QAEf;AAkCD,MAAM,CAAN,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,mCAAa,CAAA;IACb,qCAAe,CAAA;IACf,iCAAW,CAAA;IACX,qCAAe,CAAA;AACjB,CAAC,EALW,kBAAkB,KAAlB,kBAAkB,QAK7B;AAED,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,0BAAa,CAAA;IACb,wBAAW,CAAA;AACb,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AA2CD;;GAEG;AACH,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;AACrB,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAuDD;;GAEG;AACH,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,gCAAmB,CAAA;IACnB,4BAAe,CAAA;AACjB,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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_DUPLICATE = "/duplicate";
|
|
26
|
+
export declare const API_WEBSITE_LIST = "/";
|
|
27
|
+
export declare const API_WEBSITE_ASSET_READ = "/assets";
|
|
28
|
+
export declare const API_WEBSITE_ASSETS_WRITE = "/assets";
|
|
29
|
+
export declare const API_WEBSITE_META_READ = "/meta";
|
|
30
|
+
export declare const API_WEBSITE_META_WRITE = "/meta";
|
|
31
|
+
export declare let SILEX_VERSION: any;
|
|
32
|
+
export declare const DEV_MESSAGE: string;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Silex website builder, free/libre no-code tool for makers.
|
|
4
|
+
* Copyright (c) 2023 lexoyo and Silex Labs foundation
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License as published by
|
|
8
|
+
* the Free Software Foundation, either version 3 of the License, or any later version.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.DEV_MESSAGE = exports.SILEX_VERSION = exports.API_WEBSITE_META_WRITE = exports.API_WEBSITE_META_READ = exports.API_WEBSITE_ASSETS_WRITE = exports.API_WEBSITE_ASSET_READ = exports.API_WEBSITE_LIST = exports.API_WEBSITE_DUPLICATE = exports.API_WEBSITE_DELETE = exports.API_WEBSITE_CREATE = exports.API_WEBSITE_WRITE = exports.API_WEBSITE_READ = exports.API_WEBSITE_PATH = exports.API_PUBLICATION_STATUS = exports.API_PUBLICATION_PUBLISH = exports.API_PUBLICATION_PATH = exports.API_CONNECTOR_LOGIN_CALLBACK = exports.API_CONNECTOR_SETTINGS = exports.API_CONNECTOR_LOGIN = exports.API_CONNECTOR_LOGOUT = exports.API_CONNECTOR_LIST = exports.API_CONNECTOR_USER = exports.API_CONNECTOR_PATH = exports.API_PATH = exports.CLIENT_CONFIG_FILE_NAME = exports.DEFAULT_LANGUAGE = exports.DEFAULT_WEBSITE_ID = exports.WEBSITE_META_DATA_FILE = exports.WEBSITE_DATA_FILE = void 0;
|
|
20
|
+
/**
|
|
21
|
+
* @fileoverview define constants for Silex client and server
|
|
22
|
+
*/
|
|
23
|
+
exports.WEBSITE_DATA_FILE = 'website.json';
|
|
24
|
+
exports.WEBSITE_META_DATA_FILE = 'meta.json';
|
|
25
|
+
exports.DEFAULT_WEBSITE_ID = 'default';
|
|
26
|
+
exports.DEFAULT_LANGUAGE = 'en';
|
|
27
|
+
exports.CLIENT_CONFIG_FILE_NAME = 'silex.js';
|
|
28
|
+
exports.API_PATH = '/api';
|
|
29
|
+
exports.API_CONNECTOR_PATH = '/connector';
|
|
30
|
+
exports.API_CONNECTOR_USER = '/user';
|
|
31
|
+
exports.API_CONNECTOR_LIST = '/';
|
|
32
|
+
exports.API_CONNECTOR_LOGOUT = '/logout';
|
|
33
|
+
exports.API_CONNECTOR_LOGIN = '/login';
|
|
34
|
+
exports.API_CONNECTOR_SETTINGS = '/settings';
|
|
35
|
+
exports.API_CONNECTOR_LOGIN_CALLBACK = '/login/callback';
|
|
36
|
+
exports.API_PUBLICATION_PATH = '/publication';
|
|
37
|
+
exports.API_PUBLICATION_PUBLISH = '/';
|
|
38
|
+
exports.API_PUBLICATION_STATUS = '/publication/status';
|
|
39
|
+
exports.API_WEBSITE_PATH = '/website';
|
|
40
|
+
exports.API_WEBSITE_READ = '/';
|
|
41
|
+
exports.API_WEBSITE_WRITE = '/';
|
|
42
|
+
exports.API_WEBSITE_CREATE = '/';
|
|
43
|
+
exports.API_WEBSITE_DELETE = '/';
|
|
44
|
+
exports.API_WEBSITE_DUPLICATE = '/duplicate';
|
|
45
|
+
exports.API_WEBSITE_LIST = '/';
|
|
46
|
+
exports.API_WEBSITE_ASSET_READ = '/assets';
|
|
47
|
+
exports.API_WEBSITE_ASSETS_WRITE = '/assets';
|
|
48
|
+
exports.API_WEBSITE_META_READ = '/meta';
|
|
49
|
+
exports.API_WEBSITE_META_WRITE = '/meta';
|
|
50
|
+
try {
|
|
51
|
+
exports.SILEX_VERSION = SILEX_VERSION_ENV;
|
|
52
|
+
}
|
|
53
|
+
catch (e) {
|
|
54
|
+
// fallback to default value
|
|
55
|
+
exports.SILEX_VERSION = exports.SILEX_VERSION || '3.0.0';
|
|
56
|
+
}
|
|
57
|
+
exports.DEV_MESSAGE = `
|
|
58
|
+
__________________________________________________________
|
|
59
|
+
|
|
60
|
+
Create static websites visually, with dynamic content,
|
|
61
|
+
in the free spirit of the web.
|
|
62
|
+
|
|
63
|
+
███████ ██ ██ ███████ ██ ██ ██ ██ ██████
|
|
64
|
+
██ ██ ██ ██ ██ ██ ██ ██ ██
|
|
65
|
+
███████ ██ ██ █████ ███ ██ ██ █████
|
|
66
|
+
██ ██ ██ ██ ██ ██ ██ ██ ██
|
|
67
|
+
███████ ██ ███████ ███████ ██ ██ ████ ██████ ${exports.SILEX_VERSION.slice(1)}
|
|
68
|
+
|
|
69
|
+
Users are expected to contribute:
|
|
70
|
+
|
|
71
|
+
* Web designers: https://docs.silex.me/en/user/contribute
|
|
72
|
+
* Developers: https://docs.silex.me/en/dev/contribute
|
|
73
|
+
|
|
74
|
+
__________________________________________________________
|
|
75
|
+
`;
|
|
76
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/ts/constants.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH;;GAEG;AAEU,QAAA,iBAAiB,GAAG,cAAc,CAAA;AAClC,QAAA,sBAAsB,GAAG,WAAW,CAAA;AAEpC,QAAA,kBAAkB,GAAG,SAAS,CAAA;AAC9B,QAAA,gBAAgB,GAAG,IAAI,CAAA;AACvB,QAAA,uBAAuB,GAAG,UAAU,CAAA;AAEpC,QAAA,QAAQ,GAAG,MAAM,CAAA;AAEjB,QAAA,kBAAkB,GAAG,YAAY,CAAA;AACjC,QAAA,kBAAkB,GAAG,OAAO,CAAA;AAC5B,QAAA,kBAAkB,GAAG,GAAG,CAAA;AACxB,QAAA,oBAAoB,GAAG,SAAS,CAAA;AAChC,QAAA,mBAAmB,GAAG,QAAQ,CAAA;AAC9B,QAAA,sBAAsB,GAAG,WAAW,CAAA;AACpC,QAAA,4BAA4B,GAAG,iBAAiB,CAAA;AAEhD,QAAA,oBAAoB,GAAG,cAAc,CAAA;AACrC,QAAA,uBAAuB,GAAG,GAAG,CAAA;AAC7B,QAAA,sBAAsB,GAAG,qBAAqB,CAAA;AAE9C,QAAA,gBAAgB,GAAG,UAAU,CAAA;AAC7B,QAAA,gBAAgB,GAAG,GAAG,CAAA;AACtB,QAAA,iBAAiB,GAAG,GAAG,CAAA;AACvB,QAAA,kBAAkB,GAAG,GAAG,CAAA;AACxB,QAAA,kBAAkB,GAAG,GAAG,CAAA;AACxB,QAAA,qBAAqB,GAAG,YAAY,CAAA;AACpC,QAAA,gBAAgB,GAAG,GAAG,CAAA;AACtB,QAAA,sBAAsB,GAAG,SAAS,CAAA;AAClC,QAAA,wBAAwB,GAAG,SAAS,CAAA;AACpC,QAAA,qBAAqB,GAAG,OAAO,CAAA;AAC/B,QAAA,sBAAsB,GAAG,OAAO,CAAA;AAO7C,IAAI,CAAC;IAAC,qBAAa,GAAG,iBAAiB,CAAA;AAAC,CAAC;AAAC,OAAO,CAAC,EAAE,CAAC;IACnD,4BAA4B;IAC5B,qBAAa,GAAG,qBAAa,IAAI,OAAO,CAAA;AAC1C,CAAC;AAEY,QAAA,WAAW,GAAG;;;;;;;;;;2DAUgC,qBAAa,CAAC,KAAK,CAAC,CAAC,CAAC;;;;;;;;CAQhF,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Silex website builder, free/libre no-code tool for makers.
|
|
4
|
+
* Copyright (c) 2023 lexoyo and Silex Labs foundation
|
|
5
|
+
*
|
|
6
|
+
* This program is free software: you can redistribute it and/or modify
|
|
7
|
+
* it under the terms of the GNU Affero General Public License as published by
|
|
8
|
+
* the Free Software Foundation, either version 3 of the License, or any later version.
|
|
9
|
+
*
|
|
10
|
+
* This program is distributed in the hope that it will be useful,
|
|
11
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
12
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
13
|
+
* GNU Affero General Public License for more details.
|
|
14
|
+
*
|
|
15
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
16
|
+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
17
|
+
*/
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
exports.noCache = noCache;
|
|
20
|
+
exports.withCache = withCache;
|
|
21
|
+
function noCache(req, res, next) {
|
|
22
|
+
res.header('Cache-Control', 'private,no-cache,no-store,must-revalidate,proxy-revalidate');
|
|
23
|
+
res.header('Expires', '-1');
|
|
24
|
+
res.header('Pragma', 'no-cache');
|
|
25
|
+
next();
|
|
26
|
+
}
|
|
27
|
+
function withCache(req, res, next) {
|
|
28
|
+
if (req.url.endsWith('.html') || req.url.endsWith('/')) {
|
|
29
|
+
noCache(req, res, next);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
res.header('Cache-Control', 'public,max-age=86400,immutable'); // 24h
|
|
33
|
+
next();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=Cache.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cache.js","sourceRoot":"","sources":["../../../../../src/ts/plugins/server/Cache.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAEH,0BAKC;AAED,8BAOC;AAdD,SAAgB,OAAO,CAAE,GAAG,EAAE,GAAG,EAAE,IAAI;IACrC,GAAG,CAAC,MAAM,CAAC,eAAe,EAAE,4DAA4D,CAAC,CAAA;IACzF,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAA;IAC3B,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAA;IAChC,IAAI,EAAE,CAAA;AACR,CAAC;AAED,SAAgB,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI;IACtC,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACvD,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAA;IACzB,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,MAAM,CAAC,eAAe,EAAE,gCAAgC,CAAC,CAAA,CAAC,MAAM;QACpE,IAAI,EAAE,CAAA;IACR,CAAC;AACH,CAAC"}
|