@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,20 +1,4 @@
1
1
  "use strict";
2
- /*
3
- * Silex website builder, free/libre no-code tool for makers.
4
- * Copyright (c) 2023 lexoyo and Silex Labs foundation
5
- *
6
- * This program is free software: you can redistribute it and/or modify
7
- * it under the terms of the GNU Affero General Public License as published by
8
- * the Free Software Foundation, either version 3 of the License, or any later version.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU Affero General Public License for more details.
14
- *
15
- * You should have received a copy of the GNU Affero General Public License
16
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
17
- */
18
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
19
3
  if (k2 === undefined) k2 = k;
20
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -31,43 +15,34 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
31
15
  }) : function(o, v) {
32
16
  o["default"] = v;
33
17
  });
34
- var __importStar = (this && this.__importStar) || function (mod) {
35
- if (mod && mod.__esModule) return mod;
36
- var result = {};
37
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
38
- __setModuleDefault(result, mod);
39
- return result;
40
- };
41
- var __importDefault = (this && this.__importDefault) || function (mod) {
42
- return (mod && mod.__esModule) ? mod : { "default": mod };
43
- };
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
+ })();
44
35
  Object.defineProperty(exports, "__esModule", { value: true });
45
36
  exports.computeGitBlobSha = computeGitBlobSha;
46
- const constants_1 = require("../../constants");
47
- const connectors_1 = require("../../server/connectors/connectors");
48
- const types_1 = require("../../types");
49
- const node_fetch_1 = __importDefault(require("node-fetch"));
37
+ const constants_js_1 = require("../../common/constants.js");
38
+ const connectors_js_1 = require("../connectors/connectors.js");
39
+ const types_js_1 = require("../../common/types.js");
50
40
  const crypto_1 = __importStar(require("crypto"));
51
41
  const path_1 = require("path");
52
- const https_1 = require("https");
53
- const websiteDataSerialization_1 = require("../../server/utils/websiteDataSerialization");
54
- /**
55
- * Gitlab connector
56
- * @fileoverview Gitlab connector for Silex, connect to the user's Gitlab account to store websites
57
- * @see https://docs.gitlab.com/ee/api/oauth2.html
58
- */
42
+ const websiteDataSerialization_js_1 = require("../utils/websiteDataSerialization.js");
59
43
  const MAX_BATCH_UPLOAD_SIZE = 100;
60
- const MAX_BODY_SIZE_KB = 8 * 1000 * 1024; // 8MB (note that 10 MB PNG → becomes ~13.3 MB → ❌ often too big for Gitlab)
44
+ const MAX_BODY_SIZE_KB = 8 * 1000 * 1024;
61
45
  const WEBSITE_DATA_FILE_FORMAT_VERSION = '1.0.0';
