@silexlabs/silex 3.7.0 → 3.9.0-canary.2

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 (596) hide show
  1. package/README.md +115 -78
  2. package/common/examples/plugin.js +6 -0
  3. package/common/silex-plugins/config.test.ts +71 -0
  4. package/common/silex-plugins/config.ts +25 -0
  5. package/common/silex-plugins/index.ts +2 -0
  6. package/common/silex-plugins/plugin.test.ts +57 -0
  7. package/common/silex-plugins/plugin.ts +65 -0
  8. package/dist/client/css/admin.css +25 -12
  9. package/dist/client/css/all.min.css +5 -5
  10. package/dist/client/index.html +2 -2
  11. package/dist/client/js/main.js +3108 -2940
  12. package/dist/client/js/main.js.LICENSE.txt +6 -4
  13. package/dist/client/webfonts/fa-brands-400.woff2 +0 -0
  14. package/dist/client/webfonts/fa-regular-400.woff2 +0 -0
  15. package/dist/client/webfonts/fa-solid-900.woff2 +0 -0
  16. package/dist/client/webfonts/fa-v4compatibility.woff2 +0 -0
  17. package/dist/server/common/externs.js +2 -0
  18. package/dist/server/common/silex-plugins/config.js +25 -0
  19. package/dist/server/common/silex-plugins/index.js +18 -0
  20. package/dist/server/common/silex-plugins/plugin.js +41 -0
  21. package/dist/server/server/api/api.js +9 -9
  22. package/dist/server/server/api/connectorApi.js +35 -35
  23. package/dist/server/server/api/publicationApi.js +19 -19
  24. package/dist/server/server/api/websiteApi.js +46 -46
  25. package/dist/server/server/config.js +19 -19
  26. package/dist/server/server/connectors/FsHosting.js +6 -6
  27. package/dist/server/server/connectors/FsStorage.js +35 -35
  28. package/dist/server/server/connectors/connectors.js +3 -3
  29. package/dist/server/server/expose.js +18 -8
  30. package/dist/server/server/express.js +3 -3
  31. package/dist/server/server/index.js +29 -19
  32. package/dist/server/server/jobs.js +4 -4
  33. package/dist/{plugins/server/plugins/server → server/server/plugins}/DownloadConnector.js +23 -28
  34. package/dist/{plugins/server/plugins/server → server/server/plugins}/FtpConnector.js +42 -117
  35. package/dist/{plugins/server/plugins/server → server/server/plugins}/GitlabConnector.js +80 -271
  36. package/dist/{plugins/server/plugins/server → server/server/plugins}/GitlabHostingConnector.js +11 -134
  37. package/dist/server/server/plugins/PublicationOptimizer.js +2 -0
  38. package/dist/{plugins/server/plugins/server → server/server/plugins}/SslPlugin.js +3 -32
  39. package/dist/{plugins/server/plugins/server → server/server/plugins}/StaticPlugin.js +4 -21
  40. package/dist/server/server/utils/BackwardCompat.js +2 -0
  41. package/dist/server/server/utils/websiteDataSerialization.js +10 -10
  42. package/{src/ts/client → editor}/api.ts +2 -2
  43. package/{src/ts/client → editor}/assetUrl.test.ts +6 -33
  44. package/{src/ts/client → editor}/assetUrl.ts +2 -2
  45. package/{src/ts/client → editor}/config.ts +3 -3
  46. package/{src/css/theme-modern.scss → editor/css/design-system.scss} +29 -14
  47. package/{src → editor}/css/index.scss +1 -3
  48. package/{src → editor}/css/project-bar.scss +5 -0
  49. package/{src/ts/client → editor}/expose.ts +3 -3
  50. package/{src/ts/client → editor}/grapesjs/LoginDialog.ts +3 -3
  51. package/{src/ts/client → editor}/grapesjs/PublicationManager.ts +3 -3
  52. package/{src/ts/client → editor}/grapesjs/PublicationUi.ts +1 -1
  53. package/{src/ts/client → editor}/grapesjs/cms/index.ts +1 -1
  54. package/{src/ts/client → editor}/grapesjs/cms/page-settings.ts +1 -1
  55. package/{src/ts/client → editor}/grapesjs/cms/publication.ts +1 -1
  56. package/{src/ts/client → editor}/grapesjs/eleventy.ts +1 -1
  57. package/{src/ts/client → editor}/grapesjs/index.ts +5 -3
  58. package/{src/ts/client → editor}/grapesjs/internal-links.ts +2 -2
  59. package/{src/ts/client → editor}/grapesjs/resize-panel.ts +2 -1
  60. package/{src/ts/client → editor}/grapesjs/settings-sections.ts +1 -1
  61. package/{src/ts/client → editor}/grapesjs/settings.ts +2 -2
  62. package/{src/ts/client → editor}/grapesjs/storage.ts +1 -1
  63. package/editor/grapesjs/website-info.ts +52 -0
  64. package/{src/ts/client → editor}/index.ts +1 -1
  65. package/{src/ts/client → editor}/publication-transformers.test.ts +10 -10
  66. package/{src/ts/client → editor}/publication-transformers.ts +1 -1
  67. package/{src/ts/client → editor}/publish-fonts.ts +2 -2
  68. package/grapesjs-plugins/expression-input/.husky/pre-commit +2 -0
  69. package/grapesjs-plugins/expression-input/.prettierrc.json +7 -0
  70. package/grapesjs-plugins/expression-input/.vscode/extensions.json +9 -0
  71. package/grapesjs-plugins/expression-input/CHANGELOG.md +47 -0
  72. package/grapesjs-plugins/expression-input/LICENSE +661 -0
  73. package/grapesjs-plugins/expression-input/README.md +59 -0
  74. package/grapesjs-plugins/expression-input/babel.config.js +3 -0
  75. package/grapesjs-plugins/expression-input/commitlint.config.js +1 -0
  76. package/grapesjs-plugins/expression-input/dev/README.md +1 -0
  77. package/grapesjs-plugins/expression-input/dev/expression-input.html +148 -0
  78. package/grapesjs-plugins/expression-input/dev/input-chain.html +88 -0
  79. package/grapesjs-plugins/expression-input/dev/popin-form.html +83 -0
  80. package/grapesjs-plugins/expression-input/docs/expression-input.md +173 -0
  81. package/grapesjs-plugins/expression-input/docs/popin-form.md +228 -0
  82. package/grapesjs-plugins/expression-input/eslint.config.mjs +71 -0
  83. package/grapesjs-plugins/expression-input/package.json +84 -0
  84. package/grapesjs-plugins/expression-input/playwright.config.ts +6 -0
  85. package/grapesjs-plugins/expression-input/rollup.config.js +39 -0
  86. package/grapesjs-plugins/expression-input/src/expression-input.ts +339 -0
  87. package/grapesjs-plugins/expression-input/src/index.ts +3 -0
  88. package/grapesjs-plugins/expression-input/src/input-chain.ts +216 -0
  89. package/grapesjs-plugins/expression-input/src/popin-form.ts +189 -0
  90. package/grapesjs-plugins/expression-input/src/popin-overlay.ts +188 -0
  91. package/grapesjs-plugins/expression-input/src/styles.ts +374 -0
  92. package/grapesjs-plugins/expression-input/src/test/popin-form_test.ts +47 -0
  93. package/grapesjs-plugins/expression-input/tsconfig.json +34 -0
  94. package/grapesjs-plugins/expression-input/web-dev-server.config.js +25 -0
  95. package/grapesjs-plugins/expression-input/web-test-runner.config.js +124 -0
  96. package/grapesjs-plugins/grapesjs-advanced-selector/.editorconfig +5 -0
  97. package/grapesjs-plugins/grapesjs-advanced-selector/.husky/pre-commit +4 -0
  98. package/grapesjs-plugins/grapesjs-advanced-selector/LICENSE +661 -0
  99. package/grapesjs-plugins/grapesjs-advanced-selector/README.md +158 -0
  100. package/grapesjs-plugins/grapesjs-advanced-selector/babel.config.js +3 -0
  101. package/grapesjs-plugins/grapesjs-advanced-selector/eslint.config.mjs +20 -0
  102. package/grapesjs-plugins/grapesjs-advanced-selector/index.html +353 -0
  103. package/grapesjs-plugins/grapesjs-advanced-selector/jest.config.cjs +11 -0
  104. package/grapesjs-plugins/grapesjs-advanced-selector/package-lock.json +12500 -0
  105. package/grapesjs-plugins/grapesjs-advanced-selector/package.json +75 -0
  106. package/grapesjs-plugins/grapesjs-advanced-selector/public/simple-selector.html +12 -0
  107. package/grapesjs-plugins/grapesjs-advanced-selector/src/StylableElement.ts +15 -0
  108. package/grapesjs-plugins/grapesjs-advanced-selector/src/capabilities.ts +49 -0
  109. package/grapesjs-plugins/grapesjs-advanced-selector/src/commands.ts +89 -0
  110. package/grapesjs-plugins/grapesjs-advanced-selector/src/components/complex-selector.ts +187 -0
  111. package/grapesjs-plugins/grapesjs-advanced-selector/src/components/compound-selector.ts +241 -0
  112. package/grapesjs-plugins/grapesjs-advanced-selector/src/components/current-selector-display.ts +289 -0
  113. package/grapesjs-plugins/grapesjs-advanced-selector/src/components/inline-select.ts +199 -0
  114. package/grapesjs-plugins/grapesjs-advanced-selector/src/components/resize-input.ts +19 -0
  115. package/grapesjs-plugins/grapesjs-advanced-selector/src/components/simple-selector.ts +537 -0
  116. package/grapesjs-plugins/grapesjs-advanced-selector/src/i18n/en.ts +75 -0
  117. package/grapesjs-plugins/grapesjs-advanced-selector/src/i18n/fr.ts +75 -0
  118. package/grapesjs-plugins/grapesjs-advanced-selector/src/index.ts +47 -0
  119. package/grapesjs-plugins/grapesjs-advanced-selector/src/model/ComplexSelector.test.ts +380 -0
  120. package/grapesjs-plugins/grapesjs-advanced-selector/src/model/ComplexSelector.ts +231 -0
  121. package/grapesjs-plugins/grapesjs-advanced-selector/src/model/CompoundSelector.test.ts +232 -0
  122. package/grapesjs-plugins/grapesjs-advanced-selector/src/model/CompoundSelector.ts +128 -0
  123. package/grapesjs-plugins/grapesjs-advanced-selector/src/model/GrapesJsSelectors.test.ts +1077 -0
  124. package/grapesjs-plugins/grapesjs-advanced-selector/src/model/GrapesJsSelectors.ts +653 -0
  125. package/grapesjs-plugins/grapesjs-advanced-selector/src/model/Operator.test.ts +45 -0
  126. package/grapesjs-plugins/grapesjs-advanced-selector/src/model/Operator.ts +129 -0
  127. package/grapesjs-plugins/grapesjs-advanced-selector/src/model/PseudoClass.test.ts +31 -0
  128. package/grapesjs-plugins/grapesjs-advanced-selector/src/model/PseudoClass.ts +159 -0
  129. package/grapesjs-plugins/grapesjs-advanced-selector/src/model/SimpleSelector.test.ts +181 -0
  130. package/grapesjs-plugins/grapesjs-advanced-selector/src/model/SimpleSelector.ts +379 -0
  131. package/grapesjs-plugins/grapesjs-advanced-selector/src/plugin.ts +225 -0
  132. package/grapesjs-plugins/grapesjs-advanced-selector/src/styles.ts +40 -0
  133. package/grapesjs-plugins/grapesjs-advanced-selector/src/test-data.json +3546 -0
  134. package/grapesjs-plugins/grapesjs-advanced-selector/tsconfig.json +37 -0
  135. package/grapesjs-plugins/grapesjs-ai-capabilities/.eslintrc.json +31 -0
  136. package/grapesjs-plugins/grapesjs-ai-capabilities/LICENSE +17 -0
  137. package/grapesjs-plugins/grapesjs-ai-capabilities/README.md +129 -0
  138. package/grapesjs-plugins/grapesjs-ai-capabilities/_index.html +37 -0
  139. package/grapesjs-plugins/grapesjs-ai-capabilities/package-lock.json +9023 -0
  140. package/grapesjs-plugins/grapesjs-ai-capabilities/package.json +46 -0
  141. package/grapesjs-plugins/grapesjs-ai-capabilities/src/index.js +97 -0
  142. package/grapesjs-plugins/grapesjs-ai-capabilities/test/index.test.js +198 -0
  143. package/grapesjs-plugins/grapesjs-ai-capabilities/tsconfig.json +29 -0
  144. package/grapesjs-plugins/grapesjs-css-variables/.eslintrc.json +31 -0
  145. package/grapesjs-plugins/grapesjs-css-variables/LICENSE +661 -0
  146. package/grapesjs-plugins/grapesjs-css-variables/README.md +172 -0
  147. package/grapesjs-plugins/grapesjs-css-variables/TEST_SCENARIOS.md +181 -0
  148. package/grapesjs-plugins/grapesjs-css-variables/_index.html +93 -0
  149. package/grapesjs-plugins/grapesjs-css-variables/package-lock.json +9020 -0
  150. package/grapesjs-plugins/grapesjs-css-variables/package.json +46 -0
  151. package/grapesjs-plugins/grapesjs-css-variables/src/capabilities.js +133 -0
  152. package/grapesjs-plugins/grapesjs-css-variables/src/index.js +37 -0
  153. package/grapesjs-plugins/grapesjs-css-variables/src/locale/en.js +22 -0
  154. package/grapesjs-plugins/grapesjs-css-variables/src/locale/fr.js +22 -0
  155. package/grapesjs-plugins/grapesjs-css-variables/src/modal.js +692 -0
  156. package/grapesjs-plugins/grapesjs-css-variables/src/style-manager.js +461 -0
  157. package/grapesjs-plugins/grapesjs-css-variables/src/types.js +8 -0
  158. package/grapesjs-plugins/grapesjs-css-variables/src/variables.js +439 -0
  159. package/grapesjs-plugins/grapesjs-data-source/.husky/pre-commit +4 -0
  160. package/grapesjs-plugins/grapesjs-data-source/.nvmrc +1 -0
  161. package/grapesjs-plugins/grapesjs-data-source/LICENSE +661 -0
  162. package/grapesjs-plugins/grapesjs-data-source/README.md +674 -0
  163. package/grapesjs-plugins/grapesjs-data-source/__mocks__/directus-schema.json +67137 -0
  164. package/grapesjs-plugins/grapesjs-data-source/__mocks__/directus-test-schema.json +8393 -0
  165. package/grapesjs-plugins/grapesjs-data-source/__mocks__/graphql-mocks.js +7 -0
  166. package/grapesjs-plugins/grapesjs-data-source/__mocks__/simple-schema.json +493 -0
  167. package/grapesjs-plugins/grapesjs-data-source/__mocks__/squidex-schema.json +6656 -0
  168. package/grapesjs-plugins/grapesjs-data-source/__mocks__/strapi-schema.json +7986 -0
  169. package/grapesjs-plugins/grapesjs-data-source/_index.html +110 -0
  170. package/grapesjs-plugins/grapesjs-data-source/babel.config.js +7 -0
  171. package/grapesjs-plugins/grapesjs-data-source/eslint.config.mjs +47 -0
  172. package/grapesjs-plugins/grapesjs-data-source/example.graphql +355 -0
  173. package/grapesjs-plugins/grapesjs-data-source/example.graphql.json +5666 -0
  174. package/grapesjs-plugins/grapesjs-data-source/example.page.json +1 -0
  175. package/grapesjs-plugins/grapesjs-data-source/integration-tests/base/graphql-response.json +6 -0
  176. package/grapesjs-plugins/grapesjs-data-source/integration-tests/base/graphql-types.json +2095 -0
  177. package/grapesjs-plugins/grapesjs-data-source/integration-tests/base/preview.html +5 -0
  178. package/grapesjs-plugins/grapesjs-data-source/integration-tests/base/website.json +79 -0
  179. package/grapesjs-plugins/grapesjs-data-source/integration-tests/countries-lists/graphql-response.json +1056 -0
  180. package/grapesjs-plugins/grapesjs-data-source/integration-tests/countries-lists/graphql-types.json +2095 -0
  181. package/grapesjs-plugins/grapesjs-data-source/integration-tests/countries-lists/preview.html +36 -0
  182. package/grapesjs-plugins/grapesjs-data-source/integration-tests/countries-lists/website.json +422 -0
  183. package/grapesjs-plugins/grapesjs-data-source/integration-tests/example.graphql-result.json +18718 -0
  184. package/grapesjs-plugins/grapesjs-data-source/integration-tests/example.graphql-types.json +1955 -0
  185. package/grapesjs-plugins/grapesjs-data-source/integration-tests/graphql-modules.json +191 -0
  186. package/grapesjs-plugins/grapesjs-data-source/integration-tests/modules.html +45 -0
  187. package/grapesjs-plugins/grapesjs-data-source/integration-tests/visibility-truthy/graphql-response.json +1056 -0
  188. package/grapesjs-plugins/grapesjs-data-source/integration-tests/visibility-truthy/graphql-types.json +2095 -0
  189. package/grapesjs-plugins/grapesjs-data-source/integration-tests/visibility-truthy/preview.html +31 -0
  190. package/grapesjs-plugins/grapesjs-data-source/integration-tests/visibility-truthy/website.json +261 -0
  191. package/grapesjs-plugins/grapesjs-data-source/integration-tests/website-modules.json +650 -0
  192. package/grapesjs-plugins/grapesjs-data-source/jest.config.js +21 -0
  193. package/grapesjs-plugins/grapesjs-data-source/package-lock.json +13182 -0
  194. package/grapesjs-plugins/grapesjs-data-source/package.json +77 -0
  195. package/grapesjs-plugins/grapesjs-data-source/src/api.ts +386 -0
  196. package/grapesjs-plugins/grapesjs-data-source/src/capabilities.ts +80 -0
  197. package/grapesjs-plugins/grapesjs-data-source/src/commands.ts +269 -0
  198. package/grapesjs-plugins/grapesjs-data-source/src/datasources/GraphQL.ts +1039 -0
  199. package/grapesjs-plugins/grapesjs-data-source/src/datasources/graphql-introspection-query.ts +112 -0
  200. package/grapesjs-plugins/grapesjs-data-source/src/datasources/graphql.test.ts +657 -0
  201. package/grapesjs-plugins/grapesjs-data-source/src/filters/index.ts +102 -0
  202. package/grapesjs-plugins/grapesjs-data-source/src/filters/liquid.test.ts +27 -0
  203. package/grapesjs-plugins/grapesjs-data-source/src/filters/liquid.ts +985 -0
  204. package/grapesjs-plugins/grapesjs-data-source/src/index.ts +103 -0
  205. package/grapesjs-plugins/grapesjs-data-source/src/integration.test.ts +504 -0
  206. package/grapesjs-plugins/grapesjs-data-source/src/model/ExpressionTree.ts +251 -0
  207. package/grapesjs-plugins/grapesjs-data-source/src/model/completion.ts +213 -0
  208. package/grapesjs-plugins/grapesjs-data-source/src/model/dataSourceManager.ts +315 -0
  209. package/grapesjs-plugins/grapesjs-data-source/src/model/dataSourceRegistry.test.ts +170 -0
  210. package/grapesjs-plugins/grapesjs-data-source/src/model/dataSourceRegistry.ts +117 -0
  211. package/grapesjs-plugins/grapesjs-data-source/src/model/expressionEvaluator.ts +241 -0
  212. package/grapesjs-plugins/grapesjs-data-source/src/model/previewDataLoader.ts +196 -0
  213. package/grapesjs-plugins/grapesjs-data-source/src/model/queryBuilder.ts +118 -0
  214. package/grapesjs-plugins/grapesjs-data-source/src/model/state.test.ts +76 -0
  215. package/grapesjs-plugins/grapesjs-data-source/src/model/state.ts +243 -0
  216. package/grapesjs-plugins/grapesjs-data-source/src/model/token.ts +336 -0
  217. package/grapesjs-plugins/grapesjs-data-source/src/storage.test.ts +81 -0
  218. package/grapesjs-plugins/grapesjs-data-source/src/storage.ts +55 -0
  219. package/grapesjs-plugins/grapesjs-data-source/src/test-data.ts +154 -0
  220. package/grapesjs-plugins/grapesjs-data-source/src/types.ts +299 -0
  221. package/grapesjs-plugins/grapesjs-data-source/src/utils.test.ts +46 -0
  222. package/grapesjs-plugins/grapesjs-data-source/src/utils.ts +367 -0
  223. package/grapesjs-plugins/grapesjs-data-source/src/view/canvas.ts +718 -0
  224. package/grapesjs-plugins/grapesjs-data-source/src/view/custom-states-editor.ts +371 -0
  225. package/grapesjs-plugins/grapesjs-data-source/src/view/defaultStyles.ts +432 -0
  226. package/grapesjs-plugins/grapesjs-data-source/src/view/index.ts +168 -0
  227. package/grapesjs-plugins/grapesjs-data-source/src/view/properties-editor.ts +249 -0
  228. package/grapesjs-plugins/grapesjs-data-source/src/view/settings.ts +1551 -0
  229. package/grapesjs-plugins/grapesjs-data-source/src/view/state-editor.ts +528 -0
  230. package/grapesjs-plugins/grapesjs-data-source/strapi/.editorconfig +16 -0
  231. package/grapesjs-plugins/grapesjs-data-source/strapi/.env.example +7 -0
  232. package/grapesjs-plugins/grapesjs-data-source/strapi/.eslintignore +3 -0
  233. package/grapesjs-plugins/grapesjs-data-source/strapi/.eslintrc +27 -0
  234. package/grapesjs-plugins/grapesjs-data-source/strapi/README.md +57 -0
  235. package/grapesjs-plugins/grapesjs-data-source/strapi/config/admin.js +13 -0
  236. package/grapesjs-plugins/grapesjs-data-source/strapi/config/api.js +7 -0
  237. package/grapesjs-plugins/grapesjs-data-source/strapi/config/database.js +92 -0
  238. package/grapesjs-plugins/grapesjs-data-source/strapi/config/middlewares.js +12 -0
  239. package/grapesjs-plugins/grapesjs-data-source/strapi/config/server.js +10 -0
  240. package/grapesjs-plugins/grapesjs-data-source/strapi/database/migrations/.gitkeep +0 -0
  241. package/grapesjs-plugins/grapesjs-data-source/strapi/favicon.png +0 -0
  242. package/grapesjs-plugins/grapesjs-data-source/strapi/jsconfig.json +8 -0
  243. package/grapesjs-plugins/grapesjs-data-source/strapi/package.json +31 -0
  244. package/grapesjs-plugins/grapesjs-data-source/strapi/public/robots.txt +3 -0
  245. package/grapesjs-plugins/grapesjs-data-source/strapi/public/uploads/.gitkeep +0 -0
  246. package/grapesjs-plugins/grapesjs-data-source/strapi/src/admin/app.example.js +39 -0
  247. package/grapesjs-plugins/grapesjs-data-source/strapi/src/admin/webpack.config.example.js +9 -0
  248. package/grapesjs-plugins/grapesjs-data-source/strapi/src/api/.gitkeep +0 -0
  249. package/grapesjs-plugins/grapesjs-data-source/strapi/src/api/post/content-types/post/schema.json +26 -0
  250. package/grapesjs-plugins/grapesjs-data-source/strapi/src/api/post/controllers/post.js +9 -0
  251. package/grapesjs-plugins/grapesjs-data-source/strapi/src/api/post/routes/post.js +9 -0
  252. package/grapesjs-plugins/grapesjs-data-source/strapi/src/api/post/services/post.js +9 -0
  253. package/grapesjs-plugins/grapesjs-data-source/strapi/src/extensions/.gitkeep +0 -0
  254. package/grapesjs-plugins/grapesjs-data-source/strapi/src/index.js +20 -0
  255. package/grapesjs-plugins/grapesjs-data-source/strapi/types/generated/components.d.ts +5 -0
  256. package/grapesjs-plugins/grapesjs-data-source/strapi/types/generated/contentTypes.d.ts +723 -0
  257. package/grapesjs-plugins/grapesjs-data-source/tmp/countries-lists.html +1 -0
  258. package/grapesjs-plugins/grapesjs-data-source/tsconfig.cjs.json +8 -0
  259. package/grapesjs-plugins/grapesjs-data-source/tsconfig.json +49 -0
  260. package/grapesjs-plugins/grapesjs-filter-styles/README.md +137 -0
  261. package/grapesjs-plugins/grapesjs-filter-styles/eslint.config.mjs +35 -0
  262. package/grapesjs-plugins/grapesjs-filter-styles/package-lock.json +8927 -0
  263. package/grapesjs-plugins/grapesjs-filter-styles/package.json +40 -0
  264. package/grapesjs-plugins/grapesjs-filter-styles/src/index.js +283 -0
  265. package/grapesjs-plugins/grapesjs-filter-styles/tsconfig.json +26 -0
  266. package/grapesjs-plugins/grapesjs-fonts/.eslintrc.json +31 -0
  267. package/grapesjs-plugins/grapesjs-fonts/LICENSE +9 -0
  268. package/grapesjs-plugins/grapesjs-fonts/README.md +231 -0
  269. package/grapesjs-plugins/grapesjs-fonts/_index.html +95 -0
  270. package/grapesjs-plugins/grapesjs-fonts/package-lock.json +9024 -0
  271. package/grapesjs-plugins/grapesjs-fonts/package.json +46 -0
  272. package/grapesjs-plugins/grapesjs-fonts/src/capabilities.js +61 -0
  273. package/grapesjs-plugins/grapesjs-fonts/src/commands.js +100 -0
  274. package/grapesjs-plugins/grapesjs-fonts/src/fonts.js +396 -0
  275. package/grapesjs-plugins/grapesjs-fonts/src/index.js +34 -0
  276. package/grapesjs-plugins/grapesjs-fonts/src/locale/en.js +19 -0
  277. package/grapesjs-plugins/grapesjs-fonts/src/locale/fr.js +21 -0
  278. package/grapesjs-plugins/grapesjs-fonts/src/locale/ptbr.js +18 -0
  279. package/grapesjs-plugins/grapesjs-fonts/tsconfig.json +29 -0
  280. package/grapesjs-plugins/grapesjs-keymaps-dialog/README.md +116 -0
  281. package/grapesjs-plugins/grapesjs-keymaps-dialog/package.json +46 -0
  282. package/grapesjs-plugins/grapesjs-keymaps-dialog/src/KeymapsDialog.ts +208 -0
  283. package/grapesjs-plugins/grapesjs-keymaps-dialog/src/KeymapsDialogManager.ts +78 -0
  284. package/grapesjs-plugins/grapesjs-keymaps-dialog/src/index.ts +70 -0
  285. package/grapesjs-plugins/grapesjs-keymaps-dialog/tsconfig.json +29 -0
  286. package/grapesjs-plugins/grapesjs-loading/.eslintrc.json +22 -0
  287. package/grapesjs-plugins/grapesjs-loading/README.md +140 -0
  288. package/grapesjs-plugins/grapesjs-loading/_index.html +90 -0
  289. package/grapesjs-plugins/grapesjs-loading/eslint.config.mjs +20 -0
  290. package/grapesjs-plugins/grapesjs-loading/grapesjs-loading.gif +0 -0
  291. package/grapesjs-plugins/grapesjs-loading/package.json +50 -0
  292. package/grapesjs-plugins/grapesjs-loading/src/index.ts +54 -0
  293. package/grapesjs-plugins/grapesjs-loading/tsconfig.json +20 -0
  294. package/grapesjs-plugins/grapesjs-notifications/LICENSE +661 -0
  295. package/grapesjs-plugins/grapesjs-notifications/README.md +295 -0
  296. package/grapesjs-plugins/grapesjs-notifications/_index.html +95 -0
  297. package/grapesjs-plugins/grapesjs-notifications/package-lock.json +8187 -0
  298. package/grapesjs-plugins/grapesjs-notifications/package.json +58 -0
  299. package/grapesjs-plugins/grapesjs-notifications/src/Notification.ts +117 -0
  300. package/grapesjs-plugins/grapesjs-notifications/src/NotificationManager.ts +93 -0
  301. package/grapesjs-plugins/grapesjs-notifications/src/Storage.ts +26 -0
  302. package/grapesjs-plugins/grapesjs-notifications/src/capabilities.ts +33 -0
  303. package/grapesjs-plugins/grapesjs-notifications/src/commands.ts +5 -0
  304. package/grapesjs-plugins/grapesjs-notifications/src/index.ts +126 -0
  305. package/grapesjs-plugins/grapesjs-notifications/src/locale/en.js +8 -0
  306. package/grapesjs-plugins/grapesjs-notifications/src/view.ts +127 -0
  307. package/grapesjs-plugins/grapesjs-notifications/tsconfig.json +30 -0
  308. package/grapesjs-plugins/grapesjs-storage-rate-limit/LICENSE +213 -0
  309. package/grapesjs-plugins/grapesjs-storage-rate-limit/README.md +119 -0
  310. package/grapesjs-plugins/grapesjs-storage-rate-limit/jest.config.js +197 -0
  311. package/grapesjs-plugins/grapesjs-storage-rate-limit/package-lock.json +10752 -0
  312. package/grapesjs-plugins/grapesjs-storage-rate-limit/package.json +44 -0
  313. package/grapesjs-plugins/grapesjs-storage-rate-limit/src/index.js +90 -0
  314. package/grapesjs-plugins/grapesjs-storage-rate-limit/src/index.test.js +122 -0
  315. package/grapesjs-plugins/grapesjs-symbols/.eslintrc.cjs +20 -0
  316. package/grapesjs-plugins/grapesjs-symbols/.husky/pre-commit +5 -0
  317. package/grapesjs-plugins/grapesjs-symbols/.nvmrc +1 -0
  318. package/grapesjs-plugins/grapesjs-symbols/LICENSE +661 -0
  319. package/grapesjs-plugins/grapesjs-symbols/README.md +228 -0
  320. package/grapesjs-plugins/grapesjs-symbols/_index.html +104 -0
  321. package/grapesjs-plugins/grapesjs-symbols/es5.html +119 -0
  322. package/grapesjs-plugins/grapesjs-symbols/es6.html +107 -0
  323. package/grapesjs-plugins/grapesjs-symbols/eslint.config.mjs +72 -0
  324. package/grapesjs-plugins/grapesjs-symbols/jest.config.js +12 -0
  325. package/grapesjs-plugins/grapesjs-symbols/package-lock.json +6867 -0
  326. package/grapesjs-plugins/grapesjs-symbols/package.json +73 -0
  327. package/grapesjs-plugins/grapesjs-symbols/rollup.config.mjs +26 -0
  328. package/grapesjs-plugins/grapesjs-symbols/src/SymbolsCommands.test.ts +147 -0
  329. package/grapesjs-plugins/grapesjs-symbols/src/SymbolsCommands.ts +144 -0
  330. package/grapesjs-plugins/grapesjs-symbols/src/capabilities.ts +50 -0
  331. package/grapesjs-plugins/grapesjs-symbols/src/events.ts +8 -0
  332. package/grapesjs-plugins/grapesjs-symbols/src/id-utils.ts +158 -0
  333. package/grapesjs-plugins/grapesjs-symbols/src/index.ts +46 -0
  334. package/grapesjs-plugins/grapesjs-symbols/src/test-utils.ts +51 -0
  335. package/grapesjs-plugins/grapesjs-symbols/src/utils.test.ts +118 -0
  336. package/grapesjs-plugins/grapesjs-symbols/src/utils.ts +90 -0
  337. package/grapesjs-plugins/grapesjs-symbols/src/view/SymbolsView.ts +251 -0
  338. package/grapesjs-plugins/grapesjs-symbols/src/view/traits.ts +101 -0
  339. package/grapesjs-plugins/grapesjs-symbols/tsconfig.json +35 -0
  340. package/grapesjs-plugins/grapesjs-symbols/tsconfig.test.json +12 -0
  341. package/grapesjs-plugins/grapesjs-version-flow/LICENSE +661 -0
  342. package/grapesjs-plugins/grapesjs-version-flow/README.md +422 -0
  343. package/grapesjs-plugins/grapesjs-version-flow/_index.html +494 -0
  344. package/grapesjs-plugins/grapesjs-version-flow/babel.config.js +9 -0
  345. package/grapesjs-plugins/grapesjs-version-flow/package-lock.json +11832 -0
  346. package/grapesjs-plugins/grapesjs-version-flow/package.json +77 -0
  347. package/grapesjs-plugins/grapesjs-version-flow/prompts/initial.txt +116 -0
  348. package/grapesjs-plugins/grapesjs-version-flow/src/event-system.js +48 -0
  349. package/grapesjs-plugins/grapesjs-version-flow/src/index.js +87 -0
  350. package/grapesjs-plugins/grapesjs-version-flow/src/locale/en.js +26 -0
  351. package/grapesjs-plugins/grapesjs-version-flow/src/locale/fr.js +26 -0
  352. package/grapesjs-plugins/grapesjs-version-flow/src/modal-ui.js +562 -0
  353. package/grapesjs-plugins/grapesjs-version-flow/src/style-manager.js +240 -0
  354. package/grapesjs-plugins/grapesjs-version-flow/src/upgrade-engine.js +237 -0
  355. package/grapesjs-plugins/grapesjs-version-flow/src/version-manager.js +117 -0
  356. package/grapesjs-plugins/grapesjs-version-flow/tests/index.test.js +241 -0
  357. package/grapesjs-plugins/grapesjs-version-flow/tests/integration.test.js +227 -0
  358. package/grapesjs-plugins/grapesjs-version-flow/tests/setup.js +67 -0
  359. package/grapesjs-plugins/grapesjs-version-flow/tests/upgrade-engine.test.js +360 -0
  360. package/grapesjs-plugins/grapesjs-version-flow/tests/version-manager.test.js +168 -0
  361. package/grapesjs-plugins/grapesjs-version-flow/tests/version-storage.test.js +203 -0
  362. package/grapesjs-plugins/grapesjs-version-flow/tsconfig.json +26 -0
  363. package/package.json +127 -159
  364. package/{src/ts/server → server}/api/api.ts +6 -6
  365. package/{src/ts/server → server}/api/connectorApi.ts +5 -5
  366. package/{src/ts/server → server}/api/publicationApi.ts +7 -7
  367. package/{src/ts/server → server}/api/websiteApi.ts +7 -8
  368. package/{src/ts/server → server}/config.ts +14 -12
  369. package/{src/ts/server → server}/connectors/FsHosting.ts +4 -4
  370. package/{src/ts/server → server}/connectors/FsStorage.test.ts +2 -2
  371. package/{src/ts/server → server}/connectors/FsStorage.ts +8 -8
  372. package/{src/ts/server → server}/connectors/connectors.ts +3 -3
  373. package/server/deploy/.nvmrc +1 -0
  374. package/server/deploy/.silex.js +220 -0
  375. package/server/deploy/client-config.js +17 -0
  376. package/server/deploy/client-plugins/.gitkeep +0 -0
  377. package/server/deploy/client-plugins/onboarding.js +67 -0
  378. package/server/deploy/example.env +25 -0
  379. package/server/deploy/onboarding.json +22 -0
  380. package/server/deploy/picto-silex@3x.png +0 -0
  381. package/server/deploy/server-plugins/dashboard.js +74 -0
  382. package/server/deploy/server-plugins/onboarding.js +212 -0
  383. package/server/deploy/silex-platform.yml +75 -0
  384. package/{src/ts/server → server}/events.ts +2 -2
  385. package/{src/ts/server → server}/expose.ts +1 -1
  386. package/{src/ts/server → server}/express.ts +2 -2
  387. package/{src/ts/server → server}/index.ts +7 -7
  388. package/{src/ts/server → server}/jobs.test.ts +1 -1
  389. package/{src/ts/server → server}/jobs.ts +1 -1
  390. package/server/plugins/DownloadConnector.publish.test.ts +32 -0
  391. package/server/plugins/DownloadConnector.test.ts +70 -0
  392. package/{src/ts/plugins/server → server/plugins}/DownloadConnector.ts +22 -10
  393. package/{src/ts/plugins/server → server/plugins}/FtpConnector.test.ts +3 -3
  394. package/{src/ts/plugins/server → server/plugins}/FtpConnector.ts +7 -7
  395. package/{src/ts/plugins/server → server/plugins}/GitlabConnector.ts +9 -26
  396. package/{src/ts/plugins/server → server/plugins}/GitlabHostingConnector.ts +5 -5
  397. package/{src/ts/plugins/server → server/plugins}/SslPlugin.ts +2 -2
  398. package/{src/ts/plugins/server → server/plugins}/StaticPlugin.ts +2 -2
  399. package/{src/ts/server → server}/utils/BackwardCompat.ts +1 -1
  400. package/{src/ts/server → server}/utils/websiteDataSerialization.test.ts +2 -2
  401. package/{src/ts/server → server}/utils/websiteDataSerialization.ts +3 -3
  402. package/.silex.js +0 -76
  403. package/dist/client/client/api.d.ts +0 -101
  404. package/dist/client/client/assetUrl.d.ts +0 -60
  405. package/dist/client/client/config.d.ts +0 -110
  406. package/dist/client/client/events.d.ts +0 -23
  407. package/dist/client/client/expose.d.ts +0 -10
  408. package/dist/client/client/grapesjs/LoginDialog.d.ts +0 -15
  409. package/dist/client/client/grapesjs/PublicationManager.d.ts +0 -117
  410. package/dist/client/client/grapesjs/PublicationUi.d.ts +0 -59
  411. package/dist/client/client/grapesjs/blocks.d.ts +0 -1
  412. package/dist/client/client/grapesjs/body-remap.d.ts +0 -15
  413. package/dist/client/client/grapesjs/breadcrumbs.d.ts +0 -1
  414. package/dist/client/client/grapesjs/cms/DataSource.d.ts +0 -43
  415. package/dist/client/client/grapesjs/cms/blocks.d.ts +0 -2
  416. package/dist/client/client/grapesjs/cms/buttons.d.ts +0 -2
  417. package/dist/client/client/grapesjs/cms/collection-pages.d.ts +0 -4
  418. package/dist/client/client/grapesjs/cms/config.d.ts +0 -9
  419. package/dist/client/client/grapesjs/cms/filters.d.ts +0 -3
  420. package/dist/client/client/grapesjs/cms/index.d.ts +0 -43
  421. package/dist/client/client/grapesjs/cms/liquid.d.ts +0 -73
  422. package/dist/client/client/grapesjs/cms/page-settings.d.ts +0 -6
  423. package/dist/client/client/grapesjs/cms/publication.d.ts +0 -60
  424. package/dist/client/client/grapesjs/cms/site-settings.d.ts +0 -3
  425. package/dist/client/client/grapesjs/cms/states.d.ts +0 -8
  426. package/dist/client/client/grapesjs/cms/traits.d.ts +0 -8
  427. package/dist/client/client/grapesjs/core-commands.d.ts +0 -3
  428. package/dist/client/client/grapesjs/css-props.d.ts +0 -6
  429. package/dist/client/client/grapesjs/flex.d.ts +0 -3
  430. package/dist/client/client/grapesjs/footer.d.ts +0 -2
  431. package/dist/client/client/grapesjs/img.d.ts +0 -6
  432. package/dist/client/client/grapesjs/index.d.ts +0 -9
  433. package/dist/client/client/grapesjs/internal-links.d.ts +0 -1
  434. package/dist/client/client/grapesjs/keymaps.d.ts +0 -123
  435. package/dist/client/client/grapesjs/li.d.ts +0 -7
  436. package/dist/client/client/grapesjs/new-page-dialog.d.ts +0 -2
  437. package/dist/client/client/grapesjs/openImport.d.ts +0 -9
  438. package/dist/client/client/grapesjs/page-panel.d.ts +0 -13
  439. package/dist/client/client/grapesjs/project-bar.d.ts +0 -21
  440. package/dist/client/client/grapesjs/resize-panel.d.ts +0 -1
  441. package/dist/client/client/grapesjs/rich-text.d.ts +0 -4
  442. package/dist/client/client/grapesjs/sectors.d.ts +0 -12
  443. package/dist/client/client/grapesjs/semantic.d.ts +0 -1
  444. package/dist/client/client/grapesjs/settings-sections.d.ts +0 -19
  445. package/dist/client/client/grapesjs/settings.d.ts +0 -16
  446. package/dist/client/client/grapesjs/storage.d.ts +0 -3
  447. package/dist/client/client/grapesjs/symbolDialogs.d.ts +0 -4
  448. package/dist/client/client/grapesjs/upload-progress.d.ts +0 -2
  449. package/dist/client/client/grapesjs/view-buttons.d.ts +0 -2
  450. package/dist/client/client/index.d.ts +0 -10
  451. package/dist/client/client/publication-transformers.d.ts +0 -42
  452. package/dist/client/client/publish-custom-code-block.d.ts +0 -4
  453. package/dist/client/client/publish-fonts.d.ts +0 -4
  454. package/dist/client/client/utils.d.ts +0 -23
  455. package/dist/client/constants.d.ts +0 -35
  456. package/dist/client/page.d.ts +0 -2
  457. package/dist/client/types.d.ts +0 -365
  458. package/dist/client/webfonts/fa-brands-400.ttf +0 -0
  459. package/dist/client/webfonts/fa-regular-400.ttf +0 -0
  460. package/dist/client/webfonts/fa-solid-900.ttf +0 -0
  461. package/dist/client/webfonts/fa-v4compatibility.ttf +0 -0
  462. package/dist/plugins/client/client/events.d.ts +0 -23
  463. package/dist/plugins/client/client/events.js +0 -43
  464. package/dist/plugins/client/client/events.js.map +0 -1
  465. package/dist/plugins/client/plugins/client/template.d.ts +0 -2
  466. package/dist/plugins/client/plugins/client/template.js +0 -234
  467. package/dist/plugins/client/plugins/client/template.js.map +0 -1
  468. package/dist/plugins/client/plugins/client/website-info.d.ts +0 -1
  469. package/dist/plugins/client/plugins/client/website-info.js +0 -72
  470. package/dist/plugins/client/plugins/client/website-info.js.map +0 -1
  471. package/dist/plugins/client/types.d.ts +0 -365
  472. package/dist/plugins/client/types.js +0 -83
  473. package/dist/plugins/client/types.js.map +0 -1
  474. package/dist/plugins/server/constants.d.ts +0 -35
  475. package/dist/plugins/server/constants.js +0 -79
  476. package/dist/plugins/server/constants.js.map +0 -1
  477. package/dist/plugins/server/page.d.ts +0 -2
  478. package/dist/plugins/server/page.js +0 -35
  479. package/dist/plugins/server/page.js.map +0 -1
  480. package/dist/plugins/server/plugins/server/Cache.d.ts +0 -2
  481. package/dist/plugins/server/plugins/server/Cache.js +0 -36
  482. package/dist/plugins/server/plugins/server/Cache.js.map +0 -1
  483. package/dist/plugins/server/plugins/server/DownloadConnector.d.ts +0 -29
  484. package/dist/plugins/server/plugins/server/DownloadConnector.js.map +0 -1
  485. package/dist/plugins/server/plugins/server/FtpConnector.d.ts +0 -86
  486. package/dist/plugins/server/plugins/server/FtpConnector.js.map +0 -1
  487. package/dist/plugins/server/plugins/server/GitlabConnector.d.ts +0 -172
  488. package/dist/plugins/server/plugins/server/GitlabConnector.js.map +0 -1
  489. package/dist/plugins/server/plugins/server/GitlabHostingConnector.d.ts +0 -23
  490. package/dist/plugins/server/plugins/server/GitlabHostingConnector.js.map +0 -1
  491. package/dist/plugins/server/plugins/server/PublicationOptimizer.js +0 -14
  492. package/dist/plugins/server/plugins/server/PublicationOptimizer.js.map +0 -1
  493. package/dist/plugins/server/plugins/server/SslPlugin.d.ts +0 -1
  494. package/dist/plugins/server/plugins/server/SslPlugin.js.map +0 -1
  495. package/dist/plugins/server/plugins/server/StaticPlugin.d.ts +0 -8
  496. package/dist/plugins/server/plugins/server/StaticPlugin.js.map +0 -1
  497. package/dist/plugins/server/server/config.d.ts +0 -59
  498. package/dist/plugins/server/server/config.js +0 -181
  499. package/dist/plugins/server/server/config.js.map +0 -1
  500. package/dist/plugins/server/server/connectors/FsHosting.d.ts +0 -14
  501. package/dist/plugins/server/server/connectors/FsHosting.js +0 -66
  502. package/dist/plugins/server/server/connectors/FsHosting.js.map +0 -1
  503. package/dist/plugins/server/server/connectors/FsStorage.d.ts +0 -44
  504. package/dist/plugins/server/server/connectors/FsStorage.js +0 -303
  505. package/dist/plugins/server/server/connectors/FsStorage.js.map +0 -1
  506. package/dist/plugins/server/server/connectors/connectors.d.ts +0 -86
  507. package/dist/plugins/server/server/connectors/connectors.js +0 -126
  508. package/dist/plugins/server/server/connectors/connectors.js.map +0 -1
  509. package/dist/plugins/server/server/events.d.ts +0 -26
  510. package/dist/plugins/server/server/events.js +0 -31
  511. package/dist/plugins/server/server/events.js.map +0 -1
  512. package/dist/plugins/server/server/jobs.d.ts +0 -12
  513. package/dist/plugins/server/server/jobs.js +0 -79
  514. package/dist/plugins/server/server/jobs.js.map +0 -1
  515. package/dist/plugins/server/server/utils/validation.d.ts +0 -7
  516. package/dist/plugins/server/server/utils/validation.js +0 -37
  517. package/dist/plugins/server/server/utils/validation.js.map +0 -1
  518. package/dist/plugins/server/server/utils/websiteDataSerialization.d.ts +0 -24
  519. package/dist/plugins/server/server/utils/websiteDataSerialization.js +0 -136
  520. package/dist/plugins/server/server/utils/websiteDataSerialization.js.map +0 -1
  521. package/dist/plugins/server/types.d.ts +0 -365
  522. package/dist/plugins/server/types.js +0 -87
  523. package/dist/plugins/server/types.js.map +0 -1
  524. package/dist/server/server/cli.js +0 -71
  525. package/src/css/grapesjs-light.scss +0 -180
  526. package/src/ts/plugins/client/template.ts +0 -246
  527. package/src/ts/plugins/client/website-info.ts +0 -84
  528. package/src/ts/server/cli.ts +0 -67
  529. /package/{src/ts → common}/constants.ts +0 -0
  530. /package/{src/ts → common}/externs.ts +0 -0
  531. /package/{src/ts → common}/page.ts +0 -0
  532. /package/{src/ts → common}/types.ts +0 -0
  533. /package/dist/server/{constants.js → common/constants.js} +0 -0
  534. /package/dist/server/{page.js → common/page.js} +0 -0
  535. /package/dist/server/{types.js → common/types.js} +0 -0
  536. /package/dist/server/{plugins/server → server/plugins}/Cache.js +0 -0
  537. /package/{src → editor}/css/_mixins.scss +0 -0
  538. /package/{src → editor}/css/_variables.scss +0 -0
  539. /package/{src → editor}/css/dialog.scss +0 -0
  540. /package/{src → editor}/css/dialogs.scss +0 -0
  541. /package/{src → editor}/css/fonts.scss +0 -0
  542. /package/{src → editor}/css/footer.scss +0 -0
  543. /package/{src → editor}/css/grapesjs-plugins.scss +0 -0
  544. /package/{src → editor}/css/grapesjs.scss +0 -0
  545. /package/{src → editor}/css/loader.scss +0 -0
  546. /package/{src → editor}/css/page-panel.scss +0 -0
  547. /package/{src → editor}/css/panels.scss +0 -0
  548. /package/{src → editor}/css/silex.scss +0 -0
  549. /package/{src → editor}/css/theme-base.scss +0 -0
  550. /package/{src → editor}/css/website-info.scss +0 -0
  551. /package/{src/ts/client → editor}/events.ts +0 -0
  552. /package/{src/ts/client → editor}/grapesjs/blocks.ts +0 -0
  553. /package/{src/ts/client → editor}/grapesjs/body-remap.ts +0 -0
  554. /package/{src/ts/client → editor}/grapesjs/breadcrumbs.ts +0 -0
  555. /package/{src/ts/client → editor}/grapesjs/cms/DataSource.ts +0 -0
  556. /package/{src/ts/client → editor}/grapesjs/cms/blocks.ts +0 -0
  557. /package/{src/ts/client → editor}/grapesjs/cms/buttons.ts +0 -0
  558. /package/{src/ts/client → editor}/grapesjs/cms/collection-pages.ts +0 -0
  559. /package/{src/ts/client → editor}/grapesjs/cms/config.ts +0 -0
  560. /package/{src/ts/client → editor}/grapesjs/cms/filters.ts +0 -0
  561. /package/{src/ts/client → editor}/grapesjs/cms/liquid.mock.ts +0 -0
  562. /package/{src/ts/client → editor}/grapesjs/cms/liquid.test.ts +0 -0
  563. /package/{src/ts/client → editor}/grapesjs/cms/liquid.ts +0 -0
  564. /package/{src/ts/client → editor}/grapesjs/cms/publication.test.ts +0 -0
  565. /package/{src/ts/client → editor}/grapesjs/cms/site-settings.ts +0 -0
  566. /package/{src/ts/client → editor}/grapesjs/cms/states.ts +0 -0
  567. /package/{src/ts/client → editor}/grapesjs/cms/traits.ts +0 -0
  568. /package/{src/ts/client → editor}/grapesjs/core-commands.ts +0 -0
  569. /package/{src/ts/client → editor}/grapesjs/css-props.ts +0 -0
  570. /package/{src/ts/client → editor}/grapesjs/flex.ts +0 -0
  571. /package/{src/ts/client → editor}/grapesjs/footer.ts +0 -0
  572. /package/{src/ts/client → editor}/grapesjs/img.ts +0 -0
  573. /package/{src/ts/client → editor}/grapesjs/internal-links.test.ts +0 -0
  574. /package/{src/ts/client → editor}/grapesjs/keymaps.ts +0 -0
  575. /package/{src/ts/client → editor}/grapesjs/li.ts +0 -0
  576. /package/{src/ts/client → editor}/grapesjs/new-page-dialog.ts +0 -0
  577. /package/{src/ts/client → editor}/grapesjs/openImport.ts +0 -0
  578. /package/{src/ts/client → editor}/grapesjs/page-panel.ts +0 -0
  579. /package/{src/ts/client → editor}/grapesjs/project-bar.ts +0 -0
  580. /package/{src/ts/client → editor}/grapesjs/rich-text.ts +0 -0
  581. /package/{src/ts/client → editor}/grapesjs/sectors.ts +0 -0
  582. /package/{src/ts/client → editor}/grapesjs/semantic.ts +0 -0
  583. /package/{src/ts/client → editor}/grapesjs/static-plugins.ts +0 -0
  584. /package/{src/ts/client → editor}/grapesjs/symbolDialogs.ts +0 -0
  585. /package/{src/ts/client → editor}/grapesjs/upload-progress.ts +0 -0
  586. /package/{src/ts/client → editor}/grapesjs/view-buttons.ts +0 -0
  587. /package/{src → editor}/html/debug.pug +0 -0
  588. /package/{src → editor}/html/index.pug +0 -0
  589. /package/{src → editor}/html/templates/includes.pug +0 -0
  590. /package/{src → editor}/html/templates/workspace.pug +0 -0
  591. /package/{src/ts/client → editor}/publish-custom-code-block.ts +0 -0
  592. /package/{src/ts/client → editor}/utils.ts +0 -0
  593. /package/{dist/plugins/server/plugins/server/PublicationOptimizer.d.ts → grapesjs-plugins/expression-input/docs/.nojekyll} +0 -0
  594. /package/{src/ts/plugins/server → server/plugins}/Cache.ts +0 -0
  595. /package/{src/ts/plugins/server → server/plugins}/PublicationOptimizer.ts +0 -0
  596. /package/{src/ts/server → server}/utils/validation.ts +0 -0
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ServerConfig = void 0;
4
- const silex_plugins_1 = require("@silexlabs/silex-plugins");
4
+ const index_js_1 = require("../common/silex-plugins/index.js");
5
5
  const path_1 = require("path");
