@silexlabs/silex 3.0.0-alpha.96 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/.env.default +2 -1
  2. package/README.md +31 -9
  3. package/dist/client/client/api.d.ts +5 -0
  4. package/dist/client/client/assetUrl.d.ts +3 -0
  5. package/dist/client/client/config.d.ts +31 -0
  6. package/dist/client/client/events.d.ts +7 -1
  7. package/dist/client/client/grapesjs/PublicationManager.d.ts +2 -1
  8. package/dist/client/client/grapesjs/css-props.d.ts +6 -0
  9. package/dist/client/client/grapesjs/img.d.ts +6 -0
  10. package/dist/client/client/grapesjs/index.d.ts +2 -2
  11. package/dist/client/client/grapesjs/new-page-dialog.d.ts +1 -1
  12. package/dist/client/client/grapesjs/page-panel.d.ts +1 -1
  13. package/dist/client/client/grapesjs/project-bar.d.ts +16 -0
  14. package/dist/client/client/grapesjs/resize-panel.d.ts +1 -0
  15. package/dist/client/client/grapesjs/rich-text.d.ts +4 -1
  16. package/dist/client/client/grapesjs/semantic.d.ts +1 -1
  17. package/dist/client/client/grapesjs/settings-sections.d.ts +15 -0
  18. package/dist/client/client/grapesjs/settings.d.ts +3 -1
  19. package/dist/client/client/grapesjs/symbolDialogs.d.ts +1 -1
  20. package/dist/client/client/grapesjs/view-buttons.d.ts +1 -0
  21. package/dist/client/client/index.d.ts +10 -0
  22. package/dist/client/client/publication-transformers.d.ts +4 -3
  23. package/dist/client/client/publish-custom-code-block.d.ts +4 -0
  24. package/dist/client/client/publish-fonts.d.ts +4 -0
  25. package/dist/client/client/utils.d.ts +4 -0
  26. package/dist/client/constants.d.ts +1 -0
  27. package/dist/client/css/admin.css +273 -32
  28. package/dist/client/index.html +2 -1
  29. package/dist/client/js/main.js +164 -123
  30. package/dist/client/js/main.js.LICENSE.txt +15 -1
  31. package/dist/client/types.d.ts +12 -7
  32. package/dist/plugins/client/client/events.d.ts +7 -1
  33. package/dist/plugins/client/client/events.js +7 -1
  34. package/dist/plugins/client/client/events.js.map +1 -1
  35. package/dist/plugins/client/plugins/client/template.js +108 -58
  36. package/dist/plugins/client/plugins/client/template.js.map +1 -1
  37. package/dist/plugins/client/types.d.ts +12 -7
  38. package/dist/plugins/client/types.js +6 -0
  39. package/dist/plugins/client/types.js.map +1 -1
  40. package/dist/plugins/server/constants.d.ts +1 -0
  41. package/dist/plugins/server/constants.js +2 -1
  42. package/dist/plugins/server/constants.js.map +1 -1
  43. package/dist/plugins/server/plugins/server/FtpConnector.d.ts +1 -0
  44. package/dist/plugins/server/plugins/server/FtpConnector.js +12 -1
  45. package/dist/plugins/server/plugins/server/FtpConnector.js.map +1 -1
  46. package/dist/plugins/server/plugins/server/GitlabConnector.d.ts +3 -0
  47. package/dist/plugins/server/plugins/server/GitlabConnector.js +72 -35
  48. package/dist/plugins/server/plugins/server/GitlabConnector.js.map +1 -1
  49. package/dist/plugins/server/server/config.js +3 -3
  50. package/dist/plugins/server/server/config.js.map +1 -1
  51. package/dist/plugins/server/server/connectors/FsHosting.d.ts +1 -0
  52. package/dist/plugins/server/server/connectors/FsHosting.js +13 -1
  53. package/dist/plugins/server/server/connectors/FsHosting.js.map +1 -1
  54. package/dist/plugins/server/server/connectors/FsStorage.d.ts +2 -1
  55. package/dist/plugins/server/server/connectors/FsStorage.js +29 -25
  56. package/dist/plugins/server/server/connectors/FsStorage.js.map +1 -1
  57. package/dist/plugins/server/server/connectors/connectors.d.ts +1 -0
  58. package/dist/plugins/server/server/jobs.js +4 -2
  59. package/dist/plugins/server/server/jobs.js.map +1 -1
  60. package/dist/plugins/server/types.d.ts +12 -7
  61. package/dist/plugins/server/types.js +7 -1
  62. package/dist/plugins/server/types.js.map +1 -1
  63. package/dist/server/constants.js +2 -1
  64. package/dist/server/server/api/publicationApi.js +3 -5
  65. package/dist/server/server/api/websiteApi.js +26 -7
  66. package/dist/server/server/cli.js +9 -6
  67. package/dist/server/server/config.js +3 -3
  68. package/dist/server/server/connectors/FsHosting.js +13 -1
  69. package/dist/server/server/connectors/FsStorage.js +28 -25
  70. package/dist/server/server/jobs.js +4 -2
  71. package/dist/server/types.js +7 -1
  72. package/package.json +35 -31
  73. package/public/assets/favicon.ico +0 -0
  74. package/public/assets/favicon.png +0 -0
  75. package/public/assets/logo-silex-small.png +0 -0
  76. package/src/css/_variables.scss +5 -3
  77. package/src/css/dialog.scss +22 -1
  78. package/src/css/fonts.scss +31 -0
  79. package/src/css/footer.scss +1 -1
  80. package/src/css/grapesjs-plugins.scss +34 -0
  81. package/src/css/grapesjs.scss +26 -11
  82. package/src/css/index.scss +1 -0
  83. package/src/css/project-bar.scss +11 -7
  84. package/src/css/silex.scss +58 -5
  85. package/src/html/index.pug +2 -2
  86. package/src/ts/client/api.ts +14 -9
  87. package/src/ts/client/assetUrl.test.ts +145 -42
  88. package/src/ts/client/assetUrl.ts +29 -10
  89. package/src/ts/client/config.ts +85 -4
  90. package/src/ts/client/events.ts +15 -9
  91. package/src/ts/client/grapesjs/PublicationManager.ts +71 -38
  92. package/src/ts/client/grapesjs/PublicationUi.ts +13 -11
  93. package/src/ts/client/grapesjs/css-props.ts +544 -0
  94. package/src/ts/client/grapesjs/eleventy.ts +2 -5
  95. package/src/ts/client/grapesjs/footer.ts +24 -9
  96. package/src/ts/client/grapesjs/img.ts +147 -0
  97. package/src/ts/client/grapesjs/index.ts +63 -25
  98. package/src/ts/client/grapesjs/internal-links.test.ts +2 -1
  99. package/src/ts/client/grapesjs/internal-links.ts +0 -1
  100. package/src/ts/client/grapesjs/new-page-dialog.ts +2 -3
  101. package/src/ts/client/grapesjs/page-panel.ts +28 -3
  102. package/src/ts/client/grapesjs/project-bar.ts +83 -64
  103. package/src/ts/client/grapesjs/resize-panel.ts +20 -0
  104. package/src/ts/client/grapesjs/rich-text.ts +21 -13
  105. package/src/ts/client/grapesjs/semantic.ts +3 -3
  106. package/src/ts/client/grapesjs/settings-sections.ts +117 -0
  107. package/src/ts/client/grapesjs/settings.ts +120 -77
  108. package/src/ts/client/grapesjs/symbolDialogs.ts +2 -3
  109. package/src/ts/client/grapesjs/view-buttons.ts +42 -0
  110. package/src/ts/client/index.ts +13 -6
  111. package/src/ts/client/publication-transformers.test.ts +13 -5
  112. package/src/ts/client/publication-transformers.ts +60 -47
  113. package/{dist/plugins/client/client/utils.js → src/ts/client/publish-custom-code-block.ts} +14 -8
  114. package/{dist/plugins/client/page.js → src/ts/client/publish-fonts.ts} +19 -14
  115. package/src/ts/client/utils.ts +18 -0
  116. package/src/ts/constants.ts +1 -0
  117. package/src/ts/plugins/client/template.ts +112 -60
  118. package/src/ts/plugins/server/FtpConnector.ts +14 -2
  119. package/src/ts/plugins/server/GitlabConnector.ts +71 -32
  120. package/src/ts/server/api/publicationApi.ts +5 -5
  121. package/src/ts/server/api/websiteApi.ts +51 -17
  122. package/src/ts/server/cli.ts +7 -5
  123. package/src/ts/server/config.ts +4 -4
  124. package/src/ts/server/connectors/FsHosting.ts +11 -5
  125. package/src/ts/server/connectors/FsStorage.ts +33 -4
  126. package/src/ts/server/connectors/connectors.ts +1 -1
  127. package/src/ts/server/jobs.ts +4 -2
  128. package/src/ts/types.ts +10 -7
  129. package/dist/plugins/client/client/api.d.ts +0 -85
  130. package/dist/plugins/client/client/api.js +0 -114
  131. package/dist/plugins/client/client/api.js.map +0 -1
  132. package/dist/plugins/client/client/assetUrl.d.ts +0 -51
  133. package/dist/plugins/client/client/assetUrl.js +0 -224
  134. package/dist/plugins/client/client/assetUrl.js.map +0 -1
  135. package/dist/plugins/client/client/config.d.ts +0 -58
  136. package/dist/plugins/client/client/config.js +0 -90
  137. package/dist/plugins/client/client/config.js.map +0 -1
  138. package/dist/plugins/client/client/grapesjs/LoginDialog.d.ts +0 -15
  139. package/dist/plugins/client/client/grapesjs/LoginDialog.js +0 -195
  140. package/dist/plugins/client/client/grapesjs/LoginDialog.js.map +0 -1
  141. package/dist/plugins/client/client/grapesjs/PublicationManager.d.ts +0 -72
  142. package/dist/plugins/client/client/grapesjs/PublicationManager.js +0 -356
  143. package/dist/plugins/client/client/grapesjs/PublicationManager.js.map +0 -1
  144. package/dist/plugins/client/client/grapesjs/PublicationUi.d.ts +0 -62
  145. package/dist/plugins/client/client/grapesjs/PublicationUi.js +0 -336
  146. package/dist/plugins/client/client/grapesjs/PublicationUi.js.map +0 -1
  147. package/dist/plugins/client/client/grapesjs/blocks.d.ts +0 -1
  148. package/dist/plugins/client/client/grapesjs/blocks.js +0 -37
  149. package/dist/plugins/client/client/grapesjs/blocks.js.map +0 -1
  150. package/dist/plugins/client/client/grapesjs/breadcrumbs.d.ts +0 -1
  151. package/dist/plugins/client/client/grapesjs/breadcrumbs.js +0 -75
  152. package/dist/plugins/client/client/grapesjs/breadcrumbs.js.map +0 -1
  153. package/dist/plugins/client/client/grapesjs/footer.d.ts +0 -2
  154. package/dist/plugins/client/client/grapesjs/footer.js +0 -28
  155. package/dist/plugins/client/client/grapesjs/footer.js.map +0 -1
  156. package/dist/plugins/client/client/grapesjs/index.d.ts +0 -5
  157. package/dist/plugins/client/client/grapesjs/index.js +0 -313
  158. package/dist/plugins/client/client/grapesjs/index.js.map +0 -1
  159. package/dist/plugins/client/client/grapesjs/internal-links.d.ts +0 -1
  160. package/dist/plugins/client/client/grapesjs/internal-links.js +0 -219
  161. package/dist/plugins/client/client/grapesjs/internal-links.js.map +0 -1
  162. package/dist/plugins/client/client/grapesjs/new-page-dialog.d.ts +0 -2
  163. package/dist/plugins/client/client/grapesjs/new-page-dialog.js +0 -83
  164. package/dist/plugins/client/client/grapesjs/new-page-dialog.js.map +0 -1
  165. package/dist/plugins/client/client/grapesjs/openImport.d.ts +0 -9
  166. package/dist/plugins/client/client/grapesjs/openImport.js +0 -74
  167. package/dist/plugins/client/client/grapesjs/openImport.js.map +0 -1
  168. package/dist/plugins/client/client/grapesjs/page-panel.d.ts +0 -3
  169. package/dist/plugins/client/client/grapesjs/page-panel.js +0 -113
  170. package/dist/plugins/client/client/grapesjs/page-panel.js.map +0 -1
  171. package/dist/plugins/client/client/grapesjs/project-bar.d.ts +0 -1
  172. package/dist/plugins/client/client/grapesjs/project-bar.js +0 -104
  173. package/dist/plugins/client/client/grapesjs/project-bar.js.map +0 -1
  174. package/dist/plugins/client/client/grapesjs/rich-text.d.ts +0 -1
  175. package/dist/plugins/client/client/grapesjs/rich-text.js +0 -31
  176. package/dist/plugins/client/client/grapesjs/rich-text.js.map +0 -1
  177. package/dist/plugins/client/client/grapesjs/semantic.d.ts +0 -1
  178. package/dist/plugins/client/client/grapesjs/semantic.js +0 -110
  179. package/dist/plugins/client/client/grapesjs/semantic.js.map +0 -1
  180. package/dist/plugins/client/client/grapesjs/settings.d.ts +0 -2
  181. package/dist/plugins/client/client/grapesjs/settings.js +0 -198
  182. package/dist/plugins/client/client/grapesjs/settings.js.map +0 -1
  183. package/dist/plugins/client/client/grapesjs/storage.d.ts +0 -1
  184. package/dist/plugins/client/client/grapesjs/storage.js +0 -126
  185. package/dist/plugins/client/client/grapesjs/storage.js.map +0 -1
  186. package/dist/plugins/client/client/grapesjs/symbolDialogs.d.ts +0 -3
  187. package/dist/plugins/client/client/grapesjs/symbolDialogs.js +0 -36
  188. package/dist/plugins/client/client/grapesjs/symbolDialogs.js.map +0 -1
  189. package/dist/plugins/client/client/publication-transformers.d.ts +0 -41
  190. package/dist/plugins/client/client/publication-transformers.js +0 -238
  191. package/dist/plugins/client/client/publication-transformers.js.map +0 -1
  192. package/dist/plugins/client/client/utils.d.ts +0 -2
  193. package/dist/plugins/client/client/utils.js.map +0 -1
  194. package/dist/plugins/client/constants.d.ts +0 -29
  195. package/dist/plugins/client/constants.js +0 -46
  196. package/dist/plugins/client/constants.js.map +0 -1
  197. package/dist/plugins/client/page.d.ts +0 -2
  198. package/dist/plugins/client/page.js.map +0 -1
  199. package/dist/plugins/client/plugins/client/11ty.d.ts +0 -17
  200. package/dist/plugins/client/plugins/client/11ty.js +0 -86
  201. package/dist/plugins/client/plugins/client/11ty.js.map +0 -1
  202. package/dist/plugins/client/plugins/client/publicationRenderer.d.ts +0 -2
  203. package/dist/plugins/client/plugins/client/publicationRenderer.js +0 -170
  204. package/dist/plugins/client/plugins/client/publicationRenderer.js.map +0 -1
  205. package/src/ts/plugins/client/11ty.ts +0 -104
  206. package/src/ts/plugins/client/publicationRenderer.ts +0 -174
