@makeswift/runtime 0.8.10 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (552) hide show
  1. package/dist/Box.cjs.js +6 -4
  2. package/dist/Box.cjs.js.map +1 -1
  3. package/dist/Box.es.js +6 -4
  4. package/dist/Box.es.js.map +1 -1
  5. package/dist/Button.cjs.js +6 -4
  6. package/dist/Button.cjs.js.map +1 -1
  7. package/dist/Button.es.js +6 -4
  8. package/dist/Button.es.js.map +1 -1
  9. package/dist/Carousel.cjs.js +9 -7
  10. package/dist/Carousel.cjs.js.map +1 -1
  11. package/dist/Carousel.es.js +9 -7
  12. package/dist/Carousel.es.js.map +1 -1
  13. package/dist/Countdown.cjs.js +6 -4
  14. package/dist/Countdown.cjs.js.map +1 -1
  15. package/dist/Countdown.es.js +6 -4
  16. package/dist/Countdown.es.js.map +1 -1
  17. package/dist/Divider.cjs.js +6 -4
  18. package/dist/Divider.cjs.js.map +1 -1
  19. package/dist/Divider.es.js +6 -4
  20. package/dist/Divider.es.js.map +1 -1
  21. package/dist/Embed.cjs.js +6 -4
  22. package/dist/Embed.cjs.js.map +1 -1
  23. package/dist/Embed.es.js +6 -4
  24. package/dist/Embed.es.js.map +1 -1
  25. package/dist/Form.cjs.js +6 -4
  26. package/dist/Form.cjs.js.map +1 -1
  27. package/dist/Form.es.js +6 -4
  28. package/dist/Form.es.js.map +1 -1
  29. package/dist/Image.cjs.js +6 -4
  30. package/dist/Image.cjs.js.map +1 -1
  31. package/dist/Image.es.js +6 -4
  32. package/dist/Image.es.js.map +1 -1
  33. package/dist/LiveProvider.cjs.js +8 -6
  34. package/dist/LiveProvider.cjs.js.map +1 -1
  35. package/dist/LiveProvider.es.js +7 -5
  36. package/dist/LiveProvider.es.js.map +1 -1
  37. package/dist/Navigation.cjs.js +6 -4
  38. package/dist/Navigation.cjs.js.map +1 -1
  39. package/dist/Navigation.es.js +6 -4
  40. package/dist/Navigation.es.js.map +1 -1
  41. package/dist/PreviewProvider.cjs.js +51 -34
  42. package/dist/PreviewProvider.cjs.js.map +1 -1
  43. package/dist/PreviewProvider.es.js +23 -6
  44. package/dist/PreviewProvider.es.js.map +1 -1
  45. package/dist/ReadOnlyText.cjs.js +72 -67
  46. package/dist/ReadOnlyText.cjs.js.map +1 -1
  47. package/dist/ReadOnlyText.es.js +18 -13
  48. package/dist/ReadOnlyText.es.js.map +1 -1
  49. package/dist/ReadOnlyTextV2.cjs.js +136 -91
  50. package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
  51. package/dist/ReadOnlyTextV2.es.js +82 -37
  52. package/dist/ReadOnlyTextV2.es.js.map +1 -1
  53. package/dist/Root.cjs.js +6 -4
  54. package/dist/Root.cjs.js.map +1 -1
  55. package/dist/Root.es.js +6 -4
  56. package/dist/Root.es.js.map +1 -1
  57. package/dist/SocialLinks.cjs.js +6 -4
  58. package/dist/SocialLinks.cjs.js.map +1 -1
  59. package/dist/SocialLinks.es.js +6 -4
  60. package/dist/SocialLinks.es.js.map +1 -1
  61. package/dist/Text.cjs.js +7 -5
  62. package/dist/Text.cjs.js.map +1 -1
  63. package/dist/Text.es.js +7 -5
  64. package/dist/Text.es.js.map +1 -1
  65. package/dist/Video.cjs.js +6 -4
  66. package/dist/Video.cjs.js.map +1 -1
  67. package/dist/Video.es.js +6 -4
  68. package/dist/Video.es.js.map +1 -1
  69. package/dist/actions.cjs.js +16 -1
  70. package/dist/actions.cjs.js.map +1 -1
  71. package/dist/actions.es.js +14 -2
  72. package/dist/actions.es.js.map +1 -1
  73. package/dist/builder.cjs.js +7 -2
  74. package/dist/builder.cjs.js.map +1 -1
  75. package/dist/builder.es.js +7 -2
  76. package/dist/builder.es.js.map +1 -1
  77. package/dist/components.cjs.js +8 -6
  78. package/dist/components.cjs.js.map +1 -1
  79. package/dist/components.es.js +8 -6
  80. package/dist/components.es.js.map +1 -1
  81. package/dist/constants.cjs.js +0 -408
  82. package/dist/constants.cjs.js.map +1 -1
  83. package/dist/constants.es.js +1 -372
  84. package/dist/constants.es.js.map +1 -1
  85. package/dist/control-serialization.cjs.js +84 -41
  86. package/dist/control-serialization.cjs.js.map +1 -1
  87. package/dist/control-serialization.es.js +44 -1
  88. package/dist/control-serialization.es.js.map +1 -1
  89. package/dist/controls.cjs.js +58 -50
  90. package/dist/controls.cjs.js.map +1 -1
  91. package/dist/controls.es.js +8 -3
  92. package/dist/controls.es.js.map +1 -1
  93. package/dist/index.cjs.js +534 -495
  94. package/dist/index.cjs.js.map +1 -1
  95. package/dist/index.cjs10.js +372 -0
  96. package/dist/index.cjs10.js.map +1 -0
  97. package/dist/index.cjs2.js +10 -8
  98. package/dist/index.cjs2.js.map +1 -1
  99. package/dist/index.cjs5.js +2 -480
  100. package/dist/index.cjs5.js.map +1 -1
  101. package/dist/index.cjs6.js +6 -7
  102. package/dist/index.cjs6.js.map +1 -1
  103. package/dist/index.cjs7.js +17 -39
  104. package/dist/index.cjs7.js.map +1 -1
  105. package/dist/index.cjs8.js +14 -180
  106. package/dist/index.cjs8.js.map +1 -1
  107. package/dist/index.cjs9.js +191 -265
  108. package/dist/index.cjs9.js.map +1 -1
  109. package/dist/index.es.js +299 -260
  110. package/dist/index.es.js.map +1 -1
  111. package/dist/index.es10.js +365 -0
  112. package/dist/index.es10.js.map +1 -0
  113. package/dist/index.es2.js +5 -3
  114. package/dist/index.es2.js.map +1 -1
  115. package/dist/index.es5.js +3 -471
  116. package/dist/index.es5.js.map +1 -1
  117. package/dist/index.es6.js +4 -5
  118. package/dist/index.es6.js.map +1 -1
  119. package/dist/index.es7.js +17 -37
  120. package/dist/index.es7.js.map +1 -1
  121. package/dist/index.es8.js +13 -175
  122. package/dist/index.es8.js.map +1 -1
  123. package/dist/index.es9.js +188 -262
  124. package/dist/index.es9.js.map +1 -1
  125. package/dist/leaf.cjs.js +4 -4
  126. package/dist/leaf.cjs.js.map +1 -1
  127. package/dist/leaf.es.js +1 -1
  128. package/dist/leaf.es.js.map +1 -1
  129. package/dist/main.cjs.js +8 -4
  130. package/dist/main.cjs.js.map +1 -1
  131. package/dist/main.es.js +6 -5
  132. package/dist/main.es.js.map +1 -1
  133. package/dist/next.cjs.js +6 -4
  134. package/dist/next.cjs.js.map +1 -1
  135. package/dist/next.es.js +6 -4
  136. package/dist/next.es.js.map +1 -1
  137. package/dist/prop-controllers.cjs.js +11 -7
  138. package/dist/prop-controllers.cjs.js.map +1 -1
  139. package/dist/prop-controllers.es.js +7 -3
  140. package/dist/prop-controllers.es.js.map +1 -1
  141. package/dist/{descriptors.cjs.js → react-page.cjs.js} +1559 -102
  142. package/dist/react-page.cjs.js.map +1 -0
  143. package/dist/{descriptors.es.js → react-page.es.js} +1469 -80
  144. package/dist/react-page.es.js.map +1 -0
  145. package/dist/react.cjs.js +6 -4
  146. package/dist/react.cjs.js.map +1 -1
  147. package/dist/react.es.js +6 -4
  148. package/dist/react.es.js.map +1 -1
  149. package/dist/slate.cjs.js +17 -11
  150. package/dist/slate.cjs.js.map +1 -1
  151. package/dist/slate.es.js +7 -5
  152. package/dist/slate.es.js.map +1 -1
  153. package/dist/state/breakpoints.cjs.js.map +1 -1
  154. package/dist/state/breakpoints.es.js.map +1 -1
  155. package/dist/text-input.cjs.js +0 -6
  156. package/dist/text-input.cjs.js.map +1 -1
  157. package/dist/text-input.es.js +1 -5
  158. package/dist/text-input.es.js.map +1 -1
  159. package/dist/types/src/api/graphql/documents/queries.d.ts.map +1 -1
  160. package/dist/types/src/api/graphql/generated/types.d.ts +36 -44
  161. package/dist/types/src/api/graphql/generated/types.d.ts.map +1 -1
  162. package/dist/types/src/api/graphql/types.d.ts +2 -2
  163. package/dist/types/src/api/graphql/types.d.ts.map +1 -1
  164. package/dist/types/src/api/react.d.ts +3 -3
  165. package/dist/types/src/api/react.d.ts.map +1 -1
  166. package/dist/types/src/builder/serialization/control-serialization.d.ts +66 -66
  167. package/dist/types/src/builder/serialization/control-serialization.d.ts.map +1 -1
  168. package/dist/types/src/builder/serialization/controls/rich-text-v2.d.ts +5 -0
  169. package/dist/types/src/builder/serialization/controls/rich-text-v2.d.ts.map +1 -0
  170. package/dist/types/src/builder/serialization/controls/types.d.ts +3 -3
  171. package/dist/types/src/builder/serialization/controls/types.d.ts.map +1 -1
  172. package/dist/types/src/builder/serialization/function-serialization.d.ts +4 -4
  173. package/dist/types/src/builder/serialization/function-serialization.d.ts.map +1 -1
  174. package/dist/types/src/components/builtin/Box/animations.d.ts +1 -1
  175. package/dist/types/src/components/builtin/Box/animations.d.ts.map +1 -1
  176. package/dist/types/src/components/builtin/Box/components/Placeholder/index.d.ts +1 -1
  177. package/dist/types/src/components/builtin/Box/components/Placeholder/index.d.ts.map +1 -1
  178. package/dist/types/src/components/builtin/Box/constants.d.ts +1 -1
  179. package/dist/types/src/components/builtin/Box/constants.d.ts.map +1 -1
  180. package/dist/types/src/components/builtin/Button/Button.d.ts +3 -3
  181. package/dist/types/src/components/builtin/Button/Button.d.ts.map +1 -1
  182. package/dist/types/src/components/builtin/Button/contants.d.ts +1 -1
  183. package/dist/types/src/components/builtin/Button/contants.d.ts.map +1 -1
  184. package/dist/types/src/components/builtin/Carousel/Carousel.d.ts +1 -1
  185. package/dist/types/src/components/builtin/Carousel/Carousel.d.ts.map +1 -1
  186. package/dist/types/src/components/builtin/Carousel/register.d.ts.map +1 -1
  187. package/dist/types/src/components/builtin/Countdown/Countdown.d.ts +1 -1
  188. package/dist/types/src/components/builtin/Countdown/Countdown.d.ts.map +1 -1
  189. package/dist/types/src/components/builtin/Countdown/register.d.ts.map +1 -1
  190. package/dist/types/src/components/builtin/Divider/Divider.d.ts +2 -2
  191. package/dist/types/src/components/builtin/Divider/Divider.d.ts.map +1 -1
  192. package/dist/types/src/components/builtin/Divider/register.d.ts.map +1 -1
  193. package/dist/types/src/components/builtin/Embed/Embed.d.ts +1 -1
  194. package/dist/types/src/components/builtin/Embed/Embed.d.ts.map +1 -1
  195. package/dist/types/src/components/builtin/Embed/register.d.ts.map +1 -1
  196. package/dist/types/src/components/builtin/Form/Form.d.ts +2 -2
  197. package/dist/types/src/components/builtin/Form/Form.d.ts.map +1 -1
  198. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +2 -2
  199. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts.map +1 -1
  200. package/dist/types/src/components/builtin/Form/components/Field/components/CheckboxTableField/index.d.ts +1 -1
  201. package/dist/types/src/components/builtin/Form/components/Field/components/CheckboxTableField/index.d.ts.map +1 -1
  202. package/dist/types/src/components/builtin/Form/components/Field/components/EmailTableField/index.d.ts +1 -1
  203. package/dist/types/src/components/builtin/Form/components/Field/components/EmailTableField/index.d.ts.map +1 -1
  204. package/dist/types/src/components/builtin/Form/components/Field/components/Input/index.d.ts +1 -1
  205. package/dist/types/src/components/builtin/Form/components/Field/components/Input/index.d.ts.map +1 -1
  206. package/dist/types/src/components/builtin/Form/components/Field/components/Label/index.d.ts +2 -2
  207. package/dist/types/src/components/builtin/Form/components/Field/components/Label/index.d.ts.map +1 -1
  208. package/dist/types/src/components/builtin/Form/components/Field/components/LongTextTableField/index.d.ts +1 -1
  209. package/dist/types/src/components/builtin/Form/components/Field/components/LongTextTableField/index.d.ts.map +1 -1
  210. package/dist/types/src/components/builtin/Form/components/Field/components/MultipleSelectTableField/index.d.ts +1 -1
  211. package/dist/types/src/components/builtin/Form/components/Field/components/MultipleSelectTableField/index.d.ts.map +1 -1
  212. package/dist/types/src/components/builtin/Form/components/Field/components/NumberTableField/index.d.ts +1 -1
  213. package/dist/types/src/components/builtin/Form/components/Field/components/NumberTableField/index.d.ts.map +1 -1
  214. package/dist/types/src/components/builtin/Form/components/Field/components/PhoneNumberTableField/index.d.ts +1 -1
  215. package/dist/types/src/components/builtin/Form/components/Field/components/PhoneNumberTableField/index.d.ts.map +1 -1
  216. package/dist/types/src/components/builtin/Form/components/Field/components/RadioButton/index.d.ts +1 -1
  217. package/dist/types/src/components/builtin/Form/components/Field/components/RadioButton/index.d.ts.map +1 -1
  218. package/dist/types/src/components/builtin/Form/components/Field/components/SingleLineTextTableField/index.d.ts +1 -1
  219. package/dist/types/src/components/builtin/Form/components/Field/components/SingleLineTextTableField/index.d.ts.map +1 -1
  220. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnRadioButtonGroup/index.d.ts +1 -1
  221. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnRadioButtonGroup/index.d.ts.map +1 -1
  222. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnSingleSelect/index.d.ts +1 -1
  223. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnSingleSelect/index.d.ts.map +1 -1
  224. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/index.d.ts +1 -1
  225. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/index.d.ts.map +1 -1
  226. package/dist/types/src/components/builtin/Form/components/Field/components/TextArea/index.d.ts +1 -1
  227. package/dist/types/src/components/builtin/Form/components/Field/components/TextArea/index.d.ts.map +1 -1
  228. package/dist/types/src/components/builtin/Form/components/Field/components/URLTableField/index.d.ts +1 -1
  229. package/dist/types/src/components/builtin/Form/components/Field/components/URLTableField/index.d.ts.map +1 -1
  230. package/dist/types/src/components/builtin/Form/components/Field/index.d.ts +2 -2
  231. package/dist/types/src/components/builtin/Form/components/Field/index.d.ts.map +1 -1
  232. package/dist/types/src/components/builtin/Form/components/Placeholder/index.d.ts +1 -1
  233. package/dist/types/src/components/builtin/Form/components/Placeholder/index.d.ts.map +1 -1
  234. package/dist/types/src/components/builtin/Form/context/FormContext.d.ts +5 -5
  235. package/dist/types/src/components/builtin/Form/context/FormContext.d.ts.map +1 -1
  236. package/dist/types/src/components/builtin/Form/register.d.ts.map +1 -1
  237. package/dist/types/src/components/builtin/Form/types.d.ts +13 -13
  238. package/dist/types/src/components/builtin/Form/types.d.ts.map +1 -1
  239. package/dist/types/src/components/builtin/Image/Image.d.ts +1 -1
  240. package/dist/types/src/components/builtin/Image/Image.d.ts.map +1 -1
  241. package/dist/types/src/components/builtin/Navigation/Navigation.d.ts +1 -1
  242. package/dist/types/src/components/builtin/Navigation/Navigation.d.ts.map +1 -1
  243. package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts +3 -3
  244. package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts.map +1 -1
  245. package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts +1 -1
  246. package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts.map +1 -1
  247. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts +3 -3
  248. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts.map +1 -1
  249. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts +1 -1
  250. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts.map +1 -1
  251. package/dist/types/src/components/builtin/Navigation/register.d.ts.map +1 -1
  252. package/dist/types/src/components/builtin/Root/Root.d.ts +1 -1
  253. package/dist/types/src/components/builtin/Root/Root.d.ts.map +1 -1
  254. package/dist/types/src/components/builtin/SocialLinks/SocialLinks.d.ts +1 -1
  255. package/dist/types/src/components/builtin/SocialLinks/SocialLinks.d.ts.map +1 -1
  256. package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts +1 -1
  257. package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts.map +1 -1
  258. package/dist/types/src/components/builtin/SocialLinks/register.d.ts.map +1 -1
  259. package/dist/types/src/components/builtin/Text/EditableText/editable-text.d.ts +1 -1
  260. package/dist/types/src/components/builtin/Text/EditableText/editable-text.d.ts.map +1 -1
  261. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts +3 -3
  262. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +1 -1
  263. package/dist/types/src/components/builtin/Text/Text.d.ts +1 -1
  264. package/dist/types/src/components/builtin/Text/Text.d.ts.map +1 -1
  265. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts +2 -2
  266. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts.map +1 -1
  267. package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts +1 -1
  268. package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts.map +1 -1
  269. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts +5 -5
  270. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +1 -1
  271. package/dist/types/src/components/builtin/Video/Video.d.ts +1 -1
  272. package/dist/types/src/components/builtin/Video/Video.d.ts.map +1 -1
  273. package/dist/types/src/components/builtin/Video/register.d.ts.map +1 -1
  274. package/dist/types/src/components/hooks/useBackgrounds.d.ts +8 -8
  275. package/dist/types/src/components/hooks/useBackgrounds.d.ts.map +1 -1
  276. package/dist/types/src/components/hooks/useBorder.d.ts +3 -3
  277. package/dist/types/src/components/hooks/useBorder.d.ts.map +1 -1
  278. package/dist/types/src/components/hooks/useBoxShadow.d.ts +3 -3
  279. package/dist/types/src/components/hooks/useBoxShadow.d.ts.map +1 -1
  280. package/dist/types/src/components/page/BodySnippet.d.ts +1 -1
  281. package/dist/types/src/components/page/BodySnippet.d.ts.map +1 -1
  282. package/dist/types/src/components/page/Page.d.ts +1 -1
  283. package/dist/types/src/components/page/Page.d.ts.map +1 -1
  284. package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts +1 -1
  285. package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts.map +1 -1
  286. package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts +1 -1
  287. package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts.map +1 -1
  288. package/dist/types/src/components/shared/BackgroundsContainer/components/Parallax/index.d.ts +1 -1
  289. package/dist/types/src/components/shared/BackgroundsContainer/components/Parallax/index.d.ts.map +1 -1
  290. package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts +1 -1
  291. package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts.map +1 -1
  292. package/dist/types/src/components/shared/FallbackComponent/FallbackComponent.d.ts +1 -1
  293. package/dist/types/src/components/shared/FallbackComponent/FallbackComponent.d.ts.map +1 -1
  294. package/dist/types/src/components/shared/GutterContainer/index.d.ts +2 -2
  295. package/dist/types/src/components/shared/GutterContainer/index.d.ts.map +1 -1
  296. package/dist/types/src/components/shared/Link/index.d.ts +1 -1
  297. package/dist/types/src/components/shared/Link/index.d.ts.map +1 -1
  298. package/dist/types/src/components/shared/grid-item.d.ts +2 -2
  299. package/dist/types/src/components/shared/grid-item.d.ts.map +1 -1
  300. package/dist/types/src/components/utils/drop-first.d.ts +1 -1
  301. package/dist/types/src/components/utils/drop-first.d.ts.map +1 -1
  302. package/dist/types/src/components/utils/types.d.ts +2 -2
  303. package/dist/types/src/components/utils/types.d.ts.map +1 -1
  304. package/dist/types/src/controls/checkbox.d.ts +3 -3
  305. package/dist/types/src/controls/checkbox.d.ts.map +1 -1
  306. package/dist/types/src/controls/color.d.ts +3 -3
  307. package/dist/types/src/controls/color.d.ts.map +1 -1
  308. package/dist/types/src/controls/combobox.d.ts +5 -5
  309. package/dist/types/src/controls/combobox.d.ts.map +1 -1
  310. package/dist/types/src/controls/control.d.ts +6 -4
  311. package/dist/types/src/controls/control.d.ts.map +1 -1
  312. package/dist/types/src/controls/image.d.ts +4 -4
  313. package/dist/types/src/controls/image.d.ts.map +1 -1
  314. package/dist/types/src/controls/link.d.ts +8 -8
  315. package/dist/types/src/controls/link.d.ts.map +1 -1
  316. package/dist/types/src/controls/list.d.ts +6 -6
  317. package/dist/types/src/controls/list.d.ts.map +1 -1
  318. package/dist/types/src/controls/number.d.ts +3 -3
  319. package/dist/types/src/controls/number.d.ts.map +1 -1
  320. package/dist/types/src/controls/rich-text/dto-types.d.ts +4 -4
  321. package/dist/types/src/controls/rich-text/dto-types.d.ts.map +1 -1
  322. package/dist/types/src/controls/rich-text/rich-text.d.ts +11 -11
  323. package/dist/types/src/controls/rich-text/rich-text.d.ts.map +1 -1
  324. package/dist/types/src/controls/rich-text/translation.d.ts +1 -1
  325. package/dist/types/src/controls/rich-text/translation.d.ts.map +1 -1
  326. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +39 -18
  327. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  328. package/dist/types/src/controls/select.d.ts +5 -5
  329. package/dist/types/src/controls/select.d.ts.map +1 -1
  330. package/dist/types/src/controls/shape.d.ts +5 -5
  331. package/dist/types/src/controls/shape.d.ts.map +1 -1
  332. package/dist/types/src/controls/slot.d.ts +17 -8
  333. package/dist/types/src/controls/slot.d.ts.map +1 -1
  334. package/dist/types/src/controls/style.d.ts +18 -18
  335. package/dist/types/src/controls/style.d.ts.map +1 -1
  336. package/dist/types/src/controls/text-area.d.ts +3 -3
  337. package/dist/types/src/controls/text-area.d.ts.map +1 -1
  338. package/dist/types/src/controls/text-input.d.ts +3 -3
  339. package/dist/types/src/controls/text-input.d.ts.map +1 -1
  340. package/dist/types/src/controls/types.d.ts +5 -5
  341. package/dist/types/src/controls/types.d.ts.map +1 -1
  342. package/dist/types/src/css/border-radius.d.ts +2 -2
  343. package/dist/types/src/css/border-radius.d.ts.map +1 -1
  344. package/dist/types/src/css/border.d.ts +2 -2
  345. package/dist/types/src/css/border.d.ts.map +1 -1
  346. package/dist/types/src/css/length-percentage.d.ts +2 -2
  347. package/dist/types/src/css/length-percentage.d.ts.map +1 -1
  348. package/dist/types/src/css/length.d.ts +1 -1
  349. package/dist/types/src/css/length.d.ts.map +1 -1
  350. package/dist/types/src/css/margin.d.ts +2 -2
  351. package/dist/types/src/css/margin.d.ts.map +1 -1
  352. package/dist/types/src/css/padding.d.ts +2 -2
  353. package/dist/types/src/css/padding.d.ts.map +1 -1
  354. package/dist/types/src/index.d.ts +2 -1
  355. package/dist/types/src/index.d.ts.map +1 -1
  356. package/dist/types/src/next/api-handler/handlers/element-tree.d.ts +3 -3
  357. package/dist/types/src/next/api-handler/handlers/element-tree.d.ts.map +1 -1
  358. package/dist/types/src/next/api-handler/handlers/fonts.d.ts +5 -5
  359. package/dist/types/src/next/api-handler/handlers/fonts.d.ts.map +1 -1
  360. package/dist/types/src/next/api-handler/handlers/manifest.d.ts +6 -4
  361. package/dist/types/src/next/api-handler/handlers/manifest.d.ts.map +1 -1
  362. package/dist/types/src/next/api-handler/handlers/proxy-preview-mode.d.ts +2 -2
  363. package/dist/types/src/next/api-handler/handlers/proxy-preview-mode.d.ts.map +1 -1
  364. package/dist/types/src/next/api-handler/handlers/revalidate.d.ts +3 -3
  365. package/dist/types/src/next/api-handler/handlers/revalidate.d.ts.map +1 -1
  366. package/dist/types/src/next/api-handler/index.d.ts +5 -4
  367. package/dist/types/src/next/api-handler/index.d.ts.map +1 -1
  368. package/dist/types/src/next/client.d.ts +15 -15
  369. package/dist/types/src/next/client.d.ts.map +1 -1
  370. package/dist/types/src/next/dynamic.d.ts +4 -4
  371. package/dist/types/src/next/dynamic.d.ts.map +1 -1
  372. package/dist/types/src/next/index.d.ts +10 -7
  373. package/dist/types/src/next/index.d.ts.map +1 -1
  374. package/dist/types/src/next/preview-mode.d.ts +18 -4
  375. package/dist/types/src/next/preview-mode.d.ts.map +1 -1
  376. package/dist/types/src/prop-controllers/descriptors.d.ts +179 -179
  377. package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
  378. package/dist/types/src/prop-controllers/instances.d.ts +17 -17
  379. package/dist/types/src/prop-controllers/instances.d.ts.map +1 -1
  380. package/dist/types/src/runtimes/react/components/LiveProvider.d.ts +1 -1
  381. package/dist/types/src/runtimes/react/components/LiveProvider.d.ts.map +1 -1
  382. package/dist/types/src/runtimes/react/components/PreviewProvider.d.ts +1 -1
  383. package/dist/types/src/runtimes/react/components/PreviewProvider.d.ts.map +1 -1
  384. package/dist/types/src/runtimes/react/components/render-hook.d.ts +1 -1
  385. package/dist/types/src/runtimes/react/components/render-hook.d.ts.map +1 -1
  386. package/dist/types/src/runtimes/react/controls/checkbox.d.ts +1 -1
  387. package/dist/types/src/runtimes/react/controls/checkbox.d.ts.map +1 -1
  388. package/dist/types/src/runtimes/react/controls/color.d.ts +1 -1
  389. package/dist/types/src/runtimes/react/controls/color.d.ts.map +1 -1
  390. package/dist/types/src/runtimes/react/controls/combobox.d.ts +1 -1
  391. package/dist/types/src/runtimes/react/controls/combobox.d.ts.map +1 -1
  392. package/dist/types/src/runtimes/react/controls/control.d.ts +2 -2
  393. package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
  394. package/dist/types/src/runtimes/react/controls/image.d.ts +3 -3
  395. package/dist/types/src/runtimes/react/controls/image.d.ts.map +1 -1
  396. package/dist/types/src/runtimes/react/controls/link.d.ts +2 -2
  397. package/dist/types/src/runtimes/react/controls/link.d.ts.map +1 -1
  398. package/dist/types/src/runtimes/react/controls/list.d.ts +3 -3
  399. package/dist/types/src/runtimes/react/controls/list.d.ts.map +1 -1
  400. package/dist/types/src/runtimes/react/controls/number.d.ts +1 -1
  401. package/dist/types/src/runtimes/react/controls/number.d.ts.map +1 -1
  402. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts +3 -3
  403. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -1
  404. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts +7 -4
  405. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -1
  406. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts +2 -2
  407. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  408. package/dist/types/src/runtimes/react/controls/rich-text.d.ts +2 -2
  409. package/dist/types/src/runtimes/react/controls/rich-text.d.ts.map +1 -1
  410. package/dist/types/src/runtimes/react/controls/select.d.ts +1 -1
  411. package/dist/types/src/runtimes/react/controls/select.d.ts.map +1 -1
  412. package/dist/types/src/runtimes/react/controls/shape.d.ts +2 -2
  413. package/dist/types/src/runtimes/react/controls/shape.d.ts.map +1 -1
  414. package/dist/types/src/runtimes/react/controls/slot.d.ts +4 -4
  415. package/dist/types/src/runtimes/react/controls/slot.d.ts.map +1 -1
  416. package/dist/types/src/runtimes/react/controls/style.d.ts +1 -1
  417. package/dist/types/src/runtimes/react/controls/style.d.ts.map +1 -1
  418. package/dist/types/src/runtimes/react/controls/text-area.d.ts +1 -1
  419. package/dist/types/src/runtimes/react/controls/text-area.d.ts.map +1 -1
  420. package/dist/types/src/runtimes/react/controls/text-input.d.ts +1 -1
  421. package/dist/types/src/runtimes/react/controls/text-input.d.ts.map +1 -1
  422. package/dist/types/src/runtimes/react/controls.d.ts +8 -8
  423. package/dist/types/src/runtimes/react/controls.d.ts.map +1 -1
  424. package/dist/types/src/runtimes/react/element-imperative-handle.d.ts +1 -1
  425. package/dist/types/src/runtimes/react/element-imperative-handle.d.ts.map +1 -1
  426. package/dist/types/src/runtimes/react/find-dom-node.d.ts +1 -1
  427. package/dist/types/src/runtimes/react/find-dom-node.d.ts.map +1 -1
  428. package/dist/types/src/runtimes/react/index.d.ts +10 -8
  429. package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
  430. package/dist/types/src/slate/BlockPlugin/constants.d.ts.map +1 -0
  431. package/dist/types/src/slate/BlockPlugin/dedent.d.ts.map +1 -0
  432. package/dist/types/src/slate/BlockPlugin/indent.d.ts.map +1 -0
  433. package/dist/types/src/slate/BlockPlugin/index.d.ts +56 -2
  434. package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
  435. package/dist/types/src/slate/BlockPlugin/setBlockKeyForDevice.d.ts +1 -1
  436. package/dist/types/src/slate/BlockPlugin/setBlockKeyForDevice.d.ts.map +1 -1
  437. package/dist/types/src/slate/{ListPlugin → BlockPlugin}/toggleList.d.ts +2 -2
  438. package/dist/types/src/slate/BlockPlugin/toggleList.d.ts.map +1 -0
  439. package/dist/types/src/slate/BlockPlugin/types.d.ts +3 -3
  440. package/dist/types/src/slate/BlockPlugin/types.d.ts.map +1 -1
  441. package/dist/types/src/slate/BlockPlugin/unwrapInline.d.ts +1 -1
  442. package/dist/types/src/slate/BlockPlugin/unwrapInline.d.ts.map +1 -1
  443. package/dist/types/src/slate/{ListPlugin → BlockPlugin}/unwrapList.d.ts +1 -1
  444. package/dist/types/src/slate/BlockPlugin/unwrapList.d.ts.map +1 -0
  445. package/dist/types/src/slate/BlockPlugin/utils/filterForSubtreeRoots.d.ts.map +1 -0
  446. package/dist/types/src/slate/BlockPlugin/utils/getSelectedListItems.d.ts.map +1 -0
  447. package/dist/types/src/slate/BlockPlugin/utils/location.d.ts.map +1 -0
  448. package/dist/types/src/slate/BlockPlugin/wrapInline.d.ts +1 -1
  449. package/dist/types/src/slate/BlockPlugin/wrapInline.d.ts.map +1 -1
  450. package/dist/types/src/slate/{ListPlugin → BlockPlugin}/wrapList.d.ts +2 -2
  451. package/dist/types/src/slate/BlockPlugin/wrapList.d.ts.map +1 -0
  452. package/dist/types/src/slate/BuilderPlugin/index.d.ts +1 -1
  453. package/dist/types/src/slate/BuilderPlugin/index.d.ts.map +1 -1
  454. package/dist/types/src/slate/InlineModePlugin/index.d.ts +6 -2
  455. package/dist/types/src/slate/InlineModePlugin/index.d.ts.map +1 -1
  456. package/dist/types/src/slate/TypographyPlugin/clearActiveTypographyStyle.d.ts +1 -1
  457. package/dist/types/src/slate/TypographyPlugin/clearActiveTypographyStyle.d.ts.map +1 -1
  458. package/dist/types/src/slate/TypographyPlugin/clearDeviceActiveTypography.d.ts +1 -1
  459. package/dist/types/src/slate/TypographyPlugin/clearDeviceActiveTypography.d.ts.map +1 -1
  460. package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts +2 -2
  461. package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts.map +1 -1
  462. package/dist/types/src/slate/TypographyPlugin/index.d.ts +2 -2
  463. package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -1
  464. package/dist/types/src/slate/TypographyPlugin/setActiveTypographyId.d.ts +1 -1
  465. package/dist/types/src/slate/TypographyPlugin/setActiveTypographyId.d.ts.map +1 -1
  466. package/dist/types/src/slate/TypographyPlugin/setActiveTypographyStyle.d.ts +1 -1
  467. package/dist/types/src/slate/TypographyPlugin/setActiveTypographyStyle.d.ts.map +1 -1
  468. package/dist/types/src/slate/index.d.ts +1 -1
  469. package/dist/types/src/slate/index.d.ts.map +1 -1
  470. package/dist/types/src/slate/selectors.d.ts +1 -1
  471. package/dist/types/src/slate/selectors.d.ts.map +1 -1
  472. package/dist/types/{types/slate.d.ts → src/slate/types.d.ts} +42 -35
  473. package/dist/types/src/slate/types.d.ts.map +1 -0
  474. package/dist/types/src/slate/utils/editor.d.ts +1 -1
  475. package/dist/types/src/slate/utils/editor.d.ts.map +1 -1
  476. package/dist/types/src/slate/utils/element.d.ts +1 -2
  477. package/dist/types/src/slate/utils/element.d.ts.map +1 -1
  478. package/dist/types/src/state/actions.d.ts +66 -41
  479. package/dist/types/src/state/actions.d.ts.map +1 -1
  480. package/dist/types/src/state/makeswift-api-client.d.ts +5 -5
  481. package/dist/types/src/state/makeswift-api-client.d.ts.map +1 -1
  482. package/dist/types/src/state/modules/api-resources.d.ts +2 -2
  483. package/dist/types/src/state/modules/api-resources.d.ts.map +1 -1
  484. package/dist/types/src/state/modules/box-models.d.ts +2 -2
  485. package/dist/types/src/state/modules/box-models.d.ts.map +1 -1
  486. package/dist/types/src/state/modules/breakpoints.d.ts +9 -9
  487. package/dist/types/src/state/modules/breakpoints.d.ts.map +1 -1
  488. package/dist/types/src/state/modules/builder-edit-mode.d.ts +2 -2
  489. package/dist/types/src/state/modules/builder-edit-mode.d.ts.map +1 -1
  490. package/dist/types/src/state/modules/components-meta.d.ts +27 -3
  491. package/dist/types/src/state/modules/components-meta.d.ts.map +1 -1
  492. package/dist/types/src/state/modules/element-imperative-handles.d.ts +1 -1
  493. package/dist/types/src/state/modules/element-imperative-handles.d.ts.map +1 -1
  494. package/dist/types/src/state/modules/is-in-builder.d.ts +1 -1
  495. package/dist/types/src/state/modules/is-in-builder.d.ts.map +1 -1
  496. package/dist/types/src/state/modules/is-preview.d.ts +1 -1
  497. package/dist/types/src/state/modules/is-preview.d.ts.map +1 -1
  498. package/dist/types/src/state/modules/locales.d.ts +16 -0
  499. package/dist/types/src/state/modules/locales.d.ts.map +1 -0
  500. package/dist/types/src/state/modules/pointer.d.ts +2 -2
  501. package/dist/types/src/state/modules/pointer.d.ts.map +1 -1
  502. package/dist/types/src/state/modules/prop-controller-handles.d.ts +1 -1
  503. package/dist/types/src/state/modules/prop-controller-handles.d.ts.map +1 -1
  504. package/dist/types/src/state/modules/prop-controllers.d.ts +1 -1
  505. package/dist/types/src/state/modules/prop-controllers.d.ts.map +1 -1
  506. package/dist/types/src/state/modules/react-components.d.ts +2 -2
  507. package/dist/types/src/state/modules/react-components.d.ts.map +1 -1
  508. package/dist/types/src/state/modules/read-only-documents.d.ts +7 -7
  509. package/dist/types/src/state/modules/read-only-documents.d.ts.map +1 -1
  510. package/dist/types/src/state/modules/read-write-documents.d.ts +1 -1
  511. package/dist/types/src/state/modules/read-write-documents.d.ts.map +1 -1
  512. package/dist/types/src/state/react-builder-preview.d.ts +7 -6
  513. package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
  514. package/dist/types/src/state/react-page.d.ts +15 -7
  515. package/dist/types/src/state/react-page.d.ts.map +1 -1
  516. package/dist/types/src/state/react-page.test.d.ts +3 -0
  517. package/dist/types/src/state/react-page.test.d.ts.map +1 -0
  518. package/dist/types/src/utils/isErrorWithMessage.d.ts +1 -1
  519. package/dist/types/src/utils/isErrorWithMessage.d.ts.map +1 -1
  520. package/package.json +8 -4
  521. package/dist/descriptors.cjs.js.map +0 -1
  522. package/dist/descriptors.es.js.map +0 -1
  523. package/dist/element.cjs.js +0 -55
  524. package/dist/element.cjs.js.map +0 -1
  525. package/dist/element.es.js +0 -54
  526. package/dist/element.es.js.map +0 -1
  527. package/dist/introspection.cjs.js +0 -329
  528. package/dist/introspection.cjs.js.map +0 -1
  529. package/dist/introspection.es.js +0 -315
  530. package/dist/introspection.es.js.map +0 -1
  531. package/dist/slate.cjs2.js +0 -46
  532. package/dist/slate.cjs2.js.map +0 -1
  533. package/dist/slate.es2.js +0 -44
  534. package/dist/slate.es2.js.map +0 -1
  535. package/dist/types/src/slate/ListPlugin/constants.d.ts.map +0 -1
  536. package/dist/types/src/slate/ListPlugin/dedent.d.ts.map +0 -1
  537. package/dist/types/src/slate/ListPlugin/indent.d.ts.map +0 -1
  538. package/dist/types/src/slate/ListPlugin/index.d.ts +0 -17
  539. package/dist/types/src/slate/ListPlugin/index.d.ts.map +0 -1
  540. package/dist/types/src/slate/ListPlugin/toggleList.d.ts.map +0 -1
  541. package/dist/types/src/slate/ListPlugin/unwrapList.d.ts.map +0 -1
  542. package/dist/types/src/slate/ListPlugin/utils/filterForSubtreeRoots.d.ts.map +0 -1
  543. package/dist/types/src/slate/ListPlugin/utils/getSelectedListItems.d.ts.map +0 -1
  544. package/dist/types/src/slate/ListPlugin/utils/location.d.ts.map +0 -1
  545. package/dist/types/src/slate/ListPlugin/wrapList.d.ts.map +0 -1
  546. package/dist/types/types/slate.d.ts.map +0 -1
  547. /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/constants.d.ts +0 -0
  548. /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/dedent.d.ts +0 -0
  549. /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/indent.d.ts +0 -0
  550. /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/utils/filterForSubtreeRoots.d.ts +0 -0
  551. /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/utils/getSelectedListItems.d.ts +0 -0
  552. /package/dist/types/src/slate/{ListPlugin → BlockPlugin}/utils/location.d.ts +0 -0
