@silexlabs/silex 3.0.0-alpha.69 → 3.0.0-alpha.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/client/js/main.js +9 -10
  2. package/dist/plugins/client/client/assetUrl.js +10 -10
  3. package/dist/plugins/client/client/assetUrl.js.map +1 -1
  4. package/dist/plugins/client/client/config.js.map +1 -1
  5. package/dist/plugins/client/client/grapesjs/PublicationManager.js +17 -0
  6. package/dist/plugins/client/client/grapesjs/PublicationManager.js.map +1 -1
  7. package/dist/plugins/client/client/grapesjs/PublicationUi.js +13 -9
  8. package/dist/plugins/client/client/grapesjs/PublicationUi.js.map +1 -1
  9. package/dist/plugins/client/plugins/client/template.js.map +1 -1
  10. package/dist/plugins/server/plugins/server/DownloadConnector.d.ts +29 -0
  11. package/dist/plugins/server/plugins/server/DownloadConnector.js +129 -0
  12. package/dist/plugins/server/plugins/server/DownloadConnector.js.map +1 -0
  13. package/dist/plugins/server/plugins/server/GitlabConnector.js +60 -3
  14. package/dist/plugins/server/plugins/server/GitlabConnector.js.map +1 -1
  15. package/dist/plugins/server/server/api/publicationApi.d.ts +23 -0
  16. package/dist/plugins/server/server/api/publicationApi.js +148 -0
  17. package/dist/plugins/server/server/api/publicationApi.js.map +1 -0
  18. package/dist/plugins/server/server/connectors/connectors.d.ts +3 -3
  19. package/dist/plugins/server/server/events.js +16 -0
  20. package/dist/plugins/server/server/events.js.map +1 -1
  21. package/package.json +3 -1
  22. package/src/ts/client/assetUrl.ts +10 -10
  23. package/src/ts/client/config.ts +0 -1
  24. package/src/ts/client/grapesjs/PublicationManager.ts +17 -0
  25. package/src/ts/client/grapesjs/PublicationUi.ts +13 -9
  26. package/src/ts/plugins/client/template.ts +1 -1
  27. package/src/ts/plugins/server/DownloadConnector.ts +150 -0
  28. package/src/ts/plugins/server/GitlabConnector.ts +61 -3
  29. package/src/ts/server/connectors/connectors.ts +4 -4
  30. package/src/ts/server/events.ts +18 -0
@@ -108,14 +108,72 @@ async function wait(ms: number) {
108
108
  return new Promise(resolve => setTimeout(resolve, ms))
109
109
  }
110
110
 
