@makeswift/runtime 0.7.7 → 0.7.8

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 (263) hide show
  1. package/dist/Box.cjs.js +2 -0
  2. package/dist/Box.cjs.js.map +1 -1
  3. package/dist/Box.es.js +2 -0
  4. package/dist/Box.es.js.map +1 -1
  5. package/dist/Button.cjs.js +2 -0
  6. package/dist/Button.cjs.js.map +1 -1
  7. package/dist/Button.es.js +2 -0
  8. package/dist/Button.es.js.map +1 -1
  9. package/dist/Carousel.cjs.js +2 -0
  10. package/dist/Carousel.cjs.js.map +1 -1
  11. package/dist/Carousel.es.js +2 -0
  12. package/dist/Carousel.es.js.map +1 -1
  13. package/dist/Countdown.cjs.js +2 -0
  14. package/dist/Countdown.cjs.js.map +1 -1
  15. package/dist/Countdown.es.js +2 -0
  16. package/dist/Countdown.es.js.map +1 -1
  17. package/dist/Divider.cjs.js +2 -0
  18. package/dist/Divider.cjs.js.map +1 -1
  19. package/dist/Divider.es.js +2 -0
  20. package/dist/Divider.es.js.map +1 -1
  21. package/dist/Embed.cjs.js +2 -0
  22. package/dist/Embed.cjs.js.map +1 -1
  23. package/dist/Embed.es.js +2 -0
  24. package/dist/Embed.es.js.map +1 -1
  25. package/dist/Form.cjs.js +3 -1
  26. package/dist/Form.cjs.js.map +1 -1
  27. package/dist/Form.es.js +3 -1
  28. package/dist/Form.es.js.map +1 -1
  29. package/dist/Image.cjs.js +2 -0
  30. package/dist/Image.cjs.js.map +1 -1
  31. package/dist/Image.es.js +2 -0
  32. package/dist/Image.es.js.map +1 -1
  33. package/dist/LiveProvider.cjs.js +2 -0
  34. package/dist/LiveProvider.cjs.js.map +1 -1
  35. package/dist/LiveProvider.es.js +3 -1
  36. package/dist/LiveProvider.es.js.map +1 -1
  37. package/dist/Navigation.cjs.js +2 -0
  38. package/dist/Navigation.cjs.js.map +1 -1
  39. package/dist/Navigation.es.js +2 -0
  40. package/dist/Navigation.es.js.map +1 -1
  41. package/dist/PreviewProvider.cjs.js +29 -0
  42. package/dist/PreviewProvider.cjs.js.map +1 -1
  43. package/dist/PreviewProvider.es.js +33 -3
  44. package/dist/PreviewProvider.es.js.map +1 -1
  45. package/dist/ReadOnlyText.cjs.js +185 -153
  46. package/dist/ReadOnlyText.cjs.js.map +1 -1
  47. package/dist/ReadOnlyText.es.js +182 -153
  48. package/dist/ReadOnlyText.es.js.map +1 -1
  49. package/dist/Root.cjs.js +2 -0
  50. package/dist/Root.cjs.js.map +1 -1
  51. package/dist/Root.es.js +2 -0
  52. package/dist/Root.es.js.map +1 -1
  53. package/dist/SocialLinks.cjs.js +2 -0
  54. package/dist/SocialLinks.cjs.js.map +1 -1
  55. package/dist/SocialLinks.es.js +2 -0
  56. package/dist/SocialLinks.es.js.map +1 -1
  57. package/dist/Text.cjs.js +3 -1
  58. package/dist/Text.cjs.js.map +1 -1
  59. package/dist/Text.es.js +3 -1
  60. package/dist/Text.es.js.map +1 -1
  61. package/dist/Video.cjs.js +2 -0
  62. package/dist/Video.cjs.js.map +1 -1
  63. package/dist/Video.es.js +2 -0
  64. package/dist/Video.es.js.map +1 -1
  65. package/dist/actions.cjs.js +1 -0
  66. package/dist/actions.cjs.js.map +1 -1
  67. package/dist/actions.es.js +1 -1
  68. package/dist/builder.cjs.js +2 -0
  69. package/dist/builder.cjs.js.map +1 -1
  70. package/dist/builder.es.js +2 -0
  71. package/dist/builder.es.js.map +1 -1
  72. package/dist/compare.cjs.js +126 -0
  73. package/dist/compare.cjs.js.map +1 -0
  74. package/dist/compare.es.js +124 -0
  75. package/dist/compare.es.js.map +1 -0
  76. package/dist/components.cjs.js +2 -0
  77. package/dist/components.cjs.js.map +1 -1
  78. package/dist/components.es.js +2 -0
  79. package/dist/components.es.js.map +1 -1
  80. package/dist/constants.cjs.js +2 -0
  81. package/dist/constants.cjs.js.map +1 -1
  82. package/dist/constants.es.js +2 -0
  83. package/dist/constants.es.js.map +1 -1
  84. package/dist/control-serialization.cjs.js +29 -0
  85. package/dist/control-serialization.cjs.js.map +1 -1
  86. package/dist/control-serialization.es.js +30 -0
  87. package/dist/control-serialization.es.js.map +1 -1
  88. package/dist/controls.cjs.js +13 -0
  89. package/dist/controls.cjs.js.map +1 -1
  90. package/dist/controls.es.js +4 -1
  91. package/dist/controls.es.js.map +1 -1
  92. package/dist/index.cjs.js +6 -4
  93. package/dist/index.cjs.js.map +1 -1
  94. package/dist/index.cjs2.js +2 -0
  95. package/dist/index.cjs2.js.map +1 -1
  96. package/dist/index.cjs5.js +2 -0
  97. package/dist/index.cjs5.js.map +1 -1
  98. package/dist/index.cjs6.js +663 -96
  99. package/dist/index.cjs6.js.map +1 -1
  100. package/dist/index.es.js +6 -4
  101. package/dist/index.es.js.map +1 -1
  102. package/dist/index.es2.js +2 -0
  103. package/dist/index.es2.js.map +1 -1
  104. package/dist/index.es5.js +2 -0
  105. package/dist/index.es5.js.map +1 -1
  106. package/dist/index.es6.js +657 -95
  107. package/dist/index.es6.js.map +1 -1
  108. package/dist/main.cjs.js +2 -0
  109. package/dist/main.cjs.js.map +1 -1
  110. package/dist/main.es.js +2 -0
  111. package/dist/main.es.js.map +1 -1
  112. package/dist/next.cjs.js +2 -0
  113. package/dist/next.cjs.js.map +1 -1
  114. package/dist/next.es.js +2 -0
  115. package/dist/next.es.js.map +1 -1
  116. package/dist/prop-controllers.cjs.js +2 -0
  117. package/dist/prop-controllers.cjs.js.map +1 -1
  118. package/dist/prop-controllers.es.js +2 -0
  119. package/dist/prop-controllers.es.js.map +1 -1
  120. package/dist/react.cjs.js +2 -0
  121. package/dist/react.cjs.js.map +1 -1
  122. package/dist/react.es.js +2 -0
  123. package/dist/react.es.js.map +1 -1
  124. package/dist/rich-text.cjs.js +894 -22
  125. package/dist/rich-text.cjs.js.map +1 -1
  126. package/dist/rich-text.es.js +888 -23
  127. package/dist/rich-text.es.js.map +1 -1
  128. package/dist/types/src/components/builtin/Button/Button.d.ts +1 -1
  129. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +1 -1
  130. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/ListPlugin.d.ts +13 -0
  131. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/ListPlugin.d.ts.map +1 -0
  132. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/constants.d.ts +3 -0
  133. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/constants.d.ts.map +1 -0
  134. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/index.d.ts +2 -0
  135. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/index.d.ts.map +1 -0
  136. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/dedent.d.ts +3 -0
  137. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/dedent.d.ts.map +1 -0
  138. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/indent.d.ts +4 -0
  139. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/indent.d.ts.map +1 -0
  140. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/index.d.ts +6 -0
  141. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/index.d.ts.map +1 -0
  142. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/toggleList.d.ts +8 -0
  143. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/toggleList.d.ts.map +1 -0
  144. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/unwrapList.d.ts +4 -0
  145. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/unwrapList.d.ts.map +1 -0
  146. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/utils/editor.d.ts +7 -0
  147. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/utils/editor.d.ts.map +1 -0
  148. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/utils/element.d.ts +26 -0
  149. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/utils/element.d.ts.map +1 -0
  150. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/utils/filterForSubtreeRoots.d.ts +3 -0
  151. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/utils/filterForSubtreeRoots.d.ts.map +1 -0
  152. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/utils/getSelectedListItems.d.ts +5 -0
  153. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/utils/getSelectedListItems.d.ts.map +1 -0
  154. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/utils/location.d.ts +5 -0
  155. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/utils/location.d.ts.map +1 -0
  156. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/wrapList.d.ts +8 -0
  157. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/lib/wrapList.d.ts.map +1 -0
  158. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/dedent.test.d.ts +3 -0
  159. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/dedent.test.d.ts.map +1 -0
  160. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/indent.test.d.ts +3 -0
  161. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/indent.test.d.ts.map +1 -0
  162. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/normalization.test.d.ts +3 -0
  163. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/normalization.test.d.ts.map +1 -0
  164. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/slate-test-helper.d.ts +48 -0
  165. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/slate-test-helper.d.ts.map +1 -0
  166. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/toggleList.test.d.ts +3 -0
  167. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/toggleList.test.d.ts.map +1 -0
  168. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/types.d.ts +21 -0
  169. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/types.d.ts.map +1 -0
  170. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/unwrapList.test.d.ts +3 -0
  171. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/unwrapList.test.d.ts.map +1 -0
  172. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/utils/filterForSubtreeRoots.test.d.ts +2 -0
  173. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/utils/filterForSubtreeRoots.test.d.ts.map +1 -0
  174. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/utils/getSelectedListItems.test.d.ts +3 -0
  175. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/utils/getSelectedListItems.test.d.ts.map +1 -0
  176. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/wrapList.test.d.ts +3 -0
  177. package/dist/types/src/components/builtin/Text/EditableText/ListPlugin/test/wrapList.test.d.ts.map +1 -0
  178. package/dist/types/src/components/builtin/Text/EditableText/editable-text.d.ts +13 -0
  179. package/dist/types/src/components/builtin/Text/EditableText/editable-text.d.ts.map +1 -0
  180. package/dist/types/src/components/builtin/Text/EditableText/index.d.ts +4 -0
  181. package/dist/types/src/components/builtin/Text/EditableText/index.d.ts.map +1 -0
  182. package/dist/types/src/components/builtin/Text/EditableText/useSyncWithBuilder.d.ts +8 -0
  183. package/dist/types/src/components/builtin/Text/EditableText/useSyncWithBuilder.d.ts.map +1 -0
  184. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts +16 -0
  185. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +1 -1
  186. package/dist/types/src/components/builtin/Text/Text.d.ts +1 -1
  187. package/dist/types/src/components/builtin/Text/Text.d.ts.map +1 -1
  188. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts +8 -0
  189. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts.map +1 -0
  190. package/dist/types/src/components/builtin/Text/components/Element/element.d.ts +4 -0
  191. package/dist/types/src/components/builtin/Text/components/Element/element.d.ts.map +1 -0
  192. package/dist/types/src/components/builtin/Text/components/Element/index.d.ts +2 -0
  193. package/dist/types/src/components/builtin/Text/components/Element/index.d.ts.map +1 -0
  194. package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts +8 -0
  195. package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts.map +1 -0
  196. package/dist/types/src/components/builtin/Text/components/Leaf/index.d.ts +3 -0
  197. package/dist/types/src/components/builtin/Text/components/Leaf/index.d.ts.map +1 -0
  198. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts +4 -0
  199. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +1 -0
  200. package/dist/types/src/components/builtin/Text/components/Leaf/typography.d.ts +27 -0
  201. package/dist/types/src/components/builtin/Text/components/Leaf/typography.d.ts.map +1 -0
  202. package/dist/types/src/components/builtin/Text/components/index.d.ts +3 -0
  203. package/dist/types/src/components/builtin/Text/components/index.d.ts.map +1 -0
  204. package/dist/types/src/components/utils/types.d.ts +1 -1
  205. package/dist/types/src/components/utils/types.d.ts.map +1 -1
  206. package/dist/types/src/controls/rich-text/compare.d.ts +5 -0
  207. package/dist/types/src/controls/rich-text/compare.d.ts.map +1 -0
  208. package/dist/types/src/controls/rich-text/compare.test.d.ts +2 -0
  209. package/dist/types/src/controls/rich-text/compare.test.d.ts.map +1 -0
  210. package/dist/types/src/controls/rich-text/dto-types.d.ts +131 -0
  211. package/dist/types/src/controls/rich-text/dto-types.d.ts.map +1 -0
  212. package/dist/types/src/controls/rich-text/fixtures/blockquote.d.ts +3 -0
  213. package/dist/types/src/controls/rich-text/fixtures/blockquote.d.ts.map +1 -0
  214. package/dist/types/src/controls/rich-text/fixtures/index.d.ts +4 -0
  215. package/dist/types/src/controls/rich-text/fixtures/index.d.ts.map +1 -0
  216. package/dist/types/src/controls/rich-text/fixtures/list.d.ts +3 -0
  217. package/dist/types/src/controls/rich-text/fixtures/list.d.ts.map +1 -0
  218. package/dist/types/src/controls/rich-text/fixtures/typography.d.ts +3 -0
  219. package/dist/types/src/controls/rich-text/fixtures/typography.d.ts.map +1 -0
  220. package/dist/types/src/controls/rich-text/index.d.ts +6 -0
  221. package/dist/types/src/controls/rich-text/index.d.ts.map +1 -0
  222. package/dist/types/src/controls/{rich-text.d.ts → rich-text/rich-text.d.ts} +8 -10
  223. package/dist/types/src/controls/rich-text/rich-text.d.ts.map +1 -0
  224. package/dist/types/src/controls/rich-text/translation.d.ts +8 -0
  225. package/dist/types/src/controls/rich-text/translation.d.ts.map +1 -0
  226. package/dist/types/src/controls/rich-text/translation.test.d.ts +2 -0
  227. package/dist/types/src/controls/rich-text/translation.test.d.ts.map +1 -0
  228. package/dist/types/src/controls/rich-text/types.d.ts +134 -0
  229. package/dist/types/src/controls/rich-text/types.d.ts.map +1 -0
  230. package/dist/types/src/prop-controllers/descriptors.d.ts +2 -3
  231. package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
  232. package/dist/types/src/prop-controllers/instances.d.ts +4 -7
  233. package/dist/types/src/prop-controllers/instances.d.ts.map +1 -1
  234. package/dist/types/src/prop-controllers/introspection.d.ts.map +1 -1
  235. package/dist/types/src/runtimes/react/element-imperative-handle.d.ts.map +1 -1
  236. package/dist/typography.cjs.js +146 -0
  237. package/dist/typography.cjs.js.map +1 -0
  238. package/dist/typography.es.js +143 -0
  239. package/dist/typography.es.js.map +1 -0
  240. package/package.json +7 -10
  241. package/dist/EditableText.cjs.js +0 -380
  242. package/dist/EditableText.cjs.js.map +0 -1
  243. package/dist/EditableText.es.js +0 -373
  244. package/dist/EditableText.es.js.map +0 -1
  245. package/dist/types/src/components/builtin/Text/EditableText.d.ts +0 -16
  246. package/dist/types/src/components/builtin/Text/EditableText.d.ts.map +0 -1
  247. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Block/index.d.ts +0 -10
  248. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Block/index.d.ts.map +0 -1
  249. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Mark/hooks/useTypographyMark.d.ts +0 -25
  250. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Mark/hooks/useTypographyMark.d.ts.map +0 -1
  251. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Mark/index.d.ts +0 -10
  252. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Mark/index.d.ts.map +0 -1
  253. package/dist/types/src/components/builtin/Text/components/RichTextEditor/index.d.ts +0 -5
  254. package/dist/types/src/components/builtin/Text/components/RichTextEditor/index.d.ts.map +0 -1
  255. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/DeviceOverridesBlocks.d.ts +0 -3
  256. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/DeviceOverridesBlocks.d.ts.map +0 -1
  257. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/DeviceOverridesMarks.d.ts +0 -3
  258. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/DeviceOverridesMarks.d.ts.map +0 -1
  259. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/Inlines.d.ts +0 -3
  260. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/Inlines.d.ts.map +0 -1
  261. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/Link.d.ts +0 -3
  262. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/Link.d.ts.map +0 -1
  263. package/dist/types/src/controls/rich-text.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs6.js","sources":["../src/components/builtin/Text/components/RichTextEditor/components/Mark/hooks/useTypographyMark.ts","../src/components/builtin/Text/components/RichTextEditor/components/Mark/index.tsx","../src/components/builtin/Text/components/RichTextEditor/components/Block/index.tsx"],"sourcesContent":["import { Length as LengthValue } from '../../../../../../../../prop-controllers'\nimport { ColorValue as Color } from '../../../../../../../utils/types'\nimport { findDeviceOverride } from '../../../../../../../utils/devices'\nimport type { DeviceOverride } from '../../../../../../../../prop-controllers'\nimport {\n useSwatches,\n useTypography,\n} from '../../../../../../../../runtimes/react/hooks/makeswift-api'\nimport { Swatch, Typography } from '../../../../../../../../api'\nimport { getTypographyStyleSwatchIds } from '../../../../../../../../prop-controllers/introspection'\nimport { isNonNullable } from '../../../../../../../utils/isNonNullable'\n\nexport type TypographyMarkDataValue = {\n fontWeight?: number\n fontSize?: LengthValue\n fontFamily?: string\n color?: Color\n textAlign?: string\n lineHeight?: number\n letterSpacing?: number\n uppercase?: boolean\n italic?: boolean\n underline?: boolean\n strikethrough?: boolean\n}\n\nexport type TypographyMarkValue = {\n id: string | null | undefined\n style: Typography['style']\n}\n\nexport type TypographyMarkData = Array<DeviceOverride<TypographyMarkDataValue>>\n\nconst getDeviceId = ({ deviceId }: DeviceOverride<unknown>) => deviceId\n\nconst withColor =\n (swatches: Swatch[]) =>\n ({\n value: { color, ...restOfValue },\n ...rest\n }: Typography['style'][number]): DeviceOverride<TypographyMarkDataValue> =>\n ({\n ...rest,\n value: {\n ...restOfValue,\n ...(color\n ? {\n color: {\n swatch: swatches.find(s => s && s.id === color.swatchId),\n alpha: color.alpha,\n },\n }\n : {}),\n } as TypographyMarkDataValue,\n } as DeviceOverride<TypographyMarkDataValue>)\n\nexport const overrideTypographyStyle = <A>(\n source: Array<DeviceOverride<A>>,\n override: Array<DeviceOverride<A>>,\n): Array<DeviceOverride<A>> => {\n const devices = [...new Set(source.map(getDeviceId).concat(override.map(getDeviceId)))]\n\n return devices.map(deviceId => ({\n deviceId,\n value: {\n ...(findDeviceOverride(source, deviceId) || { value: {} }).value,\n ...(findDeviceOverride(override, deviceId, v => v) || { value: {} }).value,\n },\n })) as DeviceOverride<A>[]\n}\n\nexport default function useTypographyMark(\n value: TypographyMarkValue | null | undefined,\n): TypographyMarkData | null | undefined {\n const typography = useTypography(value?.id ?? null)\n const swatchIds = [\n ...getTypographyStyleSwatchIds(value?.style),\n ...getTypographyStyleSwatchIds(typography?.style),\n ]\n const swatches = useSwatches(swatchIds)\n\n return overrideTypographyStyle(\n typography?.style.map(withColor(swatches.filter(isNonNullable))) ?? [],\n value?.style.map(withColor(swatches.filter(isNonNullable))) ?? [],\n )\n}\n","import { ComponentPropsWithoutRef } from 'react'\n\nimport useTypographyMark, {\n TypographyMarkValue,\n overrideTypographyStyle,\n TypographyMarkDataValue,\n} from './hooks/useTypographyMark'\nimport { colorToString } from '../../../../../../utils/colorToString'\nimport { shallowMergeFallbacks } from '../../../../../../utils/devices'\nimport { cx } from '@emotion/css'\nimport { useStyle } from '../../../../../../../runtimes/react/use-style'\nimport { responsiveStyle } from '../../../../../../utils/responsive-style'\nimport { ResponsiveValue } from '../../../../../../../prop-controllers/descriptors'\n\nexport type { TypographyMarkValue }\nexport { overrideTypographyStyle }\n\ntype BaseProps = { value: TypographyMarkValue }\n\ntype Props = BaseProps & Omit<ComponentPropsWithoutRef<'span'>, keyof BaseProps>\n\nexport default function Mark({ value, className, ...restOfProps }: Props): JSX.Element {\n const typographyStyle = useTypographyMark(value)\n const typographyClassName = useStyle(\n responsiveStyle<\n TypographyMarkDataValue,\n [ResponsiveValue<TypographyMarkDataValue> | null | undefined]\n >(\n [typographyStyle],\n ([\n {\n color,\n fontFamily,\n fontSize,\n fontWeight,\n lineHeight,\n letterSpacing,\n uppercase,\n underline,\n strikethrough,\n italic,\n } = {} as TypographyMarkDataValue,\n ]) => ({\n ...(color == null ? {} : { color: colorToString(color) }),\n ...(fontFamily == null ? {} : { fontFamily: `\"${fontFamily}\"` }),\n ...(fontSize == null || fontSize.value == null || fontSize.unit == null\n ? {}\n : { fontSize: `${fontSize.value}${fontSize.unit}` }),\n ...(fontWeight == null ? {} : { fontWeight }),\n ...(lineHeight == null ? {} : { lineHeight }),\n ...(letterSpacing == null ? {} : { letterSpacing: `${letterSpacing / 10}em` }),\n ...(uppercase == null\n ? {}\n : { textTransform: uppercase === true ? 'uppercase' : 'initial' }),\n ...(underline == null && strikethrough == null\n ? {}\n : {\n textDecoration: [\n Boolean(underline) && 'underline',\n Boolean(strikethrough) && 'line-through',\n ]\n .filter(Boolean)\n .join(' '),\n }),\n ...(italic == null ? {} : { fontStyle: italic === true ? 'italic' : 'initial' }),\n }),\n shallowMergeFallbacks,\n ),\n )\n\n return <span {...restOfProps} className={cx(typographyClassName, className)} />\n}\n","import { cx } from '@emotion/css'\nimport { forwardRef, ComponentPropsWithoutRef, ForwardedRef, ElementRef, ElementType } from 'react'\n\nimport type { ResponsiveValue } from '../../../../../../../prop-controllers'\nimport { useStyle } from '../../../../../../../runtimes/react/use-style'\nimport { responsiveStyle } from '../../../../../../utils/responsive-style'\n\ntype BaseProps<T extends ElementType> = {\n as?: T\n textAlign?: ResponsiveValue<'left' | 'center' | 'right' | 'justify'>\n}\n\ntype Props<T extends ElementType> = BaseProps<T> &\n Omit<ComponentPropsWithoutRef<T>, keyof BaseProps<T>>\n\nexport default forwardRef(function Block<T extends ElementType>(\n { textAlign, className, as, ...restOfProps }: Props<T>,\n ref: ForwardedRef<ElementRef<T>>,\n) {\n const Component = as ?? 'div'\n\n return (\n // @ts-ignore: `ref` types don't match.\n <Component\n {...restOfProps}\n ref={ref}\n className={cx(\n useStyle({ margin: 0 }),\n useStyle(responsiveStyle([textAlign], ([textAlign = 'left']) => ({ textAlign }))),\n useStyle(\n as === 'blockquote'\n ? {\n padding: '0.5em 10px',\n fontSize: '1.25em',\n fontWeight: '300',\n borderLeft: '5px solid rgba(0, 0, 0, 0.1)',\n }\n : {},\n ),\n className,\n )}\n />\n )\n})\n"],"names":["findDeviceOverride","useTypography","getTypographyStyleSwatchIds","useSwatches","isNonNullable","value","className","restOfProps","typographyStyle","useTypographyMark","typographyClassName","useStyle","responsiveStyle","color","fontFamily","fontSize","fontWeight","lineHeight","letterSpacing","uppercase","underline","strikethrough","italic","colorToString","unit","textTransform","textDecoration","Boolean","filter","join","fontStyle","shallowMergeFallbacks","cx","forwardRef","ref","textAlign","as","Component","margin","padding","borderLe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FS,KA1Ca,qBAAA,CADmB;AA+CpC,iFAAiBxB;IAAa,WAAWyB,IAAAA,GAAGtB,qBAAqBJ,SAAtB;AAAA,EAAA,EAA3C;AACD;ACxDD,IAAA,sBAAe2B,iBAAW,eACxB,IACAC,KACA;AAFA,eAAEC;AAAAA;AAAAA,IAAW7B;AAAAA,IAAW8B;AAAAA,MAAxB,IAA+B7B,wBAA/B,IAA+BA;AAAAA,IAA7B4B;AAAAA,IAAW7B;AAAAA,IAAW8B;AAAAA;AAGxB,QAAMC,YAAYD,kBAAM;AAExB,wCAEG,4CACK7B;IACJ;AAAA,IACA,WAAWyB,OACTrB,cAAS;AAAA,MAAE2B,QAAQ;AAAA,IAAA,CAAX,GACR3B,KAAAA,SAASC,KAAAA,gBAAgB,CAACuB,SAAD,GAAa,CAAC,CAACA,aAAY,YAAa;AAAA,MAAEA,WAAAA;AAAAA,IAA3C,EAAA,CAAhB,GACRxB,cACEyB,OAAO,eACH;AAAA,MACEG,SAAS;AAAA,MACTxB,UAAU;AAAA,MACVC,YAAY;AAAA,MACZwB,YAAY;AAAA,IAAA,IAEd,CAAA,CARE,GAURlC,SAbW;AAAA,EAAA,EAHf;AAoBH,CA5BwB;;;"}
1
+ {"version":3,"file":"index.cjs6.js","sources":["../src/components/builtin/Text/components/Leaf/leaf.tsx","../src/components/builtin/Text/components/Element/block.tsx","../src/components/builtin/Text/components/Element/inline.tsx","../src/components/builtin/Text/components/Element/element.tsx","../src/components/builtin/Text/EditableText/useSyncWithBuilder.tsx","../src/components/builtin/Text/EditableText/ListPlugin/lib/utils/element.ts","../src/components/builtin/Text/EditableText/ListPlugin/lib/wrapList.ts","../src/components/builtin/Text/EditableText/ListPlugin/constants.ts","../src/components/builtin/Text/EditableText/ListPlugin/lib/utils/editor.ts","../src/components/builtin/Text/EditableText/ListPlugin/lib/utils/filterForSubtreeRoots.ts","../src/components/builtin/Text/EditableText/ListPlugin/lib/utils/location.ts","../src/components/builtin/Text/EditableText/ListPlugin/lib/utils/getSelectedListItems.ts","../src/components/builtin/Text/EditableText/ListPlugin/lib/unwrapList.ts","../src/components/builtin/Text/EditableText/ListPlugin/lib/toggleList.ts","../src/components/builtin/Text/EditableText/ListPlugin/lib/indent.ts","../src/components/builtin/Text/EditableText/ListPlugin/lib/dedent.ts","../src/components/builtin/Text/EditableText/ListPlugin/ListPlugin.ts","../src/components/builtin/Text/EditableText/editable-text.tsx"],"sourcesContent":["import { RenderLeafProps } from 'slate-react'\nimport { TextType } from '../../../../../controls'\nimport { TypographyLeaf } from './typography'\n\nexport function Leaf({ leaf, ...props }: RenderLeafProps) {\n switch (leaf.type) {\n case TextType.Typography:\n return <TypographyLeaf leaf={leaf} {...props} />\n\n default:\n return <span {...props.attributes}>{props.children}</span>\n }\n}\n","import { cx } from '@emotion/css'\nimport { RenderElementProps } from 'slate-react'\nimport { Block, BlockType } from '../../../../../controls'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\nimport { responsiveStyle } from '../../../../utils/responsive-style'\n\nexport interface InlineRenderElementProps extends RenderElementProps {\n element: Block\n}\n\nexport function BlockElement({ element, attributes, children }: InlineRenderElementProps) {\n const blockStyles = [\n useStyle({ margin: 0 }),\n useStyle(responsiveStyle([element.textAlign], ([textAlign = 'left']) => ({ textAlign }))),\n ]\n\n switch (element.type) {\n case BlockType.Paragraph:\n return (\n <p {...attributes} className={cx(...blockStyles)}>\n {children}\n </p>\n )\n case BlockType.Heading1:\n return (\n <h1 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h1>\n )\n case BlockType.Heading2:\n return (\n <h2 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h2>\n )\n case BlockType.Heading3:\n return (\n <h3 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h3>\n )\n case BlockType.Heading4:\n return (\n <h4 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h4>\n )\n case BlockType.Heading5:\n return (\n <h5 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h5>\n )\n case BlockType.Heading6:\n return (\n <h6 {...attributes} className={cx(...blockStyles)}>\n {children}\n </h6>\n )\n case BlockType.BlockQuote:\n return (\n <blockquote\n {...attributes}\n className={cx(\n ...blockStyles,\n useStyle({\n padding: '0.5em 10px',\n fontSize: '1.25em',\n fontWeight: '300',\n borderLeft: '5px solid rgba(0, 0, 0, 0.1)',\n }),\n )}\n >\n {children}\n </blockquote>\n )\n case BlockType.OrderedList:\n return (\n <ol {...attributes} className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n {children}\n </ol>\n )\n case BlockType.UnorderedList:\n return (\n <ul {...attributes} className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n {children}\n </ul>\n )\n case BlockType.ListItem:\n return (\n <li {...attributes} className={cx(...blockStyles)}>\n {children}\n </li>\n )\n case BlockType.ListItemChild:\n return (\n <span {...attributes} className={cx(...blockStyles)}>\n {children}\n </span>\n )\n }\n}\n","import { cx } from '@emotion/css'\nimport { ComponentPropsWithoutRef } from 'react'\nimport { RenderElementProps } from 'slate-react'\nimport { Inline, InlineType } from '../../../../../controls'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\nimport { Link } from '../../../../shared/Link'\n\nfunction StyledLink({ className, ...restOfProps }: ComponentPropsWithoutRef<typeof Link>) {\n return <Link {...restOfProps} className={cx(useStyle({ textDecoration: 'none' }), className)} />\n}\n\nexport interface InlineRenderElementProps extends RenderElementProps {\n element: Inline\n}\n\nexport function InlineElement({ element, attributes, children }: InlineRenderElementProps) {\n switch (element.type) {\n case InlineType.Code:\n return <code {...attributes}>{children}</code>\n case InlineType.SuperScript:\n return <sup {...attributes}>{children}</sup>\n case InlineType.SubScript:\n return <sub {...attributes}>{children}</sub>\n case InlineType.Link:\n return (\n <StyledLink {...attributes} link={element.link}>\n {children}\n </StyledLink>\n )\n }\n}\n","import { RenderElementProps } from 'slate-react'\nimport { BlockType, InlineType } from '../../../../../controls'\nimport { BlockElement } from './block'\nimport { InlineElement } from './inline'\n\nexport function Element({ element, ...props }: RenderElementProps) {\n switch (element.type) {\n case InlineType.Code:\n case InlineType.SuperScript:\n case InlineType.SubScript:\n case InlineType.Link:\n return <InlineElement element={element} {...props} />\n case BlockType.Paragraph:\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.BlockQuote:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return <BlockElement element={element} {...props} />\n default:\n return <span {...props.attributes}>{props.children}</span>\n }\n}\n","import { useState, useEffect, useCallback } from 'react'\nimport { Editor } from 'slate'\nimport {\n compareRichTextDAO,\n compareRichTextSelection,\n richTextDTOtoDAO,\n richTextDTOtoSelection,\n} from '../../../../controls'\nimport { RichTextValue } from '../../../../prop-controllers'\n\nconst COMMIT_DEBOUNCE_DELAY = 500\n\n/**\n * Compare new prop value with current editor and update editor\n * if the values are not equal. \n */\nexport function useSyncWithBuilder(editor: Editor, text?: RichTextValue) {\n const [shouldCommit, setShouldCommit] = useState(true)\n\n useEffect(() => {\n if (shouldCommit && text) {\n const nextValue = richTextDTOtoDAO(text)\n const nextSelection = richTextDTOtoSelection(text)\n if (\n !compareRichTextDAO(editor.children, nextValue) ||\n !compareRichTextSelection(editor.selection, nextSelection)\n ) {\n editor.children = nextValue\n editor.selection = nextSelection\n editor.onChange()\n }\n }\n }, [editor, shouldCommit, text])\n\n useEffect(() => {\n if (shouldCommit) return\n\n const timeoutId = window.setTimeout(() => {\n setShouldCommit(true)\n }, COMMIT_DEBOUNCE_DELAY)\n\n return () => {\n window.clearTimeout(timeoutId)\n }\n }, [shouldCommit])\n\n return useCallback(() => setShouldCommit(false), [])\n}\n","import { Node, Element, Text } from 'slate'\nimport {\n TextType,\n BlockType,\n Block,\n ParagraphElement,\n OrderedListElement,\n UnorderedListElement,\n ListItemElement,\n ListItemChildElement,\n} from '../../../../../../../controls'\n\nexport const ElementUtils = {\n isConvertibleToListTextNode(node: Node) {\n return (\n !this.isList(node) &&\n !this.isListItem(node) &&\n !this.isListItemChild(node) &&\n !this.isText(node) &&\n !this.isTypography(node)\n )\n },\n isText(node: Node) {\n return Element.isElementType(node, TextType.Text) || Text.isText(node)\n },\n isTypography(node: Node) {\n return Element.isElementType(node, TextType.Typography)\n },\n isParagraph(node: Node): node is ParagraphElement {\n return Element.isElementType(node, BlockType.Paragraph)\n },\n isList(node: Node): node is OrderedListElement | UnorderedListElement {\n return (\n Element.isElementType(node, BlockType.OrderedList) ||\n Element.isElementType(node, BlockType.UnorderedList)\n )\n },\n isListItem(node: Node): node is ListItemElement {\n return Element.isElementType(node, BlockType.ListItem)\n },\n isListItemChild(node: Node): node is ListItemChildElement {\n return Element.isElementType(node, BlockType.ListItemChild)\n },\n createText() {\n return { text: '', type: TextType.Text }\n },\n createParagraph() {\n return {\n children: [this.createText()],\n type: BlockType.Paragraph,\n }\n },\n createList(type: BlockType = BlockType.UnorderedList): Block {\n return { children: [this.createText()], type }\n },\n createListItem(): Block {\n return {\n children: [this.createListItemChild()],\n type: BlockType.ListItem,\n }\n },\n createListItemChild(): Block {\n return {\n children: [this.createText()],\n type: BlockType.ListItemChild,\n }\n },\n}\n","import { Editor, Element, Transforms } from 'slate'\nimport { BlockType } from '../../../../../../controls'\nimport { ElementUtils } from './utils/element'\n\ntype WrapListOptions = {\n type: typeof BlockType.UnorderedList | typeof BlockType.OrderedList\n}\n\nexport function wrapList(\n editor: Editor,\n options: WrapListOptions = { type: BlockType.UnorderedList },\n) {\n if (!editor.selection) return\n\n const nonListEntries = Array.from(\n Editor.nodes(editor, {\n at: editor.selection,\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 at: path,\n })\n Transforms.wrapNodes(editor, ElementUtils.createList(options.type), {\n at: path,\n })\n })\n }\n ref.unref()\n })\n}\n","export const LIST_ITEM_CHILD_POSITION = 0\nexport const LIST_ITEM_LIST_POSITION = 1\n","import { Path, Editor, NodeEntry } from 'slate'\nimport { ListElement, ListItemElement } from '../../../../../../../controls'\nimport { ElementUtils } from './element'\n\nexport const EditorUtils = {\n getFirstAncestorList(editor: Editor, path: Path): NodeEntry<ListElement> | null {\n const parentList = Editor.above(editor, {\n at: path,\n match: (node): node is ListElement => ElementUtils.isList(node),\n })\n return parentList ?? null\n },\n getFirstAncestorListItem(editor: Editor, path: Path): NodeEntry<ListItemElement> | null {\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 },\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 './editor'\nimport { ElementUtils } from './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\nexport function getSelectedLists(editor: Editor): NodeEntry<Element>[] {\n if (!editor.selection) return []\n\n const start = LocationUtils.getStartPath(editor.selection)\n const lists = Editor.nodes(editor, {\n at: editor.selection,\n match: node => ElementUtils.isList(node),\n })\n const firstAncestorPath = EditorUtils.getFirstAncestorList(editor, start)?.[1] ?? []\n\n return Array.from(lists).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, Transforms, Path, Node } from 'slate'\nimport { BlockType } from '../../../../../../controls'\nimport { LIST_ITEM_CHILD_POSITION, LIST_ITEM_LIST_POSITION } from '../constants'\nimport { EditorUtils } from './utils/editor'\nimport { filterForSubtreeRoots } from './utils/filterForSubtreeRoots'\nimport { getSelectedListItems } from './utils/getSelectedListItems'\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\nexport function unwrapList(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 unwrapPath(editor, ref.current)\n }\n ref.unref()\n })\n}\n","import { Editor, Node, Path, Transforms } from 'slate'\nimport { BlockType } from '../../../../../../controls'\nimport { unwrapList } from './unwrapList'\nimport { ElementUtils } from './utils/element'\nimport { LocationUtils } from './utils/location'\nimport { wrapList } from './wrapList'\n\ntype ToggleListOptions = {\n type: typeof BlockType.UnorderedList | typeof BlockType.OrderedList\n}\n\nexport function toggleList(\n editor: Editor,\n options: ToggleListOptions = { type: BlockType.UnorderedList },\n) {\n if (!editor.selection) return\n const start = LocationUtils.getStartPath(editor.selection)\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 })\n }\n\n if (ancestor.type === options.type) {\n unwrapList(editor)\n } else {\n Transforms.setNodes(editor, { type: options.type }, { at: ancestorPath })\n }\n}\n","import { Editor, Node, Path, Transforms } from 'slate'\nimport { LIST_ITEM_LIST_POSITION } from '../constants'\nimport { ElementUtils } from './utils/element'\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 \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 type { KeyboardEvent } from 'react'\nimport { Editor, Transforms, Range, Node, PathRef } from 'slate'\nimport isHotkey from 'is-hotkey'\nimport { ElementUtils } from './lib/utils/element'\nimport { unwrapList, wrapList, indent, dedent, toggleList } from './lib'\nimport { EditorUtils } from './lib/utils/editor'\nimport { LIST_ITEM_CHILD_POSITION } from './constants'\nimport { BlockType } from '../../../../../controls'\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 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 removing stray text elements from lists\n if (ElementUtils.isList(normalizationNode)) {\n Array.from(Node.children(editor, normalizationPath)).forEach(([node, path]) => {\n if (ElementUtils.isText(node)) {\n Transforms.removeNodes(editor, { at: path })\n return\n }\n })\n }\n\n // Normalization for merging adjacent lists of the same type\n if (!ElementUtils.isText(normalizationNode) && !ElementUtils.isTypography(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 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.forEach(([_, childPath], index) => {\n Transforms.moveNodes(editor, {\n at: childPath,\n to: [...nodePath, nodeChildren.length + index],\n })\n })\n Transforms.removeNodes(editor, { at: nodeToBeMergedPath })\n })\n nodePathRef.unref()\n nodeToBeMergedPathRef.unref()\n })\n return\n }\n }\n }\n\n return editor\n}\n","import {\n forwardRef,\n KeyboardEvent,\n Ref,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useState,\n} from 'react'\n\nimport { createEditor } from 'slate'\nimport { Slate, Editable, withReact, ReactEditor } from 'slate-react'\n\nimport { ElementIDValue, RichTextValue } from '../../../../prop-controllers/descriptors'\nimport { cx } from '@emotion/css'\nimport { DescriptorsPropControllers } from '../../../../prop-controllers/instances'\nimport { Descriptors } from '../../../../runtimes/react/controls/rich-text'\nimport { getBox } from '../../../../box-model'\nimport { PropControllersHandle } from '../../../../state/modules/prop-controller-handles'\nimport { BlockType, RichTextDAO, richTextDTOtoDAO, TextType } from '../../../../controls'\nimport { Leaf } from '../components/Leaf'\nimport { Element } from '../components/Element'\nimport { useSyncWithBuilder } from './useSyncWithBuilder'\nimport { onKeyDown, withList } from './ListPlugin'\nimport isHotkey from 'is-hotkey'\nimport { useBuilderEditMode } from '../../../../runtimes/react'\nimport { BuilderEditMode } from '../../../../state/modules/builder-edit-mode'\n\ntype Props = {\n id?: ElementIDValue\n text?: RichTextValue\n width?: string\n margin?: string\n}\n\nconst defaultText: RichTextDAO = [\n { type: BlockType.Paragraph, children: [{ type: TextType.Text, text: '' }] },\n]\n\nexport const EditableText = forwardRef(function EditableText(\n { id, text, width, margin }: Props,\n ref: Ref<PropControllersHandle<Descriptors>>,\n) {\n const [editor] = useState(() => withList(withReact(createEditor())))\n const delaySync = useSyncWithBuilder(editor, text)\n const editMode = useBuilderEditMode()\n\n const [propControllers, setPropControllers] =\n useState<DescriptorsPropControllers<Descriptors> | null>(null)\n const controller = propControllers?.text\n\n useImperativeHandle(\n ref,\n () => ({\n getDomNode() {\n return ReactEditor.toDOMNode(editor, editor)\n },\n getBoxModel() {\n return getBox(ReactEditor.toDOMNode(editor, editor))\n },\n setPropControllers,\n }),\n [editor, setPropControllers],\n )\n\n const initialValue = useMemo(() => (text ? richTextDTOtoDAO(text) : defaultText), [text])\n\n useEffect(() => {\n controller?.setSlateEditor(editor)\n }, [controller, editor])\n\n const handleFocus = useCallback(() => {\n controller?.focus()\n }, [controller])\n\n const handleKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (isHotkey('mod+shift+z', e)) return controller?.redo()\n if (isHotkey('mod+z', e)) return controller?.undo()\n if (isHotkey('escape')(e)) return controller?.blur()\n onKeyDown(e, editor)\n },\n [controller, editor],\n )\n\n return (\n <Slate editor={editor} value={initialValue} onChange={delaySync}>\n <Editable\n id={id}\n renderLeaf={Leaf}\n renderElement={Element}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n className={cx(width, margin)}\n readOnly={editMode === BuilderEditMode.INTERACT}\n />\n </Slate>\n )\n})\n\nexport default EditableText\n"],"names":["leaf","props","type","TextType","Typography","TypographyLeaf","attributes","children","element","blockStyles","useStyle","margin","responsiveStyle","textAlign","BlockType","Paragraph","cx","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","padding","fontSize","fontWeight","borderLeft","OrderedList","listStylePosition","UnorderedList","ListItem","ListItemChild","className","restOfProps","Link","textDecoration","InlineType","Code","SuperScript","SubScript","link","COMMIT_DEBOUNCE_DELAY","editor","text","shouldCommit","setShouldCommit","useState","useEffect","nextValue","richTextDTOtoDAO","nextSelection","richTextDTOtoSelection","compareRichTextDAO","compareRichTextSelection","selection","onChange","timeoutId","window","setTimeout","clearTimeout","useCallback","Element","Text","Editor","Transforms","Path","Range","Point","Node","isHotkey","defaultText","EditableText","forwardRef","id","width","ref","withList","withReact","createEditor","delaySync","useSyncWithBuilder","editMode","useBuilderEditMode","propControllers","setPropControllers","controller","useImperativeHandle","getDomNode","ReactEditor","toDOMNode","getBoxModel","getBox","initialValue","useMemo","setSlateEditor","handleFocus","focus","handleKeyDown","e","redo","undo","blur","onKeyDown","Slate","Editable","Leaf","BuilderEditMode","INTERACT"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIqB,cAAA,IAAqC;AAArC,eAAEA;AAAAA;AAAAA,MAAF,IAAWC,kBAAX,IAAWA;AAAAA,IAATD;AAAAA;AACbA,UAAAA,KAAKE;AAAAA,SACNC,SAASC,SAAAA;AACZ,4CAAQC,WAAAA,gBAAD;AAAA,QAAgB;AAAA,SAAgBJ,MAAvC;AAAA;AAGO,4CAAA,QAAA,iCAAUA,MAAMK,aAAhB;AAAA,QAAA,UAA6BL,MAAMM;AAAAA,MAAAA,EAA1C;AAAA;AAEL;ACF4B,sBAAA;AAAA,EAAEC;AAAAA,EAASF;AAAAA,EAAYC;AAAAA,GAAsC;AAClFE,QAAAA,cAAc,CAClBC,cAAS;AAAA,IAAEC,QAAQ;AAAA,EAAA,CAAX,GACRD,KAAAA,SAASE,KAAgB,gBAAA,CAACJ,QAAQK,SAAT,GAAqB,CAAC,CAACA,YAAY,YAAa;AAAA,IAAEA;AAAAA,EAAAA,EAAnD,CAAhB,CAFU;AAKZL,UAAAA,QAAQN;AAAAA,SACTY,SAAUC,UAAAA;AACb,kFACST;QAAY,WAAWU,IAAAA,GAAG,GAAGP,WAAJ;AAAA,QAC7BF;AAAAA,MAAAA,EAFL;AAAA,SAKGO,SAAUG,UAAAA;AACb,mFACUX;QAAY,WAAWU,IAAAA,GAAG,GAAGP,WAAJ;AAAA,QAC9BF;AAAAA,MAAAA,EAFL;AAAA,SAKGO,SAAUI,UAAAA;AACb,mFACUZ;QAAY,WAAWU,IAAAA,GAAG,GAAGP,WAAJ;AAAA,Q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AeC,cAAQ,MAAOlD,OAAOM,SAAAA,iBAAiBN,IAAD,IAAS2B,aAAc,CAAC3B,IAAD,CAAtD;AAE5BI,QAAAA,UAAU,MAAM;AACdsC,6CAAYS,eAAepD;AAAAA,EAA3B,GACC,CAAC2C,YAAY3C,MAAb,CAFM;AAIHqD,QAAAA,cAAcnC,MAAAA,YAAY,MAAM;AACpCyB,6CAAYW;AAAAA,EAAZ,GACC,CAACX,UAAD,CAF4B;AAIzBY,QAAAA,gBAAgBrC,kBACpB,CAACsC,MAAqB;AAChB7B,QAAAA,kBAAAA,WAAS,eAAe6B,CAAhB;AAAoB,aAAOb,yCAAYc;AAC/C9B,QAAAA,kBAAAA,WAAS,SAAS6B,CAAV;AAAc,aAAOb,yCAAYe;AACzC/B,QAAAA,kBAAAA,WAAS,QAAD,EAAW6B,CAAnB;AAAuB,aAAOb,yCAAYgB;AAC9CC,cAAUJ,GAAGxD,MAAJ;AAAA,EAAA,GAEX,CAAC2C,YAAY3C,MAAb,CAP+B;AAUjC,wCACG6D,WAAAA,OAAD;AAAA,IAAO;AAAA,IAAgB,OAAOX;AAAAA,IAAc,UAAUb;AAAAA,IAAtD,yCACGyB,qBAAD;AAAA,MACE;AAAA,MACA,YAAYC;AAAAA,MACZ,eAAe5C;AAAAA,MACf,WAAWoC;AAAAA,MACX,SAASF;AAAAA,MACT,WAAWhF,IAAAA,GAAG2D,OAAOhE,MAAR;AAAA,MACb,UAAUuE,aAAayB,SAAAA,gBAAgBC;AAAAA,IAAAA,CAPzC;AAAA,EAAA,CAFJ;AAaD,CA3DqC;AA6DtC,IAAA,iBAAepC;;;"}
package/dist/index.es.js CHANGED
@@ -46,8 +46,10 @@ import { serializeStyles } from "@emotion/serialize";
46
46
  import { registerStyles, insertStyles } from "@emotion/utils";
47
47
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
48
48
  import { e as ShapeControlType, L as ListControlType, T as Types, E as ElementID, B as Backgrounds, W as Width, f as ResponsiveIconRadioGroup, M as Margin, P as Padding, g as Border, h as BorderRadius, i as Shadows, G as GapY, j as GapX, k as ResponsiveSelect, l as ResponsiveNumber, m as Checkbox, n as Grid, o as TextInput, p as Link, q as ResponsiveColor, s as TextStyle, t as Images, N as Number$1, D as Date$1, F as Font, u as ResponsiveLength, v as TextArea, w as Table, x as TableFormFields, y as Image, z as ResponsiveOpacity, A as NavigationLinks, H as SocialLinks, J as RichText, V as Video, K as StyleControlProperty, O as ImageControlValueFormat, S as SlotControlType, Q as LinkControlType, I as ImageControlType, C as ColorControlType, U as BorderPropControllerFormat, X as ShadowsPropControllerFormat, Y as BorderRadiusPropControllerFormat, Z as MarginPropControllerFormat, _ as PaddingPropControllerFormat, $ as WidthPropControllerFormat, a0 as RichTextControlType, a1 as StyleControlType } from "./rich-text.es.js";
49
+ import "slate";
49
50
  import { S as SelectControlType, T as TextAreaControlType, a as TextInputControlType, N as NumberControlType, C as CheckboxControlType } from "./text-input.es.js";
50
51
  import { C as ComboboxControlType } from "./combobox.es.js";
52
+ import "slate-react";
51
53
  import { useSyncExternalStore } from "use-sync-external-store/shim";
52
54
  import { createStore, applyMiddleware } from "redux";
53
55
  import thunk from "redux-thunk";
@@ -965,7 +967,7 @@ function useCachedSite(siteId) {
965
967
  const site = useSyncExternalStore(client.subscribe, getSnapshot, getSnapshot);
966
968
  return site;
967
969
  }
968
- const version = "0.7.7";
970
+ const version = "0.7.8";
969
971
  class Makeswift {
970
972
  constructor(apiKey, { apiOrigin = "https://api.makeswift.com" } = {}) {
971
973
  __publicField(this, "apiKey");
@@ -3888,9 +3890,9 @@ class ElementImperativeHandle {
3888
3890
  const current = this.getCurrent();
3889
3891
  if (current === null)
3890
3892
  this.setPropControllers(null);
3891
- else if (this.lastPropControllers !== null)
3892
- this.setPropControllers(this.lastPropControllers);
3893
3893
  this.getCurrent = getCurrent;
3894
+ if (this.lastPropControllers !== null)
3895
+ this.setPropControllers(this.lastPropControllers);
3894
3896
  }
3895
3897
  getBoxModel() {
3896
3898
  const current = this.getCurrent();
@@ -4147,5 +4149,5 @@ const DocumentReference = memo(forwardRef(function DocumentReference2({
4147
4149
  document: document2
4148
4150
  });
4149
4151
  }));
4150
- export { getServerSideProps as $, Alignments as A, useFile as B, Contrasts as C, DocumentReference as D, Element$1 as E, DEVICES as F, findDeviceOverride as G, forwardNextDynamicRef as H, useIsPreview as I, useFiles as J, useSwatches as K, usePagePathnameSlice as L, useElementId as M, deepEqual as N, storeContextDefaultValue as O, PageProvider as P, StoreContext as Q, RuntimeProvider as R, Shapes as S, MakeswiftProvider as T, useBuilderEditMode as U, pollBoxModel as V, useTypography as W, shallowMergeFallbacks as X, MakeswiftClient as Y, getStaticPaths as Z, getStaticProps as _, ReactRuntime as a, Page as a0, Makeswift as a1, PreviewModeScript as a2, Document$1 as a3, MakeswiftApiHandler as a4, usePageId as b, DEFAULT_BOX_ANIMATE_TYPE as c, DEFAULT_BOX_ANIMATE_DELAY as d, DEFAULT_BOX_ANIMATE_DURATION as e, DEFAULT_ITEM_ANIMATE_TYPE as f, DEFAULT_ITEM_ANIMATE_DELAY as g, DEFAULT_ITEM_ANIMATE_DURATION as h, DEFAULT_ITEM_STAGGER_DURATION as i, useBorder as j, useBoxShadow as k, useResponsiveColor as l, useMediaQuery as m, Page$1 as n, useStyle as o, responsiveWidth as p, responsiveTextStyle as q, responsiveStyle as r, colorToString as s, Sizes as t, useIsInBuilder as u, useFormContext as v, responsiveGridItem as w, useTable as x, useMakeswiftClient as y, Provider as z };
4152
+ export { getServerSideProps as $, Alignments as A, useFile as B, Contrasts as C, DocumentReference as D, Element$1 as E, DEVICES as F, findDeviceOverride as G, forwardNextDynamicRef as H, useIsPreview as I, useFiles as J, useSwatches as K, usePagePathnameSlice as L, useElementId as M, deepEqual as N, ElementImperativeHandle as O, PageProvider as P, storeContextDefaultValue as Q, RuntimeProvider as R, Shapes as S, StoreContext as T, MakeswiftProvider as U, useBuilderEditMode as V, useTypography as W, shallowMergeFallbacks as X, MakeswiftClient as Y, getStaticPaths as Z, getStaticProps as _, ReactRuntime as a, Page as a0, Makeswift as a1, PreviewModeScript as a2, Document$1 as a3, MakeswiftApiHandler as a4, usePageId as b, DEFAULT_BOX_ANIMATE_TYPE as c, DEFAULT_BOX_ANIMATE_DELAY as d, DEFAULT_BOX_ANIMATE_DURATION as e, DEFAULT_ITEM_ANIMATE_TYPE as f, DEFAULT_ITEM_ANIMATE_DELAY as g, DEFAULT_ITEM_ANIMATE_DURATION as h, DEFAULT_ITEM_STAGGER_DURATION as i, useBorder as j, useBoxShadow as k, useResponsiveColor as l, useMediaQuery as m, Page$1 as n, useStyle as o, responsiveWidth as p, responsiveTextStyle as q, responsiveStyle as r, colorToString as s, Sizes as t, useIsInBuilder as u, useFormContext as v, responsiveGridItem as w, useTable as x, useMakeswiftClient as y, Provider as z };
4151
4153
  //# sourceMappingURL=index.es.js.map