@@ -0,0 +1,544 @@
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
+ import { Editor } from 'grapesjs'
19
+
20
+ /**
21
+ * @fileoverview Adds various css properties
22
+ */
23
+
24
+ export default (editor: Editor, opts) => {
25
+ editor.on('load', () => {
26
+ editor.StyleManager.addProperty('dimension', {
27
+ name: 'Min width',
28
+ property: 'min-width',
29
+ type: 'integer',
30
+ units: ['px', '%', 'em'],
31
+ default: 'auto',
32
+ fixedValues: ['inherit', 'initial', 'unset', 'none', 'max-content', 'min-content', 'fit-content'],
33
+ }, { at: 2 })
34
+ editor.StyleManager.addProperty('dimension', {
35
+ name: 'Max height',
36
+ property: 'max-height',
37
+ type: 'integer',
38
+ units: ['px', '%', 'em'],
39
+ default: 'auto',
40
+ fixedValues: ['inherit', 'initial', 'unset', 'none', 'max-content', 'min-content', 'fit-content'],
41
+ }, { at: 5 })
42
+ editor.StyleManager.addProperty('dimension', {
43
+ name: 'Overflow',
44
+ property: 'overflow',
45
+ type: 'composite',
46
+ properties: [{
47
+ name: 'Overflow X',
48
+ type: 'radio',
49
+ options: [
50
+ /* @ts-ignore */
51
+ { value: 'auto', name: 'auto' },
52
+ /* @ts-ignore */
53
+ { value: 'hidden', name: 'hidden' },
54
+ /* @ts-ignore */
55
+ { value: 'visible', name: 'visible' },
56
+ /* @ts-ignore */
57
+ { value: 'scroll', name: 'scroll' },
58
+ ],
59
+ }, {
60
+ name: 'Overflow Y',
61
+ type: 'radio',
62
+ options: [
63
+ /* @ts-ignore */
64
+ { value: 'auto', name: 'auto' },
65
+ /* @ts-ignore */
66
+ { value: 'hidden', name: 'hidden' },
67
+ /* @ts-ignore */
68
+ { value: 'visible', name: 'visible' },
69
+ /* @ts-ignore */
70
+ { value: 'scroll', name: 'scroll' },
71
+ ],
72
+ }],
73
+ info: 'The overflow CSS property sets what to do when an element\'s content is too big to fit in its block formatting context. It is a shorthand for overflow-x and overflow-y.',
74
+ }, { at: 6 })
75
+ editor.StyleManager.addProperty('extra', {
76
+ name: 'Z index',
77
+ property: 'z-index',
78
+ type: 'slider',
79
+ step: 1,
80
+ min: -10000,
81
+ max: 10000,
82
+ units: [],
83
+ info: 'Stacking order of the element',
84
+ default: 'auto',
85
+ fixedValues: ['auto', 'unset', 'initial', 'inherit', 'revert'],
86
+ }, { at: 1 })
87
+ editor.StyleManager.addProperty('extra', {
88
+ name: 'Pointer events',
89
+ property: 'pointer-events',
90
+ type: 'select',
91
+ defaults: 'auto',
92
+ options: [
93
+ /* @ts-ignore */
94
+ { value: 'auto', name: 'auto' },
95
+ /* @ts-ignore */
96
+ { value: 'none', name: 'none' },
97
+ /* @ts-ignore */
98
+ { value: 'visiblePainted', name: 'visiblePainted' },
99
+ /* @ts-ignore */
100
+ { value: 'visibleFill', name: 'visibleFill' },
101
+ /* @ts-ignore */
102
+ { value: 'visibleStroke', name: 'visibleStroke' },
103
+ /* @ts-ignore */
104
+ { value: 'visible', name: 'visible' },
105
+ /* @ts-ignore */
106
+ { value: 'painted', name: 'painted' },
107
+ /* @ts-ignore */
108
+ { value: 'fill', name: 'fill' },
109
+ /* @ts-ignore */
110
+ { value: 'stroke', name: 'stroke' },
111
+ /* @ts-ignore */
112
+ { value: 'all', name: 'all' },
113
+ ],
114
+ info: 'The pointer-events CSS property sets under what circumstances (if any) a particular graphic element can become the target of pointer events.',
115
+ }, { at: 2 })
116
+ editor.StyleManager.addProperty('extra', {
117
+ name: 'Cursor',
118
+ property: 'cursor',
119
+ type: 'select',
120
+ defaults: 'auto',
121
+ options: [
122
+ /* @ts-ignore */
123
+ { value: 'auto', name: 'auto' },
124
+ /* @ts-ignore */
125
+ { value: 'default', name: 'default' },
126
+ /* @ts-ignore */
127
+ { value: 'none', name: 'none' },
128
+ /* @ts-ignore */
129
+ { value: 'context-menu', name: 'context-menu' },
130
+ /* @ts-ignore */
131
+ { value: 'help', name: 'help' },
132
+ /* @ts-ignore */
133
+ { value: 'pointer', name: 'pointer' },
134
+ /* @ts-ignore */
135
+ { value: 'progress', name: 'progress' },
136
+ /* @ts-ignore */
137
+ { value: 'wait', name: 'wait' },
138
+ /* @ts-ignore */
139
+ { value: 'cell', name: 'cell' },
140
+ /* @ts-ignore */
141
+ { value: 'crosshair', name: 'crosshair' },
142
+ /* @ts-ignore */
143
+ { value: 'text', name: 'text' },
144
+ /* @ts-ignore */
145
+ { value: 'vertical-text', name: 'vertical-text' },
146
+ /* @ts-ignore */
147
+ { value: 'alias', name: 'alias' },
148
+ /* @ts-ignore */
149
+ { value: 'copy', name: 'copy' },
150
+ /* @ts-ignore */
151
+ { value: 'move', name: 'move' },
152
+ /* @ts-ignore */
153
+ { value: 'no-drop', name: 'no-drop' },
154
+ /* @ts-ignore */
155
+ { value: 'not-allowed', name: 'not-allowed' },
156
+ /* @ts-ignore */
157
+ { value: 'grab', name: 'grab' },
158
+ /* @ts-ignore */
159
+ { value: 'grabbing', name: 'grabbing' },
160
+ /* @ts-ignore */
161
+ { value: 'all-scroll', name: 'all-scroll' },
162
+ /* @ts-ignore */
163
+ { value: 'col-resize', name: 'col-resize' },
164
+ /* @ts-ignore */
165
+ { value: 'row-resize', name: 'row-resize' },
166
+ /* @ts-ignore */
167
+ { value: 'n-resize', name: 'n-resize' },
168
+ /* @ts-ignore */
169
+ { value: 'e-resize', name: 'e-resize' },
170
+ /* @ts-ignore */
171
+ { value: 's-resize', name: 's-resize' },
172
+ /* @ts-ignore */
173
+ { value: 'w-resize', name: 'w-resize' },
174
+ /* @ts-ignore */
175
+ { value: 'ne-resize', name: 'ne-resize' },
176
+ /* @ts-ignore */
177
+ { value: 'nw-resize', name: 'nw-resize' },
178
+ /* @ts-ignore */
179
+ { value: 'se-resize', name: 'se-resize' },
180
+ /* @ts-ignore */
181
+ { value: 'sw-resize', name: 'sw-resize' },
182
+ /* @ts-ignore */
183
+ { value: 'ew-resize', name: 'ew-resize' },
184
+ /* @ts-ignore */
185
+ { value: 'ns-resize', name: 'ns-resize' },
186
+ /* @ts-ignore */
187
+ { value: 'nesw-resize', name: 'nesw-resize' },
188
+ /* @ts-ignore */
189
+ { value: 'nwse-resize', name: 'nwse-resize' },
190
+ /* @ts-ignore */
191
+ { value: 'zoom-in', name: 'zoom-in' },
192
+ /* @ts-ignore */
193
+ { value: 'zoom-out', name: 'zoom-out' },
194
+ ],
195
+ info: 'The cursor CSS property sets the type of mouse cursor, if any, to show when the mouse pointer is over an element.',
196
+ }, { at: 3 })
197
+ editor.StyleManager.addProperty('extra', {
198
+ name: 'Column count',
199
+ property: 'column-count',
200
+ type: 'integer',
201
+ units: [],
202
+ info: 'The column-count CSS property breaks an element\'s content into the specified number of columns.',
203
+ default: 'auto',
204
+ fixedValues: ['auto', 'inherit', 'initial', 'revert', 'unset'],
205
+ min: 1,
206
+ }, { at: 4 })
207
+ editor.StyleManager.addProperty('extra', {
208
+ name: 'Column width',
209
+ property: 'column-width',
210
+ type: 'integer',
211
+ units: ['px', '%', 'em'],
212
+ info: 'The column-width CSS property suggests an optimal column width. This is not a absolute value but a mere hint. Browser will adjust the width of the element automatically.',
213
+ default: 'auto',
214
+ fixedValues: ['auto', 'inherit', 'initial', 'revert', 'unset'],
215
+ }, { at: 5 })
216
+ editor.StyleManager.addProperty('extra', {
217
+ name: 'Column gap',
218
+ property: 'column-gap',
219
+ type: 'integer',
220
+ units: ['px', '%', 'em'],
221
+ info: 'The column-gap CSS property sets the size of the gap (gutter) between an element\'s columns.',
222
+ default: 'normal',
223
+ fixedValues: ['normal', 'inherit', 'initial', 'revert', 'unset'],
224
+ }, { at: 5 })
225
+ editor.StyleManager.addProperty('extra', {
226
+ name: 'Column rule',
227
+ property: 'column-rule',
228
+ type: 'composite',
229
+ properties: [{
230
+ name: 'Column rule width',
231
+ property: 'column-rule-width',
232
+ type: 'integer',
233
+ units: ['px', '%', 'em'],
234
+ info: 'The column-rule-width CSS property sets the width of the line drawn between columns in a multi-column layout.',
235
+ default: 'medium',
236
+ fixedValues: ['medium', 'thin', 'thick', 'inherit', 'initial', 'revert', 'unset'],
237
+ }, {
238
+ name: 'Column rule style',
239
+ property: 'column-rule-style',
240
+ type: 'select',
241
+ defaults: 'none',
242
+ options: [
243
+ /* @ts-ignore */
244
+ { value: 'none', name: 'none' },
245
+ /* @ts-ignore */
246
+ { value: 'hidden', name: 'hidden' },
247
+ /* @ts-ignore */
248
+ { value: 'dotted', name: 'dotted' },
249
+ /* @ts-ignore */
250
+ { value: 'dashed', name: 'dashed' },
251
+ /* @ts-ignore */
252
+ { value: 'solid', name: 'solid' },
253
+ /* @ts-ignore */
254
+ { value: 'double', name: 'double' },
255
+ /* @ts-ignore */
256
+ { value: 'groove', name: 'groove' },
257
+ /* @ts-ignore */
258
+ { value: 'ridge', name: 'ridge' },
259
+ /* @ts-ignore */
260
+ { value: 'inset', name: 'inset' },
261
+ /* @ts-ignore */
262
+ { value: 'outset', name: 'outset' },
263
+ /* @ts-ignore */
264
+ { value: 'inherit', name: 'inherit' },
265
+ ],
266
+ info: 'The column-rule-style CSS property sets the style of the line drawn between columns in a multi-column layout.',
267
+ }, {
268
+ name: 'Column rule color',
269
+ property: 'column-rule-color',
270
+ type: 'color',
271
+ defaults: 'none',
272
+ info: 'The column-rule-color CSS property sets the color of the line drawn between columns in a multi-column layout.',
273
+ }],
274
+ }, { at: 6 })
275
+ editor.StyleManager.addProperty('extra', {
276
+ name: 'Column span',
277
+ property: 'column-span',
278
+ type: 'select',
279
+ defaults: 'none',
280
+ options: [
281
+ /* @ts-ignore */
282
+ { value: 'none', name: 'none' },
283
+ /* @ts-ignore */
284
+ { value: 'all', name: 'all' },
285
+ ],
286
+ info: 'The column-span CSS property makes it possible for an element to span across all columns when its value is set to all.',
287
+ }, { at: 7 })
288
+
289
+ editor.StyleManager.addProperty('decorations', {
290
+ name: 'Outline',
291
+ property: 'outline',
292
+ type: 'composite',
293
+ properties: [{
294
+ name: 'Outline width',
295
+ property: 'outline-width',
296
+ type: 'integer',
297
+ units: ['px', '%', 'em'],
298
+ info: 'The outline-width CSS property sets the thickness of an element\'s outline. An outline is a line that is drawn around an element, outside the border.',
299
+ default: 'medium',
300
+ fixedValues: ['medium', 'thin', 'thick', 'inherit', 'initial', 'revert', 'unset'],
301
+ }, {
302
+ name: 'Outline style',
303
+ property: 'outline-style',
304
+ type: 'select',
305
+ defaults: 'none',
306
+ options: [
307
+ /* @ts-ignore */
308
+ { value: 'none', name: 'none' },
309
+ /* @ts-ignore */
310
+ { value: 'hidden', name: 'hidden' },
311
+ /* @ts-ignore */
312
+ { value: 'dotted', name: 'dotted' },
313
+ /* @ts-ignore */
314
+ { value: 'dashed', name: 'dashed' },
315
+ /* @ts-ignore */
316
+ { value: 'solid', name: 'solid' },
317
+ /* @ts-ignore */
318
+ { value: 'double', name: 'double' },
319
+ /* @ts-ignore */
320
+ { value: 'groove', name: 'groove' },
321
+ /* @ts-ignore */
322
+ { value: 'ridge', name: 'ridge' },
323
+ /* @ts-ignore */
324
+ { value: 'inset', name: 'inset' },
325
+ /* @ts-ignore */
326
+ { value: 'outset', name: 'outset' },
327
+ ],
328
+ info: 'The outline-style CSS property sets the style of an element\'s outline. An outline is a line that is drawn around an element, outside the border.',
329
+ }, {
330
+ name: 'Outline color',
331
+ property: 'outline-color',
332
+ type: 'color',
333
+ defaults: 'none',
334
+ info: 'The outline-color CSS property sets the color of an element\'s outline.',
335
+ }],
336
+ }, { at: 8 })
337
+ editor.StyleManager.addProperty('typography', {
338
+ name: 'Word break',
339
+ property: 'word-break',
340
+ type: 'select',
341
+ defaults: 'normal',
342
+ options: [
343
+ /* @ts-ignore */
344
+ { value: 'normal', name: 'normal' },
345
+ /* @ts-ignore */
346
+ { value: 'break-all', name: 'break-all' },
347
+ /* @ts-ignore */
348
+ { value: 'keep-all', name: 'keep-all' },
349
+ /* @ts-ignore */
350
+ { value: 'break-word', name: 'break-word' },
351
+ ],
352
+ info: 'The word-break CSS property sets whether line breaks appear wherever the text would otherwise overflow its content box.',
353
+ }, { at: 7 })
354
+ editor.StyleManager.addProperty('typography', {
355
+ name: 'Word wrap',
356
+ property: 'word-wrap',
357
+ type: 'radio',
358
+ defaults: 'normal',
359
+ options: [
360
+ /* @ts-ignore */
361
+ { value: 'normal', name: 'normal' },
362
+ /* @ts-ignore */
363
+ { value: 'break-word', name: 'break-word' },
364
+ ],
365
+ info: 'The word-wrap CSS property sets whether the line may be broken within a word in order to prevent overflow when an otherwise unbreakable string is too long to fit in its containing box.',
366
+ }, { at: 8 })
367
+ editor.StyleManager.addProperty('typography', {
368
+ name: 'White space',
369
+ property: 'white-space',
370
+ type: 'select',
371
+ defaults: 'normal',
372
+ options: [
373
+ /* @ts-ignore */
374
+ { value: 'normal', name: 'normal' },
375
+ /* @ts-ignore */
376
+ { value: 'nowrap', name: 'nowrap' },
377
+ /* @ts-ignore */
378
+ { value: 'pre', name: 'pre' },
379
+ /* @ts-ignore */
380
+ { value: 'pre-wrap', name: 'pre-wrap' },
381
+ /* @ts-ignore */
382
+ { value: 'pre-line', name: 'pre-line' },
383
+ /* @ts-ignore */
384
+ { value: 'break-spaces', name: 'break-spaces' },
385
+ ],
386
+ info: 'The white-space CSS property sets how white space inside an element is handled.',
387
+ }, { at: 9 })
388
+ editor.StyleManager.addProperty('typography', {
389
+ name: 'Text decoration',
390
+ property: 'text-decoration',
391
+ type: 'composite',
392
+ properties: [{
393
+ name: 'Text decoration line',
394
+ property: 'text-decoration-line',
395
+ type: 'select',
396
+ defaults: 'none',
397
+ fixedValues: ['auto', 'inherit', 'initial', 'revert', 'unset'],
398
+ options: [
399
+ /* @ts-ignore */
400
+ { value: 'none', name: 'none' },
401
+ /* @ts-ignore */
402
+ { value: 'underline', name: 'underline' },
403
+ /* @ts-ignore */
404
+ { value: 'overline', name: 'overline' },
405
+ /* @ts-ignore */
406
+ { value: 'line-through', name: 'line-through' },
407
+ /* @ts-ignore */
408
+ { value: 'blink', name: 'blink' },
409
+ ],
410
+ info: 'The text-decoration CSS property sets the appearance of decorative lines on text.',
411
+ }, {
412
+ name: 'Text decoration style',
413
+ property: 'text-decoration-style',
414
+ type: 'select',
415
+ defaults: 'solid',
416
+ options: [
417
+ /* @ts-ignore */
418
+ { value: 'solid', name: 'solid' },
419
+ /* @ts-ignore */
420
+ { value: 'double', name: 'double' },
421
+ /* @ts-ignore */
422
+ { value: 'dotted', name: 'dotted' },
423
+ /* @ts-ignore */
424
+ { value: 'dashed', name: 'dashed' },
425
+ /* @ts-ignore */
426
+ { value: 'wavy', name: 'wavy' },
427
+ ],
428
+ info: 'The text-decoration-style CSS property sets the style of the lines specified by text-decoration-line. The style applies to all lines, there is no way to define different styles for each of the lines.',
429
+ }, {
430
+ name: 'Text decoration color',
431
+ property: 'text-decoration-color',
432
+ type: 'color',
433
+ defaults: 'initial',
434
+ fixedValues: ['inherit', 'initial', 'revert', 'unset'],
435
+ info: 'The text-decoration-color CSS property sets the color of decorations added to text by text-decoration-line.',
436
+ }, {
437
+ name: 'Text decoration thickness',
438
+ property: 'text-decoration-thickness',
439
+ type: 'integer',
440
+ units: ['px', '%', 'em'],
441
+ info: 'The text-decoration-thickness CSS property sets the stroke thickness of the decoration line that is used on text in an element, such as a line-through, underline, or overline.',
442
+ default: 'auto',
443
+ fixedValues: ['auto', 'inherit', 'initial', 'revert', 'unset'],
444
+ }],
445
+ }, { at: 10 })
446
+ editor.StyleManager.addProperty('typography', {
447
+ name: 'Text transform',
448
+
449
+ property: 'text-transform',
450
+ type: 'select',
451
+ defaults: 'none',
452
+ options: [
453
+ /* @ts-ignore */
454
+ { value: 'none', name: 'none' },
455
+ /* @ts-ignore */
456
+ { value: 'capitalize', name: 'capitalize' },
457
+ /* @ts-ignore */
458
+ { value: 'uppercase', name: 'uppercase' },
459
+ /* @ts-ignore */
460
+ { value: 'lowercase', name: 'lowercase' },
461
+ ],
462
+ info: 'The text-transform CSS property sets how to capitalize an element\'s text. It can be used to make text appear in all-uppercase or all-lowercase, or with each word capitalized.',
463
+ }, { at: 11 })
464
+ editor.StyleManager.addProperty('typography', {
465
+ name: 'Text overflow',
466
+ property: 'text-overflow',
467
+ type: 'select',
468
+ defaults: 'clip',
469
+ options: [
470
+ /* @ts-ignore */
471
+ { value: 'clip', name: 'clip' },
472
+ /* @ts-ignore */
473
+ { value: 'ellipsis', name: 'ellipsis' },
474
+ ],
475
+ info: 'The text-overflow CSS property sets how hidden overflow content is signaled to users. It can be clipped, display an ellipsis (\'…\', U+2026 HORIZONTAL ELLIPSIS) or a Web author-defined string. It covers the two long-hand properties text-overflow-clip and text-overflow-string.',
476
+ }, { at: 12 })
477
+
478
+ editor.StyleManager.addProperty('general', {
479
+ name: 'Visibility',
480
+ property: 'visibility',
481
+ type: 'select',
482
+ defaults: 'visible',
483
+ options: [
484
+ /* @ts-ignore */
485
+ { value: 'visible', name: 'visible' },
486
+ /* @ts-ignore */
487
+ { value: 'hidden', name: 'hidden' },
488
+ /* @ts-ignore */
489
+ { value: 'collapse', name: 'collapse' },
490
+ ],
491
+ info: 'The visibility CSS property shows or hides an element without changing the layout of a document. The property can also hide rows or columns in a <table>.',
492
+ }, { at: 1 })
493
+
494
+ // Add content property, visible only when a pseudo element is selected
495
+ const contentProp = editor.StyleManager.addProperty('general', {
496
+ name: 'Content',
497
+ property: 'content',
498
+ type: 'text',
499
+ defaults: 'none',
500
+ info: 'The content CSS property replaces an element with a generated value. Objects inserted using the content property are anonymous replaced elements.',
501
+ full: true,
502
+ visible: false,
503
+ }, { at: 0 })
504
+ function refreshContentProp() {
505
+ const state = editor.SelectorManager.getState()
506
+ if (['before', 'after'].includes(state)) {
507
+ contentProp.set('visible', true)
508
+ } else {
509
+ contentProp.set('visible', false)
510
+ }
511
+ }
512
+ editor.on('selector:state component:selected component:styleUpdate style:sector:update', (state, opts) => setTimeout(() => refreshContentProp()))
513
+ editor.StyleManager.getSector('general').on('change', () => refreshContentProp())
514
+
515
+ // Add pseudo elements
516
+ editor.SelectorManager.states.add({name: 'before', label: 'Before'})
517
+ editor.SelectorManager.states.add({name: 'after', label: 'After'})
518
+ editor.SelectorManager.states.add({name: 'active', label: 'Active'})
519
+ editor.SelectorManager.states.add({name: 'first-child', label: 'First child'})
520
+ editor.SelectorManager.states.add({name: 'last-child', label: 'Last child'})
521
+ editor.SelectorManager.states.add({name: 'focus', label: 'Focus'})
522
+ editor.SelectorManager.states.add({name: 'visited', label: 'Visited'})
523
+ editor.SelectorManager.states.add({name: 'link', label: 'Link'})
524
+ editor.SelectorManager.states.add({name: 'first-letter', label: 'First letter'})
525
+ editor.SelectorManager.states.add({name: 'first-line', label: 'First line'})
526
+ editor.SelectorManager.states.add({name: 'selection', label: 'Selection'})
527
+ editor.SelectorManager.states.add({name: 'empty', label: 'Empty'})
528
+ editor.SelectorManager.states.add({name: 'enabled', label: 'Enabled'})
529
+ editor.SelectorManager.states.add({name: 'disabled', label: 'Disabled'})
530
+ editor.SelectorManager.states.add({name: 'checked', label: 'Checked'})
531
+ editor.SelectorManager.states.add({name: 'indeterminate', label: 'Indeterminate'})
532
+ editor.SelectorManager.states.add({name: 'placeholder-shown', label: 'Placeholder shown'})
533
+ editor.SelectorManager.states.add({name: 'placeholder', label: 'Placeholder'})
534
+ editor.SelectorManager.states.add({name: 'default', label: 'Default'})
535
+ editor.SelectorManager.states.add({name: 'valid', label: 'Valid'})
536
+ editor.SelectorManager.states.add({name: 'invalid', label: 'Invalid'})
537
+ editor.SelectorManager.states.add({name: 'in-range', label: 'In range'})
538
+ editor.SelectorManager.states.add({name: 'out-of-range', label: 'Out of range'})
539
+ editor.SelectorManager.states.add({name: 'required', label: 'Required'})
540
+ editor.SelectorManager.states.add({name: 'optional', label: 'Optional'})
541
+ editor.SelectorManager.states.add({name: 'read-only', label: 'Read only'})
542
+ editor.SelectorManager.states.add({name: 'read-write', label: 'Read write'})
543
+ })
544
+ }
@@ -23,15 +23,13 @@
23
23
  console.warn('This plugin is deprecated. Use the publication renderer plugin instead.')