@@ -19,356 +19,7 @@ var __spreadValues = (a, b) => {
19
19
  };
20
20
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
21
  var slate = require("slate");
22
- var isHotkey = require("is-hotkey");
23
- var element = require("./element.cjs.js");
24
- var slate$1 = require("./slate.cjs2.js");
25
22
  var state_breakpoints = require("./state/breakpoints.cjs.js");
26
- var slateReact = require("slate-react");
27
- function _interopDefaultLegacy(e) {
28
- return e && typeof e === "object" && "default" in e ? e : { "default": e };
29
- }
30
- var isHotkey__default = /* @__PURE__ */ _interopDefaultLegacy(isHotkey);
31
- const LIST_ITEM_CHILD_POSITION = 0;
32
- const LIST_ITEM_LIST_POSITION = 1;
33
- const EditorUtils = {
34
- getFirstAncestorList(editor, path) {
35
- try {
36
- const parentList = slate.Editor.above(editor, {
37
- at: path,
38
- match: (node) => element.ElementUtils.isList(node)
39
- });
40
- return parentList != null ? parentList : null;
41
- } catch (e) {
42
- return null;
43
- }
44
- },
45
- getFirstAncestorListItem(editor, path) {
46
- try {
47
- const parentListItem = slate.Editor.above(editor, {
48
- at: path,
49
- match: (node) => element.ElementUtils.isListItem(node)
50
- });
51
- return parentListItem != null ? parentListItem : null;
52
- } catch (e) {
53
- return null;
54
- }
55
- }
56
- };
57
- function filterForSubtreeRoots(entries) {
58
- return entries.filter(([, nodePath]) => !slate.Path.ancestors(nodePath).some((ancestor) => {
59
- return entries.some(([, path]) => slate.Path.equals(path, ancestor));
60
- }));
61
- }
62
- const LocationUtils = {
63
- getStartPath(location) {
64
- if (slate.Range.isRange(location))
65
- return slate.Range.start(location).path;
66
- if (slate.Point.isPoint(location))
67
- return location.path;
68
- return location;
69
- }
70
- };
71
- function getSelectedListItems(editor) {
72
- var _a, _b;
73
- if (!editor.selection)
74
- return [];
75
- const start = LocationUtils.getStartPath(editor.selection);
76
- const listItems = slate.Editor.nodes(editor, {
77
- at: editor.selection,
78
- match: (node) => element.ElementUtils.isListItem(node)
79
- });
80
- const firstAncestorPath = (_b = (_a = EditorUtils.getFirstAncestorListItem(editor, start)) == null ? void 0 : _a[1]) != null ? _b : [];
81
- return Array.from(listItems).filter((node) => slate.Path.isDescendant(start, node[1]) ? slate.Path.equals(node[1], firstAncestorPath) : !slate.Path.isAfter(start, node[1]));
82
- }
83
- function indentPath(editor, path) {
84
- const parent = slate.Node.parent(editor, path);
85
- if (!path || !slate.Path.hasPrevious(path) || !element.ElementUtils.isList(parent))
86
- return;
87
- const previosPath = slate.Path.previous(path);
88
- const previousChildListPath = [...previosPath, LIST_ITEM_LIST_POSITION];
89
- const previousHasChildList = slate.Node.has(editor, previousChildListPath);
90
- slate.Editor.withoutNormalizing(editor, () => {
91
- if (!previousHasChildList) {
92
- slate.Transforms.insertNodes(editor, element.ElementUtils.createList(parent.type), {
93
- at: previousChildListPath
94
- });
95
- }
96
- const previousChildList = slate.Node.get(editor, previousChildListPath);
97
- if (element.ElementUtils.isList(previousChildList)) {
98
- const index = previousHasChildList ? previousChildList.children.length : 0;
99
- slate.Transforms.moveNodes(editor, {
100
- at: path,
101
- to: [...previousChildListPath, index]
102
- });
103
- }
104
- });
105
- }
106
- function indent(editor) {
107
- if (!editor.selection)
108
- return;
109
- const listItems = getSelectedListItems(editor);
110
- const subRoots = filterForSubtreeRoots(listItems);
111
- const refs = subRoots.map(([_, path]) => slate.Editor.pathRef(editor, path));
112
- refs.forEach((ref) => {
113
- if (ref.current) {
114
- indentPath(editor, ref.current);
115
- }
116
- ref.unref();
117
- });
118
- }
119
- function dedentPath(editor, listItemPath) {
120
- const parentList = EditorUtils.getFirstAncestorList(editor, listItemPath);
121
- const listItemContainingParentList = EditorUtils.getFirstAncestorListItem(editor, listItemPath);
122
- if (!parentList || !listItemContainingParentList)
123
- return;
124
- const [parentListNode, parentListPath] = parentList;
125
- const [_, listItemContainingParentListPath] = listItemContainingParentList;
126
- const listItemPosition = listItemPath[listItemPath.length - 1];
127
- const previousSiblings = parentListNode.children.slice(0, listItemPosition);
128
- const nextSiblings = parentListNode.children.slice(listItemPosition + 1);
129
- slate.Editor.withoutNormalizing(editor, () => {
130
- nextSiblings.forEach(() => {
131
- const nextSiblingPath = [...parentListPath, listItemPosition + 1];
132
- indentPath(editor, nextSiblingPath);
133
- });
134
- slate.Transforms.moveNodes(editor, {
135
- at: listItemPath,
136
- to: slate.Path.next(listItemContainingParentListPath)
137
- });
138
- if (previousSiblings.length === 0) {
139
- slate.Transforms.removeNodes(editor, { at: parentListPath });
140
- }
141
- });
142
- }
143
- function dedent(editor) {
144
- if (!editor.selection)
145
- return;
146
- const listItems = getSelectedListItems(editor);
147
- const subRoots = filterForSubtreeRoots(listItems);
148
- const refs = subRoots.map(([_, path]) => slate.Editor.pathRef(editor, path));
149
- refs.forEach((ref) => {
150
- if (ref.current) {
151
- dedentPath(editor, ref.current);
152
- }
153
- ref.unref();
154
- });
155
- }
156
- function unwrapPath(editor, listItemPath) {
157
- const parentList = EditorUtils.getFirstAncestorList(editor, listItemPath);
158
- const listItemContainingParentList = EditorUtils.getFirstAncestorListItem(editor, listItemPath);
159
- if (!parentList || listItemContainingParentList)
160
- return;
161
- slate.Editor.withoutNormalizing(editor, () => {
162
- const listItemTextPath = [...listItemPath, LIST_ITEM_CHILD_POSITION];
163
- const listItemNestedListPath = [...listItemPath, LIST_ITEM_LIST_POSITION];
164
- if (slate.Node.has(editor, listItemNestedListPath)) {
165
- slate.Transforms.setNodes(editor, { type: parentList[0].type }, { at: listItemNestedListPath });
166
- slate.Transforms.liftNodes(editor, { at: listItemNestedListPath });
167
- slate.Transforms.liftNodes(editor, { at: slate.Path.next(listItemPath) });
168
- }
169
- if (slate.Node.has(editor, listItemTextPath)) {
170
- slate.Transforms.setNodes(editor, { type: slate$1.BlockType.Paragraph }, {
171
- at: listItemTextPath
172
- });
173
- slate.Transforms.liftNodes(editor, { at: listItemTextPath });
174
- slate.Transforms.liftNodes(editor, { at: listItemPath });
175
- }
176
- });
177
- }
178
- function unwrapList(editor, options) {
179
- var _a;
180
- const at = (_a = options == null ? void 0 : options.at) != null ? _a : editor.selection;
181
- if (!at)
182
- return;
183
- const listItems = Array.from(slate.Editor.nodes(editor, {
184
- at,
185
- match: (node) => {
186
- return slate.Element.isElement(node) && element.ElementUtils.isListItem(node);
187
- }
188
- }));
189
- const subRoots = filterForSubtreeRoots(listItems);
190
- const refs = subRoots.map(([_, path]) => slate.Editor.pathRef(editor, path));
191
- refs.forEach((ref) => {
192
- if (ref.current) {
193
- unwrapPath(editor, ref.current);
194
- }
195
- ref.unref();
196
- });
197
- }
198
- function wrapList(editor, options = { type: slate$1.BlockType.UnorderedList }) {
199
- var _a;
200
- const at = (_a = options.at) != null ? _a : editor.selection;
201
- if (!at)
202
- return;
203
- const nonListEntries = Array.from(slate.Editor.nodes(editor, {
204
- at,
205
- match: (node) => {
206
- return slate.Element.isElement(node) && element.ElementUtils.isConvertibleToListTextNode(node);
207
- }
208
- }));
209
- const refs = nonListEntries.map(([_, path]) => slate.Editor.pathRef(editor, path));
210
- refs.forEach((ref) => {
211
- const path = ref.current;
212
- if (path) {
213
- slate.Editor.withoutNormalizing(editor, () => {
214
- slate.Transforms.setNodes(editor, { type: slate$1.BlockType.ListItemChild }, {
215
- at: path
216
- });
217
- slate.Transforms.wrapNodes(editor, element.ElementUtils.createListItem(), {
218
- match: (node) => element.ElementUtils.isListItemChild(node),
219
- at: path
220
- });
221
- slate.Transforms.wrapNodes(editor, element.ElementUtils.createList(options.type), {
222
- at: path
223
- });
224
- });
225
- }
226
- ref.unref();
227
- });
228
- }
229
- function toggleList(editor, options = { type: slate$1.BlockType.UnorderedList }) {
230
- var _a;
231
- const at = (_a = options.at) != null ? _a : editor.selection;
232
- if (at == null)
233
- return;
234
- const start = LocationUtils.getStartPath(at);
235
- const ancestorPath = slate.Path.ancestors(start).at(1);
236
- if (!ancestorPath || !slate.Node.has(editor, ancestorPath))
237
- return;
238
- const ancestor = slate.Node.get(editor, ancestorPath);
239
- if (!element.ElementUtils.isList(ancestor)) {
240
- return wrapList(editor, { type: options.type, at });
241
- }
242
- if (ancestor.type === options.type) {
243
- unwrapList(editor, { at });
244
- } else {
245
- slate.Transforms.setNodes(editor, { type: options.type }, { at: ancestorPath });
246
- }
247
- }
248
- const List = {
249
- unwrapList,
250
- wrapList,
251
- indent,
252
- dedent,
253
- toggleList
254
- };
255
- function onKeyDown(e, editor) {
256
- if (!editor.selection || Array.from(slate.Editor.nodes(editor, { match: (node) => element.ElementUtils.isListItem(node) })).length === 0)
257
- return;
258
- if (isHotkey__default["default"]("shift+tab", e)) {
259
- e.preventDefault();
260
- List.dedent(editor);
261
- }
262
- if (isHotkey__default["default"]("tab", e)) {
263
- e.preventDefault();
264
- List.indent(editor);
265
- }
266
- if (isHotkey__default["default"]("backspace", e)) {
267
- if (!editor.selection)
268
- return;
269
- if (slate.Range.isExpanded(editor.selection))
270
- return;
271
- const listItem = EditorUtils.getFirstAncestorListItem(editor, editor.selection.anchor.path);
272
- if (editor.selection.anchor.offset === 0 && listItem) {
273
- e.preventDefault();
274
- const parentListItem = EditorUtils.getFirstAncestorListItem(editor, listItem[1]);
275
- const list = EditorUtils.getFirstAncestorList(editor, listItem[1]);
276
- if (parentListItem) {
277
- List.dedent(editor);
278
- } else if (list) {
279
- List.unwrapList(editor);
280
- }
281
- return;
282
- }
283
- }
284
- if (isHotkey__default["default"]("enter", e)) {
285
- e.preventDefault();
286
- if (!editor.selection)
287
- return;
288
- if (slate.Range.isExpanded(editor.selection)) {
289
- slate.Transforms.delete(editor);
290
- return;
291
- }
292
- const listItem = EditorUtils.getFirstAncestorListItem(editor, editor.selection.anchor.path);
293
- if (editor.selection.anchor.offset === 0 && listItem && slate.Editor.string(editor, listItem[1]) === "") {
294
- const parentListItem = EditorUtils.getFirstAncestorListItem(editor, listItem[1]);
295
- if (parentListItem) {
296
- List.dedent(editor);
297
- } else {
298
- List.unwrapList(editor);
299
- }
300
- return;
301
- }
302
- slate.Transforms.splitNodes(editor, {
303
- at: editor.selection,
304
- always: true,
305
- match: (node) => element.ElementUtils.isListItem(node)
306
- });
307
- }
308
- if (isHotkey__default["default"]("shift+enter", e)) {
309
- e.preventDefault();
310
- editor.insertText("\n");
311
- }
312
- }
313
- function withList(editor) {
314
- const { normalizeNode } = editor;
315
- editor.normalizeNode = (entry) => {
316
- const [normalizationNode, normalizationPath] = entry;
317
- if (element.ElementUtils.isListItem(normalizationNode)) {
318
- const pathToListItemText = [...normalizationPath, LIST_ITEM_CHILD_POSITION];
319
- if (slate.Node.has(editor, pathToListItemText)) {
320
- const nodeInListItemTextPosition = slate.Node.get(editor, pathToListItemText);
321
- if (element.ElementUtils.isParagraph(nodeInListItemTextPosition)) {
322
- slate.Transforms.setNodes(editor, { type: slate$1.BlockType.ListItemChild }, {
323
- at: pathToListItemText
324
- });
325
- return;
326
- }
327
- } else {
328
- slate.Transforms.insertNodes(editor, element.ElementUtils.createListItem(), {
329
- at: pathToListItemText
330
- });
331
- return;
332
- }
333
- }
334
- if (!slate.Text.isText(normalizationNode)) {
335
- const mergeableChildren = Array.from(slate.Node.children(editor, normalizationPath)).map((child, index, children) => {
336
- const potentialNodeToBeMerged = children.at(index + 1);
337
- if (!potentialNodeToBeMerged || !element.ElementUtils.isList(potentialNodeToBeMerged[0]) || !element.ElementUtils.isList(child[0]) || potentialNodeToBeMerged[0].type !== child[0].type) {
338
- return null;
339
- }
340
- return [
341
- slate.Editor.pathRef(editor, child[1]),
342
- slate.Editor.pathRef(editor, potentialNodeToBeMerged[1])
343
- ];
344
- }).filter((mergeableNodes) => Boolean(mergeableNodes));
345
- if (mergeableChildren.length !== 0) {
346
- mergeableChildren.reverse().forEach(([nodePathRef, nodeToBeMergedPathRef]) => {
347
- const nodePath = nodePathRef.current;
348
- const nodeToBeMergedPath = nodeToBeMergedPathRef.current;
349
- if (nodePath == null || nodeToBeMergedPath == null)
350
- return;
351
- const nodeChildren = Array.from(slate.Node.children(editor, nodePath));
352
- const childrenToBeMerged = Array.from(slate.Node.children(editor, nodeToBeMergedPath));
353
- slate.Editor.withoutNormalizing(editor, () => {
354
- childrenToBeMerged.reverse().forEach(([_, childPath]) => {
355
- slate.Transforms.moveNodes(editor, {
356
- at: childPath,
357
- to: [...nodePath, nodeChildren.length]
358
- });
359
- });
360
- slate.Transforms.removeNodes(editor, { at: nodeToBeMergedPath });
361
- });
362
- nodePathRef.unref();
363
- nodeToBeMergedPathRef.unref();
364
- });
365
- return;
366
- }
367
- }
368
- normalizeNode(entry);
369
- };
370
- return editor;
371
- }
372
23
  function clearActiveTypographyStyle(editor, options) {
373
24
  slate.Editor.withoutNormalizing(editor, () => {
374
25
  var _a;
@@ -532,7 +183,7 @@ function setActiveTypographyStyle(editor, breakpoints, deviceId, prop, value, op
532
183
  atRef.unref();
533
184
  });
534
185
  }
535
- const Typography = {
186
+ const TypographyActions = {
536
187
  setActiveTypographyId,
537
188
  setActiveTypographyStyle,
538
189
  clearActiveTypographyStyle,
@@ -556,135 +207,6 @@ function withTypography(editor) {
556
207
  };
557
208
  return editor;
558
209
  }
559
- function unhangRange(editor, range) {
560
- let [start, end] = slate.Range.edges(range);
561
- if (start.offset !== 0 || end.offset !== 0 || slate.Range.isCollapsed(range)) {
562
- return range;
563
- }
564
- const endBlock = slate.Editor.above(editor, {
565
- at: end,
566
- match: (n) => slate.Element.isElement(n) && slate.Editor.isBlock(editor, n)
567
- });
568
- const blockPath = endBlock ? endBlock[1] : [];
569
- const first = slate.Editor.start(editor, start);
570
- const before = { anchor: first, focus: end };
571
- let skip = true;
572
- for (const [node, path] of slate.Editor.nodes(editor, {
573
- at: before,
574
- match: slate.Text.isText,
575
- reverse: true
576
- })) {
577
- if (skip) {
578
- skip = false;
579
- continue;
580
- }
581
- if (node.text !== "" || slate.Path.isBefore(path, blockPath)) {
582
- end = { path, offset: node.text.length };
583
- break;
584
- }
585
- }
586
- return { anchor: start, focus: end };
587
- }
588
- function getSelection(editor) {
589
- if (editor.selection)
590
- return unhangRange(editor, editor.selection);
591
- return {
592
- anchor: slate.Editor.start(editor, []),
593
- focus: slate.Editor.end(editor, [])
594
- };
595
- }
596
- function getBlocksInSelection(editor) {
597
- return Array.from(slate.Editor.nodes(editor, {
598
- at: getSelection(editor),
599
- match: (node) => element.ElementUtils.isRootBlock(node)
600
- })).filter((entry) => element.ElementUtils.isRootBlock(entry[0]));
601
- }
602
- function setBlockKeyForDevice(editor, breakpoints, deviceId, key, value, options) {
603
- var _a, _b;
604
- const at = (_a = options == null ? void 0 : options.at) != null ? _a : editor.selection;
605
- if (!at)
606
- return;
607
- const rootElements = getBlocksInSelection(editor);
608
- for (const [node, path] of rootElements) {
609
- if (element.ElementUtils.isBlock(node)) {
610
- const deviceValues = (_b = node[key]) != null ? _b : [];
611
- const currentDeviceValue = state_breakpoints.findBreakpointOverride(breakpoints, deviceValues, deviceId, (v) => v);
612
- const nextDeviceValue = __spreadProps(__spreadValues({}, currentDeviceValue), {
613
- deviceId,
614
- value
615
- });
616
- slate.Transforms.setNodes(editor, {
617
- [key]: [...deviceValues.filter((v) => v.deviceId !== deviceId), nextDeviceValue]
618
- }, { at: path });
619
- }
620
- }
621
- }
622
- function clearBlockKeyForDevice(editor, deviceId, key) {
623
- var _a;
624
- const rootElements = getBlocksInSelection(editor);
625
- for (const [node, path] of rootElements) {
626
- if (element.ElementUtils.isBlock(node)) {
627
- const deviceOverrides = (_a = node[key]) != null ? _a : [];
628
- slate.Transforms.setNodes(editor, {
629
- [key]: deviceOverrides.filter((v) => v.deviceId !== deviceId)
630
- }, { at: path });
631
- }
632
- }
633
- }
634
- function wrapInline(editor, inline) {
635
- slate.Transforms.wrapNodes(editor, inline, {
636
- at: getSelection(editor),
637
- split: true
638
- });
639
- }
640
- function unwrapInline(editor, type) {
641
- slate.Transforms.unwrapNodes(editor, {
642
- match: (node) => element.ElementUtils.isInline(node) && node.type === type,
643
- at: getSelection(editor)
644
- });
645
- }
646
- const Block = {
647
- setBlockKeyForDevice,
648
- clearBlockKeyForDevice,
649
- wrapInline,
650
- unwrapInline
651
- };
652
- function withBlock(editor) {
653
- const { normalizeNode } = editor;
654
- editor.isInline = (entry) => {
655
- return element.ElementUtils.isInline(entry);
656
- };
657
- editor.normalizeNode = (entry) => {
658
- var _a;
659
- const [normalizationNode, normalizationPath] = entry;
660
- if (element.ElementUtils.isBlock(normalizationNode) && ((_a = normalizationNode == null ? void 0 : normalizationNode.textAlign) == null ? void 0 : _a.length) == 0) {
661
- slate.Transforms.unsetNodes(editor, "textAlign", { at: normalizationPath });
662
- return;
663
- }
664
- normalizeNode(entry);
665
- };
666
- return editor;
667
- }
668
- function withBuilder(editor) {
669
- editor.deselectAndBlur = function() {
670
- slateReact.ReactEditor.deselect(editor);
671
- slateReact.ReactEditor.blur(editor);
672
- };
673
- editor.focusAndSelectAll = function() {
674
- slateReact.ReactEditor.focus(editor);
675
- slate.Transforms.select(editor, {
676
- anchor: slate.Editor.start(editor, []),
677
- focus: slate.Editor.end(editor, [])
678
- });
679
- };
680
- return editor;
681
- }
682
- exports.Block = Block;
683
- exports.List = List;
684
- exports.Typography = Typography;
685
- exports.onKeyDown = onKeyDown;
686
- exports.withBlock = withBlock;
687
- exports.withBuilder = withBuilder;
688
- exports.withList = withList;
210
+ exports.TypographyActions = TypographyActions;
689
211
  exports.withTypography = withTypography;
690
212
  //# sourceMappingURL=index.cjs5.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs5.js","sources":["../src/slate/ListPlugin/constants.ts","../src/slate/utils/editor.ts","../src/slate/ListPlugin/utils/filterForSubtreeRoots.ts","../src/slate/ListPlugin/utils/location.ts","../src/slate/ListPlugin/utils/getSelectedListItems.ts","../src/slate/ListPlugin/indent.ts","../src/slate/ListPlugin/dedent.ts","../src/slate/ListPlugin/unwrapList.ts","../src/slate/ListPlugin/wrapList.ts","../src/slate/ListPlugin/toggleList.ts","../src/slate/ListPlugin/index.ts","../src/slate/TypographyPlugin/clearActiveTypographyStyle.ts","../src/slate/TypographyPlugin/clearDeviceActiveTypography.ts","../src/slate/TypographyPlugin/detachActiveTypography.ts","../src/slate/TypographyPlugin/setActiveTypographyId.ts","../src/slate/TypographyPlugin/setActiveTypographyStyle.ts","../src/slate/TypographyPlugin/index.ts","../src/slate/utils/unhangRange.ts","../src/slate/selectors.ts","../src/slate/BlockPlugin/setBlockKeyForDevice.ts","../src/slate/BlockPlugin/clearBlockKeyForDevice.ts","../src/slate/BlockPlugin/wrapInline.ts","../src/slate/BlockPlugin/unwrapInline.ts","../src/slate/BlockPlugin/index.ts","../src/slate/BuilderPlugin/index.ts"],"sourcesContent":["export const LIST_ITEM_CHILD_POSITION = 0\nexport const LIST_ITEM_LIST_POSITION = 1\n","import { Path, Editor, NodeEntry } from 'slate'\n\nimport { ElementUtils } from './element'\nimport { ListElement, ListItemElement } from '../../../types/slate'\n\nexport const EditorUtils = {\n getFirstAncestorList(editor: Editor, path: Path): NodeEntry<ListElement> | null {\n try {\n const parentList = Editor.above(editor, {\n at: path,\n match: (node): node is ListElement => ElementUtils.isList(node),\n })\n return parentList ?? null\n } catch (e) {\n return null\n }\n },\n getFirstAncestorListItem(editor: Editor, path: Path): NodeEntry<ListItemElement> | null {\n try {\n const parentListItem = Editor.above(editor, {\n at: path,\n match: (node): node is ListItemElement => ElementUtils.isListItem(node),\n })\n\n return parentListItem ?? null\n } catch (e) {\n return null\n }\n },\n}\n","import type { Node, NodeEntry } from 'slate'\nimport { Path } from 'slate'\n\nexport function filterForSubtreeRoots(entries: NodeEntry<Node>[]): NodeEntry<Node>[] {\n return entries.filter(\n ([, nodePath]) =>\n !Path.ancestors(nodePath).some(ancestor => {\n return entries.some(([, path]) => Path.equals(path, ancestor))\n }),\n )\n}\n","import { Range, Point, Path, Location } from 'slate'\n\nexport const LocationUtils = {\n getStartPath(location: Location): Path {\n if (Range.isRange(location)) return Range.start(location).path\n if (Point.isPoint(location)) return location.path\n return location\n },\n}\n","import type { Element, NodeEntry } from 'slate'\nimport { Editor, Path } from 'slate'\nimport { EditorUtils } from '../../utils/editor'\nimport { ElementUtils } from '../../utils/element'\nimport { LocationUtils } from './location'\n\nexport function getSelectedListItems(editor: Editor): NodeEntry<Element>[] {\n if (!editor.selection) return []\n\n const start = LocationUtils.getStartPath(editor.selection)\n const listItems = Editor.nodes(editor, {\n at: editor.selection,\n match: node => ElementUtils.isListItem(node),\n })\n const firstAncestorPath = EditorUtils.getFirstAncestorListItem(editor, start)?.[1] ?? []\n\n return Array.from(listItems).filter((node): node is NodeEntry<Element> =>\n Path.isDescendant(start, node[1])\n ? Path.equals(node[1], firstAncestorPath)\n : !Path.isAfter(start, node[1]),\n )\n}\n","import { Editor, Node, Path, Transforms } from 'slate'\nimport { ElementUtils } from '../utils/element'\nimport { LIST_ITEM_LIST_POSITION } from './constants'\nimport { filterForSubtreeRoots } from './utils/filterForSubtreeRoots'\nimport { getSelectedListItems } from './utils/getSelectedListItems'\n\nexport function indentPath(editor: Editor, path: Path) {\n const parent = Node.parent(editor, path)\n if (!path || !Path.hasPrevious(path) || !ElementUtils.isList(parent)) return\n\n const previosPath = Path.previous(path)\n\n const previousChildListPath = [...previosPath, LIST_ITEM_LIST_POSITION]\n const previousHasChildList = Node.has(editor, previousChildListPath)\n\n Editor.withoutNormalizing(editor, () => {\n if (!previousHasChildList) {\n Transforms.insertNodes(editor, ElementUtils.createList(parent.type), {\n at: previousChildListPath,\n })\n }\n\n const previousChildList = Node.get(editor, previousChildListPath)\n\n if (ElementUtils.isList(previousChildList)) {\n const index = previousHasChildList ? previousChildList.children.length : 0\n Transforms.moveNodes(editor, {\n at: path,\n to: [...previousChildListPath, index],\n })\n }\n })\n}\n\nexport function indent(editor: Editor) {\n if (!editor.selection) return\n\n const listItems = getSelectedListItems(editor)\n const subRoots = filterForSubtreeRoots(listItems)\n const refs = subRoots.map(([_, path]) => Editor.pathRef(editor, path))\n\n refs.forEach(ref => {\n if (ref.current) {\n indentPath(editor, ref.current)\n }\n ref.unref()\n })\n}\n","import { Editor, Path, Transforms } from 'slate'\nimport { indentPath } from './indent'\nimport { getSelectedListItems } from './utils/getSelectedListItems'\nimport { filterForSubtreeRoots } from './utils/filterForSubtreeRoots'\nimport { EditorUtils } from '../utils/editor'\n\nfunction dedentPath(editor: Editor, listItemPath: Path) {\n const parentList = EditorUtils.getFirstAncestorList(editor, listItemPath)\n const listItemContainingParentList = EditorUtils.getFirstAncestorListItem(editor, listItemPath)\n if (!parentList || !listItemContainingParentList) return\n\n const [parentListNode, parentListPath] = parentList\n const [_, listItemContainingParentListPath] = listItemContainingParentList\n\n const listItemPosition = listItemPath[listItemPath.length - 1]\n const previousSiblings = parentListNode.children.slice(0, listItemPosition)\n const nextSiblings = parentListNode.children.slice(listItemPosition + 1)\n\n Editor.withoutNormalizing(editor, () => {\n // put next siblings into list item\n nextSiblings.forEach(() => {\n const nextSiblingPath = [...parentListPath, listItemPosition + 1]\n indentPath(editor, nextSiblingPath)\n })\n // move list item to parent list\n Transforms.moveNodes(editor, {\n at: listItemPath,\n to: Path.next(listItemContainingParentListPath),\n })\n // delete old parent list if there are no other list items\n if (previousSiblings.length === 0) {\n Transforms.removeNodes(editor, { at: parentListPath })\n }\n })\n}\n\nexport function dedent(editor: Editor) {\n if (!editor.selection) return\n\n const listItems = getSelectedListItems(editor)\n const subRoots = filterForSubtreeRoots(listItems)\n const refs = subRoots.map(([_, path]) => Editor.pathRef(editor, path))\n\n refs.forEach(ref => {\n if (ref.current) {\n dedentPath(editor, ref.current)\n }\n ref.unref()\n })\n}\n","import { Editor, Element, Transforms, Path, Node, Location, Span } from 'slate'\nimport { EditorUtils } from '../utils/editor'\nimport { LIST_ITEM_CHILD_POSITION, LIST_ITEM_LIST_POSITION } from './constants'\nimport { filterForSubtreeRoots } from './utils/filterForSubtreeRoots'\nimport { ElementUtils } from '../utils/element'\nimport { BlockType } from '../../../types/slate'\n\nexport function unwrapPath(editor: Editor, listItemPath: Path) {\n const parentList = EditorUtils.getFirstAncestorList(editor, listItemPath)\n const listItemContainingParentList = EditorUtils.getFirstAncestorListItem(editor, listItemPath)\n //if this is a nested item we don't want to unwrap it\n if (!parentList || listItemContainingParentList) return\n\n Editor.withoutNormalizing(editor, () => {\n const listItemTextPath = [...listItemPath, LIST_ITEM_CHILD_POSITION]\n const listItemNestedListPath = [...listItemPath, LIST_ITEM_LIST_POSITION]\n\n if (Node.has(editor, listItemNestedListPath)) {\n Transforms.setNodes(editor, { type: parentList[0].type }, { at: listItemNestedListPath })\n Transforms.liftNodes(editor, { at: listItemNestedListPath })\n Transforms.liftNodes(editor, { at: Path.next(listItemPath) })\n }\n\n if (Node.has(editor, listItemTextPath)) {\n Transforms.setNodes(\n editor,\n { type: BlockType.Paragraph },\n {\n at: listItemTextPath,\n },\n )\n Transforms.liftNodes(editor, { at: listItemTextPath })\n Transforms.liftNodes(editor, { at: listItemPath })\n }\n })\n}\n\ntype UnwrapListOptions = {\n at?: Location | Span\n}\n\nexport function unwrapList(editor: Editor, options?: UnwrapListOptions) {\n const at = options?.at ?? editor.selection\n if (!at) return\n\n const listItems = Array.from(\n Editor.nodes(editor, {\n at,\n match: node => {\n return Element.isElement(node) && ElementUtils.isListItem(node)\n },\n }),\n )\n const subRoots = filterForSubtreeRoots(listItems)\n const refs = subRoots.map(([_, path]) => Editor.pathRef(editor, path))\n\n refs.forEach(ref => {\n if (ref.current) {\n unwrapPath(editor, ref.current)\n }\n ref.unref()\n })\n}\n","import { Editor, Element, Location, Span, Transforms } from 'slate'\nimport { ElementUtils } from '../utils/element'\nimport { BlockType } from '../../../types/slate'\n\ntype WrapListOptions = {\n type: typeof BlockType.UnorderedList | typeof BlockType.OrderedList\n at?: Location | Span\n}\n\nexport function wrapList(\n editor: Editor,\n options: WrapListOptions = { type: BlockType.UnorderedList },\n) {\n const at = options.at ?? editor.selection\n if (!at) return\n\n const nonListEntries = Array.from(\n Editor.nodes(editor, {\n at,\n match: node => {\n return Element.isElement(node) && ElementUtils.isConvertibleToListTextNode(node)\n },\n }),\n )\n\n const refs = nonListEntries.map(([_, path]) => Editor.pathRef(editor, path))\n\n refs.forEach(ref => {\n const path = ref.current\n if (path) {\n Editor.withoutNormalizing(editor, () => {\n Transforms.setNodes(\n editor,\n { type: BlockType.ListItemChild },\n {\n at: path,\n },\n )\n Transforms.wrapNodes(editor, ElementUtils.createListItem(), {\n match: node => ElementUtils.isListItemChild(node),\n at: path,\n })\n Transforms.wrapNodes(editor, ElementUtils.createList(options.type), {\n at: path,\n })\n })\n }\n ref.unref()\n })\n}\n","import { Editor, Location, Node, Path, Transforms } from 'slate'\nimport { ElementUtils } from '../utils/element'\nimport { unwrapList } from './unwrapList'\nimport { LocationUtils } from './utils/location'\nimport { wrapList } from './wrapList'\nimport { BlockType } from '../../../types/slate'\n\ntype ToggleListOptions = {\n type: typeof BlockType.UnorderedList | typeof BlockType.OrderedList\n at?: Location\n}\n\nexport function toggleList(\n editor: Editor,\n options: ToggleListOptions = { type: BlockType.UnorderedList },\n) {\n const at = options.at ?? editor.selection\n if (at == null) return\n const start = LocationUtils.getStartPath(at)\n const ancestorPath = Path.ancestors(start).at(1)\n if (!ancestorPath || !Node.has(editor, ancestorPath)) return\n const ancestor = Node.get(editor, ancestorPath)\n\n if (!ElementUtils.isList(ancestor)) {\n return wrapList(editor, { type: options.type, at })\n }\n\n if (ancestor.type === options.type) {\n unwrapList(editor, { at })\n } else {\n Transforms.setNodes(editor, { type: options.type }, { at: ancestorPath })\n }\n}\n","import type { KeyboardEvent } from 'react'\nimport { Editor, Transforms, Range, Node, PathRef, Text } from 'slate'\nimport isHotkey from 'is-hotkey'\nimport { LIST_ITEM_CHILD_POSITION } from './constants'\nimport { EditorUtils } from '../utils/editor'\nimport { ElementUtils } from '../utils/element'\nimport { dedent } from './dedent'\nimport { indent } from './indent'\nimport { toggleList } from './toggleList'\nimport { unwrapList } from './unwrapList'\nimport { wrapList } from './wrapList'\nimport { BlockType } from '../../../types/slate'\n\nexport const List = {\n unwrapList,\n wrapList,\n indent,\n dedent,\n toggleList,\n}\n\nexport function onKeyDown(e: KeyboardEvent, editor: Editor) {\n if (\n !editor.selection ||\n Array.from(Editor.nodes(editor, { match: node => ElementUtils.isListItem(node) })).length === 0\n )\n return\n\n if (isHotkey('shift+tab', e)) {\n e.preventDefault()\n List.dedent(editor)\n }\n\n if (isHotkey('tab', e)) {\n e.preventDefault()\n List.indent(editor)\n }\n\n if (isHotkey('backspace', e)) {\n if (!editor.selection) return\n if (Range.isExpanded(editor.selection)) return\n const listItem = EditorUtils.getFirstAncestorListItem(editor, editor.selection.anchor.path)\n if (editor.selection.anchor.offset === 0 && listItem) {\n e.preventDefault()\n const parentListItem = EditorUtils.getFirstAncestorListItem(editor, listItem[1])\n const list = EditorUtils.getFirstAncestorList(editor, listItem[1])\n\n if (parentListItem) {\n List.dedent(editor)\n } else if (list) {\n List.unwrapList(editor)\n }\n return\n }\n }\n\n if (isHotkey('enter', e)) {\n e.preventDefault()\n\n if (!editor.selection) return\n\n if (Range.isExpanded(editor.selection)) {\n Transforms.delete(editor)\n return\n }\n\n const listItem = EditorUtils.getFirstAncestorListItem(editor, editor.selection.anchor.path)\n if (\n editor.selection.anchor.offset === 0 &&\n listItem &&\n Editor.string(editor, listItem[1]) === ''\n ) {\n const parentListItem = EditorUtils.getFirstAncestorListItem(editor, listItem[1])\n\n if (parentListItem) {\n List.dedent(editor)\n } else {\n List.unwrapList(editor)\n }\n return\n }\n\n Transforms.splitNodes(editor, {\n at: editor.selection,\n always: true,\n match: node => ElementUtils.isListItem(node),\n })\n }\n\n if (isHotkey('shift+enter', e)) {\n e.preventDefault()\n editor.insertText('\\n')\n }\n}\n\nexport function withList(editor: Editor) {\n const { normalizeNode } = editor\n editor.normalizeNode = entry => {\n const [normalizationNode, normalizationPath] = entry\n\n // Normalization for converting children of list items to list item children\n // In the case of backspace from position 0 of node into a list this converts the node into a list item.\n if (ElementUtils.isListItem(normalizationNode)) {\n const pathToListItemText = [...normalizationPath, LIST_ITEM_CHILD_POSITION]\n\n if (Node.has(editor, pathToListItemText)) {\n const nodeInListItemTextPosition = Node.get(editor, pathToListItemText)\n if (ElementUtils.isParagraph(nodeInListItemTextPosition)) {\n Transforms.setNodes(\n editor,\n { type: BlockType.ListItemChild },\n {\n at: pathToListItemText,\n },\n )\n return\n }\n } else {\n Transforms.insertNodes(editor, ElementUtils.createListItem(), {\n at: pathToListItemText,\n })\n return\n }\n }\n\n // Normalization for merging adjacent lists of the same type\n if (!Text.isText(normalizationNode)) {\n const mergeableChildren = Array.from(Node.children(editor, normalizationPath))\n .map((child, index, children) => {\n const potentialNodeToBeMerged = children.at(index + 1)\n if (\n !potentialNodeToBeMerged ||\n !ElementUtils.isList(potentialNodeToBeMerged[0]) ||\n !ElementUtils.isList(child[0]) ||\n potentialNodeToBeMerged[0].type !== child[0].type\n ) {\n return null\n }\n return [\n Editor.pathRef(editor, child[1]),\n Editor.pathRef(editor, potentialNodeToBeMerged[1]),\n ]\n })\n .filter((mergeableNodes): mergeableNodes is PathRef[] => Boolean(mergeableNodes))\n\n if (mergeableChildren.length !== 0) {\n mergeableChildren.reverse().forEach(([nodePathRef, nodeToBeMergedPathRef]) => {\n const nodePath = nodePathRef.current\n const nodeToBeMergedPath = nodeToBeMergedPathRef.current\n if (nodePath == null || nodeToBeMergedPath == null) return\n const nodeChildren = Array.from(Node.children(editor, nodePath))\n const childrenToBeMerged = Array.from(Node.children(editor, nodeToBeMergedPath))\n Editor.withoutNormalizing(editor, () => {\n childrenToBeMerged.reverse().forEach(([_, childPath]) => {\n Transforms.moveNodes(editor, {\n at: childPath,\n to: [...nodePath, nodeChildren.length],\n })\n })\n Transforms.removeNodes(editor, { at: nodeToBeMergedPath })\n })\n nodePathRef.unref()\n nodeToBeMergedPathRef.unref()\n })\n return\n }\n }\n\n normalizeNode(entry)\n }\n\n return editor\n}\n","import { Editor, Transforms, Text, Range } from 'slate'\nimport { RichTextTypography } from '../../../types/slate'\n\ntype ClearActiveTypographyStyleOptions = {\n at?: Range\n}\n\nexport function clearActiveTypographyStyle(\n editor: Editor,\n options?: ClearActiveTypographyStyleOptions,\n) {\n Editor.withoutNormalizing(editor, () => {\n const at = options?.at ?? editor.selection\n if (!at) return\n const atRef = Editor.rangeRef(editor, at)\n\n if (atRef.current) {\n Transforms.setNodes(\n editor,\n {\n slice: true,\n },\n {\n at: atRef.current,\n match: node => Text.isText(node),\n split: Range.isExpanded(atRef.current),\n },\n )\n }\n\n if (atRef.current) {\n const textNodes = Array.from(\n Editor.nodes(editor, {\n at: atRef.current,\n match: node => Text.isText(node) && node.slice === true,\n }),\n )\n\n for (const [node, path] of textNodes) {\n if (Text.isText(node)) {\n const typography: RichTextTypography = {\n ...node.typography,\n style: [],\n }\n\n Transforms.setNodes(\n editor,\n {\n typography,\n },\n { at: path },\n )\n }\n }\n }\n\n atRef.unref()\n })\n}\n","import { Editor, Transforms, Text, Range } from 'slate'\nimport { RichTextTypography } from '../../../types/slate'\n\ntype ClearDeviceActiveTypographyOptions = {\n at?: Range\n}\n\nexport function clearDeviceActiveTypography(\n editor: Editor,\n currentDeviceId: string,\n options?: ClearDeviceActiveTypographyOptions,\n) {\n Editor.withoutNormalizing(editor, () => {\n const at = options?.at ?? editor.selection\n if (!at) return\n const atRef = Editor.rangeRef(editor, at)\n\n if (atRef.current) {\n Transforms.setNodes(\n editor,\n {\n slice: true,\n },\n {\n at: atRef.current,\n match: node => Text.isText(node),\n split: Range.isExpanded(atRef.current),\n },\n )\n }\n\n if (atRef.current) {\n const textNodes = Array.from(\n Editor.nodes(editor, {\n at: atRef.current,\n match: node => Text.isText(node) && node.slice === true,\n }),\n )\n\n for (const [node, path] of textNodes) {\n if (Text.isText(node)) {\n const typography: RichTextTypography = {\n ...node.typography,\n style:\n node?.typography?.style.filter(({ deviceId }) => deviceId !== currentDeviceId) ?? [],\n }\n\n Transforms.setNodes(\n editor,\n {\n typography,\n },\n { at: path },\n )\n }\n }\n }\n\n atRef.unref()\n })\n}\n","import { Editor, Transforms, Text, Range } from 'slate'\nimport { RichTextTypography } from '../../../types/slate'\n\ntype SetActiveTypographyIdOptions = {\n at?: Range\n}\n\nexport function detachActiveTypography(\n editor: Editor,\n value: RichTextTypography['style'],\n options?: SetActiveTypographyIdOptions,\n) {\n Editor.withoutNormalizing(editor, () => {\n const at = options?.at ?? editor.selection\n if (!at) return\n const atRef = Editor.rangeRef(editor, at)\n\n if (atRef.current) {\n Transforms.setNodes(\n editor,\n {\n slice: true,\n },\n {\n at: atRef.current,\n match: node => Text.isText(node),\n split: Range.isExpanded(atRef.current),\n },\n )\n }\n\n if (atRef.current) {\n const textNodes = Array.from(\n Editor.nodes(editor, {\n at: atRef.current,\n match: node => Text.isText(node) && node.slice === true,\n }),\n )\n\n for (const [node, path] of textNodes) {\n if (Text.isText(node)) {\n Transforms.setNodes(\n editor,\n {\n typography: {\n style: value,\n },\n },\n { at: path },\n )\n }\n }\n }\n\n atRef.unref()\n })\n}\n","import { Editor, Transforms, Text, Range } from 'slate'\n\ntype SetActiveTypographyIdOptions = {\n at?: Range\n}\n\nexport function setActiveTypographyId(\n editor: Editor,\n id?: string,\n options?: SetActiveTypographyIdOptions,\n) {\n const at = options?.at ?? editor.selection\n if (!at) return\n Transforms.setNodes(\n editor,\n {\n typography: {\n id,\n style: [],\n },\n },\n {\n at,\n match: node => Text.isText(node),\n split: Range.isExpanded(at),\n },\n )\n}\n","import { Editor, Transforms, Text, Range } from 'slate'\nimport { Breakpoints, findBreakpointOverride, BreakpointId } from '../../state/modules/breakpoints'\nimport { RichTextTypography } from '../../../types/slate'\n\ntype SetActiveTypographyStyleOptions = {\n at?: Range\n}\n\nexport function setActiveTypographyStyle(\n editor: Editor,\n breakpoints: Breakpoints,\n deviceId: string,\n prop: string,\n value?: unknown,\n options?: SetActiveTypographyStyleOptions,\n) {\n Editor.withoutNormalizing(editor, () => {\n const at = options?.at ?? editor.selection\n if (!at) return\n const atRef = Editor.rangeRef(editor, at)\n\n if (atRef.current) {\n Transforms.setNodes(\n editor,\n {\n slice: true,\n },\n {\n at: atRef.current,\n match: node => Text.isText(node),\n split: Range.isExpanded(atRef.current),\n },\n )\n }\n\n if (atRef.current) {\n const textNodes = Array.from(\n Editor.nodes(editor, {\n at: atRef.current,\n match: node => Text.isText(node) && node.slice === true,\n }),\n )\n\n for (const [node, path] of textNodes) {\n if (Text.isText(node)) {\n const deviceOverrides = node?.typography?.style ?? []\n const deviceStyle = findBreakpointOverride(\n breakpoints,\n deviceOverrides,\n deviceId as BreakpointId,\n v => v,\n ) || {\n value: {},\n }\n const nextDeviceStyle = {\n deviceId,\n value: { ...deviceStyle.value, [prop]: value },\n }\n\n const nextTypography: RichTextTypography = {\n ...node.typography,\n style: [...deviceOverrides.filter(v => v.deviceId !== deviceId), nextDeviceStyle],\n }\n\n Transforms.setNodes(\n editor,\n {\n typography: nextTypography,\n },\n { at: path },\n )\n }\n }\n }\n\n atRef.unref()\n })\n}\n","import { Editor, Text, Transforms } from 'slate'\nimport { clearActiveTypographyStyle } from './clearActiveTypographyStyle'\nimport { clearDeviceActiveTypography } from './clearDeviceActiveTypography'\nimport { detachActiveTypography } from './detachActiveTypography'\nimport { setActiveTypographyId } from './setActiveTypographyId'\nimport { setActiveTypographyStyle } from './setActiveTypographyStyle'\n\nexport const Typography = {\n setActiveTypographyId,\n setActiveTypographyStyle,\n clearActiveTypographyStyle,\n clearDeviceActiveTypography,\n detachActiveTypography,\n}\n\nexport function withTypography(editor: Editor) {\n const { normalizeNode } = editor\n editor.normalizeNode = entry => {\n const [normalizationNode, normalizationPath] = entry\n if (\n Text.isText(normalizationNode) &&\n normalizationNode?.typography?.id == null &&\n normalizationNode?.typography?.style.length === 0\n ) {\n Transforms.unsetNodes(editor, 'typography', { at: normalizationPath })\n return\n }\n\n if (Text.isText(normalizationNode) && normalizationNode?.slice != null) {\n Transforms.unsetNodes(editor, 'slice', { at: normalizationPath })\n return\n }\n\n normalizeNode(entry)\n }\n\n return editor\n}\n","import { Editor, Range, Element, Text, Path } from 'slate'\n\n/**\n * The `Editor.unhangeRange` within Slate early exits if `Path.hasPrevious(end.path)` ie if this isn't a root block.\n * Unfortunately when you `setNode(..., {split:true})` or `wrapNodes()` you also have a hanging selection, but not in the root position.\n *\n * This c/p removes the `Path.hasPrevious(end.path)` from the early exit but it the same otherwise\n */\nfunction unhangRange(editor: Editor, range: Range): Range {\n // eslint-disable-next-line prefer-const\n let [start, end] = Range.edges(range)\n // PERF: exit early if we can guarantee that the range isn't hanging.\n if (start.offset !== 0 || end.offset !== 0 || Range.isCollapsed(range)) {\n return range\n }\n\n const endBlock = Editor.above(editor, {\n at: end,\n match: n => Element.isElement(n) && Editor.isBlock(editor, n),\n })\n const blockPath = endBlock ? endBlock[1] : []\n const first = Editor.start(editor, start)\n const before = { anchor: first, focus: end }\n let skip = true\n\n for (const [node, path] of Editor.nodes(editor, {\n at: before,\n match: Text.isText,\n reverse: true,\n })) {\n if (skip) {\n skip = false\n continue\n }\n\n if (node.text !== '' || Path.isBefore(path, blockPath)) {\n end = { path, offset: node.text.length }\n break\n }\n }\n\n return { anchor: start, focus: end }\n}\n\nexport default unhangRange\n","import { Editor, NodeEntry, Range, Text } from 'slate'\nimport { EditableBlockKey } from './BlockPlugin/types'\nimport { ElementUtils } from './utils/element'\n\nimport unhangRange from './utils/unhangRange'\nimport shallowEqual from '../utils/shallowEqual'\nimport { isNonNullable } from '../utils/isNonNullable'\n\nimport { Breakpoints, BreakpointId, findBreakpointOverride } from '../state/modules/breakpoints'\nimport deepEqual from '../utils/deepEqual'\nimport keys from '../utils/keys'\nimport {\n RootBlock,\n Inline,\n RootBlockType,\n ResponsiveBlockTextAlignment,\n BlockTextAlignment,\n RichTextTypography,\n} from '../../types/slate'\n\nexport function getSelection(editor: Editor): Range {\n if (editor.selection) return unhangRange(editor, editor.selection)\n return {\n anchor: Editor.start(editor, []),\n focus: Editor.end(editor, []),\n }\n}\n\nexport function getBlocksInSelection(editor: Editor): NodeEntry<RootBlock>[] {\n return Array.from(\n Editor.nodes(editor, {\n at: getSelection(editor),\n match: node => ElementUtils.isRootBlock(node),\n }),\n ).filter((entry): entry is NodeEntry<RootBlock> => ElementUtils.isRootBlock(entry[0]))\n}\n\nexport function getInlinesInSelection(editor: Editor): NodeEntry<Inline>[] {\n return Array.from(\n Editor.nodes(editor, {\n at: getSelection(editor),\n match: node => ElementUtils.isInline(node),\n }),\n ).filter((entry): entry is NodeEntry<Inline> => ElementUtils.isInline(entry[0]))\n}\n\nexport function getActiveBlockType(editor: Editor): RootBlockType | null {\n const rootBlocks = getBlocksInSelection(editor).map(([node]) => node.type)\n\n return rootBlocks.reduce<RootBlockType | null>(\n (a, b) => (a === b ? b : null),\n rootBlocks.at(0) ?? null,\n )\n}\n\nexport function getActiveBlockValue(editor: Editor, key: EditableBlockKey) {\n const blocks = getBlocksInSelection(editor)\n\n const active = blocks.map(\n ([block]) => block[key] ?? null,\n ) as (ResponsiveBlockTextAlignment | null)[]\n\n return active.length === 0 ? null : active.reduce((a, b) => (shallowEqual(a, b) ? b : null))\n}\n\nexport function getActiveBlockDeviceOverrideValue(\n editor: Editor,\n key: EditableBlockKey,\n breakpoints: Breakpoints,\n deviceId: BreakpointId,\n) {\n const active: (BlockTextAlignment | null)[] = []\n const blocks = getBlocksInSelection(editor)\n\n blocks.forEach(([block]) => {\n const deviceOverride =\n findBreakpointOverride<BlockTextAlignment>(breakpoints, block[key], deviceId) || null\n active.push(deviceOverride?.value ?? null)\n })\n\n return active.length === 0 ? null : active.reduce((a, b) => (shallowEqual(a, b) ? b : null))\n}\n\n// Typography\n\nconst concat = (a: unknown[], b: unknown[]) => a.concat(b)\n\n// TODO: This is more cruft from trying to remove null from the typography type. This optimization is not worth it.\n/**\n * This is a c/p of the intersection of the utils from the root utils folder.\n * The only change is defaulting to undefined instead of to null.\n */\nexport default function intersection<A extends Record<string, unknown>, B extends A>(\n a: A,\n b: B,\n isEqual: (a: unknown, b: unknown) => boolean = deepEqual,\n): { [K in keyof A]: A[K] | undefined } {\n const allKeys = [...new Set([...keys(a), ...keys(b)])] as (keyof A)[]\n\n return allKeys.reduce((acc, k) => {\n if (isEqual(a[k], b[k])) acc[k] = a[k]\n else acc[k] = undefined\n\n return acc\n }, {} as { [K in keyof A]: A[K] | undefined })\n}\n\nconst fuseTypographyMarks = (\n values: Array<RichTextTypography | null | undefined>,\n breakpoints: Breakpoints,\n): RichTextTypography => {\n const devices = [\n ...new Set(\n values\n .filter(isNonNullable)\n .map(({ style }) => style.map(({ deviceId }) => deviceId))\n .reduce(concat, []),\n ),\n ] as BreakpointId[]\n\n return {\n id: values.map(v => v && v.id).reduce((a, b) => (a === b ? a : undefined)) ?? undefined,\n style: devices.map(deviceId =>\n values\n .map(\n v =>\n (v && findBreakpointOverride(breakpoints, v.style, deviceId)) || {\n deviceId,\n value: {},\n },\n )\n .reduce((acc, { value }) => {\n const a = intersection(acc.value, value)\n return {\n deviceId,\n value: a,\n }\n }),\n ),\n }\n}\n\nexport function getActiveTypographyMark(\n editor: Editor,\n breakpoints: Breakpoints,\n): RichTextTypography {\n const active: RichTextTypography[] = []\n\n const textNodes = Editor.nodes(editor, {\n at: getSelection(editor),\n match: node => Text.isText(node),\n })\n\n for (const [node] of textNodes) {\n if (Text.isText(node) && 'typography' in node && node.typography != undefined) {\n active.push(node.typography)\n }\n }\n return active.length === 0 ? { style: [] } : fuseTypographyMarks(active, breakpoints)\n}\n","import { Editor, Transforms, Location } from 'slate'\nimport { getBlocksInSelection } from '../selectors'\nimport { ElementUtils } from '../utils/element'\nimport { EditableBlockKey, EditableBlockValue } from './types'\nimport { Breakpoints, BreakpointId, findBreakpointOverride } from '../../state/modules/breakpoints'\n\ntype SetBlockKeyForDeviceOptions = {\n at?: Location\n}\n\nexport function setBlockKeyForDevice(\n editor: Editor,\n breakpoints: Breakpoints,\n deviceId: BreakpointId,\n key: EditableBlockKey,\n value: EditableBlockValue[number]['value'],\n options?: SetBlockKeyForDeviceOptions,\n) {\n const at = options?.at ?? editor.selection\n if (!at) return\n\n const rootElements = getBlocksInSelection(editor)\n\n for (const [node, path] of rootElements) {\n if (ElementUtils.isBlock(node)) {\n const deviceValues = node[key] ?? []\n const currentDeviceValue = findBreakpointOverride(breakpoints, deviceValues, deviceId, v => v)\n const nextDeviceValue = {\n ...currentDeviceValue,\n deviceId,\n value,\n }\n Transforms.setNodes(\n editor,\n {\n [key]: [...deviceValues.filter(v => v.deviceId !== deviceId), nextDeviceValue],\n },\n { at: path },\n )\n }\n }\n}\n","import { Editor, Transforms } from 'slate'\nimport { ElementUtils } from '../utils/element'\nimport { EditableBlockKey } from './types'\nimport { getBlocksInSelection } from '../selectors'\nimport { BreakpointId } from '../../state/modules/breakpoints'\n\nexport function clearBlockKeyForDevice(\n editor: Editor,\n deviceId: BreakpointId,\n key: EditableBlockKey,\n) {\n const rootElements = getBlocksInSelection(editor)\n\n for (const [node, path] of rootElements) {\n if (ElementUtils.isBlock(node)) {\n const deviceOverrides = node[key] ?? []\n Transforms.setNodes(\n editor,\n {\n [key]: deviceOverrides.filter(v => v.deviceId !== deviceId),\n },\n { at: path },\n )\n }\n }\n}\n","import { Editor, Transforms } from 'slate'\nimport { getSelection } from '../selectors'\nimport { Inline } from '../../../types/slate'\n\nexport function wrapInline(editor: Editor, inline: Inline) {\n Transforms.wrapNodes(editor, inline, {\n at: getSelection(editor),\n split: true,\n })\n}\n","import { Editor, Transforms } from 'slate'\nimport { ElementUtils } from '../utils/element'\nimport { getSelection } from '../selectors'\nimport { InlineType } from '../../../types/slate'\n\nexport function unwrapInline(editor: Editor, type: InlineType) {\n Transforms.unwrapNodes(editor, {\n match: node => ElementUtils.isInline(node) && node.type === type,\n at: getSelection(editor),\n })\n}\n","import { Editor, Transforms } from 'slate'\nimport { setBlockKeyForDevice } from './setBlockKeyForDevice'\nimport { clearBlockKeyForDevice } from './clearBlockKeyForDevice'\nimport { wrapInline } from './wrapInline'\nimport { unwrapInline } from './unwrapInline'\nimport { ElementUtils } from '../utils/element'\n\nexport const Block = {\n setBlockKeyForDevice,\n clearBlockKeyForDevice,\n wrapInline,\n unwrapInline,\n}\n\nexport function withBlock(editor: Editor) {\n const { normalizeNode } = editor\n\n editor.isInline = entry => {\n return ElementUtils.isInline(entry)\n }\n\n editor.normalizeNode = entry => {\n const [normalizationNode, normalizationPath] = entry\n // Normalization textAlign with empty array of values\n if (ElementUtils.isBlock(normalizationNode) && normalizationNode?.textAlign?.length == 0) {\n Transforms.unsetNodes(editor, 'textAlign', { at: normalizationPath })\n return\n }\n\n normalizeNode(entry)\n }\n\n return editor\n}\n","import { BaseEditor, Editor, Transforms } from 'slate'\nimport { ReactEditor } from 'slate-react'\n\nexport interface BuilderEditor extends BaseEditor {\n focusAndSelectAll: () => void\n deselectAndBlur: () => void\n}\n\nexport function withBuilder(editor: Editor) {\n editor.deselectAndBlur = function () {\n ReactEditor.deselect(editor)\n ReactEditor.blur(editor)\n }\n\n editor.focusAndSelectAll = function () {\n ReactEditor.focus(editor)\n Transforms.select(editor, {\n anchor: Editor.start(editor, []),\n focus: Editor.end(editor, []),\n })\n }\n\n return editor\n}\n"],"names":["Editor","ElementUtils","Path","Range","Point","Node","Transforms","BlockType","Element","isHotkey","Text","findBreakpointOverride","ReactEditor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,MAAM,2BAA2B;AACjC,MAAM,0BAA0B;ACIhC,MAAM,cAAc;AAAA,EACzB,qBAAqB,QAAgB,MAA2C;AAC1E,QAAA;AACI,YAAA,aAAaA,MAAAA,OAAO,MAAM,QAAQ;AAAA,QACtC,IAAI;AAAA,QACJ,OAAO,CAAC,SAA8BC,qBAAa,OAAO,IAAI;AAAA,MAAA,CAC/D;AACD,aAAO,kCAAc;AAAA,aACd;AACA,aAAA;AAAA,IACT;AAAA,EACF;AAAA,EACA,yBAAyB,QAAgB,MAA+C;AAClF,QAAA;AACI,YAAA,iBAAiBD,MAAAA,OAAO,MAAM,QAAQ;AAAA,QAC1C,IAAI;AAAA,QACJ,OAAO,CAAC,SAAkCC,qBAAa,WAAW,IAAI;AAAA,MAAA,CACvE;AAED,aAAO,0CAAkB;AAAA,aAClB;AACA,aAAA;AAAA,IACT;AAAA,EACF;AACF;AC1BO,+BAA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src/slate/TypographyPlugin/clearDeviceActiveTypography.ts","../src/slate/TypographyPlugin/detachActiveTypography.ts","../src/slate/TypographyPlugin/setActiveTypographyId.ts","../src/slate/TypographyPlugin/setActiveTypographyStyle.ts","../src/slate/TypographyPlugin/index.ts"],"sourcesContent":["import { Editor, Transforms, Text, Range } from 'slate'\nimport { RichTextTypography } from '../types'\n\ntype ClearActiveTypographyStyleOptions = {\n at?: Range\n}\n\nexport function clearActiveTypographyStyle(\n editor: Editor,\n options?: ClearActiveTypographyStyleOptions,\n) {\n Editor.withoutNormalizing(editor, () => {\n const at = options?.at ?? editor.selection\n if (!at) return\n const atRef = Editor.rangeRef(editor, at)\n\n if (atRef.current) {\n Transforms.setNodes(\n editor,\n {\n slice: true,\n },\n {\n at: atRef.current,\n match: node => Text.isText(node),\n split: Range.isExpanded(atRef.current),\n },\n )\n }\n\n if (atRef.current) {\n const textNodes = Array.from(\n Editor.nodes(editor, {\n at: atRef.current,\n match: node => Text.isText(node) && node.slice === true,\n }),\n )\n\n for (const [node, path] of textNodes) {\n if (Text.isText(node)) {\n const typography: RichTextTypography = {\n ...node.typography,\n style: [],\n }\n\n Transforms.setNodes(\n editor,\n {\n typography,\n },\n { at: path },\n )\n }\n }\n }\n\n atRef.unref()\n })\n}\n","import { Editor, Transforms, Text, Range } from 'slate'\nimport { RichTextTypography } from '../types'\n\ntype ClearDeviceActiveTypographyOptions = {\n at?: Range\n}\n\nexport function clearDeviceActiveTypography(\n editor: Editor,\n currentDeviceId: string,\n options?: ClearDeviceActiveTypographyOptions,\n) {\n Editor.withoutNormalizing(editor, () => {\n const at = options?.at ?? editor.selection\n if (!at) return\n const atRef = Editor.rangeRef(editor, at)\n\n if (atRef.current) {\n Transforms.setNodes(\n editor,\n {\n slice: true,\n },\n {\n at: atRef.current,\n match: node => Text.isText(node),\n split: Range.isExpanded(atRef.current),\n },\n )\n }\n\n if (atRef.current) {\n const textNodes = Array.from(\n Editor.nodes(editor, {\n at: atRef.current,\n match: node => Text.isText(node) && node.slice === true,\n }),\n )\n\n for (const [node, path] of textNodes) {\n if (Text.isText(node)) {\n const typography: RichTextTypography = {\n ...node.typography,\n style:\n node?.typography?.style.filter(({ deviceId }) => deviceId !== currentDeviceId) ?? [],\n }\n\n Transforms.setNodes(\n editor,\n {\n typography,\n },\n { at: path },\n )\n }\n }\n }\n\n atRef.unref()\n })\n}\n","import { Editor, Transforms, Text, Range } from 'slate'\nimport { RichTextTypography } from '../types'\n\ntype SetActiveTypographyIdOptions = {\n at?: Range\n}\n\nexport function detachActiveTypography(\n editor: Editor,\n value: RichTextTypography['style'],\n options?: SetActiveTypographyIdOptions,\n) {\n Editor.withoutNormalizing(editor, () => {\n const at = options?.at ?? editor.selection\n if (!at) return\n const atRef = Editor.rangeRef(editor, at)\n\n if (atRef.current) {\n Transforms.setNodes(\n editor,\n {\n slice: true,\n },\n {\n at: atRef.current,\n match: node => Text.isText(node),\n split: Range.isExpanded(atRef.current),\n },\n )\n }\n\n if (atRef.current) {\n const textNodes = Array.from(\n Editor.nodes(editor, {\n at: atRef.current,\n match: node => Text.isText(node) && node.slice === true,\n }),\n )\n\n for (const [node, path] of textNodes) {\n if (Text.isText(node)) {\n Transforms.setNodes(\n editor,\n {\n typography: {\n style: value,\n },\n },\n { at: path },\n )\n }\n }\n }\n\n atRef.unref()\n })\n}\n","import { Editor, Transforms, Text, Range } from 'slate'\n\ntype SetActiveTypographyIdOptions = {\n at?: Range\n}\n\nexport function setActiveTypographyId(\n editor: Editor,\n id?: string,\n options?: SetActiveTypographyIdOptions,\n) {\n const at = options?.at ?? editor.selection\n if (!at) return\n Transforms.setNodes(\n editor,\n {\n typography: {\n id,\n style: [],\n },\n },\n {\n at,\n match: node => Text.isText(node),\n split: Range.isExpanded(at),\n },\n )\n}\n","import { Editor, Transforms, Text, Range } from 'slate'\nimport { Breakpoints, findBreakpointOverride, BreakpointId } from '../../state/modules/breakpoints'\nimport { RichTextTypography } from '../types'\n\ntype SetActiveTypographyStyleOptions = {\n at?: Range\n}\n\nexport function setActiveTypographyStyle(\n editor: Editor,\n breakpoints: Breakpoints,\n deviceId: string,\n prop: string,\n value?: unknown,\n options?: SetActiveTypographyStyleOptions,\n) {\n Editor.withoutNormalizing(editor, () => {\n const at = options?.at ?? editor.selection\n if (!at) return\n const atRef = Editor.rangeRef(editor, at)\n\n if (atRef.current) {\n Transforms.setNodes(\n editor,\n {\n slice: true,\n },\n {\n at: atRef.current,\n match: node => Text.isText(node),\n split: Range.isExpanded(atRef.current),\n },\n )\n }\n\n if (atRef.current) {\n const textNodes = Array.from(\n Editor.nodes(editor, {\n at: atRef.current,\n match: node => Text.isText(node) && node.slice === true,\n }),\n )\n\n for (const [node, path] of textNodes) {\n if (Text.isText(node)) {\n const deviceOverrides = node?.typography?.style ?? []\n const deviceStyle = findBreakpointOverride(\n breakpoints,\n deviceOverrides,\n deviceId as BreakpointId,\n v => v,\n ) || {\n value: {},\n }\n const nextDeviceStyle = {\n deviceId,\n value: { ...deviceStyle.value, [prop]: value },\n }\n\n const nextTypography: RichTextTypography = {\n ...node.typography,\n style: [...deviceOverrides.filter(v => v.deviceId !== deviceId), nextDeviceStyle],\n }\n\n Transforms.setNodes(\n editor,\n {\n typography: nextTypography,\n },\n { at: path },\n )\n }\n }\n }\n\n atRef.unref()\n })\n}\n","import { Editor, Text, Transforms } from 'slate'\nimport { clearActiveTypographyStyle } from './clearActiveTypographyStyle'\nimport { clearDeviceActiveTypography } from './clearDeviceActiveTypography'\nimport { detachActiveTypography } from './detachActiveTypography'\nimport { setActiveTypographyId } from './setActiveTypographyId'\nimport { setActiveTypographyStyle } from './setActiveTypographyStyle'\n\nexport const TypographyActions = {\n setActiveTypographyId,\n setActiveTypographyStyle,\n clearActiveTypographyStyle,\n clearDeviceActiveTypography,\n detachActiveTypography,\n}\n\nexport function withTypography(editor: Editor) {\n const { normalizeNode } = editor\n editor.normalizeNode = entry => {\n const [normalizationNode, normalizationPath] = entry\n if (\n Text.isText(normalizationNode) &&\n normalizationNode?.typography?.id == null &&\n normalizationNode?.typography?.style.length === 0\n ) {\n Transforms.unsetNodes(editor, 'typography', { at: normalizationPath })\n return\n }\n\n if (Text.isText(normalizationNode) && normalizationNode?.slice != null) {\n Transforms.unsetNodes(editor, 'slice', { at: normalizationPath })\n return\n }\n\n normalizeNode(entry)\n }\n\n return editor\n}\n"],"names":["Editor","Transforms","Text","Range","findBreakpointOverride"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAOO,oCACL,QACA,SACA;AACOA,eAAA,mBAAmB,QAAQ,MAAM;;AAChC,UAAA,KAAK,yCAAS,OAAT,YAAe,OAAO;AACjC,QAAI,CAAC;AAAI;AACT,UAAM,QAAQA,MAAA,OAAO,SAAS,QAAQ,EAAE;AAExC,QAAI,MAAM,SAAS;AACjBC,YAAA,WAAW,SACT,QACA;AAAA,QACE,OAAO;AAAA,MAAA,GAET;AAAA,QACE,IAAI,MAAM;AAAA,QACV,OAAO,CAAA,SAAQC,WAAK,OAAO,IAAI;AAAA,QAC/B,OAAOC,MAAA,MAAM,WAAW,MAAM,OAAO;AAAA,MAAA,CAEzC;AAAA,IACF;AAEA,QAAI,MAAM,SAAS;AACjB,YAAM,YAAY,MAAM,KACtBH,MAAAA,OAAO,MAAM,QAAQ;AAAA,QACnB,IAAI,MAAM;AAAA,QACV,OAAO,CAAQ,SAAAE,WAAK,OAAO,IAAI,KAAK,KAAK,UAAU;AAAA,MACpD,CAAA,CACH;AAEW,iBAAA,CAAC,MAAM,SAAS,WAAW;AAChC,YAAAA,MAAA,KAAK,OAAO,IAAI,GAAG;AACrB,gBAAM,aAAiC,iCAClC,KAAK,aAD6B;AAAA,YAErC,OAAO,CAAC;AAAA,UAAA;AAGVD,gBAAA,WAAW,SACT,QACA;AAAA,YACE;AAAA,UAAA,GAEF,EAAE,IAAI,KAAA,CACR;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAEA,UAAM,MAAM;AAAA,EAAA,CACb;AACH;AClDE,qCAAA,QACA,iBACA,SACA;A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