@plone/volto 18.0.0-alpha.2 → 18.0.0-alpha.4

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 (293) hide show
  1. package/.eslintrc +3 -3
  2. package/.prettierignore +8 -0
  3. package/.prettierrc +12 -0
  4. package/{packages/registry/.release-it.json → .release-it.json} +11 -6
  5. package/CHANGELOG.md +44 -4
  6. package/locales/ca/LC_MESSAGES/volto.po +1 -0
  7. package/locales/de/LC_MESSAGES/volto.po +1 -0
  8. package/locales/en/LC_MESSAGES/volto.po +1 -0
  9. package/locales/es/LC_MESSAGES/volto.po +1 -0
  10. package/locales/eu/LC_MESSAGES/volto.po +1 -0
  11. package/locales/fi/LC_MESSAGES/volto.po +1 -0
  12. package/locales/fr/LC_MESSAGES/volto.po +1 -0
  13. package/locales/it/LC_MESSAGES/volto.po +1 -0
  14. package/locales/ja/LC_MESSAGES/volto.po +1 -0
  15. package/locales/nl/LC_MESSAGES/volto.po +1 -0
  16. package/locales/pt/LC_MESSAGES/volto.po +1 -0
  17. package/locales/pt_BR/LC_MESSAGES/volto.po +1 -0
  18. package/locales/ro/LC_MESSAGES/volto.po +1 -0
  19. package/locales/volto.pot +2 -1
  20. package/locales/zh_CN/LC_MESSAGES/volto.po +1 -0
  21. package/package.json +57 -127
  22. package/razzle.config.js +4 -7
  23. package/src/components/manage/Blocks/Video/Body.jsx +52 -22
  24. package/src/components/manage/Blocks/Video/Body.test.jsx +167 -0
  25. package/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.jsx +2 -2
  26. package/src/components/manage/Form/Form.jsx +5 -2
  27. package/src/components/theme/Breadcrumbs/Breadcrumbs.jsx +19 -2
  28. package/src/components/theme/ContentMetadataTags/ContentMetadataTags.jsx +46 -39
  29. package/src/config/index.js +0 -4
  30. package/src/icons/divide-horizontal.svg +0 -0
  31. package/src/icons/divide-vertical.svg +0 -0
  32. package/src/icons/hero.svg +0 -0
  33. package/src/icons/slider.svg +0 -0
  34. package/src/icons/summary.svg +0 -0
  35. package/src/middleware/api.js +1 -1
  36. package/theme/themes/default/elements/icon.overrides +0 -0
  37. package/theme/themes/default/globals/reset.overrides +0 -0
  38. package/theme/themes/default/globals/site.variables +0 -0
  39. package/theme/themes/default/modules/dropdown.overrides +0 -0
  40. package/theme/themes/default/modules/dropdown.variables +0 -0
  41. package/theme/themes/default/modules/modal.variables +0 -0
  42. package/theme/themes/default/modules/video.overrides +0 -0
  43. package/theme/themes/default/modules/video.variables +0 -0
  44. package/theme/themes/pastanaga/assets/fonts/icons.eot +0 -0
  45. package/theme/themes/pastanaga/assets/fonts/icons.svg +0 -0
  46. package/theme/themes/pastanaga/assets/fonts/icons.ttf +0 -0
  47. package/theme/themes/pastanaga/assets/fonts/icons.woff +0 -0
  48. package/theme/themes/pastanaga/globals/reset.overrides +0 -0
  49. package/theme/themes/pastanaga/globals/site.variables +0 -0
  50. package/theme/themes/pastanaga/modules/dropdown.variables +0 -0
  51. package/theme/themes/pastanaga/modules/modal.variables +0 -0
  52. package/theme/themes/pastanaga/modules/video.overrides +0 -0
  53. package/theme/themes/pastanaga/modules/video.variables +0 -0
  54. package/tsconfig.json +1 -4
  55. package/types/components/manage/Blocks/Video/Body.d.ts +5 -0
  56. package/types/config/RichTextEditor/index.d.ts +5 -8
  57. package/types/helpers/AsyncConnect/index.d.ts +2 -2
  58. package/types/helpers/Url/Url.d.ts +3 -3
  59. package/types/icons/load-icons.d.ts +1 -1
  60. package/webpack-plugins/webpack-less-plugin.js +1 -0
  61. package/CODE_OF_CONDUCT.md +0 -13
  62. package/CONTRIBUTING.md +0 -7
  63. package/README.md +0 -154
  64. package/RELEASING.md +0 -73
  65. package/ROADMAP.md +0 -30
  66. package/SECURITY.md +0 -14
  67. package/logos/Logo.png +0 -0
  68. package/logos/VoltoLogoEra2-dark-mode.png +0 -0
  69. package/logos/VoltoLogoEra2.png +0 -0
  70. package/logos/volto-colorful.png +0 -0
  71. package/logos/volto-colorful.svg +0 -35
  72. package/logos/volto-guide.png +0 -0
  73. package/logos/volto-h-transparent.svg +0 -6
  74. package/logos/volto-transparent.png +0 -0
  75. package/logos/volto-transparent.svg +0 -19
  76. package/logos/volto-transparent2.svg +0 -5
  77. package/logos/volto-yellow.svg +0 -29
  78. package/logos/volto.sketch +0 -0
  79. package/packages/README.md +0 -7
  80. package/packages/registry/.towncrier/towncrier_template.jinja +0 -10
  81. package/packages/registry/CHANGELOG.md +0 -16
  82. package/packages/registry/README.md +0 -207
  83. package/packages/registry/addon-registry.js +0 -603
  84. package/packages/registry/create-addons-loader.js +0 -116
  85. package/packages/registry/create-theme-addons-loader.js +0 -78
  86. package/packages/registry/news/.gitkeep +0 -0
  87. package/packages/registry/package.json +0 -76
  88. package/packages/registry/src/index.ts +0 -174
  89. package/packages/registry/src/registry.test.js +0 -111
  90. package/packages/registry/tsconfig.json +0 -32
  91. package/packages/scripts/CHANGELOG.md +0 -173
  92. package/packages/scripts/README.md +0 -128
  93. package/packages/scripts/addon/consolidate.js +0 -28
  94. package/packages/scripts/addon/generators.js +0 -213
  95. package/packages/scripts/addon/getAddonInfo.js +0 -65
  96. package/packages/scripts/addon/index.js +0 -88
  97. package/packages/scripts/addon/utils.js +0 -44
  98. package/packages/scripts/backportpr.js +0 -75
  99. package/packages/scripts/changelogupdater.cjs +0 -94
  100. package/packages/scripts/corepackagebump.js +0 -20
  101. package/packages/scripts/i18n.cjs +0 -310
  102. package/packages/scripts/package.json +0 -76
  103. package/packages/scripts/templates/towncrier_template.jinja +0 -10
  104. package/packages/types/Blocks/View.ts +0 -11
  105. package/packages/types/actions.ts +0 -15
  106. package/packages/types/breadcrumbs.ts +0 -10
  107. package/packages/types/config/Blocks.ts +0 -153
  108. package/packages/types/config/Content.ts +0 -62
  109. package/packages/types/config/Settings.ts +0 -86
  110. package/packages/types/config/Views.ts +0 -15
  111. package/packages/types/config/Widgets.ts +0 -7
  112. package/packages/types/config/index.ts +0 -21
  113. package/packages/types/content/common.ts +0 -60
  114. package/packages/types/content/get.ts +0 -66
  115. package/packages/types/index.ts +0 -0
  116. package/packages/types/navigation.ts +0 -12
  117. package/packages/types/package.json +0 -64
  118. package/packages/types/types.ts +0 -61
  119. package/packages/volto-slate/.i18n.babel.config.js +0 -1
  120. package/packages/volto-slate/README.md +0 -4
  121. package/packages/volto-slate/build/messages/src/blocks/Table/TableBlockEdit.json +0 -90
  122. package/packages/volto-slate/build/messages/src/blocks/Text/DefaultTextBlockEditor.json +0 -6
  123. package/packages/volto-slate/build/messages/src/blocks/Text/DetachedTextBlockEditor.json +0 -6
  124. package/packages/volto-slate/build/messages/src/blocks/Text/SlashMenu.json +0 -6
  125. package/packages/volto-slate/build/messages/src/editor/plugins/AdvancedLink/index.json +0 -10
  126. package/packages/volto-slate/build/messages/src/editor/plugins/Link/index.json +0 -10
  127. package/packages/volto-slate/build/messages/src/editor/plugins/Table/index.json +0 -30
  128. package/packages/volto-slate/build/messages/src/elementEditor/messages.json +0 -10
  129. package/packages/volto-slate/build/messages/src/widgets/HtmlSlateWidget.json +0 -6
  130. package/packages/volto-slate/build/messages/src/widgets/RichTextWidgetView.json +0 -6
  131. package/packages/volto-slate/locales/de/LC_MESSAGES/volto.po +0 -148
  132. package/packages/volto-slate/locales/en/LC_MESSAGES/volto.po +0 -148
  133. package/packages/volto-slate/locales/volto.pot +0 -182
  134. package/packages/volto-slate/package.json +0 -43
  135. package/packages/volto-slate/src/actions/content.js +0 -30
  136. package/packages/volto-slate/src/actions/index.js +0 -3
  137. package/packages/volto-slate/src/actions/plugins.js +0 -9
  138. package/packages/volto-slate/src/actions/selection.js +0 -22
  139. package/packages/volto-slate/src/blocks/Table/Cell.jsx +0 -87
  140. package/packages/volto-slate/src/blocks/Table/Cell.test.js +0 -54
  141. package/packages/volto-slate/src/blocks/Table/TableBlockEdit.jsx +0 -694
  142. package/packages/volto-slate/src/blocks/Table/TableBlockEdit.test.js +0 -40
  143. package/packages/volto-slate/src/blocks/Table/TableBlockView.jsx +0 -150
  144. package/packages/volto-slate/src/blocks/Table/TableBlockView.test.js +0 -49
  145. package/packages/volto-slate/src/blocks/Table/deconstruct.js +0 -113
  146. package/packages/volto-slate/src/blocks/Table/extensions/normalizeTable.js +0 -5
  147. package/packages/volto-slate/src/blocks/Table/index.js +0 -60
  148. package/packages/volto-slate/src/blocks/Table/schema.js +0 -122
  149. package/packages/volto-slate/src/blocks/Text/DefaultTextBlockEditor.jsx +0 -304
  150. package/packages/volto-slate/src/blocks/Text/DetachedTextBlockEditor.jsx +0 -77
  151. package/packages/volto-slate/src/blocks/Text/MarkdownIntroduction.jsx +0 -59
  152. package/packages/volto-slate/src/blocks/Text/PluginSidebar.jsx +0 -18
  153. package/packages/volto-slate/src/blocks/Text/ShortcutListing.jsx +0 -28
  154. package/packages/volto-slate/src/blocks/Text/SlashMenu.jsx +0 -203
  155. package/packages/volto-slate/src/blocks/Text/TextBlockEdit.jsx +0 -38
  156. package/packages/volto-slate/src/blocks/Text/TextBlockEdit.test.js +0 -107
  157. package/packages/volto-slate/src/blocks/Text/TextBlockSchema.js +0 -54
  158. package/packages/volto-slate/src/blocks/Text/TextBlockView.jsx +0 -31
  159. package/packages/volto-slate/src/blocks/Text/css/editor.css +0 -18
  160. package/packages/volto-slate/src/blocks/Text/extensions/Readme.md +0 -49
  161. package/packages/volto-slate/src/blocks/Text/extensions/breakList.js +0 -100
  162. package/packages/volto-slate/src/blocks/Text/extensions/index.js +0 -6
  163. package/packages/volto-slate/src/blocks/Text/extensions/insertBreak.js +0 -57
  164. package/packages/volto-slate/src/blocks/Text/extensions/isSelected.js +0 -7
  165. package/packages/volto-slate/src/blocks/Text/extensions/normalizeExternalData.js +0 -7
  166. package/packages/volto-slate/src/blocks/Text/extensions/withDeserializers.js +0 -87
  167. package/packages/volto-slate/src/blocks/Text/extensions/withLists.js +0 -5
  168. package/packages/volto-slate/src/blocks/Text/index.js +0 -171
  169. package/packages/volto-slate/src/blocks/Text/keyboard/backspaceInList.js +0 -58
  170. package/packages/volto-slate/src/blocks/Text/keyboard/breakBlocks.js +0 -3
  171. package/packages/volto-slate/src/blocks/Text/keyboard/cancelEsc.js +0 -7
  172. package/packages/volto-slate/src/blocks/Text/keyboard/indentListItems.js +0 -240
  173. package/packages/volto-slate/src/blocks/Text/keyboard/index.js +0 -52
  174. package/packages/volto-slate/src/blocks/Text/keyboard/joinBlocks.js +0 -180
  175. package/packages/volto-slate/src/blocks/Text/keyboard/moveListItems.js +0 -124
  176. package/packages/volto-slate/src/blocks/Text/keyboard/slashMenu.js +0 -19
  177. package/packages/volto-slate/src/blocks/Text/keyboard/softBreak.js +0 -7
  178. package/packages/volto-slate/src/blocks/Text/keyboard/traverseBlocks.js +0 -81
  179. package/packages/volto-slate/src/blocks/Text/keyboard/unwrapEmptyString.js +0 -26
  180. package/packages/volto-slate/src/blocks/Text/schema.js +0 -39
  181. package/packages/volto-slate/src/constants.js +0 -123
  182. package/packages/volto-slate/src/editor/EditorContext.jsx +0 -5
  183. package/packages/volto-slate/src/editor/EditorReference.jsx +0 -22
  184. package/packages/volto-slate/src/editor/SlateEditor.jsx +0 -375
  185. package/packages/volto-slate/src/editor/config.jsx +0 -344
  186. package/packages/volto-slate/src/editor/decorate.js +0 -68
  187. package/packages/volto-slate/src/editor/deserialize.js +0 -185
  188. package/packages/volto-slate/src/editor/extensions/index.js +0 -6
  189. package/packages/volto-slate/src/editor/extensions/insertBreak.js +0 -15
  190. package/packages/volto-slate/src/editor/extensions/insertData.js +0 -159
  191. package/packages/volto-slate/src/editor/extensions/isInline.js +0 -14
  192. package/packages/volto-slate/src/editor/extensions/normalizeExternalData.js +0 -8
  193. package/packages/volto-slate/src/editor/extensions/normalizeNode.js +0 -48
  194. package/packages/volto-slate/src/editor/extensions/withDeserializers.js +0 -15
  195. package/packages/volto-slate/src/editor/extensions/withTestingFeatures.jsx +0 -84
  196. package/packages/volto-slate/src/editor/index.js +0 -14
  197. package/packages/volto-slate/src/editor/less/editor.less +0 -173
  198. package/packages/volto-slate/src/editor/less/globals.less +0 -18
  199. package/packages/volto-slate/src/editor/less/slate.less +0 -28
  200. package/packages/volto-slate/src/editor/plugins/AdvancedLink/deserialize.js +0 -90
  201. package/packages/volto-slate/src/editor/plugins/AdvancedLink/extensions.js +0 -32
  202. package/packages/volto-slate/src/editor/plugins/AdvancedLink/index.js +0 -50
  203. package/packages/volto-slate/src/editor/plugins/AdvancedLink/render.jsx +0 -37
  204. package/packages/volto-slate/src/editor/plugins/AdvancedLink/schema.js +0 -114
  205. package/packages/volto-slate/src/editor/plugins/AdvancedLink/styles.less +0 -8
  206. package/packages/volto-slate/src/editor/plugins/Blockquote/index.js +0 -30
  207. package/packages/volto-slate/src/editor/plugins/Callout/index.js +0 -34
  208. package/packages/volto-slate/src/editor/plugins/Image/deconstruct.js +0 -30
  209. package/packages/volto-slate/src/editor/plugins/Image/extensions.js +0 -51
  210. package/packages/volto-slate/src/editor/plugins/Image/index.js +0 -11
  211. package/packages/volto-slate/src/editor/plugins/Image/render.jsx +0 -22
  212. package/packages/volto-slate/src/editor/plugins/Link/extensions.js +0 -58
  213. package/packages/volto-slate/src/editor/plugins/Link/index.js +0 -164
  214. package/packages/volto-slate/src/editor/plugins/Link/render.jsx +0 -54
  215. package/packages/volto-slate/src/editor/plugins/Markdown/constants.js +0 -81
  216. package/packages/volto-slate/src/editor/plugins/Markdown/extensions.js +0 -334
  217. package/packages/volto-slate/src/editor/plugins/Markdown/index.js +0 -28
  218. package/packages/volto-slate/src/editor/plugins/Markdown/utils.js +0 -198
  219. package/packages/volto-slate/src/editor/plugins/StyleMenu/StyleMenu.jsx +0 -153
  220. package/packages/volto-slate/src/editor/plugins/StyleMenu/index.js +0 -19
  221. package/packages/volto-slate/src/editor/plugins/StyleMenu/style.less +0 -29
  222. package/packages/volto-slate/src/editor/plugins/StyleMenu/utils.js +0 -168
  223. package/packages/volto-slate/src/editor/plugins/Table/TableButton.jsx +0 -142
  224. package/packages/volto-slate/src/editor/plugins/Table/TableCell.jsx +0 -44
  225. package/packages/volto-slate/src/editor/plugins/Table/TableContainer.jsx +0 -37
  226. package/packages/volto-slate/src/editor/plugins/Table/TableSizePicker.jsx +0 -83
  227. package/packages/volto-slate/src/editor/plugins/Table/extensions.js +0 -87
  228. package/packages/volto-slate/src/editor/plugins/Table/index.js +0 -390
  229. package/packages/volto-slate/src/editor/plugins/Table/less/public.less +0 -29
  230. package/packages/volto-slate/src/editor/plugins/Table/less/table.less +0 -28
  231. package/packages/volto-slate/src/editor/plugins/Table/render.jsx +0 -30
  232. package/packages/volto-slate/src/editor/plugins/index.js +0 -19
  233. package/packages/volto-slate/src/editor/render.jsx +0 -224
  234. package/packages/volto-slate/src/editor/ui/BasicToolbar.jsx +0 -11
  235. package/packages/volto-slate/src/editor/ui/BlockButton.jsx +0 -31
  236. package/packages/volto-slate/src/editor/ui/ClearFormattingButton.jsx +0 -21
  237. package/packages/volto-slate/src/editor/ui/ExpandedToolbar.jsx +0 -18
  238. package/packages/volto-slate/src/editor/ui/Expando.jsx +0 -5
  239. package/packages/volto-slate/src/editor/ui/InlineToolbar.jsx +0 -73
  240. package/packages/volto-slate/src/editor/ui/MarkButton.jsx +0 -23
  241. package/packages/volto-slate/src/editor/ui/MarkElementButton.jsx +0 -30
  242. package/packages/volto-slate/src/editor/ui/Menu.jsx +0 -13
  243. package/packages/volto-slate/src/editor/ui/PositionedToolbar.jsx +0 -32
  244. package/packages/volto-slate/src/editor/ui/Separator.jsx +0 -7
  245. package/packages/volto-slate/src/editor/ui/SlateContextToolbar.jsx +0 -13
  246. package/packages/volto-slate/src/editor/ui/SlateToolbar.jsx +0 -96
  247. package/packages/volto-slate/src/editor/ui/Toolbar.jsx +0 -103
  248. package/packages/volto-slate/src/editor/ui/ToolbarButton.jsx +0 -33
  249. package/packages/volto-slate/src/editor/ui/ToolbarButton.test.js +0 -25
  250. package/packages/volto-slate/src/editor/ui/index.js +0 -15
  251. package/packages/volto-slate/src/editor/utils.js +0 -248
  252. package/packages/volto-slate/src/elementEditor/ContextButtons.jsx +0 -56
  253. package/packages/volto-slate/src/elementEditor/PluginEditor.jsx +0 -124
  254. package/packages/volto-slate/src/elementEditor/Readme.md +0 -6
  255. package/packages/volto-slate/src/elementEditor/SchemaProvider.jsx +0 -3
  256. package/packages/volto-slate/src/elementEditor/SidebarEditor.jsx +0 -46
  257. package/packages/volto-slate/src/elementEditor/ToolbarButton.jsx +0 -44
  258. package/packages/volto-slate/src/elementEditor/index.js +0 -5
  259. package/packages/volto-slate/src/elementEditor/makeInlineElementPlugin.js +0 -100
  260. package/packages/volto-slate/src/elementEditor/messages.js +0 -14
  261. package/packages/volto-slate/src/elementEditor/utils.js +0 -226
  262. package/packages/volto-slate/src/hooks/index.js +0 -3
  263. package/packages/volto-slate/src/hooks/useEditorContext.js +0 -6
  264. package/packages/volto-slate/src/hooks/useIsomorphicLayoutEffect.js +0 -7
  265. package/packages/volto-slate/src/hooks/useSelectionPosition.js +0 -25
  266. package/packages/volto-slate/src/i18n.js +0 -180
  267. package/packages/volto-slate/src/icons/hashlink.svg +0 -57
  268. package/packages/volto-slate/src/index.js +0 -61
  269. package/packages/volto-slate/src/reducers/content.js +0 -74
  270. package/packages/volto-slate/src/reducers/index.js +0 -3
  271. package/packages/volto-slate/src/reducers/plugins.js +0 -17
  272. package/packages/volto-slate/src/reducers/selection.js +0 -16
  273. package/packages/volto-slate/src/utils/blocks.js +0 -375
  274. package/packages/volto-slate/src/utils/blocks.test.js +0 -138
  275. package/packages/volto-slate/src/utils/editor.js +0 -31
  276. package/packages/volto-slate/src/utils/image.js +0 -25
  277. package/packages/volto-slate/src/utils/index.js +0 -11
  278. package/packages/volto-slate/src/utils/internals.js +0 -46
  279. package/packages/volto-slate/src/utils/lists.js +0 -92
  280. package/packages/volto-slate/src/utils/marks.js +0 -104
  281. package/packages/volto-slate/src/utils/mime-types.js +0 -24
  282. package/packages/volto-slate/src/utils/nodes.js +0 -4
  283. package/packages/volto-slate/src/utils/ops.js +0 -20
  284. package/packages/volto-slate/src/utils/random.js +0 -17
  285. package/packages/volto-slate/src/utils/selection.js +0 -236
  286. package/packages/volto-slate/src/utils/slate-string-utils.js +0 -408
  287. package/packages/volto-slate/src/utils/volto-blocks.js +0 -314
  288. package/packages/volto-slate/src/widgets/ErrorBoundary.jsx +0 -27
  289. package/packages/volto-slate/src/widgets/HtmlSlateWidget.jsx +0 -139
  290. package/packages/volto-slate/src/widgets/ObjectByTypeWidget.jsx +0 -49
  291. package/packages/volto-slate/src/widgets/RichTextWidget.jsx +0 -72
  292. package/packages/volto-slate/src/widgets/RichTextWidgetView.jsx +0 -37
  293. package/packages/volto-slate/src/widgets/style.css +0 -21
