@plone/volto 18.0.0-alpha.3 → 18.0.0-alpha.5

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 (349) hide show
  1. package/.eslintignore +1 -0
  2. package/.eslintrc +3 -3
  3. package/.prettierignore +8 -0
  4. package/.prettierrc +12 -0
  5. package/{packages/registry/.release-it.json → .release-it.json} +12 -6
  6. package/CHANGELOG.md +50 -4
  7. package/package.json +60 -127
  8. package/razzle.config.js +4 -7
  9. package/src/components/manage/Add/Add.jsx +6 -0
  10. package/src/components/manage/BlockChooser/BlockChooser.jsx +3 -1
  11. package/src/components/manage/BlockChooser/BlockChooserButton.jsx +5 -0
  12. package/src/components/manage/Blocks/Block/BlocksForm.jsx +4 -0
  13. package/src/components/manage/Blocks/Block/DefaultEdit.jsx +3 -1
  14. package/src/components/manage/Blocks/Block/EditBlockWrapper.jsx +5 -0
  15. package/src/components/manage/Blocks/Block/Settings.jsx +10 -1
  16. package/src/components/manage/Blocks/Container/Data.jsx +4 -1
  17. package/src/components/manage/Blocks/HeroImageLeft/Data.jsx +3 -1
  18. package/src/components/manage/Blocks/Image/ImageSidebar.jsx +4 -1
  19. package/src/components/manage/Blocks/Listing/ListingData.jsx +4 -1
  20. package/src/components/manage/Blocks/Maps/MapsSidebar.jsx +3 -1
  21. package/src/components/manage/Blocks/Search/SearchBlockEdit.jsx +4 -0
  22. package/src/components/manage/Blocks/Teaser/Data.jsx +4 -1
  23. package/src/components/manage/Blocks/ToC/Edit.jsx +2 -0
  24. package/src/components/manage/Blocks/Video/VideoSidebar.jsx +3 -1
  25. package/src/components/manage/Controlpanels/Users/UserGroupMembershipControlPanel.jsx +2 -2
  26. package/src/components/manage/Edit/Edit.jsx +1 -0
  27. package/src/components/manage/Form/Form.jsx +14 -3
  28. package/src/components/theme/Image/Image.jsx +4 -2
  29. package/src/components/theme/Image/Image.test.jsx +32 -0
  30. package/src/config/index.js +0 -4
  31. package/src/helpers/Blocks/Blocks.js +11 -2
  32. package/src/helpers/Extensions/withBlockSchemaEnhancer.js +20 -9
  33. package/src/helpers/Url/Url.js +5 -4
  34. package/src/helpers/Url/Url.test.js +52 -0
  35. package/src/icons/divide-horizontal.svg +0 -0
  36. package/src/icons/divide-vertical.svg +0 -0
  37. package/src/icons/hero.svg +0 -0
  38. package/src/icons/slider.svg +0 -0
  39. package/src/icons/summary.svg +0 -0
  40. package/src/middleware/api.js +1 -1
  41. package/theme/themes/default/elements/icon.overrides +0 -0
  42. package/theme/themes/default/globals/reset.overrides +0 -0
  43. package/theme/themes/default/globals/site.variables +0 -0
  44. package/theme/themes/default/modules/dropdown.overrides +0 -0
  45. package/theme/themes/default/modules/dropdown.variables +0 -0
  46. package/theme/themes/default/modules/modal.variables +0 -0
  47. package/theme/themes/default/modules/video.overrides +0 -0
  48. package/theme/themes/default/modules/video.variables +0 -0
  49. package/theme/themes/pastanaga/assets/fonts/icons.eot +0 -0
  50. package/theme/themes/pastanaga/assets/fonts/icons.svg +0 -0
  51. package/theme/themes/pastanaga/assets/fonts/icons.ttf +0 -0
  52. package/theme/themes/pastanaga/assets/fonts/icons.woff +0 -0
  53. package/theme/themes/pastanaga/globals/reset.overrides +0 -0
  54. package/theme/themes/pastanaga/globals/site.variables +0 -0
  55. package/theme/themes/pastanaga/modules/dropdown.variables +0 -0
  56. package/theme/themes/pastanaga/modules/modal.variables +0 -0
  57. package/theme/themes/pastanaga/modules/video.overrides +0 -0
  58. package/theme/themes/pastanaga/modules/video.variables +0 -0
  59. package/tsconfig.json +1 -4
  60. package/types/config/RichTextEditor/index.d.ts +5 -8
  61. package/types/helpers/AsyncConnect/index.d.ts +2 -2
  62. package/types/helpers/Extensions/withBlockSchemaEnhancer.d.ts +3 -1
  63. package/types/helpers/Url/Url.d.ts +3 -3
  64. package/types/icons/load-icons.d.ts +1 -1
  65. package/webpack-plugins/webpack-less-plugin.js +1 -0
  66. package/CODE_OF_CONDUCT.md +0 -13
  67. package/CONTRIBUTING.md +0 -7
  68. package/README.md +0 -154
  69. package/RELEASING.md +0 -73
  70. package/ROADMAP.md +0 -30
  71. package/SECURITY.md +0 -14
  72. package/apps/plone/node_modules/.bin/acorn +0 -17
  73. package/apps/plone/node_modules/.bin/addon +0 -17
  74. package/apps/plone/node_modules/.bin/autoprefixer +0 -17
  75. package/apps/plone/node_modules/.bin/browserslist +0 -17
  76. package/apps/plone/node_modules/.bin/build-storybook +0 -17
  77. package/apps/plone/node_modules/.bin/changelogupdater +0 -17
  78. package/apps/plone/node_modules/.bin/eslint +0 -17
  79. package/apps/plone/node_modules/.bin/eslint-config-prettier +0 -17
  80. package/apps/plone/node_modules/.bin/i18n +0 -17
  81. package/apps/plone/node_modules/.bin/jest +0 -17
  82. package/apps/plone/node_modules/.bin/lessc +0 -17
  83. package/apps/plone/node_modules/.bin/missdev +0 -17
  84. package/apps/plone/node_modules/.bin/prettier +0 -17
  85. package/apps/plone/node_modules/.bin/razzle +0 -17
  86. package/apps/plone/node_modules/.bin/server-test +0 -17
  87. package/apps/plone/node_modules/.bin/start-server-and-test +0 -17
  88. package/apps/plone/node_modules/.bin/start-storybook +0 -17
  89. package/apps/plone/node_modules/.bin/start-test +0 -17
  90. package/apps/plone/node_modules/.bin/storybook-server +0 -17
  91. package/apps/plone/node_modules/.bin/stylelint +0 -17
  92. package/apps/plone/node_modules/.bin/tlds +0 -17
  93. package/apps/plone/node_modules/.bin/ts-jest +0 -17
  94. package/apps/plone/node_modules/.bin/tsc +0 -17
  95. package/apps/plone/node_modules/.bin/tsserver +0 -17
  96. package/apps/plone/node_modules/.bin/uuid +0 -17
  97. package/apps/plone/node_modules/.bin/webpack +0 -17
  98. package/apps/plone/node_modules/.bin/webpack-dev-server +0 -17
  99. package/apps/plone/src/addons/volto-volto-project/node_modules/.bin/acorn +0 -17
  100. package/apps/plone/src/addons/volto-volto-project/node_modules/.bin/addon +0 -17
  101. package/apps/plone/src/addons/volto-volto-project/node_modules/.bin/browserslist +0 -17
  102. package/apps/plone/src/addons/volto-volto-project/node_modules/.bin/changelogupdater +0 -17
  103. package/apps/plone/src/addons/volto-volto-project/node_modules/.bin/eslint +0 -17
  104. package/apps/plone/src/addons/volto-volto-project/node_modules/.bin/eslint-config-prettier +0 -17
  105. package/apps/plone/src/addons/volto-volto-project/node_modules/.bin/i18n +0 -17
  106. package/apps/plone/src/addons/volto-volto-project/node_modules/.bin/prettier +0 -17
  107. package/apps/plone/src/addons/volto-volto-project/node_modules/.bin/release-it +0 -17
  108. package/apps/plone/src/addons/volto-volto-project/node_modules/.bin/stylelint +0 -17
  109. package/apps/plone/src/addons/volto-volto-project/node_modules/.bin/tsc +0 -17
  110. package/apps/plone/src/addons/volto-volto-project/node_modules/.bin/tsserver +0 -17
  111. package/logos/Logo.png +0 -0
  112. package/logos/VoltoLogoEra2-dark-mode.png +0 -0
  113. package/logos/VoltoLogoEra2.png +0 -0
  114. package/logos/volto-colorful.png +0 -0
  115. package/logos/volto-colorful.svg +0 -35
  116. package/logos/volto-guide.png +0 -0
  117. package/logos/volto-h-transparent.svg +0 -6
  118. package/logos/volto-transparent.png +0 -0
  119. package/logos/volto-transparent.svg +0 -19
  120. package/logos/volto-transparent2.svg +0 -5
  121. package/logos/volto-yellow.svg +0 -29
  122. package/logos/volto.sketch +0 -0
  123. package/packages/README.md +0 -7
  124. package/packages/registry/.towncrier/towncrier_template.jinja +0 -10
  125. package/packages/registry/CHANGELOG.md +0 -16
  126. package/packages/registry/README.md +0 -207
  127. package/packages/registry/addon-registry.js +0 -603
  128. package/packages/registry/create-addons-loader.js +0 -116
  129. package/packages/registry/create-theme-addons-loader.js +0 -78
  130. package/packages/registry/news/.gitkeep +0 -0
  131. package/packages/registry/node_modules/.bin/browserslist +0 -17
  132. package/packages/registry/node_modules/.bin/parcel +0 -17
  133. package/packages/registry/node_modules/.bin/release-it +0 -17
  134. package/packages/registry/node_modules/.bin/tsc +0 -17
  135. package/packages/registry/node_modules/.bin/tsserver +0 -17
  136. package/packages/registry/node_modules/.bin/vitest +0 -17
  137. package/packages/registry/package.json +0 -76
  138. package/packages/registry/src/index.ts +0 -174
  139. package/packages/registry/src/registry.test.js +0 -111
  140. package/packages/registry/tsconfig.json +0 -32
  141. package/packages/scripts/CHANGELOG.md +0 -173
  142. package/packages/scripts/README.md +0 -128
  143. package/packages/scripts/addon/consolidate.js +0 -28
  144. package/packages/scripts/addon/generators.js +0 -213
  145. package/packages/scripts/addon/getAddonInfo.js +0 -65
  146. package/packages/scripts/addon/index.js +0 -88
  147. package/packages/scripts/addon/utils.js +0 -44
  148. package/packages/scripts/backportpr.js +0 -75
  149. package/packages/scripts/changelogupdater.cjs +0 -94
  150. package/packages/scripts/corepackagebump.js +0 -20
  151. package/packages/scripts/i18n.cjs +0 -310
  152. package/packages/scripts/package.json +0 -76
  153. package/packages/scripts/templates/towncrier_template.jinja +0 -10
  154. package/packages/types/Blocks/View.ts +0 -11
  155. package/packages/types/actions.ts +0 -15
  156. package/packages/types/breadcrumbs.ts +0 -10
  157. package/packages/types/config/Blocks.ts +0 -153
  158. package/packages/types/config/Content.ts +0 -62
  159. package/packages/types/config/Settings.ts +0 -86
  160. package/packages/types/config/Views.ts +0 -15
  161. package/packages/types/config/Widgets.ts +0 -7
  162. package/packages/types/config/index.ts +0 -21
  163. package/packages/types/content/common.ts +0 -60
  164. package/packages/types/content/get.ts +0 -66
  165. package/packages/types/index.ts +0 -0
  166. package/packages/types/navigation.ts +0 -12
  167. package/packages/types/node_modules/.bin/browserslist +0 -17
  168. package/packages/types/node_modules/.bin/parcel +0 -17
  169. package/packages/types/node_modules/.bin/release-it +0 -17
  170. package/packages/types/node_modules/.bin/tsc +0 -17
  171. package/packages/types/node_modules/.bin/tsserver +0 -17
  172. package/packages/types/package.json +0 -64
  173. package/packages/types/types.ts +0 -61
  174. package/packages/volto-slate/.i18n.babel.config.js +0 -1
  175. package/packages/volto-slate/README.md +0 -4
  176. package/packages/volto-slate/build/messages/src/blocks/Table/TableBlockEdit.json +0 -90
  177. package/packages/volto-slate/build/messages/src/blocks/Text/DefaultTextBlockEditor.json +0 -6
  178. package/packages/volto-slate/build/messages/src/blocks/Text/DetachedTextBlockEditor.json +0 -6
  179. package/packages/volto-slate/build/messages/src/blocks/Text/SlashMenu.json +0 -6
  180. package/packages/volto-slate/build/messages/src/editor/plugins/AdvancedLink/index.json +0 -10
  181. package/packages/volto-slate/build/messages/src/editor/plugins/Link/index.json +0 -10
  182. package/packages/volto-slate/build/messages/src/editor/plugins/Table/index.json +0 -30
  183. package/packages/volto-slate/build/messages/src/elementEditor/messages.json +0 -10
  184. package/packages/volto-slate/build/messages/src/widgets/HtmlSlateWidget.json +0 -6
  185. package/packages/volto-slate/build/messages/src/widgets/RichTextWidgetView.json +0 -6
  186. package/packages/volto-slate/locales/de/LC_MESSAGES/volto.po +0 -148
  187. package/packages/volto-slate/locales/en/LC_MESSAGES/volto.po +0 -148
  188. package/packages/volto-slate/locales/volto.pot +0 -182
  189. package/packages/volto-slate/package.json +0 -43
  190. package/packages/volto-slate/src/actions/content.js +0 -30
  191. package/packages/volto-slate/src/actions/index.js +0 -3
  192. package/packages/volto-slate/src/actions/plugins.js +0 -9
  193. package/packages/volto-slate/src/actions/selection.js +0 -22
  194. package/packages/volto-slate/src/blocks/Table/Cell.jsx +0 -87
  195. package/packages/volto-slate/src/blocks/Table/Cell.test.js +0 -54
  196. package/packages/volto-slate/src/blocks/Table/TableBlockEdit.jsx +0 -694
  197. package/packages/volto-slate/src/blocks/Table/TableBlockEdit.test.js +0 -40
  198. package/packages/volto-slate/src/blocks/Table/TableBlockView.jsx +0 -150
  199. package/packages/volto-slate/src/blocks/Table/TableBlockView.test.js +0 -49
  200. package/packages/volto-slate/src/blocks/Table/deconstruct.js +0 -113
  201. package/packages/volto-slate/src/blocks/Table/extensions/normalizeTable.js +0 -5
  202. package/packages/volto-slate/src/blocks/Table/index.js +0 -60
  203. package/packages/volto-slate/src/blocks/Table/schema.js +0 -122
  204. package/packages/volto-slate/src/blocks/Text/DefaultTextBlockEditor.jsx +0 -304
  205. package/packages/volto-slate/src/blocks/Text/DetachedTextBlockEditor.jsx +0 -77
  206. package/packages/volto-slate/src/blocks/Text/MarkdownIntroduction.jsx +0 -59
  207. package/packages/volto-slate/src/blocks/Text/PluginSidebar.jsx +0 -18
  208. package/packages/volto-slate/src/blocks/Text/ShortcutListing.jsx +0 -28
  209. package/packages/volto-slate/src/blocks/Text/SlashMenu.jsx +0 -203
  210. package/packages/volto-slate/src/blocks/Text/TextBlockEdit.jsx +0 -38
  211. package/packages/volto-slate/src/blocks/Text/TextBlockEdit.test.js +0 -107
  212. package/packages/volto-slate/src/blocks/Text/TextBlockSchema.js +0 -54
  213. package/packages/volto-slate/src/blocks/Text/TextBlockView.jsx +0 -31
  214. package/packages/volto-slate/src/blocks/Text/css/editor.css +0 -18
  215. package/packages/volto-slate/src/blocks/Text/extensions/Readme.md +0 -49
  216. package/packages/volto-slate/src/blocks/Text/extensions/breakList.js +0 -100
  217. package/packages/volto-slate/src/blocks/Text/extensions/index.js +0 -6
  218. package/packages/volto-slate/src/blocks/Text/extensions/insertBreak.js +0 -57
  219. package/packages/volto-slate/src/blocks/Text/extensions/isSelected.js +0 -7
  220. package/packages/volto-slate/src/blocks/Text/extensions/normalizeExternalData.js +0 -7
  221. package/packages/volto-slate/src/blocks/Text/extensions/withDeserializers.js +0 -87
  222. package/packages/volto-slate/src/blocks/Text/extensions/withLists.js +0 -5
  223. package/packages/volto-slate/src/blocks/Text/index.js +0 -171
  224. package/packages/volto-slate/src/blocks/Text/keyboard/backspaceInList.js +0 -58
  225. package/packages/volto-slate/src/blocks/Text/keyboard/breakBlocks.js +0 -3
  226. package/packages/volto-slate/src/blocks/Text/keyboard/cancelEsc.js +0 -7
  227. package/packages/volto-slate/src/blocks/Text/keyboard/indentListItems.js +0 -240
  228. package/packages/volto-slate/src/blocks/Text/keyboard/index.js +0 -52
  229. package/packages/volto-slate/src/blocks/Text/keyboard/joinBlocks.js +0 -180
  230. package/packages/volto-slate/src/blocks/Text/keyboard/moveListItems.js +0 -124
  231. package/packages/volto-slate/src/blocks/Text/keyboard/slashMenu.js +0 -19
  232. package/packages/volto-slate/src/blocks/Text/keyboard/softBreak.js +0 -7
  233. package/packages/volto-slate/src/blocks/Text/keyboard/traverseBlocks.js +0 -81
  234. package/packages/volto-slate/src/blocks/Text/keyboard/unwrapEmptyString.js +0 -26
  235. package/packages/volto-slate/src/blocks/Text/schema.js +0 -39
  236. package/packages/volto-slate/src/constants.js +0 -123
  237. package/packages/volto-slate/src/editor/EditorContext.jsx +0 -5
  238. package/packages/volto-slate/src/editor/EditorReference.jsx +0 -22
  239. package/packages/volto-slate/src/editor/SlateEditor.jsx +0 -375
  240. package/packages/volto-slate/src/editor/config.jsx +0 -344
  241. package/packages/volto-slate/src/editor/decorate.js +0 -68
  242. package/packages/volto-slate/src/editor/deserialize.js +0 -185
  243. package/packages/volto-slate/src/editor/extensions/index.js +0 -6
  244. package/packages/volto-slate/src/editor/extensions/insertBreak.js +0 -15
  245. package/packages/volto-slate/src/editor/extensions/insertData.js +0 -159
  246. package/packages/volto-slate/src/editor/extensions/isInline.js +0 -14
  247. package/packages/volto-slate/src/editor/extensions/normalizeExternalData.js +0 -8
  248. package/packages/volto-slate/src/editor/extensions/normalizeNode.js +0 -48
  249. package/packages/volto-slate/src/editor/extensions/withDeserializers.js +0 -15
  250. package/packages/volto-slate/src/editor/extensions/withTestingFeatures.jsx +0 -84
  251. package/packages/volto-slate/src/editor/index.js +0 -14
  252. package/packages/volto-slate/src/editor/less/editor.less +0 -173
  253. package/packages/volto-slate/src/editor/less/globals.less +0 -18
  254. package/packages/volto-slate/src/editor/less/slate.less +0 -28
  255. package/packages/volto-slate/src/editor/plugins/AdvancedLink/deserialize.js +0 -90
  256. package/packages/volto-slate/src/editor/plugins/AdvancedLink/extensions.js +0 -32
  257. package/packages/volto-slate/src/editor/plugins/AdvancedLink/index.js +0 -50
  258. package/packages/volto-slate/src/editor/plugins/AdvancedLink/render.jsx +0 -37
  259. package/packages/volto-slate/src/editor/plugins/AdvancedLink/schema.js +0 -114
  260. package/packages/volto-slate/src/editor/plugins/AdvancedLink/styles.less +0 -8
  261. package/packages/volto-slate/src/editor/plugins/Blockquote/index.js +0 -30
  262. package/packages/volto-slate/src/editor/plugins/Callout/index.js +0 -34
  263. package/packages/volto-slate/src/editor/plugins/Image/deconstruct.js +0 -30
  264. package/packages/volto-slate/src/editor/plugins/Image/extensions.js +0 -51
  265. package/packages/volto-slate/src/editor/plugins/Image/index.js +0 -11
  266. package/packages/volto-slate/src/editor/plugins/Image/render.jsx +0 -22
  267. package/packages/volto-slate/src/editor/plugins/Link/extensions.js +0 -58
  268. package/packages/volto-slate/src/editor/plugins/Link/index.js +0 -164
  269. package/packages/volto-slate/src/editor/plugins/Link/render.jsx +0 -54
  270. package/packages/volto-slate/src/editor/plugins/Markdown/constants.js +0 -81
  271. package/packages/volto-slate/src/editor/plugins/Markdown/extensions.js +0 -334
  272. package/packages/volto-slate/src/editor/plugins/Markdown/index.js +0 -28
  273. package/packages/volto-slate/src/editor/plugins/Markdown/utils.js +0 -198
  274. package/packages/volto-slate/src/editor/plugins/StyleMenu/StyleMenu.jsx +0 -153
  275. package/packages/volto-slate/src/editor/plugins/StyleMenu/index.js +0 -19
  276. package/packages/volto-slate/src/editor/plugins/StyleMenu/style.less +0 -29
  277. package/packages/volto-slate/src/editor/plugins/StyleMenu/utils.js +0 -168
  278. package/packages/volto-slate/src/editor/plugins/Table/TableButton.jsx +0 -142
  279. package/packages/volto-slate/src/editor/plugins/Table/TableCell.jsx +0 -44
  280. package/packages/volto-slate/src/editor/plugins/Table/TableContainer.jsx +0 -37
  281. package/packages/volto-slate/src/editor/plugins/Table/TableSizePicker.jsx +0 -83
  282. package/packages/volto-slate/src/editor/plugins/Table/extensions.js +0 -87
  283. package/packages/volto-slate/src/editor/plugins/Table/index.js +0 -390
  284. package/packages/volto-slate/src/editor/plugins/Table/less/public.less +0 -29
  285. package/packages/volto-slate/src/editor/plugins/Table/less/table.less +0 -28
  286. package/packages/volto-slate/src/editor/plugins/Table/render.jsx +0 -30
  287. package/packages/volto-slate/src/editor/plugins/index.js +0 -19
  288. package/packages/volto-slate/src/editor/render.jsx +0 -224
  289. package/packages/volto-slate/src/editor/ui/BasicToolbar.jsx +0 -11
  290. package/packages/volto-slate/src/editor/ui/BlockButton.jsx +0 -31
  291. package/packages/volto-slate/src/editor/ui/ClearFormattingButton.jsx +0 -21
  292. package/packages/volto-slate/src/editor/ui/ExpandedToolbar.jsx +0 -18
  293. package/packages/volto-slate/src/editor/ui/Expando.jsx +0 -5
  294. package/packages/volto-slate/src/editor/ui/InlineToolbar.jsx +0 -73
  295. package/packages/volto-slate/src/editor/ui/MarkButton.jsx +0 -23
  296. package/packages/volto-slate/src/editor/ui/MarkElementButton.jsx +0 -30
  297. package/packages/volto-slate/src/editor/ui/Menu.jsx +0 -13
  298. package/packages/volto-slate/src/editor/ui/PositionedToolbar.jsx +0 -32
  299. package/packages/volto-slate/src/editor/ui/Separator.jsx +0 -7
  300. package/packages/volto-slate/src/editor/ui/SlateContextToolbar.jsx +0 -13
  301. package/packages/volto-slate/src/editor/ui/SlateToolbar.jsx +0 -96
  302. package/packages/volto-slate/src/editor/ui/Toolbar.jsx +0 -103
  303. package/packages/volto-slate/src/editor/ui/ToolbarButton.jsx +0 -33
  304. package/packages/volto-slate/src/editor/ui/ToolbarButton.test.js +0 -25
  305. package/packages/volto-slate/src/editor/ui/index.js +0 -15
  306. package/packages/volto-slate/src/editor/utils.js +0 -248
  307. package/packages/volto-slate/src/elementEditor/ContextButtons.jsx +0 -56
  308. package/packages/volto-slate/src/elementEditor/PluginEditor.jsx +0 -124
  309. package/packages/volto-slate/src/elementEditor/Readme.md +0 -6
  310. package/packages/volto-slate/src/elementEditor/SchemaProvider.jsx +0 -3
  311. package/packages/volto-slate/src/elementEditor/SidebarEditor.jsx +0 -46
  312. package/packages/volto-slate/src/elementEditor/ToolbarButton.jsx +0 -44
  313. package/packages/volto-slate/src/elementEditor/index.js +0 -5
  314. package/packages/volto-slate/src/elementEditor/makeInlineElementPlugin.js +0 -100
  315. package/packages/volto-slate/src/elementEditor/messages.js +0 -14
  316. package/packages/volto-slate/src/elementEditor/utils.js +0 -226
  317. package/packages/volto-slate/src/hooks/index.js +0 -3
  318. package/packages/volto-slate/src/hooks/useEditorContext.js +0 -6
  319. package/packages/volto-slate/src/hooks/useIsomorphicLayoutEffect.js +0 -7
  320. package/packages/volto-slate/src/hooks/useSelectionPosition.js +0 -25
  321. package/packages/volto-slate/src/i18n.js +0 -180
  322. package/packages/volto-slate/src/icons/hashlink.svg +0 -57
  323. package/packages/volto-slate/src/index.js +0 -61
  324. package/packages/volto-slate/src/reducers/content.js +0 -74
  325. package/packages/volto-slate/src/reducers/index.js +0 -3
  326. package/packages/volto-slate/src/reducers/plugins.js +0 -17
  327. package/packages/volto-slate/src/reducers/selection.js +0 -16
  328. package/packages/volto-slate/src/utils/blocks.js +0 -375
  329. package/packages/volto-slate/src/utils/blocks.test.js +0 -138
  330. package/packages/volto-slate/src/utils/editor.js +0 -31
  331. package/packages/volto-slate/src/utils/image.js +0 -25
  332. package/packages/volto-slate/src/utils/index.js +0 -11
  333. package/packages/volto-slate/src/utils/internals.js +0 -46
  334. package/packages/volto-slate/src/utils/lists.js +0 -92
  335. package/packages/volto-slate/src/utils/marks.js +0 -104
  336. package/packages/volto-slate/src/utils/mime-types.js +0 -24
  337. package/packages/volto-slate/src/utils/nodes.js +0 -4
  338. package/packages/volto-slate/src/utils/ops.js +0 -20
  339. package/packages/volto-slate/src/utils/random.js +0 -17
  340. package/packages/volto-slate/src/utils/selection.js +0 -236
  341. package/packages/volto-slate/src/utils/slate-string-utils.js +0 -408
  342. package/packages/volto-slate/src/utils/volto-blocks.js +0 -314
  343. package/packages/volto-slate/src/widgets/ErrorBoundary.jsx +0 -27
  344. package/packages/volto-slate/src/widgets/HtmlSlateWidget.jsx +0 -139
  345. package/packages/volto-slate/src/widgets/ObjectByTypeWidget.jsx +0 -49
  346. package/packages/volto-slate/src/widgets/RichTextWidget.jsx +0 -72
  347. package/packages/volto-slate/src/widgets/RichTextWidgetView.jsx +0 -37
  348. package/packages/volto-slate/src/widgets/style.css +0 -21
  349. package/types/components/manage/Blocks/Video/Body.test.d.ts +0 -1