62
- // interface MetaRepoFileContent {
63
- // websites: {
64
- // [websiteId: string]: {
65
- // meta: WebsiteMetaFileContent,
66
- // createdAt: string,
67
- // updatedAt: string,
68
- // }
69
- // }
70
- // }
71
46
  const svg = `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
72
47
  <svg
73
48
  xmlns:svg="http://www.w3.org/2000/svg"
@@ -127,26 +102,26 @@ const encodedSvg = encodeURIComponent(svg);
127
102
  const ICON = '/assets/gitlab.png';
128
103
  function computeGitBlobSha(content, binary) {
129
104
  const contentBuffer = binary
130
- ? Buffer.from(content, 'base64') // for binary files
131
- : Buffer.from(content, 'utf8'); // for text files
105
+ ? Buffer.from(content, 'base64')
106
+ : Buffer.from(content, 'utf8');
132
107
  const header = `blob ${contentBuffer.length}\0`;
133
108
  const full = Buffer.concat([Buffer.from(header), contentBuffer]);
134
109
  return crypto_1.default.createHash('sha1').update(full).digest('hex');
135
110
  }
136
111
  function sanitizeGitlabPath(name) {
137
112
  return name
138
- .normalize('NFD') // separate accents
139
- .replace(/[\u0300-\u036f]/g, '') // remove accents
140
- .replace(/[^a-zA-Z0-9._-]/g, '-') // only allow allowed characters
141
- .replace(/^[-_.]+/, '') // no starting '-', '_' or '.'
142
- .replace(/[-_.]+$/, '') // no ending '-', '_' or '.'
143
- .replace(/\.git$|\.atom$/i, '') // forbidden endings
113
+ .normalize('NFD')
114
+ .replace(/[\u0300-\u036f]/g, '')
115
+ .replace(/[^a-zA-Z0-9._-]/g, '-')
116
+ .replace(/^[-_.]+/, '')
117
+ .replace(/[-_.]+$/, '')
118
+ .replace(/\.git$|\.atom$/i, '')
144
119
  .toLowerCase();
145
120
  }
146
121
  class GitlabConnector {
147
122
  config;
148
123
  connectorId = 'gitlab';
149
- connectorType = types_1.ConnectorType.STORAGE;
124
+ connectorType = types_js_1.ConnectorType.STORAGE;
150
125
  displayName = 'GitLab';
151
126
  icon = ICON;
152
127
  disableLogout = false;
@@ -158,10 +133,8 @@ class GitlabConnector {
158
133
  this.options = {
159
134
  branch: 'main',
160
135
  assetsFolder: 'assets',
161
- //metaRepo: 'silex-meta',
162
- //metaRepoFile: 'websites.json',
163
136
  repoPrefix: 'silex_',
164
- scope: 'api', // 'api+read_api+read_user+read_repository+write_repository+email+sudo+profile+openid'
137
+ scope: 'api',
165
138
  ...opts,
166
139
  };
167
140
  if (!this.options.clientId)
@@ -171,10 +144,8 @@ class GitlabConnector {
171
144
  if (!this.options.domain)
172
145
  throw new Error('Missing Gitlab domain');
173
146
  if (!this.options.timeOut)
174
- this.options.timeOut = 15000; /* default value */
147
+ this.options.timeOut = 15000;
175
148
  }
176
- // **
177
- // Convenience methods for the Gitlab API
178
149
  getAssetPath(path, encode = true) {
179
150
  const resolvedPath = (0, path_1.join)(this.options.assetsFolder, path);
180
151
  if (encode)
@@ -186,7 +157,6 @@ class GitlabConnector {
186
157
  return gitlabDomainRegexp.test(this.options.domain);
187
158
  }
188
159
  async createFile(session, websiteId, path, content, isBase64 = false) {
189
- // Remove leading slash
190
160
  const safePath = path.replace(/^\//, '');
191
161
  const encodePath = decodeURIComponent(path);
192
162
  return this.callApi({
@@ -203,7 +173,6 @@ class GitlabConnector {
203
173
  });
204
174
  }
205
175
  async updateFile(session, websiteId, path, content, isBase64 = false) {
206
- // Remove leading slash
207
176
  const safePath = path.replace(/^\//, '');
208
177
  const encodePath = decodeURIComponent(path);
209
178
  return this.callApi({
@@ -213,22 +182,17 @@ class GitlabConnector {
213
182
  requestBody: {
214
183
  id: websiteId,
215
184
  branch: this.options.branch,
216
- content: await (0, connectors_1.contentToString)(content),
185
+ content: await (0, connectors_js_1.contentToString)(content),
217
186
  commit_message: `Update website asset ${encodePath} from Silex`,
218
187
  encoding: isBase64 ? 'base64' : undefined,
219
188
  }
220
189
  });
221
190
  }
222
191
  async readFile(session, websiteId, fileName) {
223
- // Remove leading slash
224
192
  const safePath = fileName.replace(/^\//, '');
225
193
  return this.downloadRawFile(session, websiteId, safePath);
226
194
  }
227
- /**
228
- * Call the Gitlab API with the user's token and handle errors
229
- */
230
- async callApi({ session, path, method = 'GET', requestBody = null, params = {}, responseHeaders = {}, // Will get the response heaaders
231
- }) {
195
+ async callApi({ session, path, method = 'GET', requestBody = null, params = {}, responseHeaders = {}, }) {
232
196
  const token = this.getSessionToken(session).token;
233
197
  const tokenParam = token ? `access_token=${token.access_token}&` : '';
234
198
  const paramsStr = Object.entries(params).map(([k, v]) => `${k}=${encodeURIComponent(v.toString())}`).join('&');
@@ -239,7 +203,6 @@ class GitlabConnector {
239
203
  if (method === 'GET' && requestBody) {
240
204
  console.error('[GitlabConnector] Invalid GET request: GET requests should not have a body', { url, method, body: requestBody, params });
241
205
  }
242
- // With or without body
243
206
  let response;
244
207
  const body = requestBody ? JSON.stringify(requestBody) : undefined;
245
208
  try {
@@ -254,12 +217,10 @@ class GitlabConnector {
254
217
  });
255
218
  }
256
219
  response = await this.fetchWithRetry(url, requestBody && method !== 'GET' ? {
257
- agent: this.getAgent(),
258
220
  method,
259
221
  headers,
260
222
  body,
261
223
  } : {
262
- agent: this.getAgent(),
263
224
  method,
264
225
  headers,
265
226
  });
@@ -274,11 +235,9 @@ class GitlabConnector {
274
235
  session,
275
236
  stack: e?.stack || new Error().stack,
276
237
  });
277
- throw new types_1.ApiError(`Could not reach Gitlab API: ${e.message || e}`, 500);
238
+ throw new types_js_1.ApiError(`Could not reach Gitlab API: ${e.message || e}`, 500);
278
239
  }
279
- // Pass the response headers to the caller
280
240
  response.headers.forEach((value, name) => responseHeaders[name] = value);
281
- // Handle the case when the server returns a non-JSON response (e.g. 400 Bad Request)
282
241
  const text = await async function () {
283
242
  try {
284
243
  return await response.text();
@@ -293,7 +252,7 @@ class GitlabConnector {
293
252
  params,
294
253
  error: e
295
254
  });
296
- throw new types_1.ApiError(`Gitlab API: Could not read response body (${e.message})`, 500);
255
+ throw new types_js_1.ApiError(`Gitlab API: Could not read response body (${e.message})`, 500);
297
256
  }
298
257
  }();
299
258
  if (!response.ok) {
@@ -307,10 +266,9 @@ class GitlabConnector {
307
266
  responseText: text
308
267
  });
309
268
  if (text.includes('A file with this name doesn\'t exist')) {
310
- throw new types_1.ApiError('Gitlab API: File not found', 404);
269
+ throw new types_js_1.ApiError('Gitlab API: File not found', 404);
311
270
  }
312
271
  else if (response.status === 401 && this.getSessionToken(session).token?.refresh_token) {
313
- // Refresh the token
314
272
  const token = this.getSessionToken(session).token;
315
273
  const body = {
316
274
  grant_type: 'refresh_token',
@@ -318,8 +276,7 @@ class GitlabConnector {
318
276
  client_id: this.options.clientId,
319
277
  client_secret: this.options.clientSecret,
320
278
  };
321
- const response = await (0, node_fetch_1.default)(this.options.domain + '/oauth/token', {
322
- agent: this.getAgent(),
279
+ const response = await fetch(this.options.domain + '/oauth/token', {
323
280
  method: 'POST',
324
281
  headers: {
325
282
  'Content-Type': 'application/json',
@@ -352,7 +309,7 @@ class GitlabConnector {
352
309
  refresh_token: token?.refresh_token
353
310
  });
354
311
  this.logout(session);
355
- throw new types_1.ApiError(`Gitlab API: Could not refresh token (${message})`, response.status);
312
+ throw new types_js_1.ApiError(`Gitlab API: Could not refresh token (${message})`, response.status);
356
313
  }
357
314
  }
358
315
  else {
@@ -367,11 +324,9 @@ class GitlabConnector {
367
324
  responseText: text,
368
325
  message
369
326
  });
370
- throw new types_1.ApiError(`Gitlab API error: ${message} (${text})`, response.status);
327
+ throw new types_js_1.ApiError(`Gitlab API error: ${message} (${text})`, response.status);
371
328
  }
372
329
  }
373
- // Some endpoints (e.g. /jobs/:id/trace) return plain text rather than JSON.
374
- // Skip JSON.parse when the server says the response isn't JSON.
375
330
  const contentType = response.headers.get('content-type') ?? '';
376
331
  if (response.ok && !contentType.includes('application/json')) {
377
332
  return text;
@@ -403,16 +358,12 @@ class GitlabConnector {
403
358
  const token = this.getSessionToken(session).token?.access_token;
404
359
  const domain = this.options.domain;
405
360
  const branch = this.options.branch;
406
- // Construct the raw URL
407
- // GET /projects/:id/repository/files/:file_path/raw
408
361
  const rawUrl = `${domain}/api/v4/projects/${projectId}/repository/files/${encodeURIComponent(filePath)}/raw?ref=${branch}&access_token=${token}`;
409
- const fileRes = await this.fetchWithRetry(rawUrl, {
410
- agent: this.getAgent(),
411
- });
362
+ const fileRes = await this.fetchWithRetry(rawUrl, {});
412
363
  const contentType = fileRes.headers.get('content-type');
413
364
  if (contentType?.includes('text/html')) {
414
365
  const html = await fileRes.text();
415
- throw new types_1.ApiError('GitLab returned HTML instead of file (unauthorized or not found).', 401);
366
+ throw new types_js_1.ApiError('GitLab returned HTML instead of file (unauthorized or not found).', 401);
416
367
  }
417
368
  if (!fileRes.ok) {
418
369
  const errText = await fileRes.text();
@@ -423,7 +374,7 @@ class GitlabConnector {
423
374
  url: rawUrl,
424
375
  responseText: errText
425
376
  });
426
- throw new types_1.ApiError(`GitLab raw file not found: filePath="${filePath}" (status ${fileRes.status})`, 404);
377
+ throw new types_js_1.ApiError(`GitLab raw file not found: filePath="${filePath}" (status ${fileRes.status})`, 404);
427
378
  }
428
379
  console.error('[GitlabConnector] Failed to fetch raw file from GitLab', {
429
380
  filePath,
@@ -432,15 +383,15 @@ class GitlabConnector {
432
383
  statusText: fileRes.statusText,
433
384
  responseText: errText
434
385
  });
435
- throw new types_1.ApiError(`Failed to fetch raw file from GitLab: filePath="${filePath}" - ${fileRes.statusText} (${errText})`, fileRes.status);
386
+ throw new types_js_1.ApiError(`Failed to fetch raw file from GitLab: filePath="${filePath}" - ${fileRes.statusText} (${errText})`, fileRes.status);
436
387
  }
437
388
  try {
438
- const buffer = await fileRes.buffer();
389
+ const buffer = Buffer.from(await fileRes.arrayBuffer());
439
390
  return buffer;
440
391
  }
441
392
  catch (e) {
442
393
  console.error('[GitlabConnector] Error reading binary content from GitLab raw file', e);
443
- throw new types_1.ApiError('Failed to read binary content from GitLab raw file', 500);
394
+ throw new types_js_1.ApiError('Failed to read binary content from GitLab raw file', 500);
444
395
  }
445
396
  }
446
397
  generateCodeVerifier() {
@@ -453,55 +404,34 @@ class GitlabConnector {
453
404
  async generateCodeChallenge(verifier) {
454
405
  const hashed = (0, crypto_1.createHash)('sha256').update(verifier).digest();
455
406
  let base64Url = hashed.toString('base64');
456
- // Replace '+' with '-', '/' with '_', and remove '='
457
407
  base64Url = base64Url.replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '');
458
408
  return base64Url;
459
409
  }
460
410
  getRedirect() {
461
411
  const params = `connectorId=${this.connectorId}&type=${this.connectorType}`;
462
- return `${this.config.url}${constants_1.API_PATH}${constants_1.API_CONNECTOR_PATH}${constants_1.API_CONNECTOR_LOGIN_CALLBACK}?${params}`;
463
- }
464
- // Force IPv4 when running locally
465
- getAgent() {
466
- if (this.config.url.startsWith('http://localhost')) {
467
- return new https_1.Agent({
468
- family: 4,
469
- });
470
- }
471
- return undefined;
412
+ return `${this.config.url}${constants_js_1.API_PATH}${constants_js_1.API_CONNECTOR_PATH}${constants_js_1.API_CONNECTOR_LOGIN_CALLBACK}?${params}`;
472
413
  }
473
- // GitLab returns transient 5xx (e.g. 500, 503 "Upstream Gitaly has been exhausted")
474
- // on raw-file fetches even for valid repos. Retry with exponential backoff + jitter.
475
414
  async fetchWithRetry(url, init = {}, maxRetries = 3) {
476
415
  let response;
477
416
  for (let attempt = 0; attempt <= maxRetries; attempt++) {
478
- response = await (0, node_fetch_1.default)(url, init);
417
+ response = await fetch(url, init);
479
418
  if (response.status < 500 || attempt === maxRetries)
480
419
  return response;
481
- // Drain the body so the connection can be reused
482
420
  try {
483
421
  await response.text();
484
422
  }
485
- catch { /* ignore */ }
423
+ catch { }
486
424
  const backoffMs = Math.min(8000, 500 * Math.pow(2, attempt)) + Math.floor(Math.random() * 500);
487
425
  console.warn(`[GitlabConnector] GitLab returned ${response.status} on ${url.split('?')[0]}, retrying in ${backoffMs}ms (attempt ${attempt + 1}/${maxRetries})`);
488
426
  await new Promise(resolve => setTimeout(resolve, backoffMs));
489
427
  }
490
428
  return response;
491
429
  }
492
- /**
493
- * Get the OAuth URL to redirect the user to
494
- * The URL should look like
495
- * https://gitlab.example.com/oauth/authorize?client_id=APP_ID&redirect_uri=REDIRECT_URI&response_type=code&state=STATE&scope=REQUESTED_SCOPES&code_challenge=CODE_CHALLENGE&code_challenge_method=S256
496
- * OAuth2 Step #1 from https://docs.gitlab.com/ee/api/oauth2.html#authorization-code-with-proof-key-for-code-exchange-pkce
497
- */
498
430
  async getOAuthUrl(session) {
499
431
  const redirect_uri = encodeURIComponent(this.getRedirect());
500
432
  const state = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
501
433
  const codeVerifier = this.generateCodeVerifier();
502
- // Create the code challenge
503
434
  const codeChallenge = await this.generateCodeChallenge(codeVerifier);
504
- // Store the code verifier and code challenge in the session
505
435
  this.setSessionToken(session, {
506
436
  ...this.getSessionToken(session),
507
437
  state,
@@ -520,7 +450,7 @@ class GitlabConnector {
520
450
  delete session[this.connectorId];
521
451
  }
522
452
  getOptions(formData) {
523
- return {}; // FIXME: store branch
453
+ return {};
524
454
  }
525
455
  async getLoginForm(session, redirectTo) {
526
456
  return null;
@@ -531,15 +461,8 @@ class GitlabConnector {
531
461
  async isLoggedIn(session) {
532
462
  return !!this.getSessionToken(session).token;
533
463
  }
534
- /**
535
- * Get the token from return code
536
- * Set the token in the session
537
- * OAuth2 Step #2 from https://docs.gitlab.com/ee/api/oauth2.html#authorization-code-with-proof-key-for-code-exchange-pkce
538
- */
539
464
  async setToken(session, loginResult) {
540
465
  const sessionToken = this.getSessionToken(session);
541
- // Handle state that may be JSON with redirect info or a plain string
542
- // Redirect info is when the user is comming from the /fork/ page of the dashboard
543
466
  let receivedState = loginResult.state;
544
467
  try {
545
468
  const parsed = JSON.parse(loginResult.state);
@@ -548,22 +471,20 @@ class GitlabConnector {
548
471
  }
549
472
  }
550
473
  catch {
551
- // Plain text
552
474
  }
553
475
  if (!receivedState || receivedState !== sessionToken?.state) {
554
476
  this.logout(session);
555
- throw new types_1.ApiError('Invalid state', 401);
477
+ throw new types_js_1.ApiError('Invalid state', 401);
556
478
  }
557
479
  if (!sessionToken?.codeVerifier) {
558
480
  this.logout(session);
559
- throw new types_1.ApiError('Missing code verifier', 401);
481
+ throw new types_js_1.ApiError('Missing code verifier', 401);
560
482
  }
561
483
  if (!sessionToken?.codeChallenge) {
562
484
  this.logout(session);
563
- throw new types_1.ApiError('Missing code challenge', 401);
485
+ throw new types_js_1.ApiError('Missing code challenge', 401);
564
486
  }
565
- const response = await (0, node_fetch_1.default)(this.options.domain + '/oauth/token', {
566
- agent: this.getAgent(),
487
+ const response = await fetch(this.options.domain + '/oauth/token', {
567
488
  method: 'POST',
568
489
  headers: {
569
490
  'Content-Type': 'application/json',
@@ -578,17 +499,14 @@ class GitlabConnector {
578
499
  }),
579
500
  });
580
501
  const token = await response.json();
581
- // Store the token in the session
582
502
  this.setSessionToken(session, {
583
503
  ...this.getSessionToken(session),
584
504
  token,
585
505
  });
586
- // We need to get the user ID for listWebsites
587
506
  const user = await this.callApi({
588
507
  session,
589
508
  path: 'api/v4/user'
590
509
  });
591
- // Store the user details in the session
592
510
  this.setSessionToken(session, {
593
511
  ...this.getSessionToken(session),
594
512
  userId: user.id,
@@ -607,16 +525,15 @@ class GitlabConnector {
607
525
  name: user.name,
608
526
  email: user.email,
609
527
  picture: user.avatar_url,
610
- storage: await (0, connectors_1.toConnectorData)(session, this),
528
+ storage: await (0, connectors_js_1.toConnectorData)(session, this),
611
529
  };
612
530
  }
613
531
  async listWebsites(session) {
614
532
  const userId = this.getSessionToken(session).userId;
615
533
  if (!userId) {
616
534
  this.logout(session);
617
- throw new types_1.ApiError('Missing Gitlab user ID. User not logged in?', 401);
535
+ throw new types_js_1.ApiError('Missing Gitlab user ID. User not logged in?', 401);
618
536
  }
619
- // Handle multiple pages
620
537
  let page = 1;
621
538
  let totalPages = 1;
622
539
  const projects = [];
@@ -633,7 +550,6 @@ class GitlabConnector {
633
550
  });
634
551
  projects.push(...pageProjects);
635
552
  page++;
636
- // Get the total number of pages from the response headers
637
553
  const total = responseHeaders['x-total-pages'];
638
554
  if (total) {
639
555
  totalPages = parseInt(total, 10);
@@ -651,24 +567,15 @@ class GitlabConnector {
651
567
  connectorUserSettings: {},
652
568
  }));
653
569
  }
654
- /**
655
- * Read the website data
656
- * The website data file is named `website.json` and the pages are named `page-{id}.json`
657
- * The pages are stored in the `src` folder by default
658
- */
659
570
  async readWebsite(session, websiteId) {
660
- const websiteDataBuf = await this.downloadRawFile(session, websiteId, constants_1.WEBSITE_DATA_FILE);
571
+ const websiteDataBuf = await this.downloadRawFile(session, websiteId, constants_js_1.WEBSITE_DATA_FILE);
661
572
  const websiteDataContent = websiteDataBuf.toString('utf8');
662
- // Use the common merge function to reconstruct website data
663
573
  const pageLoader = async (pagePath) => {
664
574
  const pageBuffer = await this.downloadRawFile(session, websiteId, pagePath);
665
575
  return pageBuffer.toString('utf8');
666
576
  };
667
- return await (0, websiteDataSerialization_1.merge)(websiteDataContent, pageLoader);
577
+ return await (0, websiteDataSerialization_js_1.merge)(websiteDataContent, pageLoader);
668
578
  }
669
- /**
670
- * Create a new website, i.e. a new Gitlab repository with an empty website data file
671
- */
672
579
  async createWebsite(session, websiteMeta) {
673
580
  const project = await this.callApi({
674
581
  session,
@@ -678,64 +585,39 @@ class GitlabConnector {
678
585
  name: this.options.repoPrefix + websiteMeta.name,
679
586
  }
680
587
  });
681
- await this.createFile(session, project.id, constants_1.WEBSITE_DATA_FILE, (0, websiteDataSerialization_1.stringify)(types_1.EMPTY_WEBSITE));
682
- //await this.createFile(session, project.id, WEBSITE_META_DATA_FILE, JSON.stringify(websiteMeta))
683
- //await this.updateWebsite(session, project.id, {} as WebsiteData)
684
- //await this.setWebsiteMeta(session, project.id, websiteMeta)
588
+ await this.createFile(session, project.id, constants_js_1.WEBSITE_DATA_FILE, (0, websiteDataSerialization_js_1.stringify)(types_js_1.EMPTY_WEBSITE));
685
589
  return project.id;
686
590
  }
687
- /**
688
- * Update the website data
689
- * Split the website data into 1 file per page + 1 file for the website data itself
690
- * Use gitlab batch API to create/update the files
691
- */
692
591
  async updateWebsite(session, websiteId, websiteData) {
693
592
  const batchActions = [];
694
- // **
695
- // Handle the legacy sites that have no pagesFolder
696
- // We want them to use "pages/" by default despite their files being in "src/" for now
697
593
  let isLegacySite = !websiteData.pagesFolder;
698
- // **
699
- // Backward compatibility case
700
- // The second time a legacy site is saved, the new `pages/` folder has been created
701
- // but the front end still doesn't have the `pagesFolder` key
702
- // This will be the case until the front end reloads
703
594
  if (isLegacySite) {
704
595
  const rootFiles = await this.ls({
705
596
  session,
706
597
  websiteId,
707
- path: constants_1.WEBSITE_PAGES_FOLDER,
598
+ path: constants_js_1.WEBSITE_PAGES_FOLDER,
708
599
  recursive: false,
709
600
  });
710
601
  if (rootFiles.size) {
711
- // Here the new `pages/` folder has been created already
712
602
  isLegacySite = false;
713
- websiteData.pagesFolder = constants_1.WEBSITE_PAGES_FOLDER;
603
+ websiteData.pagesFolder = constants_js_1.WEBSITE_PAGES_FOLDER;
714
604
  }
715
605
  }
716
- // **
717
- // List existing files in the OLD pages folder (to detect files to delete)
718
606
  const existingFiles = await this.ls({
719
607
  session,
720
608
  websiteId,
721
- path: (0, websiteDataSerialization_1.getPagesFolder)(websiteData),
609
+ path: (0, websiteDataSerialization_js_1.getPagesFolder)(websiteData),
722
610
  recursive: false,
723
611
  });
724
- // **
725
- // Force pagesFolder to 'pages' for writing if not defined
726
612
  if (isLegacySite) {
727
- websiteData.pagesFolder = constants_1.WEBSITE_PAGES_FOLDER;
613
+ websiteData.pagesFolder = constants_js_1.WEBSITE_PAGES_FOLDER;
728
614
  }
729
- // **
730
- // Use the common split function to create files
731
- const filesToWrite = (0, websiteDataSerialization_1.split)(websiteData);
732
- // **
733
- // Process each file to create/update
615
+ const filesToWrite = (0, websiteDataSerialization_js_1.split)(websiteData);
734
616
  for (const file of filesToWrite) {
735
617
  const filePath = file.path;
736
618
  const content = file.content;
737
619
  const newSha = computeGitBlobSha(content, false);
738
- const existingSha = existingFiles.get(filePath) || (filePath === constants_1.WEBSITE_DATA_FILE ? 'always-update' : undefined);
620
+ const existingSha = existingFiles.get(filePath) || (filePath === constants_js_1.WEBSITE_DATA_FILE ? 'always-update' : undefined);
739
621
  if (existingSha) {
740
622
  if (existingSha !== newSha) {
741
623
  batchActions.push({
@@ -743,7 +625,7 @@ class GitlabConnector {
743
625
  file_path: filePath,
744
626
  content,
745
627
  });
746
- } // else: skip unchanged file
628
+ }
747
629
  }
748
630
  else {
749
631
  batchActions.push({
@@ -753,8 +635,6 @@ class GitlabConnector {
753
635
  });
754
636
  }
755
637
  }
756
- // **
757
- // Delete pages that are not in the new website data
758
638
  const pathsToWrite = filesToWrite.map(f => f.path);
759
639
  for (const filePath of existingFiles.keys()) {
760
640
  if (!pathsToWrite.includes(filePath)) {
@@ -764,8 +644,6 @@ class GitlabConnector {
764
644
  });
765
645
  }
766
646
  }
767
- // **
768
- // Perform a batch commit
769
647
  return this.callApi({
770
648
  session,
771
649
  path: `api/v4/projects/${websiteId}/repository/commits`,
@@ -778,14 +656,12 @@ class GitlabConnector {
778
656
  });
779
657
  }
780
658
  async deleteWebsite(session, websiteId) {
781
- // Delete repo
782
659
  await this.callApi({
783
660
  session,
784
661
  path: `api/v4/projects/${websiteId}`,
785
662
  method: 'DELETE',
786
663
  });
787
664
  }
788
- // Fork the repo (user's own project)
789
665
  async duplicateWebsite(session, websiteId) {
790
666
  const meta = await this.getWebsiteMeta(session, websiteId);
791
667
  const forkName = `${meta.name} Copy ${new Date().toISOString().slice(0, 10)} ${Math.random().toString(36).substring(2, 4)}`;
@@ -796,29 +672,18 @@ class GitlabConnector {
796
672
  method: 'POST',
797
673
  requestBody: {
798
674
  name: this.options.repoPrefix + forkName,
799
- /* @ts-ignore */
800
675
  path: safePath,
801
- /* @ts-ignore */
802
676
  namespace: meta.namespace?.id || undefined,
803
677
  },
804
678
  });
805
679
  return forkedProject.id;
806
680
  }
807
- /**
808
- * Fork an external/public GitLab project (from any user/organization)
809
- * @param session - The user session
810
- * @param gitlabUrl - The project path in the "username/repo" format
811
- * @returns The new website ID (project ID)
812
- */
813
681
  async forkWebsite(session, gitlabUrl) {
814
- // Only accept "username/repo" pattern (no URLs)
815
682
  const projectPath = gitlabUrl.trim();
816
683
  if (!/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/.test(projectPath)) {
817
- throw new types_1.ApiError('Invalid project path. Use the "username/repo" format.', 400);
684
+ throw new types_js_1.ApiError('Invalid project path. Use the "username/repo" format.', 400);
818
685
  }
819
- // URL-encode the project path for the API
820
686
  const encodedPath = encodeURIComponent(projectPath);
821
- // First, get the source project info to extract its name
822
687
  let sourceProject;
823
688
  try {
824
689
  sourceProject = await this.callApi({
@@ -829,30 +694,26 @@ class GitlabConnector {
829
694
  }
830
695
  catch (e) {
831
696
  if (e.httpStatusCode === 404) {
832
- throw new types_1.ApiError(`Project not found: ${projectPath}. Make sure the project exists and is public or you have access to it.`, 404);
697
+ throw new types_js_1.ApiError(`Project not found: ${projectPath}. Make sure the project exists and is public or you have access to it.`, 404);
833
698
  }
834
699
  throw e;
835
700
  }
836
- // Generate a unique name for the fork
837
701
  const sourceName = sourceProject.name.replace(this.options.repoPrefix, '');
838
702
  const forkName = `${sourceName} ${new Date().toISOString().slice(0, 10)} ${Math.random().toString(36).substring(2, 4)}`;
839
703
  const safePath = sanitizeGitlabPath(this.options.repoPrefix + forkName);
840
- // Fork the project to the user's namespace
841
704
  const forkedProject = await this.callApi({
842
705
  session,
843
706
  path: `api/v4/projects/${encodedPath}/fork`,
844
707
  method: 'POST',
845
708
  requestBody: {
846
709
  name: this.options.repoPrefix + forkName,
847
- /* @ts-ignore */
848
710
  path: safePath,
849
711
  visibility: 'private',
850
712
  },
851
713
  });
852
- // Wait for the fork to complete (GitLab forks asynchronously)
853
714
  const forkedProjectId = forkedProject.id.toString();
854
- const maxAttempts = 30; // 30 attempts * 2 seconds = 60 seconds max
855
- const pollInterval = 2000; // 2 seconds
715
+ const maxAttempts = 30;
716
+ const pollInterval = 2000;
856
717
  for (let attempt = 0; attempt < maxAttempts; attempt++) {
857
718
  const project = await this.callApi({
858
719
  session,
@@ -863,9 +724,8 @@ class GitlabConnector {
863
724
  return forkedProjectId;
864
725
  }
865
726
  if (project.import_status === 'failed') {
866
- throw new types_1.ApiError(`Fork failed: ${project.import_error || 'Unknown error'}`, 500);
727
+ throw new types_js_1.ApiError(`Fork failed: ${project.import_error || 'Unknown error'}`, 500);
867
728
  }
868
- // Status is 'scheduled' or 'started', wait and retry
869
729
  await new Promise(resolve => setTimeout(resolve, pollInterval));
870
730
  }
871
731
  return forkedProjectId;
@@ -875,24 +735,19 @@ class GitlabConnector {
875
735
  session,
876
736
  path: `api/v4/projects/${websiteId}`
877
737
  });
878
- // Defaults
879
738
  let pagesUrl = undefined;
880
739
  let pagesVisibility = undefined;
881
740
  let lastJob = undefined;
882
- // Try to get GitLab Pages info
883
741
  try {
884
742
  const pages = await this.callApi({
885
743
  session,
886
744
  path: `api/v4/projects/${websiteId}/pages`
887
745
  });
888
746
  pagesUrl = pages.url;
889
- // pages.access_control_level may be present; fallback to project.visibility if not
890
747
  pagesVisibility = pages.access_control_level || project.visibility;
891
748
  }
892
749
  catch (e) {
893
- // If pages are not enabled or call fails, ignore and leave undefined
894
750
  }
895
- // Try to get last relevant job (prefer 'pages' job, otherwise most recent job)
896
751
  try {
897
752
  const jobs = await this.callApi({
898
753
  session,
@@ -914,9 +769,7 @@ class GitlabConnector {
914
769
  }
915
770
  }
916
771
  catch (e) {
917
- // With no jobs, leave lastJob undefined
918
772
  }
919
- // Fork info - fetch the forked-from project to get license
920
773
  let forkedFrom = undefined;
921
774
  if (project.forked_from_project) {
922
775
  let license = undefined;
@@ -929,7 +782,6 @@ class GitlabConnector {
929
782
  license = templateProject.license?.name || templateProject.license?.nickname || templateProject.license?.key;
930
783
  }
931
784
  catch (e) {
932
- // Template may be private or inaccessible
933
785
  }
934
786
  forkedFrom = {
935
787
  id: String(project.forked_from_project.id),
@@ -958,7 +810,6 @@ class GitlabConnector {
958
810
  return result;
959
811
  }
960
812
  async setWebsiteMeta(session, websiteId, websiteMeta) {
961
- // Rename the repo if needed
962
813
  const oldMeta = await this.getWebsiteMeta(session, websiteId);
963
814
  if (websiteMeta.name !== oldMeta.name) {
964
815
  await this.callApi({
@@ -972,20 +823,18 @@ class GitlabConnector {
972
823
  }
973
824
  }
974
825
  async writeAssets(session, websiteId, files, status, removeUnlisted = false) {
975
- status && await status({ message: `Preparing ${files.length} files`, status: types_1.JobStatus.IN_PROGRESS });
976
- // List all the files in assets folder
826
+ status && await status({ message: `Preparing ${files.length} files`, status: types_js_1.JobStatus.IN_PROGRESS });
977
827
  const existingFiles = await this.ls({
978
828
  session,
979
829
  websiteId,
980
830
  recursive: true,
981
831
  path: this.options.assetsFolder,
982
832
  });
983
- // Create the actions for the batch
984
833
  const filesToUpload = [];
985
834
  const filesToKeep = new Set(files.map(file => this.getAssetPath(file.path, false)));
986
835
  for (const file of files) {
987
836
  const filePath = this.getAssetPath(file.path, false);
988
- const content = (await (0, connectors_1.contentToBuffer)(file.content)).toString('base64');
837
+ const content = (await (0, connectors_js_1.contentToBuffer)(file.content)).toString('base64');
989
838
  const existingSha = existingFiles.get(filePath);
990
839
  const newSha = computeGitBlobSha(content, true);
991
840
  if (existingSha) {
@@ -996,7 +845,7 @@ class GitlabConnector {
996
845
  content,
997
846
  encoding: 'base64',
998
847
  });
999
- } // else: skip unchanged file
848
+ }
1000
849
  }
1001
850
  else {
1002
851
  filesToUpload.push({
@@ -1007,7 +856,6 @@ class GitlabConnector {
1007
856
  });
1008
857
  }
1009
858
  }
1010
- // Optionally remove unlisted files
1011
859
  if (removeUnlisted) {
1012
860
  for (const [existingFilePath] of existingFiles) {
1013
861
  if (!filesToKeep.has(existingFilePath)) {
@@ -1018,25 +866,22 @@ class GitlabConnector {
1018
866
  }
1019
867
  }
1020
868
  }
1021
- // Split the files into chunks to avoid the number of files limit
1022
869
  const chunks = [];
1023
870
  for (let i = 0; i < filesToUpload.length; i += MAX_BATCH_UPLOAD_SIZE) {
1024
871
  chunks.push(filesToUpload.slice(i, i + MAX_BATCH_UPLOAD_SIZE));
1025
872
  }
1026
- // Notify the user if nothing changed
1027
873
  if (chunks.length === 0) {
1028
874
  console.info('No files to upload');
1029
- status && await status({ message: 'No files to upload', status: types_1.JobStatus.SUCCESS });
875
+ status && await status({ message: 'No files to upload', status: types_js_1.JobStatus.SUCCESS });
1030
876
  return;
1031
877
  }
1032
- // Upload the files in chunks
1033
878
  for (let chunkIndex = 0; chunkIndex < chunks.length; chunkIndex++) {
1034
879
  const chunk = chunks[chunkIndex];
1035
880
  if (chunks.length > 1) {
1036
- status && await status({ message: `Batch ${chunkIndex + 1}/${chunks.length}: Uploading ${chunk.length} files`, status: types_1.JobStatus.IN_PROGRESS });
881
+ status && await status({ message: `Batch ${chunkIndex + 1}/${chunks.length}: Uploading ${chunk.length} files`, status: types_js_1.JobStatus.IN_PROGRESS });
1037
882
  }
1038
883
  else {
1039
- status && await status({ message: `Uploading ${files.length} file(s)`, status: types_1.JobStatus.IN_PROGRESS });
884
+ status && await status({ message: `Uploading ${files.length} file(s)`, status: types_js_1.JobStatus.IN_PROGRESS });
1040
885
  }
1041
886
  try {
1042
887
  await this.callApi({
@@ -1052,11 +897,11 @@ class GitlabConnector {
1052
897
  }
1053
898
  catch (e) {
1054
899
  console.error(`Batch ${chunkIndex + 1} failed`, e);
1055
- status && await status({ message: `Error in batch ${chunkIndex + 1}`, status: types_1.JobStatus.ERROR });
900
+ status && await status({ message: `Error in batch ${chunkIndex + 1}`, status: types_js_1.JobStatus.ERROR });
1056
901
  throw e;
1057
902
  }
1058
903
  }
1059
- status && await status({ message: `All ${files.length} files uploaded`, status: types_1.JobStatus.SUCCESS });
904
+ status && await status({ message: `All ${files.length} files uploaded`, status: types_js_1.JobStatus.SUCCESS });
1060
905
  }
1061
906
  async readAsset(session, websiteId, fileName) {
1062
907
  const finalPath = this.getAssetPath(fileName, false);
@@ -1078,35 +923,6 @@ class GitlabConnector {
1078
923
  }
1079
924
  });
1080
925
  }
1081
- /*
1082
- * Get the meta repo path for the current user
1083
- * The meta repo contains a JSON file which contains the list of websites
1084
- */
1085
- //private getMetaRepoPath(session: GitlabSession): string {
1086
- // if(!this.getSessionToken(session).username) throw new ApiError('Missing Gitlab user ID. User not logged in?', 401)
1087
- // return encodeURIComponent(`${this.getSessionToken(session).username}/${this.options.metaRepo}`)
1088
- //}
1089
- ///**
1090
- // * Initialize the storage with a meta repo
1091
- // */
1092
- //private async initStorage(session: GitlabSession): Promise<void> {
1093
- // // Create the meta repo
1094
- // try {
1095
- // const project = await this.callApi(session, 'api/v4/projects/', 'POST', {
1096
- // name: this.options.metaRepo,
1097
- // }) as any
1098
- // return this.createFile(session, this.getMetaRepoPath(session), this.options.metaRepoFile, JSON.stringify({
1099
- // websites: {}
1100
- // } as MetaRepoFileContent))
1101
- // } catch (e) {
1102
- // console.error('Could not init storage', e.statusCode, e.httpStatusCode, e)
1103
- // throw e
1104
- // }
1105
- //}
1106
- /**
1107
- * List all the files in a folder
1108
- * The result is a map of file paths to their SHA
1109
- */
1110
926
  async ls({ session, websiteId, recursive = false, path, }) {
1111
927
  const existingPaths = new Map();
1112
928
  let page = 1;
@@ -1131,25 +947,18 @@ class GitlabConnector {
1131
947
  });
1132
948
  }
1133
949
  catch (e) {
1134
- // Allow 404 errors
1135
- // This happens when the folder does not exist
1136
- // In git this just means the files don't exist yet
1137
950
  if (e.statusCode !== 404 && e.httpStatusCode !== 404) {
1138
951
  throw e;
1139
952
  }
1140
953
  }
1141
- // Filter the files
1142
954
  tree
1143
955
  .filter(item => item.type === 'blob')
1144
956
  .forEach(item => existingPaths.set(item.path, item.id));
1145
- // Check if we need to keep going
1146
957
  const maxPages = responseHeaders['x-total-pages'] ? parseInt(responseHeaders['x-total-pages'], 10) : 1;
1147
958
  keepGoing = page < maxPages;
1148
959
  page++;
1149
960
  }
1150
- // Return the set of existing paths
1151
961
  return existingPaths;
1152
962
  }
1153
963
  }
1154
964
  exports.default = GitlabConnector;
1155
- //# sourceMappingURL=GitlabConnector.js.map