@@ -1,78 +0,0 @@
1
- const fs = require('fs');
2
- const tmp = require('tmp');
3
- const cryptoRandomString = require('crypto-random-string');
4
-
5
- const titleCase = (w) => w.slice(0, 1).toUpperCase() + w.slice(1, w.length);
6
-
7
- /*
8
- * Transforms a package name to javascript variable name
9
- */
10
- function nameFromPackage(name) {
11
- name =
12
- name.replace(/[@~./\\:\s]/gi, '') ||
13
- cryptoRandomString({ length: 10, characters: 'abcdefghijk' });
14
- return name
15
- .split('-')
16
- .map((w, i) => (i > 0 ? titleCase(w) : w))
17
- .join('');
18
- }
19
-
20
- /*
21
- * Creates a static file with code necessary to load the addons configuration
22
- *
23
- */
24
- function getAddonsLoaderCode(name, customThemeAddons = []) {
25
- let buf = `/*
26
- This file is autogenerated. Don't change it directly.
27
- Add a ./theme/_${name}.scss in your add-on to load your theme customizations in the current theme.
28
- */
29
-
30
- `;
31
- customThemeAddons.forEach((addon) => {
32
- const customization = `${addon}/theme/${name}`;
33
- const line = `@import '${customization}';\n`;
34
- buf += line;
35
- });
36
-
37
- return buf;
38
- }
39
-
40
- module.exports = ({ main, variables }) => {
41
- // const addonsThemeLoaderVariablesPath = path.join(
42
- // process.cwd(),
43
- // 'src',
44
- // '_variables.scss',
45
- // );
46
- // const addonsThemeLoaderMainPath = path.join(
47
- // process.cwd(),
48
- // 'src',
49
- // '_main.scss',
50
- // );
51
-
52
- // const addonsThemeLoaderVariablesPath = path.join(
53
- // process.cwd(),
54
- // 'src',
55
- // '_variables.scss',
56
- // );
57
- // const addonsThemeLoaderMainPath = path.join(
58
- // process.cwd(),
59
- // 'src',
60
- // '_main.scss',
61
- // );
62
-
63
- const addonsThemeLoaderVariablesPath = tmp.tmpNameSync({ postfix: '.scss' });
64
- const addonsThemeLoaderMainPath = tmp.tmpNameSync({ postfix: '.scss' });
65
- fs.writeFileSync(
66
- addonsThemeLoaderVariablesPath,
67
- new Buffer.from(getAddonsLoaderCode('variables', variables)),
68
- );
69
- fs.writeFileSync(
70
- addonsThemeLoaderMainPath,
71
- new Buffer.from(getAddonsLoaderCode('main', main)),
72
- );
73
-
74
- return [addonsThemeLoaderVariablesPath, addonsThemeLoaderMainPath];
75
- };
76
-
77
- module.exports.getAddonsLoaderCode = getAddonsLoaderCode;
78
- module.exports.nameFromPackage = nameFromPackage;
File without changes
@@ -1,76 +0,0 @@
1
- {
2
- "name": "@plone/registry",
3
- "description": "Add-on and configuration registry for Plone and for JavaScript and TypeScript-based apps.",
4
- "maintainers": [
5
- {
6
- "name": "Plone Foundation",
7
- "url": "https://plone.org"
8
- }
9
- ],
10
- "funding": "https://github.com/sponsors/plone",
11
- "license": "MIT",
12
- "version": "1.0.0",
13
- "repository": {
14
- "type": "git",
15
- "url": "https://github.com/plone/volto.git"
16
- },
17
- "bugs": {
18
- "url": "https://github.com/plone/volto/issues"
19
- },
20
- "homepage": "https://plone.org",
21
- "keywords": [
22
- "volto",
23
- "plone",
24
- "plone6",
25
- "react",
26
- "add-ons",
27
- "registry",
28
- "configuration",
29
- "config"
30
- ],
31
- "publishConfig": {
32
- "access": "public"
33
- },
34
- "source": "src/index.ts",
35
- "main": "dist/main.js",
36
- "module": "dist/module.js",
37
- "types": "dist/types.d.ts",
38
- "targets": {
39
- "main": {
40
- "includeNodeModules": false
41
- }
42
- },
43
- "scripts": {
44
- "watch": "parcel watch",
45
- "build": "parcel build",
46
- "dry-release": "release-it --dry-run",
47
- "release": "release-it",
48
- "release-major-alpha": "release-it major --preRelease=alpha",
49
- "release-alpha": "release-it --preRelease=alpha"
50
- },
51
- "peerDependencies": {
52
- "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
53
- "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
54
- },
55
- "peerDependenciesMeta": {
56
- "react-dom": {
57
- "optional": true
58
- }
59
- },
60
- "dependencies": {
61
- "crypto-random-string": "3.2.0",
62
- "debug": "4.3.2",
63
- "dependency-graph": "0.10.0",
64
- "glob": "7.1.6",
65
- "lodash": "4.17.21"
66
- },
67
- "devDependencies": {
68
- "@parcel/packager-ts": "2.10.2",
69
- "@parcel/transformer-typescript-types": "2.10.2",
70
- "@types/react": "^17.0.52",
71
- "@types/react-dom": "^17",
72
- "parcel": "2.10.2",
73
- "release-it": "16.2.1",
74
- "typescript": "5.2.2"
75
- }
76
- }
@@ -1,174 +0,0 @@
1
- import { isArray } from 'lodash';
2
- import * as configTypes from '@plone/types/config';
3
-
4
- type ConfigData = {
5
- settings: configTypes.SettingsConfig;
6
- blocks: configTypes.BlocksConfig;
7
- views: configTypes.ViewsConfig;
8
- widgets: configTypes.WidgetsConfig;
9
- addonReducers: configTypes.AddonReducersConfig;
10
- addonRoutes: configTypes.AddonRoutesConfig;
11
- slots: configTypes.SlotsConfig;
12
- components: configTypes.ComponentsConfig;
13
- experimental: configTypes.ExperimentalConfig;
14
- };
15
-
16
- class Config {
17
- public _data: ConfigData | Record<string, never>;
18
- static instance: InstanceType<typeof Config>;
19
-
20
- constructor() {
21
- if (!Config.instance) {
22
- this._data = {};
23
- Config.instance = this;
24
- }
25
-
26
- return Config.instance;
27
- }
28
-
29
- set<RegistryKey extends keyof ConfigData>(
30
- registry: RegistryKey,
31
- item: ConfigData[RegistryKey],
32
- ) {
33
- this._data[registry] = item;
34
- }
35
-
36
- get(registry: keyof ConfigData) {
37
- return this._data[registry];
38
- }
39
-
40
- get settings() {
41
- return this._data.settings;
42
- }
43
-
44
- set settings(settings) {
45
- this._data.settings = settings;
46
- }
47
-
48
- get experimental() {
49
- return this._data.experimental;
50
- }
51
-
52
- set experimental(experimental) {
53
- this._data.experimental = experimental;
54
- }
55
-
56
- get blocks() {
57
- return this._data.blocks;
58
- }
59
-
60
- set blocks(blocks) {
61
- this._data.blocks = blocks;
62
- }
63
-
64
- get views() {
65
- return this._data.views;
66
- }
67
-
68
- set views(views) {
69
- this._data.views = views;
70
- }
71
-
72
- get widgets() {
73
- return this._data.widgets;
74
- }
75
-
76
- set widgets(widgets) {
77
- this._data.widgets = widgets;
78
- }
79
-
80
- get addonReducers() {
81
- return this._data.addonReducers;
82
- }
83
-
84
- set addonReducers(addonReducers) {
85
- this._data.addonReducers = addonReducers;
86
- }
87
-
88
- get addonRoutes() {
89
- return this._data.addonRoutes;
90
- }
91
-
92
- set addonRoutes(addonRoutes) {
93
- this._data.addonRoutes = addonRoutes;
94
- }
95
-
96
- get slots() {
97
- return this._data.slots;
98
- }
99
-
100
- set slots(slots) {
101
- this._data.slots = slots;
102
- }
103
-
104
- get components() {
105
- return this._data.components;
106
- }
107
-
108
- set components(components) {
109
- this._data.components = components;
110
- }
111
-
112
- getComponent(
113
- options: { name: string; dependencies: string[] | string } | string,
114
- ) {
115
- if (typeof options === 'object') {
116
- const { name, dependencies = '' } = options;
117
- let depsString: string = '';
118
- if (dependencies && isArray(dependencies)) {
119
- depsString = dependencies.join('+');
120
- } else if (typeof dependencies === 'string') {
121
- depsString = dependencies;
122
- }
123
- const componentName = `${name}${depsString ? `|${depsString}` : ''}`;
124
-
125
- return this._data.components[componentName] || {};
126
- } else {
127
- // Shortcut notation, accepting a lonely string as argument
128
- const componentName = options;
129
- return this._data.components[componentName] || {};
130
- }
131
- }
132
-
133
- registerComponent(options: {
134
- name: string;
135
- dependencies: string[] | string;
136
- component: React.ComponentType;
137
- }) {
138
- const { name, component, dependencies = '' } = options;
139
- let depsString: string = '';
140
- if (!component) {
141
- throw new Error('No component provided');
142
- } else {
143
- if (dependencies && isArray(dependencies)) {
144
- depsString = dependencies.join('+');
145
- } else if (typeof dependencies === 'string') {
146
- depsString = dependencies;
147
- }
148
- const componentName = `${name}${depsString ? `|${depsString}` : ''}`;
149
-
150
- this._data.components[componentName] = { component };
151
- // Try to set a displayName (useful for React dev tools) for the registered component
152
- // Only if it's a function and it's not set previously
153
- try {
154
- const displayName =
155
- this._data.components[componentName].component.displayName;
156
-
157
- if (
158
- !displayName &&
159
- typeof this._data.components[componentName].component === 'function'
160
- ) {
161
- this._data.components[componentName].component.displayName = name;
162
- }
163
- } catch (error) {
164
- // eslint-disable-next-line no-console
165
- console.warn(`Not setting the component displayName because ${error}`);
166
- }
167
- }
168
- }
169
- }
170
-
171
- const instance = new Config();
172
- Object.freeze(instance);
173
-
174
- export default instance;
@@ -1,111 +0,0 @@
1
- import config from './index';
2
-
3
- config.set('components', {
4
- Toolbar: { component: 'this is the Toolbar component' },
5
- 'Toolbar.Types': { component: 'this is the Types component' },
6
- 'Teaser|News Item': { component: 'This is the News Item Teaser component' },
7
- });
8
-
9
- describe('registry', () => {
10
- it('get components', () => {
11
- expect(config.getComponent('Toolbar').component).toEqual(
12
- 'this is the Toolbar component',
13
- );
14
- });
15
- it('get components with context', () => {
16
- expect(
17
- config.getComponent({ name: 'Teaser', dependencies: 'News Item' })
18
- .component,
19
- ).toEqual('This is the News Item Teaser component');
20
- });
21
- it('get components with dots (as an object)', () => {
22
- expect(config.getComponent({ name: 'Toolbar.Types' }).component).toEqual(
23
- 'this is the Types component',
24
- );
25
- });
26
- it('get components with | and spaces (as a string)', () => {
27
- expect(config.getComponent('Teaser|News Item').component).toEqual(
28
- 'This is the News Item Teaser component',
29
- );
30
- });
31
- it('resolves unexistent component (as a string)', () => {
32
- expect(config.getComponent('Toolbar.Doh').component).toEqual(undefined);
33
- expect(config.getComponent('Toolbar.Doh')).toEqual({});
34
- });
35
- it('registers and gets a component by name (as string)', () => {
36
- config.registerComponent({
37
- name: 'Toolbar.Bar',
38
- component: 'this is a Bar component',
39
- });
40
- expect(config.getComponent('Toolbar.Bar').component).toEqual(
41
- 'this is a Bar component',
42
- );
43
- });
44
- it('registers and gets a component by name (as an object)', () => {
45
- config.registerComponent({
46
- name: 'Toolbar.Bar',
47
- component: 'this is a Bar component',
48
- });
49
- expect(config.getComponent({ name: 'Toolbar.Bar' }).component).toEqual(
50
- 'this is a Bar component',
51
- );
52
- });
53
- it('registers and gets a component by name (as an object) - check displayName', () => {
54
- config.registerComponent({
55
- name: 'Toolbar.Bar',
56
- component: (props) => <div>Hello</div>,
57
- });
58
- expect(config.getComponent('Toolbar.Bar').component.displayName).toEqual(
59
- 'Toolbar.Bar',
60
- );
61
- });
62
- it('registers and gets a component by name (as an object) - check displayName if it has already one, it does not overwrite it', () => {
63
- const TestComponent = (props) => <div>Hello</div>;
64
- TestComponent.displayName = 'DisplayNameAlreadySet';
65
- config.registerComponent({
66
- name: 'Toolbar.Bar',
67
- component: TestComponent,
68
- });
69
-
70
- expect(config.getComponent('Toolbar.Bar').component.displayName).toEqual(
71
- 'DisplayNameAlreadySet',
72
- );
73
- });
74
- it('registers and gets a component by name (as an object) - check displayName - do not break if it is a normal function', () => {
75
- function myFunction() {
76
- return 'true';
77
- }
78
-
79
- config.registerComponent({
80
- name: 'Toolbar.Bar',
81
- component: myFunction,
82
- });
83
- expect(config.getComponent('Toolbar.Bar').component.displayName).toEqual(
84
- 'Toolbar.Bar',
85
- );
86
- });
87
- it('registers a component by name with dependencies', () => {
88
- config.registerComponent({
89
- name: 'Toolbar.Bar',
90
- component: 'this is a Bar component',
91
- dependencies: 'News Item',
92
- });
93
- expect(
94
- config.getComponent({ name: 'Toolbar.Bar', dependencies: 'News Item' })
95
- .component,
96
- ).toEqual('this is a Bar component');
97
- });
98
- it('registers a component by name with dependencies array', () => {
99
- config.registerComponent({
100
- name: 'Toolbar.Bar',
101
- component: 'this is a Bar component',
102
- dependencies: ['News Item', 'StringFieldWidget'],
103
- });
104
- expect(
105
- config.getComponent({
106
- name: 'Toolbar.Bar',
107
- dependencies: ['News Item', 'StringFieldWidget'],
108
- }).component,
109
- ).toEqual('this is a Bar component');
110
- });
111
- });
@@ -1,32 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ESNext",
4
- "lib": ["DOM", "DOM.Iterable", "ESNext"],
5
- "module": "commonjs",
6
- "allowJs": true,
7
- "skipLibCheck": true,
8
- "esModuleInterop": true,
9
- "allowSyntheticDefaultImports": true,
10
- "strict": true,
11
- "forceConsistentCasingInFileNames": true,
12
- "strictPropertyInitialization": false,
13
- "moduleResolution": "Node",
14
- "resolveJsonModule": true,
15
- "isolatedModules": true,
16
- "noEmit": true,
17
- "jsx": "react-jsx",
18
- "paths": {
19
- "@plone/types/*": ["../types/*"],
20
- }
21
- },
22
- "include": ["src"],
23
- "exclude": [
24
- "node_modules",
25
- "build",
26
- "public",
27
- "coverage",
28
- "src/**/*.test.{js,jsx,ts,tsx}",
29
- "src/**/*.spec.{js,jsx,ts,tsx}",
30
- "src/**/*.stories.{js,jsx,ts,tsx}"
31
- ]
32
- }
@@ -1,173 +0,0 @@
1
- # Volto Scripts Release Notes
2
-
3
- <!-- You should *NOT* be adding new change log entries to this file.
4
- You should create a file in the news directory instead.
5
- For helpful instructions, please see:
6
- https://6.docs.plone.org/volto/developer-guidelines/contributing.html#create-a-pull-request
7
- -->
8
-
9
- <!-- towncrier release notes start -->
10
-
11
- ## 3.0.1 (2023-10-06)
12
-
13
- ### Bugfix
14
-
15
- - Update `git-url-parse` dependency. @davisagli [#5098](https://github.com/plone/volto/issues/5098)
16
- - Fix error ``no such file or directory, open 'addon-testing-project/jsconfig.json'`` in addon clone command. @wesleybl [#5239](https://github.com/plone/volto/issues/5239)
17
-
18
-
19
- ## 3.0.0 (2023-04-07)
20
-
21
- ### Breaking
22
-
23
- - Remove dependency on `simple-git`. It is used by `mrs-developer` but not directly. @davisagli [#4546](https://github.com/plone/volto/issues/4546)
24
-
25
- ### Bugfix
26
-
27
- - Fixed i18n script to avoid overwriting translations with an empty msgstr @danalvrz [#4316](https://github.com/plone/volto/issues/4316)
28
-
29
-
30
- ## 2.3.0 (2023-01-13)
31
-
32
- ### Feature
33
-
34
- - The `consolidate` command includes Cypress folder @sneridagh [#4192](https://github.com/plone/volto/issues/4192)
35
- - Add backport PR helper script @sneridagh [#4222](https://github.com/plone/volto/issues/4222)
36
- - Improve consolidate and local clone copy files @sneridagh [#4253](https://github.com/plone/volto/issues/4253)
37
-
38
-
39
- ## 2.2.2 (2022-12-23)
40
-
41
- ### Internal
42
-
43
- - Adjust npmignores, reissue package @sneridagh [#0](https://github.com/plone/volto/issues/0)
44
-
45
-
46
- ## 2.2.1 (2022-11-24)
47
-
48
- ### Bugfix
49
-
50
- - Include `cypress` folder and `cypress.config.js` in the local clone command @sneridagh
51
- - Fix the local clone command `execSync` @sneridagh
52
-
53
- ## 2.2.0 (2022-11-24)
54
-
55
- ### Feature
56
-
57
- - Match the new layout for the Volto project generator for Cypress tests @sneridagh
58
-
59
- ## 2.1.5 (2022-11-24)
60
-
61
- ### Bugfix
62
-
63
- - Remove `isCanary` amendment to differentiate 15/16 way of calling the test script @sneridagh
64
-
65
- ## 2.1.4 (2022-11-24)
66
-
67
- ### Bugfix
68
-
69
- - Disable immutable installs in local package once created, so CI does not complain. We REALLY want to install something! @sneridagh
70
-
71
- ## 2.1.3 (2022-11-24)
72
-
73
- ### Bugfix
74
-
75
- - Improve `execSync` call in addon script @sneridagh
76
-
77
- ## 2.1.2 (2022-10-26)
78
-
79
- ### Internal
80
-
81
- - Add missing dependency @tiberiuichim
82
-
83
- ## 2.1.1 (2022-09-28)
84
-
85
- ### Bugfix
86
-
87
- - Fix if `canary` selected, the tests should not include `--env=jest-environment-jsdom-sixteen` @sneridagh
88
-
89
- ## 2.1.0 (2022-09-28)
90
-
91
- ### Feature
92
-
93
- - New `clone` to local command @sneridagh
94
- - New `consolidate` command @sneridagh
95
-
96
- ## 2.0.0 (2022-09-27)
97
-
98
- ### Breaking
99
-
100
- - Removed `Razzle` as dependency, leave only the `babel-preset-razzle` one which is enough.
101
-
102
- See https://6.docs.plone.org/volto/upgrade-guide/index.html for more information.
103
-
104
- ## 1.6.0 (2022-08-05)
105
-
106
- ### Feature
107
-
108
- - Add support for recommended structure `frontend` folder using `CHANGELOG.md` in the parent folder. @sneridagh
109
-
110
- ## 1.5.0 (2022-07-28)
111
-
112
- ### Feature
113
-
114
- - Add `--canary` option to use latest alpha in generator @sneridagh
115
-
116
- ## 1.4.1 (2022-02-24)
117
-
118
- ### Bugfix
119
-
120
- - Fix `branch` option not getting into the `getAddonInfo` function @sneridagh
121
-
122
- ## 1.4.0 (2021-12-29)
123
-
124
- ### Feature
125
-
126
- - Add custom `cypress:run` script for starting the right Cypress suite (in addon test environment) @sneridagh
127
-
128
- ## 1.3.0 (2021-12-28)
129
-
130
- ### Feature
131
-
132
- - Add custom `test` script for getting the right `RAZZLE_JEST_CONFIG` (in addon test environment) @sneridagh
133
-
134
- ## 1.2.0 (2021-12-28)
135
-
136
- ### Feature
137
-
138
- - Improved CLI for creating addon testing environments @sneridagh
139
-
140
- ## 1.1.0 (2021-12-24)
141
-
142
- ### Feature
143
-
144
- - Initial version of the CLI for addon testing @sneridagh
145
-
146
- ## 1.0.3 (2021-10-01)
147
-
148
- ### Bugfix
149
-
150
- - Fix defaults not getting in properly in i18n script @sneridagh
151
-
152
- ## 1.0.2 (2021-09-27)
153
-
154
- ### Bugfix
155
-
156
- - Missing default interpreter for `chagelogupdater` script @sneridagh
157
-
158
- ## 1.0.1 (2021-09-27)
159
-
160
- ### Bugfix
161
-
162
- - Missing `pofile` as dependency @sneridagh
163
-
164
- ## 1.0.0 (2021-09-25)
165
-
166
- ### Feature
167
-
168
- - Volto i18n messages extractor and `react-intl` language .json generator script @sneridagh
169
- - Changelog script @sneridagh
170
-
171
- ### Internal
172
-
173
- - Initial release