@@ -1,153 +0,0 @@
1
- import React from 'react';
2
- import { useSlate } from 'slate-react';
3
- import { Dropdown } from 'semantic-ui-react';
4
- import { useIntl, defineMessages } from 'react-intl';
5
- import cx from 'classnames';
6
- import { omit } from 'lodash';
7
- import { isBlockStyleActive, isInlineStyleActive, toggleStyle } from './utils';
8
- import config from '@plone/volto/registry';
9
- import { ToolbarButton } from '@plone/volto-slate/editor/ui';
10
- import paintSVG from '@plone/volto/icons/paint.svg';
11
-
12
- const messages = defineMessages({
13
- inlineStyle: {
14
- id: 'Inline Style',
15
- defaultMessage: 'Inline Style',
16
- },
17
- paragraphStyle: {
18
- id: 'Paragraph Style',
19
- defaultMessage: 'Paragraph Style',
20
- },
21
- additionalStyles: {
22
- id: 'Additional Styles',
23
- defaultMessage: 'Additional Styles',
24
- },
25
- });
26
-
27
- const StyleMenuButton = ({ icon, active, ...props }) => (
28
- <ToolbarButton {...props} icon={icon} active={active} />
29
- );
30
-
31
- const MenuOpts = ({ editor, toSelect, option, type }) => {
32
- const isActive = toSelect.includes(option);
33
- return (
34
- <Dropdown.Item
35
- as="span"
36
- active={isActive}
37
- className={cx(`${type}-${option.value}`, { active: isActive })}
38
- {...omit(option, ['isBlock'])}
39
- data-isblock={option.isBlock}
40
- onClick={(event, selItem) => {
41
- toggleStyle(editor, {
42
- cssClass: selItem.value,
43
- isBlock: selItem.isBlock,
44
- });
45
- }}
46
- />
47
- );
48
- };
49
-
50
- const StylingsButton = (props) => {
51
- const editor = useSlate();
52
- const intl = useIntl();
53
-
54
- // Converting the settings to a format that is required by dropdowns.
55
- const inlineOpts = [
56
- ...config.settings.slate.styleMenu.inlineStyles.map((def) => {
57
- return {
58
- value: def.cssClass,
59
- text: def.label,
60
- icon: def.icon,
61
- isBlock: false,
62
- };
63
- }),
64
- ];
65
- const blockOpts = [
66
- ...config.settings.slate.styleMenu.blockStyles.map((def) => {
67
- return {
68
- value: def.cssClass,
69
- text: def.label,
70
- icon: def.icon,
71
- isBlock: true,
72
- };
73
- }),
74
- ];
75
-
76
- // Calculating the initial selection.
77
- const toSelect = [];
78
- // block styles
79
- for (const val of blockOpts) {
80
- const ia = isBlockStyleActive(editor, val.value);
81
- if (ia) {
82
- toSelect.push(val);
83
- }
84
- }
85
- // inline styles
86
- for (const val of inlineOpts) {
87
- const ia = isInlineStyleActive(editor, val.value);
88
- if (ia) {
89
- toSelect.push(val);
90
- }
91
- }
92
-
93
- const menuItemProps = {
94
- toSelect,
95
- editor,
96
- };
97
- const showMenu = inlineOpts.length || blockOpts.length;
98
- return showMenu ? (
99
- <Dropdown
100
- id="style-menu"
101
- pointing="top left"
102
- multiple
103
- value={toSelect}
104
- disabled={config.settings.slate.styleMenu.disabled ?? false}
105
- additionLabel={intl.formatMessage(messages.additionalStyles)}
106
- trigger={
107
- <StyleMenuButton
108
- title={intl.formatMessage(messages.additionalStyles)}
109
- icon={paintSVG}
110
- active={toSelect.length > 0}
111
- />
112
- }
113
- >
114
- <Dropdown.Menu>
115
- {inlineOpts.length && (
116
- <>
117
- <Dropdown.Header
118
- content={intl.formatMessage(messages.inlineStyle)}
119
- />
120
- {inlineOpts.map((option, index) => (
121
- <MenuOpts
122
- {...menuItemProps}
123
- type="inline-style"
124
- option={option}
125
- key={index}
126
- />
127
- ))}
128
- </>
129
- )}
130
-
131
- {blockOpts.length && (
132
- <>
133
- <Dropdown.Header
134
- content={intl.formatMessage(messages.paragraphStyle)}
135
- />
136
- {blockOpts.map((option, index) => (
137
- <MenuOpts
138
- {...menuItemProps}
139
- type="block-style"
140
- option={option}
141
- key={index}
142
- />
143
- ))}
144
- </>
145
- )}
146
- </Dropdown.Menu>
147
- </Dropdown>
148
- ) : (
149
- ''
150
- );
151
- };
152
-
153
- export default StylingsButton;
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import StyleMenu from './StyleMenu';
3
- import './style.less';
4
-
5
- export default function install(config) {
6
- const { slate } = config.settings;
7
-
8
- slate.buttons.styleMenu = (props) => <StyleMenu {...props} title="Styles" />;
9
-
10
- slate.toolbarButtons.push('styleMenu');
11
- slate.expandedToolbarButtons.push('styleMenu');
12
-
13
- slate.styleMenu = {
14
- inlineStyles: [],
15
- blockStyles: [],
16
- };
17
-
18
- return config;
19
- }
@@ -1,29 +0,0 @@
1
- #style-menu.ui.dropdown .menu {
2
- .item {
3
- display: flex;
4
- user-select: none;
5
-
6
- span.text {
7
- margin-top: auto;
8
- line-height: normal;
9
- vertical-align: middle;
10
- }
11
- }
12
-
13
- .header {
14
- color: rgb(153, 153, 153);
15
- font-size: 1rem;
16
- font-weight: normal;
17
- }
18
-
19
- .active {
20
- z-index: 1;
21
- background: #68778d;
22
- box-shadow: none;
23
- color: #ffffff;
24
- font-weight: 300;
25
- }
26
-
27
- overflow: auto;
28
- max-height: 50vh;
29
- }
@@ -1,168 +0,0 @@
1
- /* eslint no-console: ["error", { allow: ["warn", "error"] }] */
2
- import { Editor, Transforms } from 'slate';
3
- import { isBlockActive } from '@plone/volto-slate/utils';
4
- import config from '@plone/volto/registry';
5
-
6
- /**
7
- * Toggles a style (e.g. in the StyleMenu plugin).
8
- * @param {Editor} editor
9
- * @param {object} options
10
- * @param {boolean} options.isRequested Whether the given style is requested by
11
- * the user. The style is only applied if it is requested and only removed if it
12
- * is not requested.
13
- */
14
- export const toggleStyle = (editor, { cssClass, isBlock, isRequested }) => {
15
- if (isBlock) {
16
- toggleBlockStyle(editor, cssClass);
17
- } else {
18
- toggleInlineStyle(editor, cssClass);
19
- }
20
- };
21
-
22
- export const toggleBlockStyle = (editor, style) => {
23
- // We have 6 boolean variables which need to be accounted for.
24
- // See https://docs.google.com/spreadsheets/d/1mVeMuqSTMABV2BhoHPrPAFjn7zUksbNgZ9AQK_dcd3U/edit?usp=sharing
25
- const { slate } = config.settings;
26
-
27
- const isListItem = isBlockActive(editor, slate.listItemType);
28
- const isActive = isBlockStyleActive(editor, style);
29
- const wantsList = false;
30
-
31
- if (isListItem && !wantsList) {
32
- toggleBlockStyleAsListItem(editor, style);
33
- } else if (isListItem && wantsList && !isActive) {
34
- // switchListType(editor, format); // this will deconstruct to Volto blocks
35
- } else if (!isListItem && wantsList) {
36
- // changeBlockToList(editor, format);
37
- } else if (!isListItem && !wantsList) {
38
- internalToggleBlockStyle(editor, style);
39
- } else {
40
- console.warn('toggleBlockStyle case not covered, please examine:', {
41
- wantsList,
42
- isActive,
43
- isListItem,
44
- });
45
- }
46
- };
47
-
48
- export const toggleInlineStyle = (editor, style) => {
49
- // We have 6 boolean variables which need to be accounted for.
50
- // See https://docs.google.com/spreadsheets/d/1mVeMuqSTMABV2BhoHPrPAFjn7zUksbNgZ9AQK_dcd3U/edit?usp=sharing
51
- const { slate } = config.settings;
52
-
53
- const isListItem = isBlockActive(editor, slate.listItemType);
54
- const isActive = isInlineStyleActive(editor, style);
55
- const wantsList = false;
56
-
57
- if (isListItem && !wantsList) {
58
- toggleInlineStyleAsListItem(editor, style);
59
- } else if (isListItem && wantsList && !isActive) {
60
- // switchListType(editor, format); // this will deconstruct to Volto blocks
61
- } else if (!isListItem && wantsList) {
62
- // changeBlockToList(editor, format);
63
- } else if (!isListItem && !wantsList) {
64
- internalToggleInlineStyle(editor, style);
65
- } else {
66
- console.warn('toggleInlineStyle case not covered, please examine:', {
67
- wantsList,
68
- isActive,
69
- isListItem,
70
- });
71
- }
72
- };
73
-
74
- export const isBlockStyleActive = (editor, style) => {
75
- const keyName = `style-${style}`;
76
- const sn = Array.from(
77
- Editor.nodes(editor, {
78
- match: (n) => {
79
- const isStyle = typeof n.styleName === 'string' || n[keyName];
80
- return !Editor.isEditor(n) && isStyle;
81
- },
82
- mode: 'all',
83
- }),
84
- );
85
-
86
- for (const [n] of sn) {
87
- if (typeof n.styleName === 'string') {
88
- if (n.styleName.split(' ').filter((x) => x === style).length > 0) {
89
- return true;
90
- }
91
- } else if (
92
- n[keyName] &&
93
- keyName.split('-').filter((x) => x === style).length > 0
94
- )
95
- return true;
96
- }
97
- return false;
98
- };
99
-
100
- export const isInlineStyleActive = (editor, style) => {
101
- const m = Editor.marks(editor);
102
- const keyName = `style-${style}`;
103
- if (m && m[keyName]) {
104
- return true;
105
- }
106
- return false;
107
- };
108
-
109
- export const internalToggleBlockStyle = (editor, style) => {
110
- toggleBlockStyleInSelection(editor, style);
111
- };
112
-
113
- export const internalToggleInlineStyle = (editor, style) => {
114
- toggleInlineStyleInSelection(editor, style);
115
- };
116
-
117
- /*
118
- * Applies a block format unto a list item. Will split the list and deconstruct the
119
- * block
120
- */
121
- export const toggleBlockStyleAsListItem = (editor, style) => {
122
- toggleBlockStyleInSelection(editor, style);
123
- };
124
-
125
- /*
126
- * Applies an inline style unto a list item.
127
- */
128
- export const toggleInlineStyleAsListItem = (editor, style) => {
129
- toggleInlineStyleInSelection(editor, style);
130
- };
131
-
132
- function toggleInlineStyleInSelection(editor, style) {
133
- const m = Editor.marks(editor);
134
- const keyName = 'style-' + style;
135
-
136
- if (m && m[keyName]) {
137
- Editor.removeMark(editor, keyName);
138
- } else {
139
- Editor.addMark(editor, keyName, true);
140
- }
141
- }
142
-
143
- function toggleBlockStyleInSelection(editor, style) {
144
- const sn = Array.from(
145
- Editor.nodes(editor, {
146
- mode: 'highest',
147
- match: (n) => {
148
- return !Editor.isEditor(n);
149
- },
150
- }),
151
- );
152
-
153
- for (const [n, p] of sn) {
154
- let cn = n.styleName;
155
- if (typeof n.styleName !== 'string') {
156
- cn = style;
157
- } else if (n.styleName.split(' ').filter((x) => x === style).length > 0) {
158
- cn = cn
159
- .split(' ')
160
- .filter((x) => x !== style)
161
- .join(' ');
162
- } else {
163
- // the style is not set but other styles are set
164
- cn = cn.split(' ').concat(style).join(' ');
165
- }
166
- Transforms.setNodes(editor, { styleName: cn }, { at: p });
167
- }
168
- }
@@ -1,142 +0,0 @@
1
- import React from 'react';
2
- import { useSlate } from 'slate-react';
3
- import { Dropdown } from 'semantic-ui-react';
4
- import { ToolbarButton } from '@plone/volto-slate/editor/ui';
5
-
6
- import tableSVG from '@plone/volto/icons/table.svg';
7
- import TableContainer from './TableContainer';
8
- import './less/table.less';
9
- import { Editor, Transforms } from 'slate';
10
-
11
- const TableButton = ({ ...props }) => {
12
- const editor = useSlate();
13
-
14
- const [dropdownOpen, setDropdownOpen] = React.useState(false);
15
-
16
- const [activeRow, setActiveRow] = React.useState(1);
17
- const [activeColumn, setActiveColumn] = React.useState(1);
18
-
19
- const defaultRowCount = 5;
20
- const defaultColumnCount = 5;
21
-
22
- const [rowCount, setRowCount] = React.useState(defaultRowCount);
23
- const [columnCount, setColumnCount] = React.useState(defaultColumnCount);
24
-
25
- const resetState = React.useCallback(() => {
26
- setRowCount(defaultRowCount);
27
- setColumnCount(defaultColumnCount);
28
- setActiveRow(1);
29
- setActiveColumn(1);
30
- }, []);
31
-
32
- const createEmptyCell = React.useCallback((formatAsColumnHeaders = false) => {
33
- return {
34
- type: formatAsColumnHeaders ? 'th' : 'td',
35
- children: [{ type: 'p', children: [{ text: '' }] }],
36
- };
37
- }, []);
38
-
39
- const createEmptyRow = React.useCallback(
40
- (cellCount, formatAsColumnHeaders = false) => {
41
- // should contain at least one <td> or it is not valid that children is empty
42
- const row = { type: 'tr', children: [] };
43
-
44
- for (let i = 0; i < cellCount; ++i) {
45
- row.children.push(createEmptyCell(formatAsColumnHeaders));
46
- }
47
-
48
- return row;
49
- },
50
- [createEmptyCell],
51
- );
52
-
53
- /**
54
- * @param {number} row Number of rows for the new empty table.
55
- * @param {number} column Number of columns for the new empty table.
56
- */
57
- const insertEmptyTable = React.useCallback(
58
- ({ row, column }) => {
59
- const rows = [createEmptyRow(column, true)];
60
- for (let i = 0; i < row - 1; ++i) {
61
- rows.push(createEmptyRow(column));
62
- }
63
-
64
- const table = {
65
- type: 'table',
66
- children: [
67
- {
68
- type: 'tbody',
69
- children: rows,
70
- },
71
- ],
72
- };
73
-
74
- Transforms.insertNodes(editor, [table], {
75
- at: Editor.end(editor, []),
76
- });
77
- },
78
- [createEmptyRow, editor],
79
- );
80
-
81
- return (
82
- <>
83
- <Dropdown
84
- open={dropdownOpen}
85
- onClose={() => {
86
- resetState();
87
- setDropdownOpen(false);
88
- }}
89
- trigger={
90
- <ToolbarButton
91
- {...props}
92
- className="slate-table-dropdown-button"
93
- onClick={() => {
94
- if (dropdownOpen) {
95
- resetState();
96
- }
97
-
98
- setDropdownOpen(!dropdownOpen);
99
- }}
100
- icon={tableSVG}
101
- ></ToolbarButton>
102
- }
103
- >
104
- <Dropdown.Menu className="slate-table-dropdown-menu">
105
- <TableContainer
106
- rowCount={rowCount}
107
- columnCount={columnCount}
108
- activeColumn={activeColumn}
109
- activeRow={activeRow}
110
- onCellMouseEnter={({ row, column }) => {
111
- if (row > rowCount - 1) {
112
- setRowCount(row + 1);
113
- } else if (row < rowCount - 1) {
114
- setRowCount(defaultRowCount);
115
- }
116
-
117
- if (column > columnCount - 1) {
118
- setColumnCount(column + 1);
119
- } else if (column < columnCount - 1) {
120
- setColumnCount(defaultColumnCount);
121
- }
122
-
123
- if (row !== activeRow) {
124
- setActiveRow(row);
125
- }
126
- if (column !== activeColumn) {
127
- setActiveColumn(column);
128
- }
129
- }}
130
- onCellMouseLeave={({ row, column }) => {}}
131
- // `row` and `column` below are 1-based indices
132
- onCellClick={({ row, column }) => {
133
- insertEmptyTable({ row, column });
134
- }}
135
- />
136
- </Dropdown.Menu>
137
- </Dropdown>
138
- </>
139
- );
140
- };
141
-
142
- export default TableButton;
@@ -1,44 +0,0 @@
1
- import React from 'react';
2
- import cx from 'classnames';
3
-
4
- export const TableCell = ({
5
- active,
6
- row,
7
- column,
8
- onClick,
9
- onMouseEnter,
10
- onMouseLeave,
11
- }) => {
12
- const handleClick = React.useCallback(
13
- (ev) => {
14
- onClick({ row, column });
15
- },
16
- [column, onClick, row],
17
- );
18
-
19
- const handleMouseEnter = React.useCallback(
20
- (ev) => {
21
- onMouseEnter({ row, column });
22
- },
23
- [column, onMouseEnter, row],
24
- );
25
-
26
- const handleMouseLeave = React.useCallback(
27
- (ev) => {
28
- onMouseLeave({ row, column });
29
- },
30
- [column, onMouseLeave, row],
31
- );
32
-
33
- return (
34
- <td
35
- onMouseEnter={handleMouseEnter}
36
- onMouseLeave={handleMouseLeave}
37
- className={cx({ active })}
38
- >
39
- <button onClick={handleClick}></button>
40
- </td>
41
- );
42
- };
43
-
44
- export default TableCell;
@@ -1,37 +0,0 @@
1
- import React from 'react';
2
- import TableSizePicker from './TableSizePicker';
3
-
4
- export const TableContainer = ({
5
- rowCount,
6
- columnCount,
7
- activeRow,
8
- activeColumn,
9
- onCellClick,
10
- onCellMouseEnter,
11
- onCellMouseLeave,
12
- }) => {
13
- return (
14
- <div style={{ padding: '1rem' }}>
15
- <TableSizePicker
16
- activeRow={activeRow}
17
- activeColumn={activeColumn}
18
- rowCount={rowCount}
19
- columnCount={columnCount}
20
- onCellClick={onCellClick}
21
- onCellMouseEnter={({ row, column }) => {
22
- onCellMouseEnter({ row, column });
23
- }}
24
- onCellMouseLeave={onCellMouseLeave}
25
- />
26
- <p
27
- style={{
28
- textAlign: 'center',
29
- }}
30
- >
31
- {activeColumn || 1} &times; {activeRow || 1}
32
- </p>
33
- </div>
34
- );
35
- };
36
-
37
- export default TableContainer;
@@ -1,83 +0,0 @@
1
- import React from 'react';
2
- import TableCell from './TableCell';
3
-
4
- export const TableSizePicker = ({
5
- rowCount,
6
- columnCount,
7
- activeRow,
8
- activeColumn,
9
- onCellClick,
10
- onCellMouseEnter,
11
- onCellMouseLeave,
12
- }) => {
13
- const handleClick = React.useCallback(
14
- (...rest) => {
15
- onCellClick(...rest);
16
- },
17
- [onCellClick],
18
- );
19
-
20
- const handleMouseEnter = React.useCallback(
21
- (...rest) => {
22
- onCellMouseEnter(...rest);
23
- },
24
- [onCellMouseEnter],
25
- );
26
-
27
- const handleMouseLeave = React.useCallback(
28
- (...rest) => {
29
- onCellMouseLeave(...rest);
30
- },
31
- [onCellMouseLeave],
32
- );
33
-
34
- const createRow = React.useCallback(
35
- (rowIndex) => {
36
- const arr = [];
37
- for (let i = 0; i < columnCount; ++i) {
38
- const columnIndex = i + 1;
39
-
40
- arr.push(
41
- <TableCell
42
- key={columnIndex}
43
- row={rowIndex + 1}
44
- column={columnIndex}
45
- active={rowIndex + 1 <= activeRow && i + 1 <= activeColumn}
46
- onClick={handleClick}
47
- onMouseEnter={handleMouseEnter}
48
- onMouseLeave={handleMouseLeave}
49
- ></TableCell>,
50
- );
51
- }
52
- return <tr key={rowIndex}>{arr}</tr>;
53
- },
54
- [
55
- activeColumn,
56
- activeRow,
57
- columnCount,
58
- handleClick,
59
- handleMouseEnter,
60
- handleMouseLeave,
61
- ],
62
- );
63
-
64
- const rows = [];
65
- for (let i = 0; i < rowCount; ++i) {
66
- rows.push(createRow(i));
67
- }
68
-
69
- const zoomFactor = 1;
70
-
71
- return (
72
- <table
73
- style={{
74
- width: `${columnCount * zoomFactor}rem`,
75
- height: `${rowCount * zoomFactor}rem`,
76
- }}
77
- >
78
- <tbody>{rows}</tbody>
79
- </table>
80
- );
81
- };
82
-
83
- export default TableSizePicker;