111
+ const svg = `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
112
+ <svg
113
+ xmlns:svg="http://www.w3.org/2000/svg"
114
+ xmlns="http://www.w3.org/2000/svg"
115
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
116
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
117
+ width="1000"
118
+ height="963.197"
119
+ viewBox="0 0 1000 963.197"
120
+ version="1.1"
121
+ id="svg85">
122
+ <sodipodi:namedview
123
+ id="namedview87"
124
+ pagecolor="#ffffff"
125
+ bordercolor="#666666"
126
+ borderopacity="1.0"
127
+ inkscape:pageshadow="2"
128
+ inkscape:pageopacity="0.0"
129
+ inkscape:pagecheckerboard="0"
130
+ showgrid="false"
131
+ inkscape:zoom="1"
132
+ inkscape:cx="991.5"
133
+ inkscape:cy="964.5"
134
+ inkscape:window-width="1126"
135
+ inkscape:window-height="895"
136
+ inkscape:window-x="774"
137
+ inkscape:window-y="12"
138
+ inkscape:window-maximized="0"
139
+ inkscape:current-layer="svg85" />
140
+ <defs
141
+ id="defs74">
142
+ <style
143
+ id="style72">.cls-1{fill:#e24329;}.cls-2{fill:#fc6d26;}.cls-3{fill:#fca326;}</style>
144
+ </defs>
145
+ <g
146
+ id="LOGO"
147
+ transform="matrix(5.2068817,0,0,5.2068817,-489.30756,-507.76085)">
148
+ <path
149
+ class="cls-1"
150
+ d="m 282.83,170.73 -0.27,-0.69 -26.14,-68.22 a 6.81,6.81 0 0 0 -2.69,-3.24 7,7 0 0 0 -8,0.43 7,7 0 0 0 -2.32,3.52 l -17.65,54 h -71.47 l -17.65,-54 a 6.86,6.86 0 0 0 -2.32,-3.53 7,7 0 0 0 -8,-0.43 6.87,6.87 0 0 0 -2.69,3.24 L 97.44,170 l -0.26,0.69 a 48.54,48.54 0 0 0 16.1,56.1 l 0.09,0.07 0.24,0.17 39.82,29.82 19.7,14.91 12,9.06 a 8.07,8.07 0 0 0 9.76,0 l 12,-9.06 19.7,-14.91 40.06,-30 0.1,-0.08 a 48.56,48.56 0 0 0 16.08,-56.04 z"
151
+ id="path76" />
152
+ <path
153
+ class="cls-2"
154
+ d="m 282.83,170.73 -0.27,-0.69 a 88.3,88.3 0 0 0 -35.15,15.8 L 190,229.25 c 19.55,14.79 36.57,27.64 36.57,27.64 l 40.06,-30 0.1,-0.08 a 48.56,48.56 0 0 0 16.1,-56.08 z"
155
+ id="path78" />
156
+ <path
157
+ class="cls-3"
158
+ d="m 153.43,256.89 19.7,14.91 12,9.06 a 8.07,8.07 0 0 0 9.76,0 l 12,-9.06 19.7,-14.91 c 0,0 -17.04,-12.89 -36.59,-27.64 -19.55,14.75 -36.57,27.64 -36.57,27.64 z"
159
+ id="path80" />
160
+ <path
161
+ class="cls-2"
162
+ d="M 132.58,185.84 A 88.19,88.19 0 0 0 97.44,170 l -0.26,0.69 a 48.54,48.54 0 0 0 16.1,56.1 l 0.09,0.07 0.24,0.17 39.82,29.82 c 0,0 17,-12.85 36.57,-27.64 z"
163
+ id="path82" />
164
+ </g>
165
+ </svg>`
166
+ const encodedSvg = encodeURIComponent(svg)
167
+ const ICON = `data:image/svg+xml,${encodedSvg}`
168
+
111
169
  export default class GitlabConnector implements StorageConnector {
112
170
  connectorId = 'gitlab'
113
171
  connectorType = ConnectorType.STORAGE
114
172
  displayName = 'GitLab'
115
- icon = 'http://gitlab.lcqb.upmc.fr/assets/favicon-075eba76312e8421991a0c1f89a89ee81678bcde72319dd3e8047e2a47cd3a42.ico'
173
+ icon = ICON
116
174
  disableLogout = false
117
- color = '#ffffff'
118
- background = '#FC6D26'
175
+ color = '#2B1B63'
176
+ background = 'rgba(252, 109, 38, 0.2)'
119
177
  options: GitlabOptions
120
178
 
121
179
  constructor(private config: ServerConfig, opts: Partial<GitlabOptions>) {
@@ -67,10 +67,7 @@ export interface Connector<Session extends ConnectorSession = ConnectorSession>
67
67
  isLoggedIn(session: Session): Promise<boolean>
68
68
  setToken(session: Session, token: object): Promise<void>
69
69
  logout(session: Session): Promise<void>
70
- getUser(session: Session): Promise<ConnectorUser>
71
- // Handle website meta file
72
- getWebsiteMeta(session: Session, websiteId: WebsiteId): Promise<WebsiteMeta>
73
- setWebsiteMeta(session: Session, websiteId: WebsiteId, data: WebsiteMetaFileContent): Promise<void>
70
+ getUser(session: Session): Promise<ConnectorUser | null>
74
71
  // Get the connector options from login form
75
72
  // They are stored in the website meta file for hosting connectors
76
73
  // And in the user session for storage connectors
@@ -94,6 +91,9 @@ export interface StorageConnector<Session extends ConnectorSession = ConnectorSe
94
91
  readAsset(session: Session, websiteId: WebsiteId, fileName: string): Promise<ConnectorFileContent>
95
92
  deleteAssets(session: Session, websiteId: WebsiteId, fileNames: string[]): Promise<void>
96
93
  //getFileUrl(session: Session, websiteId: WebsiteId, path: string): Promise<string>
94
+ // Handle website meta file
95
+ getWebsiteMeta(session: Session, websiteId: WebsiteId): Promise<WebsiteMeta>
96
+ setWebsiteMeta(session: Session, websiteId: WebsiteId, data: WebsiteMetaFileContent): Promise<void>
97
97
  }
98
98
 
99
99
  /**
@@ -1,3 +1,21 @@
1
+ /*
2
+ * Silex website builder, free/libre no-code tool for makers.
3
+ * Copyright (c) 2023 lexoyo and Silex Labs foundation
4
+ *
5
+ * This program is free software: you can redistribute it and/or modify
6
+ * it under the terms of the GNU Affero General Public License as published by
7
+ * the Free Software Foundation, either version 3 of the License, or any later version.
8
+ *
9
+ * This program is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ * GNU Affero General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU Affero General Public License
15
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
16
+ */
17
+
18
+ // FIXME: this is for client and server, it is confusing, split in 2 files
1
19
  import { ConnectorId, PublicationData, WebsiteData, WebsiteId } from '../types'
2
20
  import { ConnectorFile } from './connectors/connectors'
3
21