24
24
  throw 'This plugin is deprecated. Use the publication renderer plugin instead.'
25
25
 
26
- import grapesjs from 'grapesjs/dist/grapes.min.js'
27
-
28
26
  import { getPageSlug } from '../../page'
29
27
  import { ClientEvent } from '../events'
30
28
  import { Page } from 'grapesjs'
31
29
 
32
30
  const pluginName = 'eleventy'
33
31
 
34
- export const eleventyPlugin = grapesjs.plugins.add(pluginName, (editor, opts) => {
32
+ export const eleventyPlugin = (editor, opts) => {
35
33
  editor.on(opts.eventStart || ClientEvent.PUBLISH_DATA, data => {
36
34
  data.pages.forEach((page: Page, idx) => {
37
35
  const file = data.files[idx]
@@ -43,5 +41,4 @@ ${file.css}
43
41
  file.cssPath += '.liquid'
44
42
  })
45
43
  })
46
- })
47
-
44
+ }
@@ -1,18 +1,33 @@
1
- // Styles are in: src/scss/footer.scss
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
+
19
+ /**
20
+ * @fileoverview
21
+ * The footer is the part of the UI which contain the bread crumbs
22
+ * Styles are in: src/scss/footer.scss
23
+ */
2
24
  let _onFooter = []
3
25
  let footer
4
26
  export default function (editor, options) {
5
27
  const panel = editor.Panels.addPanel({
6
28
  id: 'footer',
7
29
  visible: true,
8
- buttons: [{
9
- id: 'myNewButton',
10
- className: 'someClass',
11
- command: 'someCommand',
12
- attributes: { title: 'Some title' },
13
- active: false,
14
-
15
- }],
30
+ buttons: [],
16
31
  })
17
32
  setTimeout(() => {
18
33
  footer = panel.view?.el