6
- const constants_1 = require("../constants");
6
+ const constants_js_1 = require("../common/constants.js");
7
7
  const promises_1 = require("fs/promises");
8
- const connectors_1 = require("./connectors/connectors");
9
- const FsStorage_1 = require("./connectors/FsStorage");
10
- const types_1 = require("../types");
11
- const FsHosting_1 = require("./connectors/FsHosting");
12
- class ServerConfig extends silex_plugins_1.Config {
8
+ const connectors_js_1 = require("./connectors/connectors.js");
9
+ const FsStorage_js_1 = require("./connectors/FsStorage.js");
10
+ const types_js_1 = require("../common/types.js");
11
+ const FsHosting_js_1 = require("./connectors/FsHosting.js");
12
+ class ServerConfig extends index_js_1.Config {
13
13
  expressOptions = {
14
14
  jsonLimit: process.env.SILEX_EXPRESS_JSON_LIMIT,
15
15
  textLimit: process.env.SILEX_EXPRESS_TEXT_LIMIT,
@@ -22,16 +22,16 @@ class ServerConfig extends silex_plugins_1.Config {
22
22
  debug = process.env.SILEX_DEBUG === 'true';
23
23
  url = process.env.SILEX_URL?.replace(/\/$/, '') ?? `${process.env.SILEX_PROTOCOL}://${process.env.SILEX_HOST}:${process.env.SILEX_PORT}`;
24
24
  userConfigPath = process.env.SILEX_SERVER_CONFIG;
25
- configFilePath = (0, path_1.resolve)(__dirname, '../../../.silex.js');
25
+ configFilePath = (0, path_1.resolve)(__dirname, '../../../server/deploy/.silex.js');
26
26
  getConnectors(type = null) {
27
27
  if (!type) {
28
28
  const allConnectors = this.getStorageConnectors().concat(this.getHostingConnectors());
29
29
  return [...new Set(allConnectors)];
30
30
  }
31
- const connectorType = (0, connectors_1.toConnectorEnum)(type.toString());
31
+ const connectorType = (0, connectors_js_1.toConnectorEnum)(type.toString());
32
32
  switch (connectorType) {
33
- case types_1.ConnectorType.HOSTING: return this.getHostingConnectors();
34
- case types_1.ConnectorType.STORAGE: return this.getStorageConnectors();
33
+ case types_js_1.ConnectorType.HOSTING: return this.getHostingConnectors();
34
+ case types_js_1.ConnectorType.STORAGE: return this.getStorageConnectors();
35
35
  default: throw new Error(`Unknown connector type ${type}`);
36
36
  }
37
37
  }
@@ -54,12 +54,12 @@ class ServerConfig extends silex_plugins_1.Config {
54
54
  }
55
55
  getHostingConnectors() { return this.hostingConnectors; }
56
56
  async addRoutes(app) {
57
- const path = process.env.SILEX_CLIENT_CONFIG;
57
+ const path = process.env.SILEX_CLIENT_CONFIG || (0, path_1.resolve)(__dirname, '../../../server/deploy/client-config.js');
58
58
  if (path) {
59
- console.info(`> Serving client side config ${path} at ${constants_1.CLIENT_CONFIG_FILE_NAME}`);
59
+ console.info(`> Serving client side config ${path} at ${constants_js_1.CLIENT_CONFIG_FILE_NAME}`);
60
60
  try {
61
61
  let clientConfig = (await (0, promises_1.readFile)(path)).toString();
62
- app.get(`/${constants_1.CLIENT_CONFIG_FILE_NAME}`, async (req, res) => {
62
+ app.get(`/${constants_js_1.CLIENT_CONFIG_FILE_NAME}`, async (req, res) => {
63
63
  if (this.debug) {
64
64
  console.info('[Debug mode] Reloading config file', path);
65
65
  clientConfig = (await (0, promises_1.readFile)(path)).toString();
@@ -71,7 +71,7 @@ class ServerConfig extends silex_plugins_1.Config {
71
71
  }
72
72
  catch (e) {
73
73
  console.error(`Error loading client config file ${path}`, e);
74
- throw new Error(`Error loading client config file ${path}: ${e.message}`);
74
+ throw new Error(`Error loading client config file ${path}: ${e.message}`, { cause: e });
75
75
  }
76
76
  }
77
77
  }
@@ -86,7 +86,7 @@ class ServerConfig extends silex_plugins_1.Config {
86
86
  await this.addPlugin(this.userConfigPath, {});
87
87
  }
88
88
  catch (e) {
89
- throw new Error(`\nUser config file ${this.userConfigPath} error:\n\n\t${e.message}\n\n`);
89
+ throw new Error(`\nUser config file ${this.userConfigPath} error:\n\n\t${e.message}\n\n`, { cause: e });
90
90
  }
91
91
  }
92
92
  }
@@ -100,18 +100,18 @@ class ServerConfig extends silex_plugins_1.Config {
100
100
  console.info('> /!\\ Config file not found', this.configFilePath);
101
101
  }
102
102
  else {
103
- throw new Error(`Error in config file ${this.configFilePath}: ${e.message}`);
103
+ throw new Error(`Error in config file ${this.configFilePath}: ${e.message}`, { cause: e });
104
104
  }
105
105
  }
106
106
  }
107
107
  async initDefaultConnectors() {
108
108
  if (!this.storageConnectors.length) {
109
- this.addStorageConnector(new FsStorage_1.FsStorage(null, {
109
+ this.addStorageConnector(new FsStorage_js_1.FsStorage(null, {
110
110
  path: process.env.SILEX_FS_ROOT || (0, path_1.join)(process.cwd(), '/silex/storage'),
111
111
  }));
112
112
  }
113
113
  if (!this.hostingConnectors.length) {
114
- this.addHostingConnector(new FsHosting_1.FsHosting(null, {
114
+ this.addHostingConnector(new FsHosting_js_1.FsHosting(null, {
115
115
  path: process.env.SILEX_FS_HOSTING_ROOT || (0, path_1.join)(process.cwd(), '/silex/hosting'),
116
116
  }));
117
117
  }
@@ -6,12 +6,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.FsHosting = void 0;
7
7
  const promises_1 = __importDefault(require("fs/promises"));
8
8
  const path_1 = require("path");
9
- const FsStorage_1 = require("./FsStorage");
10
- const types_1 = require("../../types");
11
- class FsHosting extends FsStorage_1.FsStorage {
9
+ const FsStorage_js_1 = require("./FsStorage.js");
10
+ const types_js_1 = require("../../common/types.js");
11
+ class FsHosting extends FsStorage_js_1.FsStorage {
12
12
  connectorId = 'fs-hosting';
13
13
  displayName = 'File system hosting';
14
- connectorType = types_1.ConnectorType.HOSTING;
14
+ connectorType = types_js_1.ConnectorType.HOSTING;
15
15
  async initFs() {
16
16
  const stat = await promises_1.default.stat(this.options.path).catch(() => null);
17
17
  if (!stat) {
@@ -28,10 +28,10 @@ class FsHosting extends FsStorage_1.FsStorage {
28
28
  job.status = status;
29
29
  job.message = message;
30
30
  job.logs[0].push(message);
31
- if (status === types_1.JobStatus.SUCCESS) {
31
+ if (status === types_js_1.JobStatus.SUCCESS) {
32
32
  jobSuccess(job.jobId, message);
33
33
  }
34
- else if (status === types_1.JobStatus.ERROR) {
34
+ else if (status === types_js_1.JobStatus.ERROR) {
35
35
  job.errors[0].push(message);
36
36
  jobError(job.jobId, message);
37
37
  }
@@ -6,17 +6,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.FsStorage = void 0;
7
7
  const promises_1 = __importDefault(require("fs/promises"));
8
8
  const fs_1 = require("fs");
9
- const connectors_1 = require("./connectors");
9
+ const connectors_js_1 = require("./connectors.js");
10
10
  const path_1 = require("path");
11
- const types_1 = require("../../types");
11
+ const types_js_1 = require("../../common/types.js");
12
12
  const os_1 = require("os");
13
- const validation_1 = require("../utils/validation");
14
- const constants_1 = require("../../constants");
13
+ const validation_js_1 = require("../utils/validation.js");
14
+ const constants_js_1 = require("../../common/constants.js");
15
15
  const stream_1 = require("stream");
16
16
  const uuid_1 = require("uuid");
17
- const websiteDataSerialization_1 = require("../utils/websiteDataSerialization");
17
+ const websiteDataSerialization_js_1 = require("../utils/websiteDataSerialization.js");
18
18
  if (!globalThis.__dirname) {
19
- globalThis.__dirname = (0, path_1.dirname)(process.cwd() + '/src/ts/server/connectors/FsStorage.ts');
19
+ globalThis.__dirname = (0, path_1.dirname)(process.cwd() + '/server/connectors/FsStorage.ts');
20
20
  console.info('Redefining __dirname', globalThis.__dirname);
21
21
  }
22
22
  async function copyDir(src, dest) {
@@ -38,7 +38,7 @@ class FsStorage {
38
38
  icon = FILE_ICON;
39
39
  disableLogout = true;
40
40
  options;
41
- connectorType = types_1.ConnectorType.STORAGE;
41
+ connectorType = types_js_1.ConnectorType.STORAGE;
42
42
  color = '#ffffff';
43
43
  background = '#006400';
44
44
  constructor(config, opts) {
@@ -50,13 +50,13 @@ class FsStorage {
50
50
  this.initFs();
51
51
  }
52
52
  async initFs() {
53
- const defaultSite = (0, path_1.join)(this.options.path, constants_1.DEFAULT_WEBSITE_ID);
53
+ const defaultSite = (0, path_1.join)(this.options.path, constants_js_1.DEFAULT_WEBSITE_ID);
54
54
  const stat = await promises_1.default.stat(defaultSite).catch(() => null);
55
55
  if (!stat) {
56
56
  await promises_1.default.mkdir((0, path_1.join)(defaultSite, this.options.assetsFolder), { recursive: true });
57
- await this.setWebsiteMeta({}, constants_1.DEFAULT_WEBSITE_ID, { name: 'Default website', connectorUserSettings: {} });
58
- await this.updateWebsite({}, constants_1.DEFAULT_WEBSITE_ID, types_1.EMPTY_WEBSITE);
59
- console.info(`> [FsStorage] Created ${constants_1.DEFAULT_WEBSITE_ID} in ${this.options.path}`);
57
+ await this.setWebsiteMeta({}, constants_js_1.DEFAULT_WEBSITE_ID, { name: 'Default website', connectorUserSettings: {} });
58
+ await this.updateWebsite({}, constants_js_1.DEFAULT_WEBSITE_ID, types_js_1.EMPTY_WEBSITE);
59
+ console.info(`> [FsStorage] Created ${constants_js_1.DEFAULT_WEBSITE_ID} in ${this.options.path}`);
60
60
  }
61
61
  }
62
62
  updateStatus(filesStatuses, status, statusCbk) {
@@ -69,7 +69,7 @@ class FsStorage {
69
69
  return files.map(file => ({
70
70
  file,
71
71
  message: 'Waiting',
72
- status: types_1.JobStatus.IN_PROGRESS,
72
+ status: types_js_1.JobStatus.IN_PROGRESS,
73
73
  }));
74
74
  }
75
75
  getOptions(formData) {
@@ -92,19 +92,19 @@ class FsStorage {
92
92
  return {
93
93
  name: username,
94
94
  picture: USER_ICON,
95
- storage: await (0, connectors_1.toConnectorData)(session, this),
95
+ storage: await (0, connectors_js_1.toConnectorData)(session, this),
96
96
  };
97
97
  }
98
98
  async setWebsiteMeta(session, id, data) {
99
- const websiteId = (0, validation_1.requiredParam)(id, 'website id');
100
- const content = (0, websiteDataSerialization_1.stringify)(data);
101
- const path = (0, path_1.join)(this.options.path, id, constants_1.WEBSITE_META_DATA_FILE);
99
+ const websiteId = (0, validation_js_1.requiredParam)(id, 'website id');
100
+ const content = (0, websiteDataSerialization_js_1.stringify)(data);
101
+ const path = (0, path_1.join)(this.options.path, id, constants_js_1.WEBSITE_META_DATA_FILE);
102
102
  await promises_1.default.writeFile(path, content);
103
103
  }
104
104
  async getWebsiteMeta(session, id) {
105
- const websiteId = (0, validation_1.requiredParam)(id, 'website id');
105
+ const websiteId = (0, validation_js_1.requiredParam)(id, 'website id');
106
106
  const fileStat = await promises_1.default.stat((0, path_1.join)(this.options.path, websiteId));
107
- const path = (0, path_1.join)(this.options.path, websiteId, constants_1.WEBSITE_META_DATA_FILE);
107
+ const path = (0, path_1.join)(this.options.path, websiteId, constants_js_1.WEBSITE_META_DATA_FILE);
108
108
  const content = await promises_1.default.readFile(path);
109
109
  const meta = await JSON.parse(content.toString());
110
110
  return {
@@ -120,12 +120,12 @@ class FsStorage {
120
120
  const id = (0, uuid_1.v4)();
121
121
  await promises_1.default.mkdir((0, path_1.join)(this.options.path, id, this.options.assetsFolder), { recursive: true });
122
122
  await this.setWebsiteMeta(session, id, meta);
123
- await this.updateWebsite(session, id, types_1.EMPTY_WEBSITE);
123
+ await this.updateWebsite(session, id, types_js_1.EMPTY_WEBSITE);
124
124
  return id;
125
125
  }
126
126
  async readWebsite(session, websiteId) {
127
- const id = (0, validation_1.requiredParam)(websiteId, 'website id');
128
- const path = (0, path_1.join)(this.options.path, id, constants_1.WEBSITE_DATA_FILE);
127
+ const id = (0, validation_js_1.requiredParam)(websiteId, 'website id');
128
+ const path = (0, path_1.join)(this.options.path, id, constants_js_1.WEBSITE_DATA_FILE);
129
129
  const content = await promises_1.default.readFile(path);
130
130
  const websiteDataContent = content.toString();
131
131
  const parsedData = JSON.parse(websiteDataContent);
@@ -134,13 +134,13 @@ class FsStorage {
134
134
  const pageContent = await promises_1.default.readFile(fullPath);
135
135
  return pageContent.toString();
136
136
  };
137
- return await (0, websiteDataSerialization_1.merge)(websiteDataContent, pageLoader);
137
+ return await (0, websiteDataSerialization_js_1.merge)(websiteDataContent, pageLoader);
138
138
  }
139
139
  async updateWebsite(session, websiteId, data) {
140
- const id = (0, validation_1.requiredParam)(websiteId, 'website id');
140
+ const id = (0, validation_js_1.requiredParam)(websiteId, 'website id');
141
141
  const websitePath = (0, path_1.join)(this.options.path, id);
142
- const filesToWrite = (0, websiteDataSerialization_1.split)(data);
143
- const pagesFolder = (0, websiteDataSerialization_1.getPagesFolder)(data);
142
+ const filesToWrite = (0, websiteDataSerialization_js_1.split)(data);
143
+ const pagesFolder = (0, websiteDataSerialization_js_1.getPagesFolder)(data);
144
144
  await promises_1.default.mkdir(websitePath, { recursive: true });
145
145
  const hasPageFiles = filesToWrite.some(f => f.path.startsWith(pagesFolder));
146
146
  if (hasPageFiles) {
@@ -166,9 +166,9 @@ class FsStorage {
166
166
  }
167
167
  }
168
168
  async deleteWebsite(session, websiteId) {
169
- const id = (0, validation_1.requiredParam)(websiteId, 'website id');
169
+ const id = (0, validation_js_1.requiredParam)(websiteId, 'website id');
170
170
  const path = (0, path_1.join)(this.options.path, id);
171
- return promises_1.default.rmdir(path, { recursive: true });
171
+ return promises_1.default.rm(path, { recursive: true, force: true });
172
172
  }
173
173
  async duplicateWebsite(session, websiteId) {
174
174
  const newWebsiteId = (0, uuid_1.v4)();
@@ -204,34 +204,34 @@ class FsStorage {
204
204
  const path = (0, path_1.join)(this.options.path, id, assetsFolder, file.path);
205
205
  if (typeof file.content === 'string' || Buffer.isBuffer(file.content)) {
206
206
  fileStatus.message = 'Writing';
207
- this.updateStatus(filesStatuses, types_1.JobStatus.IN_PROGRESS, statusCbk);
207
+ this.updateStatus(filesStatuses, types_js_1.JobStatus.IN_PROGRESS, statusCbk);
208
208
  try {
209
209
  await promises_1.default.writeFile(path, file.content);
210
210
  }
211
211
  catch (err) {
212
212
  fileStatus.message = `Error (${err})`;
213
- this.updateStatus(filesStatuses, types_1.JobStatus.IN_PROGRESS, statusCbk);
213
+ this.updateStatus(filesStatuses, types_js_1.JobStatus.IN_PROGRESS, statusCbk);
214
214
  error = err;
215
215
  continue;
216
216
  }
217
217
  fileStatus.message = 'Success';
218
- this.updateStatus(filesStatuses, types_1.JobStatus.IN_PROGRESS, statusCbk);
218
+ this.updateStatus(filesStatuses, types_js_1.JobStatus.IN_PROGRESS, statusCbk);
219
219
  }
220
220
  else if (file.content instanceof stream_1.Readable) {
221
221
  fileStatus.message = 'Writing';
222
- this.updateStatus(filesStatuses, types_1.JobStatus.IN_PROGRESS, statusCbk);
222
+ this.updateStatus(filesStatuses, types_js_1.JobStatus.IN_PROGRESS, statusCbk);
223
223
  const writeStream = (0, fs_1.createWriteStream)(path);
224
224
  file.content.pipe(writeStream);
225
225
  await new Promise((resolve) => {
226
226
  writeStream.on('finish', () => {
227
227
  fileStatus.message = 'Success';
228
- this.updateStatus(filesStatuses, types_1.JobStatus.IN_PROGRESS, statusCbk);
228
+ this.updateStatus(filesStatuses, types_js_1.JobStatus.IN_PROGRESS, statusCbk);
229
229
  resolve(file);
230
230
  });
231
231
  writeStream.on('error', err => {
232
232
  console.error('writeStream error', err);
233
233
  fileStatus.message = `Error (${err})`;
234
- this.updateStatus(filesStatuses, types_1.JobStatus.IN_PROGRESS, statusCbk);
234
+ this.updateStatus(filesStatuses, types_js_1.JobStatus.IN_PROGRESS, statusCbk);
235
235
  error = err;
236
236
  resolve(file);
237
237
  });
@@ -242,7 +242,7 @@ class FsStorage {
242
242
  throw new Error('Invalid file content: ' + typeof file.content);
243
243
  }
244
244
  }
245
- this.updateStatus(filesStatuses, error ? types_1.JobStatus.ERROR : types_1.JobStatus.SUCCESS, statusCbk);
245
+ this.updateStatus(filesStatuses, error ? types_js_1.JobStatus.ERROR : types_js_1.JobStatus.SUCCESS, statusCbk);
246
246
  if (error)
247
247
  throw error;
248
248
  }
@@ -252,7 +252,7 @@ class FsStorage {
252
252
  }
253
253
  }
254
254
  async readAsset(session, websiteId, fileName) {
255
- const id = (0, validation_1.requiredParam)(websiteId, 'website id');
255
+ const id = (0, validation_js_1.requiredParam)(websiteId, 'website id');
256
256
  const path = (0, path_1.join)(this.options.path, id, this.options.assetsFolder, fileName);
257
257
  return await promises_1.default.readFile(path);
258
258
  }
@@ -7,11 +7,11 @@ exports.contentToString = contentToString;
7
7
  exports.contentToBuffer = contentToBuffer;
8
8
  exports.contentToReadable = contentToReadable;
9
9
  const stream_1 = require("stream");
10
- const types_1 = require("../../types");
10
+ const types_js_1 = require("../../common/types.js");
11
11
  function toConnectorEnum(type) {
12
- const result = types_1.ConnectorType[type.toString().toUpperCase()];
12
+ const result = types_js_1.ConnectorType[type.toString().toUpperCase()];
13
13
  if (!result)
14
- throw new Error(`Unknown connector type ${type}. It should be one of ${Object.keys(types_1.ConnectorType).join(', ')}`);
14
+ throw new Error(`Unknown connector type ${type}. It should be one of ${Object.keys(types_js_1.ConnectorType).join(', ')}`);
15
15
  return result;
16
16
  }
17
17
  async function getConnector(config, session, type, connectorId) {
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  Object.defineProperty(exports, "__esModule", { value: true });
26
36
  exports.events = void 0;
27
- exports.events = __importStar(require("./events"));
37
+ exports.events = __importStar(require("./events.js"));
@@ -11,7 +11,7 @@ const compression_1 = __importDefault(require("compression"));
11
11
  const cookie_parser_1 = __importDefault(require("cookie-parser"));
12
12
  const cookie_session_1 = __importDefault(require("cookie-session"));
13
13
  const cors_1 = __importDefault(require("cors"));
14
- const events_1 = require("./events");
14
+ const events_js_1 = require("./events.js");
15
15
  function create(config) {
16
16
  const app = (0, express_1.default)();
17
17
  app.set('config', config);
@@ -36,10 +36,10 @@ function create(config) {
36
36
  }
37
37
  async function start(app) {
38
38
  const config = app.get('config');
39
- config.emit(events_1.ServerEvent.STARTUP_START, { app });
39
+ config.emit(events_js_1.ServerEvent.STARTUP_START, { app });
40
40
  return new Promise((resolve, reject) => {
41
41
  app.listen(config.port, () => {
42
- config.emit(events_1.ServerEvent.STARTUP_END, { app });
42
+ config.emit(events_js_1.ServerEvent.STARTUP_END, { app });
43
43
  resolve(app);
44
44
  });
45
45
  });
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
15
15
  }) : function(o, v) {
16
16
  o["default"] = v;
17
17
  });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
25
35
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
26
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
27
37
  };
@@ -30,20 +40,20 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
30
40
  };
31
41
  Object.defineProperty(exports, "__esModule", { value: true });
32
42
  exports.default = silex;
33
- const silexApp = __importStar(require("./express"));
34
- const api_1 = __importDefault(require("./api/api"));
35
- const config_1 = require("./config");
43
+ const silexApp = __importStar(require("./express.js"));
44
+ const api_js_1 = __importDefault(require("./api/api.js"));
45
+ const config_js_1 = require("./config.js");
36
46
  const dotenv_1 = __importDefault(require("dotenv"));
37
47
  const path_1 = require("path");
38
- const constants_1 = require("../constants");
39
- __exportStar(require("./expose"), exports);
48
+ const constants_js_1 = require("../common/constants.js");
49
+ __exportStar(require("./expose.js"), exports);
40
50
  async function silex() {
41
- console.info(constants_1.DEV_MESSAGE);
51
+ console.info(constants_js_1.DEV_MESSAGE);
42
52
  console.info(`Node version: ${process.version}`);
43
53
  console.info(`CWD: ${process.cwd()}`);
44
54
  const curDirEnv = dotenv_1.default.config();
45
55
  if (curDirEnv.error) {
46
- if (curDirEnv.error['code'] === 'ENOENT') {
56
+ if (curDirEnv.error.code === 'ENOENT') {
47
57
  console.info('> No .env file found in current directory');
48
58
  }
49
59
  else {
@@ -56,7 +66,7 @@ async function silex() {
56
66
  const DEFAULT_ENV_FILE = (0, path_1.join)(__dirname, '../../../.env.default');
57
67
  const rootDirEnv = dotenv_1.default.config({ path: DEFAULT_ENV_FILE });
58
68
  if (rootDirEnv.error) {
59
- if (rootDirEnv.error['code'] === 'ENOENT') {
69
+ if (rootDirEnv.error.code === 'ENOENT') {
60
70
  throw new Error(`\n\nFailed to load default env vars. File not found ${DEFAULT_ENV_FILE}\n\n`);
61
71
  }
62
72
  else {
@@ -64,12 +74,12 @@ async function silex() {
64
74
  }
65
75
  }
66
76
  console.info('> Default env vars loaded');
67
- const config = new config_1.ServerConfig();
77
+ const config = new config_js_1.ServerConfig();
68
78
  const app = silexApp.create(config);
69
79
  await config.addRoutes(app);
70
80
  await config.loadConfigFiles();
71
81
  await config.initDefaultConnectors();
72
- app.use('/api', (0, api_1.default)(config));
82
+ app.use('/api', (0, api_js_1.default)(config));
73
83
  await silexApp.start(app);
74
84
  console.info(`\nSilex is ready, open http://localhost:${config.port} in your browser\n`);
75
85
  if (config.debug) {
@@ -77,8 +87,8 @@ async function silex() {
77
87
  }
78
88
  }
79
89
  async function startLiverReload() {
80
- const { createServer } = await Promise.resolve().then(() => __importStar(require('livereload')));
81
- const { resolve } = await Promise.resolve().then(() => __importStar(require('path')));
90
+ const { createServer } = await import('livereload');
91
+ const { resolve } = await import('path');
82
92
  const dist = resolve(__dirname, '../../client');
83
93
  const server = createServer({
84
94
  delay: 0,
@@ -6,7 +6,7 @@ exports.getJob = getJob;
6
6
  exports.jobSuccess = jobSuccess;
7
7
  exports.jobError = jobError;
8
8
  exports.killJob = killJob;
9
- const types_1 = require("../types");
9
+ const types_js_1 = require("../common/types.js");
10
10
  const TIME_TO_KEEP_AFTER_STOP = 60 * 10 * 1000;
11
11
  const jobs = new Array();
12
12
  const timers = new WeakMap();
@@ -16,7 +16,7 @@ function startJob(message = '') {
16
16
  const jobId = `${processKey}_${++nextJobId}`;
17
17
  const job = {
18
18
  jobId,
19
- status: types_1.JobStatus.IN_PROGRESS,
19
+ status: types_js_1.JobStatus.IN_PROGRESS,
20
20
  message: message
21
21
  };
22
22
  jobs.push(job);
@@ -26,10 +26,10 @@ function getJob(id) {
26
26
  return jobs.find(job => job.jobId === id);
27
27
  }
28
28
  function jobSuccess(id, message = '') {
29
- return end(id, types_1.JobStatus.SUCCESS, message);
29
+ return end(id, types_js_1.JobStatus.SUCCESS, message);
30
30
  }
31
31
  function jobError(id, message = '') {
32
- return end(id, types_1.JobStatus.ERROR, message);
32
+ return end(id, types_js_1.JobStatus.ERROR, message);
33
33
  }
34
34
  function killJob(job) {
35
35
  clearTimeout(timers.get(job));
@@ -1,13 +1,10 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  const fs_1 = require("fs");
7
- const archiver_1 = __importDefault(require("archiver"));
8
- const types_1 = require("../../types");
4
+ const types_js_1 = require("../../common/types.js");
9
5
  const os_1 = require("os");
10
- const events_1 = require("../../server/events");
6
+ const path_1 = require("path");
7
+ const events_js_1 = require("../events.js");
11
8
  const ZIP_ICON = '/assets/download.png';
12
9
  class default_1 {
13
10
  connectorId = 'download-connector';
@@ -15,23 +12,33 @@ class default_1 {
15
12
  icon = ZIP_ICON;
16
13
  disableLogout = false;
17
14
  options;
18
- connectorType = types_1.ConnectorType.HOSTING;
15
+ connectorType = types_js_1.ConnectorType.HOSTING;
19
16
  color = '#ffffff';
20
17
  background = '#006400';
21
18
  constructor(config) {
22
- // Add a route to serve the zip file
23
- config.on(events_1.ServerEvent.STARTUP_END, ({ app }) => {
19
+ config.on(events_js_1.ServerEvent.STARTUP_END, ({ app }) => {
24
20
  app.get('/download/:tmpZipFile', async (req, res) => {
25
- const path = `${(0, os_1.tmpdir)()}/${req.params.tmpZipFile}`;
21
+ const tmpZipFile = req.params.tmpZipFile;
22
+ if ((0, path_1.basename)(tmpZipFile) !== tmpZipFile) {
23
+ res.status(400).send('Invalid download file');
24
+ return;
25
+ }
26
+ const path = (0, path_1.join)((0, os_1.tmpdir)(), tmpZipFile);
26
27
  res.sendFile(path, {}, (err) => {
27
28
  if (err) {
28
29
  console.error('[DownloadConnector] Error while sending file', err);
29
- res.status(500).send(`
30
+ if (!res.headersSent)
31
+ res.status(500).send(`
30
32
  <h1>Error</h1>
31
33
  <p>There was an error while getting the zip file of your website</p>
32
34
  <p>${err.message}</p>
33
35
  `);
36
+ return;
34
37
  }
38
+ (0, fs_1.unlink)(path, (unlinkErr) => {
39
+ if (unlinkErr)
40
+ console.error('[DownloadConnector] Error while deleting temporary zip file', unlinkErr);
41
+ });
35
42
  });
36
43
  });
37
44
  });
@@ -61,47 +68,36 @@ class default_1 {
61
68
  }
62
69
  async startPublishingInBackground(session, websiteId, files, job) {
63
70
  const fileName = `${websiteId}-${Date.now()}-${Math.random().toString(36).substring(7)}.zip`;
71
+ const { ZipArchive } = await import('archiver');
64
72
  return new Promise((resolve, reject) => {
65
73
  let resolved = false;
66
74
  try {
67
- // Generate a temporary path for the zip file, in the OS tmp folder, with the website id, the date and random string
68
75
  const path = `${(0, os_1.tmpdir)()}/${fileName}`;
69
- // create a file to stream archive data to.
70
76
  const output = (0, fs_1.createWriteStream)(path);
71
- const archive = (0, archiver_1.default)('zip', {
72
- zlib: { level: 9 } // Sets the compression level.
77
+ const archive = new ZipArchive({
78
+ zlib: { level: 9 }
73
79
  });
74
- // Listen to archive events
75
- // listen for all archive data to be written
76
- // 'close' event is fired only when a file descriptor is involved
77
80
  output.on('close', function () {
78
81
  !resolved && resolve(path);
79
82
  resolved = true;
80
83
  });
81
- // good practice to catch warnings (ie stat failures and other non-blocking errors)
82
84
  archive.on('warning', function (err) {
83
85
  if (err.code === 'ENOENT') {
84
- // log warning
85
86
  }
86
87
  else {
87
88
  !resolved && reject(err);
88
89
  resolved = true;
89
90
  }
90
91
  });
91
- // good practice to catch this error explicitly
92
92
  archive.on('error', function (err) {
93
93
  !resolved && reject(err);
94
94
  resolved = true;
95
95
  });
96
- // pipe archive data to the filey
97
96
  archive.pipe(output);
98
- // append files
99
97
  for (const file of files) {
100
98
  job.message = `Adding ${file.path} to the zip file`;
101
- // Handle content as string, buffer or readable
102
99
  archive.append(file.content, { name: file.path });
103
100
  }
104
- // finalize the archive (ie we are done appending files but streams have to finish yet)
105
101
  job.message = 'Finalizing the zip file';
106
102
  return archive.finalize()
107
103
  .then(() => path);
@@ -109,14 +105,14 @@ class default_1 {
109
105
  catch (err) {
110
106
  console.error('Error while creating the zip file', err);
111
107
  job.message = `Error while creating the zip file: ${err.message}`;
112
- job.status = types_1.JobStatus.ERROR;
108
+ job.status = types_js_1.JobStatus.ERROR;
113
109
  !resolved && reject(err);
114
110
  resolved = true;
115
111
  }
116
112
  })
117
113
  .then(path => {
118
114
  job.message = `Zip file created, <a href="/download/${fileName}" target="_blank">download it now</a>`;
119
- job.status = types_1.JobStatus.SUCCESS;
115
+ job.status = types_js_1.JobStatus.SUCCESS;
120
116
  });
121
117
  }
122
118
  async getUrl(session, websiteId) {
@@ -124,4 +120,3 @@ class default_1 {
124
120
  }
125
121
  }
126
122
  exports.default = default_1;
127
- //# sourceMappingURL=DownloadConnector.js.map