@makeswift/runtime 0.8.9 → 0.8.10

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 (249) hide show
  1. package/dist/Box.cjs.js +2 -4
  2. package/dist/Box.cjs.js.map +1 -1
  3. package/dist/Box.es.js +2 -4
  4. package/dist/Box.es.js.map +1 -1
  5. package/dist/Button.cjs.js +1 -4
  6. package/dist/Button.cjs.js.map +1 -1
  7. package/dist/Button.es.js +1 -4
  8. package/dist/Button.es.js.map +1 -1
  9. package/dist/Carousel.cjs.js +1 -4
  10. package/dist/Carousel.cjs.js.map +1 -1
  11. package/dist/Carousel.es.js +1 -4
  12. package/dist/Carousel.es.js.map +1 -1
  13. package/dist/Countdown.cjs.js +1 -4
  14. package/dist/Countdown.cjs.js.map +1 -1
  15. package/dist/Countdown.es.js +1 -4
  16. package/dist/Countdown.es.js.map +1 -1
  17. package/dist/Divider.cjs.js +1 -4
  18. package/dist/Divider.cjs.js.map +1 -1
  19. package/dist/Divider.es.js +1 -4
  20. package/dist/Divider.es.js.map +1 -1
  21. package/dist/Embed.cjs.js +3 -5
  22. package/dist/Embed.cjs.js.map +1 -1
  23. package/dist/Embed.es.js +3 -5
  24. package/dist/Embed.es.js.map +1 -1
  25. package/dist/Form.cjs.js +1 -4
  26. package/dist/Form.cjs.js.map +1 -1
  27. package/dist/Form.es.js +2 -5
  28. package/dist/Form.es.js.map +1 -1
  29. package/dist/Image.cjs.js +1 -4
  30. package/dist/Image.cjs.js.map +1 -1
  31. package/dist/Image.es.js +2 -5
  32. package/dist/Image.es.js.map +1 -1
  33. package/dist/LiveProvider.cjs.js +1 -4
  34. package/dist/LiveProvider.cjs.js.map +1 -1
  35. package/dist/LiveProvider.es.js +2 -5
  36. package/dist/LiveProvider.es.js.map +1 -1
  37. package/dist/Navigation.cjs.js +3 -5
  38. package/dist/Navigation.cjs.js.map +1 -1
  39. package/dist/Navigation.es.js +3 -5
  40. package/dist/Navigation.es.js.map +1 -1
  41. package/dist/PreviewProvider.cjs.js +1 -4
  42. package/dist/PreviewProvider.cjs.js.map +1 -1
  43. package/dist/PreviewProvider.es.js +3 -6
  44. package/dist/PreviewProvider.es.js.map +1 -1
  45. package/dist/ReadOnlyText.cjs.js +62 -60
  46. package/dist/ReadOnlyText.cjs.js.map +1 -1
  47. package/dist/ReadOnlyText.es.js +9 -7
  48. package/dist/ReadOnlyText.es.js.map +1 -1
  49. package/dist/ReadOnlyTextV2.cjs.js +318 -0
  50. package/dist/ReadOnlyTextV2.cjs.js.map +1 -0
  51. package/dist/ReadOnlyTextV2.es.js +314 -0
  52. package/dist/ReadOnlyTextV2.es.js.map +1 -0
  53. package/dist/Root.cjs.js +2 -4
  54. package/dist/Root.cjs.js.map +1 -1
  55. package/dist/Root.es.js +2 -4
  56. package/dist/Root.es.js.map +1 -1
  57. package/dist/SocialLinks.cjs.js +1 -4
  58. package/dist/SocialLinks.cjs.js.map +1 -1
  59. package/dist/SocialLinks.es.js +1 -4
  60. package/dist/SocialLinks.es.js.map +1 -1
  61. package/dist/Text.cjs.js +2 -5
  62. package/dist/Text.cjs.js.map +1 -1
  63. package/dist/Text.es.js +3 -6
  64. package/dist/Text.es.js.map +1 -1
  65. package/dist/Video.cjs.js +1 -4
  66. package/dist/Video.cjs.js.map +1 -1
  67. package/dist/Video.es.js +1 -4
  68. package/dist/Video.es.js.map +1 -1
  69. package/dist/actions.cjs.js.map +1 -1
  70. package/dist/actions.es.js.map +1 -1
  71. package/dist/builder.cjs.js +1 -2
  72. package/dist/builder.cjs.js.map +1 -1
  73. package/dist/builder.es.js +1 -2
  74. package/dist/builder.es.js.map +1 -1
  75. package/dist/components.cjs.js +2 -4
  76. package/dist/components.cjs.js.map +1 -1
  77. package/dist/components.es.js +2 -4
  78. package/dist/components.es.js.map +1 -1
  79. package/dist/constants.cjs.js.map +1 -1
  80. package/dist/constants.es.js.map +1 -1
  81. package/dist/control-serialization.cjs.js +0 -2
  82. package/dist/control-serialization.cjs.js.map +1 -1
  83. package/dist/control-serialization.es.js +0 -2
  84. package/dist/control-serialization.es.js.map +1 -1
  85. package/dist/controls.cjs.js +2 -6
  86. package/dist/controls.cjs.js.map +1 -1
  87. package/dist/controls.es.js +2 -3
  88. package/dist/controls.es.js.map +1 -1
  89. package/dist/descriptors.cjs.js +53 -88
  90. package/dist/descriptors.cjs.js.map +1 -1
  91. package/dist/descriptors.es.js +32 -64
  92. package/dist/descriptors.es.js.map +1 -1
  93. package/dist/element.cjs.js +55 -0
  94. package/dist/element.cjs.js.map +1 -0
  95. package/dist/element.es.js +54 -0
  96. package/dist/element.es.js.map +1 -0
  97. package/dist/index.cjs.js +33 -116
  98. package/dist/index.cjs.js.map +1 -1
  99. package/dist/index.cjs2.js +3 -4
  100. package/dist/index.cjs2.js.map +1 -1
  101. package/dist/index.cjs5.js +48 -82
  102. package/dist/index.cjs5.js.map +1 -1
  103. package/dist/index.cjs6.js +41 -42
  104. package/dist/index.cjs6.js.map +1 -1
  105. package/dist/index.cjs7.js +14 -341
  106. package/dist/index.cjs7.js.map +1 -1
  107. package/dist/index.cjs8.js +209 -0
  108. package/dist/index.cjs8.js.map +1 -0
  109. package/dist/index.cjs9.js +370 -0
  110. package/dist/index.cjs9.js.map +1 -0
  111. package/dist/index.es.js +32 -117
  112. package/dist/index.es.js.map +1 -1
  113. package/dist/index.es2.js +2 -3
  114. package/dist/index.es2.js.map +1 -1
  115. package/dist/index.es3.js +1 -1
  116. package/dist/index.es5.js +19 -54
  117. package/dist/index.es5.js.map +1 -1
  118. package/dist/index.es6.js +36 -40
  119. package/dist/index.es6.js.map +1 -1
  120. package/dist/index.es7.js +13 -336
  121. package/dist/index.es7.js.map +1 -1
  122. package/dist/index.es8.js +202 -0
  123. package/dist/index.es8.js.map +1 -0
  124. package/dist/index.es9.js +363 -0
  125. package/dist/index.es9.js.map +1 -0
  126. package/dist/introspection.cjs.js +0 -2
  127. package/dist/introspection.cjs.js.map +1 -1
  128. package/dist/introspection.es.js +0 -2
  129. package/dist/introspection.es.js.map +1 -1
  130. package/dist/leaf.cjs.js.map +1 -1
  131. package/dist/leaf.es.js +1 -1
  132. package/dist/leaf.es.js.map +1 -1
  133. package/dist/main.cjs.js +1 -2
  134. package/dist/main.cjs.js.map +1 -1
  135. package/dist/main.es.js +1 -2
  136. package/dist/main.es.js.map +1 -1
  137. package/dist/next.cjs.js +1 -4
  138. package/dist/next.cjs.js.map +1 -1
  139. package/dist/next.es.js +2 -5
  140. package/dist/next.es.js.map +1 -1
  141. package/dist/prop-controllers.cjs.js +1 -2
  142. package/dist/prop-controllers.cjs.js.map +1 -1
  143. package/dist/prop-controllers.es.js +1 -2
  144. package/dist/prop-controllers.es.js.map +1 -1
  145. package/dist/react.cjs.js +1 -4
  146. package/dist/react.cjs.js.map +1 -1
  147. package/dist/react.es.js +1 -4
  148. package/dist/react.es.js.map +1 -1
  149. package/dist/slate.cjs.js +8 -3
  150. package/dist/slate.cjs.js.map +1 -1
  151. package/dist/slate.cjs2.js +46 -0
  152. package/dist/slate.cjs2.js.map +1 -0
  153. package/dist/slate.es.js +6 -4
  154. package/dist/slate.es.js.map +1 -1
  155. package/dist/slate.es2.js +44 -0
  156. package/dist/slate.es2.js.map +1 -0
  157. package/dist/types/src/components/builtin/Button/Button.d.ts +1 -1
  158. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +1 -1
  159. package/dist/types/src/components/builtin/Text/EditableText/editable-text.d.ts.map +1 -1
  160. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts +2 -1
  161. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +1 -1
  162. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts +1 -1
  163. package/dist/types/src/components/builtin/Text/components/Element/block.d.ts.map +1 -1
  164. package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts +1 -1
  165. package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts.map +1 -1
  166. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts +1 -1
  167. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +1 -1
  168. package/dist/types/src/controls/list.d.ts +2 -1
  169. package/dist/types/src/controls/list.d.ts.map +1 -1
  170. package/dist/types/src/controls/rich-text/dto-types.d.ts +1 -1
  171. package/dist/types/src/controls/rich-text/dto-types.d.ts.map +1 -1
  172. package/dist/types/src/controls/rich-text/index.d.ts +0 -1
  173. package/dist/types/src/controls/rich-text/index.d.ts.map +1 -1
  174. package/dist/types/src/controls/rich-text/rich-text.d.ts +1 -1
  175. package/dist/types/src/controls/rich-text/rich-text.d.ts.map +1 -1
  176. package/dist/types/src/controls/rich-text/translation.d.ts +1 -1
  177. package/dist/types/src/controls/rich-text/translation.d.ts.map +1 -1
  178. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +25 -4
  179. package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
  180. package/dist/types/src/controls/shape.d.ts +2 -1
  181. package/dist/types/src/controls/shape.d.ts.map +1 -1
  182. package/dist/types/src/controls/slot.d.ts +1 -1
  183. package/dist/types/src/controls/slot.d.ts.map +1 -1
  184. package/dist/types/src/controls/style.d.ts +2 -1
  185. package/dist/types/src/controls/style.d.ts.map +1 -1
  186. package/dist/types/src/prop-controllers/base.d.ts +7 -0
  187. package/dist/types/src/prop-controllers/base.d.ts.map +1 -0
  188. package/dist/types/src/prop-controllers/instances.d.ts +1 -5
  189. package/dist/types/src/prop-controllers/instances.d.ts.map +1 -1
  190. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts +13 -0
  191. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -0
  192. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/index.d.ts +4 -0
  193. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/index.d.ts.map +1 -0
  194. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/useSyncDOMSelection.d.ts +9 -0
  195. package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/useSyncDOMSelection.d.ts.map +1 -0
  196. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts +21 -0
  197. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -0
  198. package/dist/types/src/runtimes/react/controls/rich-text-v2/index.d.ts +2 -0
  199. package/dist/types/src/runtimes/react/controls/rich-text-v2/index.d.ts.map +1 -0
  200. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts +8 -0
  201. package/dist/types/src/runtimes/react/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -0
  202. package/dist/types/src/slate/BlockPlugin/index.d.ts +1 -1
  203. package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
  204. package/dist/types/src/slate/BlockPlugin/types.d.ts +1 -1
  205. package/dist/types/src/slate/BlockPlugin/types.d.ts.map +1 -1
  206. package/dist/types/src/slate/BlockPlugin/unwrapInline.d.ts +1 -1
  207. package/dist/types/src/slate/BlockPlugin/unwrapInline.d.ts.map +1 -1
  208. package/dist/types/src/slate/BlockPlugin/wrapInline.d.ts +1 -1
  209. package/dist/types/src/slate/BlockPlugin/wrapInline.d.ts.map +1 -1
  210. package/dist/types/src/slate/BuilderPlugin/index.d.ts +7 -0
  211. package/dist/types/src/slate/BuilderPlugin/index.d.ts.map +1 -0
  212. package/dist/types/src/slate/InlineModePlugin/index.d.ts +5 -0
  213. package/dist/types/src/slate/InlineModePlugin/index.d.ts.map +1 -0
  214. package/dist/types/src/slate/ListPlugin/index.d.ts +1 -1
  215. package/dist/types/src/slate/ListPlugin/index.d.ts.map +1 -1
  216. package/dist/types/src/slate/ListPlugin/toggleList.d.ts +1 -1
  217. package/dist/types/src/slate/ListPlugin/toggleList.d.ts.map +1 -1
  218. package/dist/types/src/slate/ListPlugin/wrapList.d.ts +1 -1
  219. package/dist/types/src/slate/ListPlugin/wrapList.d.ts.map +1 -1
  220. package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts +1 -1
  221. package/dist/types/src/slate/TypographyPlugin/detachActiveTypography.d.ts.map +1 -1
  222. package/dist/types/src/slate/TypographyPlugin/index.d.ts +1 -1
  223. package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -1
  224. package/dist/types/src/slate/TypographyPlugin/setActiveTypographyStyle.d.ts.map +1 -1
  225. package/dist/types/src/slate/index.d.ts +2 -0
  226. package/dist/types/src/slate/index.d.ts.map +1 -1
  227. package/dist/types/src/slate/selectors.d.ts +1 -1
  228. package/dist/types/src/slate/selectors.d.ts.map +1 -1
  229. package/dist/types/src/slate/utils/editor.d.ts +1 -1
  230. package/dist/types/src/slate/utils/editor.d.ts.map +1 -1
  231. package/dist/types/src/slate/utils/element.d.ts +1 -1
  232. package/dist/types/src/slate/utils/element.d.ts.map +1 -1
  233. package/dist/types/src/state/actions.d.ts +2 -1
  234. package/dist/types/src/state/actions.d.ts.map +1 -1
  235. package/dist/types/src/state/modules/prop-controller-handles.d.ts +2 -1
  236. package/dist/types/src/state/modules/prop-controller-handles.d.ts.map +1 -1
  237. package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
  238. package/dist/types/src/state/react-page.d.ts +1 -1
  239. package/dist/types/src/state/react-page.d.ts.map +1 -1
  240. package/dist/types/{src/controls/rich-text/types.d.ts → types/slate.d.ts} +20 -17
  241. package/dist/types/types/slate.d.ts.map +1 -0
  242. package/dist/useIsomorphicLayoutEffect.cjs.js +6 -0
  243. package/dist/useIsomorphicLayoutEffect.cjs.js.map +1 -0
  244. package/dist/useIsomorphicLayoutEffect.es.js +5 -0
  245. package/dist/useIsomorphicLayoutEffect.es.js.map +1 -0
  246. package/package.json +1 -1
  247. package/dist/types/src/controls/rich-text/types.d.ts.map +0 -1
  248. package/dist/types/src/runtimes/react/controls/rich-text-v2.d.ts +0 -15
  249. package/dist/types/src/runtimes/react/controls/rich-text-v2.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"leaf.cjs.js","sources":["../src/components/builtin/Text/components/Leaf/leaf.tsx"],"sourcesContent":["import { RenderLeafProps } from 'slate-react'\nimport { CSSObject } from '@emotion/serialize'\nimport { Swatch, Typography } from '../../../../../api'\nimport { DeviceOverride, ResponsiveValue } from '../../../../../prop-controllers'\nimport { useTypography, useSwatches } from '../../../../../runtimes/react/hooks/makeswift-api'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\nimport { colorToString } from '../../../../utils/colorToString'\nimport { isNonNullable } from '../../../../utils/isNonNullable'\nimport { useResponsiveStyle } from '../../../../utils/responsive-style'\nimport { ColorValue } from '../../../../utils/types'\nimport { RichTextTypography } from '../../../../../controls'\nimport {\n findBreakpointOverride,\n shallowMergeFallbacks,\n} from '../../../../../state/modules/breakpoints'\nimport { useBreakpoints } from '../../../../../runtimes/react'\n\nexport type RichTextTypographyValue = RichTextTypography['style'][number]['value']\n\nfunction typographyFragementToRichTextTypography(\n typography: Typography | null,\n): RichTextTypography | undefined {\n if (typography == null) return undefined\n return {\n id: typography.id,\n style: typography.style.map(({ deviceId, value }) => ({\n deviceId,\n value: {\n fontFamily: value.fontFamily ?? undefined,\n lineHeight: value.lineHeight ?? undefined,\n letterSpacing: value.letterSpacing ?? undefined,\n fontWeight: value.fontWeight ?? undefined,\n textAlign: value.textAlign ?? undefined,\n uppercase: value.uppercase ?? undefined,\n underline: value.underline ?? undefined,\n strikethrough: value.strikethrough ?? undefined,\n italic: value.italic ?? undefined,\n fontSize: value.fontSize ?? undefined,\n color: value.color ?? undefined,\n },\n })),\n }\n}\n\ntype EnhancedColor = {\n color?: ColorValue\n}\n\ntype EnhancedTypographyValue = Omit<RichTextTypographyValue, keyof EnhancedColor> & EnhancedColor\n\nexport type EnhancedTypography = Array<DeviceOverride<EnhancedTypographyValue>>\n\nexport function getTypographyStyleSwatchIds(\n style: RichTextTypography['style'] | Typography['style'] | null | undefined,\n): string[] {\n return (\n style\n ?.map(override => override.value)\n .flatMap(typographyStyle => typographyStyle.color?.swatchId)\n .filter(isNonNullable) ?? []\n )\n}\n\nconst withColor =\n (swatches: Swatch[]) =>\n (\n deviceRawTypographyValue: DeviceOverride<RichTextTypographyValue>,\n ): DeviceOverride<EnhancedTypographyValue> => {\n const { value, deviceId } = deviceRawTypographyValue\n\n if (value.color == null) {\n const { color, ...nextValue } = value\n return {\n deviceId,\n value: nextValue,\n }\n }\n return {\n deviceId,\n value: {\n ...value,\n color: {\n swatch: swatches.find(s => s && s.id === value.color?.swatchId),\n alpha: value.color?.alpha ?? undefined,\n },\n },\n }\n }\n\nconst getDeviceId = ({ deviceId }: DeviceOverride<unknown>) => deviceId\n\n/**\n * `enhanced` here just means typography ids have been replaced with the related entity.\n */\nexport default function useEnhancedTypography(value?: RichTextTypography): EnhancedTypography {\n const typography = typographyFragementToRichTextTypography(useTypography(value?.id ?? null))\n const source = typography?.style ?? []\n const override = value?.style ?? []\n const breakpoints = useBreakpoints()\n\n const swatchIds = [\n ...getTypographyStyleSwatchIds(value?.style),\n ...getTypographyStyleSwatchIds(typography?.style),\n ]\n const swatches = useSwatches(swatchIds).filter(isNonNullable)\n\n const enhancedSource = source.map(withColor(swatches))\n const enhancedOverride = override.map(withColor(swatches))\n\n const devices = [\n ...new Set(enhancedSource.map(getDeviceId).concat(enhancedOverride.map(getDeviceId))),\n ]\n\n return devices\n .map(deviceId => {\n const deviceSource = findBreakpointOverride(breakpoints, enhancedSource, deviceId)?.value\n const deviceOverride = findBreakpointOverride(breakpoints, enhancedOverride, deviceId)?.value\n\n if (deviceSource && deviceOverride) {\n return {\n deviceId,\n value: { ...deviceSource, ...deviceOverride },\n }\n } else if (deviceOverride) {\n return {\n deviceId,\n value: deviceOverride,\n }\n } else if (deviceSource) {\n return {\n deviceId,\n value: deviceSource,\n }\n }\n return null\n })\n .filter(isNonNullable)\n}\n\nexport function useTypographyClassName(value: EnhancedTypography): string {\n return useStyle(\n useResponsiveStyle<\n EnhancedTypographyValue,\n [ResponsiveValue<EnhancedTypographyValue> | null | undefined]\n >(\n [value],\n ([value]) => {\n if (value === undefined) return {}\n\n let styles: CSSObject = {}\n if (value.color != null) styles.color = colorToString(value.color)\n if (value.fontFamily != null) styles.fontFamily = value.fontFamily\n if (value.fontSize != null && value.fontSize.value != null && value.fontSize.unit != null)\n styles.fontSize = `${value.fontSize.value}${value.fontSize.unit}`\n if (value.fontWeight != null) styles.fontWeight = value.fontWeight\n if (value.lineHeight != null) styles.lineHeight = value.lineHeight\n if (value.letterSpacing != null) styles.letterSpacing = `${value.letterSpacing / 10}em`\n if (value.uppercase != null)\n styles.textTransform = value.uppercase === true ? 'uppercase' : 'initial'\n if (value.underline != null || value.strikethrough != null)\n styles.textDecoration = [\n Boolean(value.underline) && 'underline',\n Boolean(value.strikethrough) && 'line-through',\n ]\n .filter(Boolean)\n .join(' ')\n if (value.italic != null) styles.fontStyle = value.italic === true ? 'italic' : 'initial'\n\n return styles\n },\n shallowMergeFallbacks,\n ),\n )\n}\n\nexport function Leaf({ leaf, ...props }: RenderLeafProps) {\n const enhancedTypography = useEnhancedTypography(leaf.typography)\n const typographyClassName = useTypographyClassName(enhancedTypography)\n\n return (\n <span {...props.attributes} className={typographyClassName}>\n {props.children}\n </span>\n )\n}\n"],"names":["typography","undefined","id","style","map","deviceId","value","fontFamily","lineHeight","letterSpacing","fontWeight","textAlign","uppercase","underline","strikethrough","italic","fontSize","color","override","flatMap","typographyStyle","swatchId","filter","isNonNullable","withColor","swatches","deviceRawTypographyValue","nextValue","swatch","find","s","alpha","getDeviceId","typographyFragementToRichTextTypography","useTypography","source","breakpoints","useBreakpoints","swatchIds","getTypographyStyleSwatchIds","useSwatches","enhancedSource","enhancedOverride","devices","Set","concat","deviceSource","findBreakpointOverride","deviceOverride","useStyle","useResponsiveStyle","styles","colorToString","unit","textTransform","textDecoration","Boolean","join","fontStyle","shallowMergeFallbacks","leaf","props","enhancedTypography","useEnhancedTypography","typographyClassName","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aAAOI,iBAAiB,CACtBC,QAAQlD,OAAMO,SAAP,KAAqB,aAC5B2C,QAAQlD,OAAMQ,aAAP,KAAyB,cAFV,EAIrBQ,OAAOkC,OAJc,EAKrBC,KAAK,GALgB;AAM1B,QAAInD,OAAMS,UAAU;AAAMoC,aAAOO,YAAYpD,OAAMS,WAAW,OAAO,WAAW;AAEzEoC,WAAAA;AAAAA,EAAAA,GAETQ,kBAAAA,qBA7BgB,CADL;AAiChB;AAEoB,cAAA,IAAqC;AAArC,eAAEC;AAAAA;AAAAA,MAAF,IAAWC,kBAAX,IAAWA;AAAAA,IAATD;AAAAA;AACfE,QAAAA,qBAAqBC,sBAAsBH,KAAK5D,UAAN;AAC1CgE,QAAAA,sBAAsBC,uBAAuBH,kBAAD;AAGhD,wCAAA,QAAA,iCAAUD,MAAMK,aAAhB;AAAA,IAA4B,WAAWF;AAAAA,IAAvC,UACGH,MAAMM;AAAAA,EAAAA,EAFX;AAKD;;;;"}
1
+ {"version":3,"file":"leaf.cjs.js","sources":["../src/components/builtin/Text/components/Leaf/leaf.tsx"],"sourcesContent":["import { RenderLeafProps } from 'slate-react'\nimport { CSSObject } from '@emotion/serialize'\nimport { Swatch, Typography } from '../../../../../api'\nimport { DeviceOverride, ResponsiveValue } from '../../../../../prop-controllers'\nimport { useTypography, useSwatches } from '../../../../../runtimes/react/hooks/makeswift-api'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\nimport { colorToString } from '../../../../utils/colorToString'\nimport { isNonNullable } from '../../../../utils/isNonNullable'\nimport { useResponsiveStyle } from '../../../../utils/responsive-style'\nimport { ColorValue } from '../../../../utils/types'\nimport {\n findBreakpointOverride,\n shallowMergeFallbacks,\n} from '../../../../../state/modules/breakpoints'\nimport { useBreakpoints } from '../../../../../runtimes/react'\nimport { RichTextTypography } from '../../../../../../types/slate'\n\nexport type RichTextTypographyValue = RichTextTypography['style'][number]['value']\n\nfunction typographyFragementToRichTextTypography(\n typography: Typography | null,\n): RichTextTypography | undefined {\n if (typography == null) return undefined\n return {\n id: typography.id,\n style: typography.style.map(({ deviceId, value }) => ({\n deviceId,\n value: {\n fontFamily: value.fontFamily ?? undefined,\n lineHeight: value.lineHeight ?? undefined,\n letterSpacing: value.letterSpacing ?? undefined,\n fontWeight: value.fontWeight ?? undefined,\n textAlign: value.textAlign ?? undefined,\n uppercase: value.uppercase ?? undefined,\n underline: value.underline ?? undefined,\n strikethrough: value.strikethrough ?? undefined,\n italic: value.italic ?? undefined,\n fontSize: value.fontSize ?? undefined,\n color: value.color ?? undefined,\n },\n })),\n }\n}\n\ntype EnhancedColor = {\n color?: ColorValue\n}\n\ntype EnhancedTypographyValue = Omit<RichTextTypographyValue, keyof EnhancedColor> & EnhancedColor\n\nexport type EnhancedTypography = Array<DeviceOverride<EnhancedTypographyValue>>\n\nexport function getTypographyStyleSwatchIds(\n style: RichTextTypography['style'] | Typography['style'] | null | undefined,\n): string[] {\n return (\n style\n ?.map(override => override.value)\n .flatMap(typographyStyle => typographyStyle.color?.swatchId)\n .filter(isNonNullable) ?? []\n )\n}\n\nconst withColor =\n (swatches: Swatch[]) =>\n (\n deviceRawTypographyValue: DeviceOverride<RichTextTypographyValue>,\n ): DeviceOverride<EnhancedTypographyValue> => {\n const { value, deviceId } = deviceRawTypographyValue\n\n if (value.color == null) {\n const { color, ...nextValue } = value\n return {\n deviceId,\n value: nextValue,\n }\n }\n return {\n deviceId,\n value: {\n ...value,\n color: {\n swatch: swatches.find(s => s && s.id === value.color?.swatchId),\n alpha: value.color?.alpha ?? undefined,\n },\n },\n }\n }\n\nconst getDeviceId = ({ deviceId }: DeviceOverride<unknown>) => deviceId\n\n/**\n * `enhanced` here just means typography ids have been replaced with the related entity.\n */\nexport default function useEnhancedTypography(value?: RichTextTypography): EnhancedTypography {\n const typography = typographyFragementToRichTextTypography(useTypography(value?.id ?? null))\n const source = typography?.style ?? []\n const override = value?.style ?? []\n const breakpoints = useBreakpoints()\n\n const swatchIds = [\n ...getTypographyStyleSwatchIds(value?.style),\n ...getTypographyStyleSwatchIds(typography?.style),\n ]\n const swatches = useSwatches(swatchIds).filter(isNonNullable)\n\n const enhancedSource = source.map(withColor(swatches))\n const enhancedOverride = override.map(withColor(swatches))\n\n const devices = [\n ...new Set(enhancedSource.map(getDeviceId).concat(enhancedOverride.map(getDeviceId))),\n ]\n\n return devices\n .map(deviceId => {\n const deviceSource = findBreakpointOverride(breakpoints, enhancedSource, deviceId)?.value\n const deviceOverride = findBreakpointOverride(breakpoints, enhancedOverride, deviceId)?.value\n\n if (deviceSource && deviceOverride) {\n return {\n deviceId,\n value: { ...deviceSource, ...deviceOverride },\n }\n } else if (deviceOverride) {\n return {\n deviceId,\n value: deviceOverride,\n }\n } else if (deviceSource) {\n return {\n deviceId,\n value: deviceSource,\n }\n }\n return null\n })\n .filter(isNonNullable)\n}\n\nexport function useTypographyClassName(value: EnhancedTypography): string {\n return useStyle(\n useResponsiveStyle<\n EnhancedTypographyValue,\n [ResponsiveValue<EnhancedTypographyValue> | null | undefined]\n >(\n [value],\n ([value]) => {\n if (value === undefined) return {}\n\n let styles: CSSObject = {}\n if (value.color != null) styles.color = colorToString(value.color)\n if (value.fontFamily != null) styles.fontFamily = value.fontFamily\n if (value.fontSize != null && value.fontSize.value != null && value.fontSize.unit != null)\n styles.fontSize = `${value.fontSize.value}${value.fontSize.unit}`\n if (value.fontWeight != null) styles.fontWeight = value.fontWeight\n if (value.lineHeight != null) styles.lineHeight = value.lineHeight\n if (value.letterSpacing != null) styles.letterSpacing = `${value.letterSpacing / 10}em`\n if (value.uppercase != null)\n styles.textTransform = value.uppercase === true ? 'uppercase' : 'initial'\n if (value.underline != null || value.strikethrough != null)\n styles.textDecoration = [\n Boolean(value.underline) && 'underline',\n Boolean(value.strikethrough) && 'line-through',\n ]\n .filter(Boolean)\n .join(' ')\n if (value.italic != null) styles.fontStyle = value.italic === true ? 'italic' : 'initial'\n\n return styles\n },\n shallowMergeFallbacks,\n ),\n )\n}\n\nexport function Leaf({ leaf, ...props }: RenderLeafProps) {\n const enhancedTypography = useEnhancedTypography(leaf.typography)\n const typographyClassName = useTypographyClassName(enhancedTypography)\n\n return (\n <span {...props.attributes} className={typographyClassName}>\n {props.children}\n </span>\n )\n}\n"],"names":["typography","undefined","id","style","map","deviceId","value","fontFamily","lineHeight","letterSpacing","fontWeight","textAlign","uppercase","underline","strikethrough","italic","fontSize","color","override","flatMap","typographyStyle","swatchId","filter","isNonNullable","withColor","swatches","deviceRawTypographyValue","nextValue","swatch","find","s","alpha","getDeviceId","typographyFragementToRichTextTypography","useTypography","source","breakpoints","useBreakpoints","swatchIds","getTypographyStyleSwatchIds","useSwatches","enhancedSource","enhancedOverride","devices","Set","concat","deviceSource","findBreakpointOverride","deviceOverride","useStyle","useResponsiveStyle","styles","colorToString","unit","textTransform","textDecoration","Boolean","join","fontStyle","shallowMergeFallbacks","leaf","props","enhancedTypography","useEnhancedTypography","typographyClassName","useTypographyClassName","attributes","children"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,iDACEA,YACgC;AAChC,MAAIA,cAAc;AAAaC,WAAAA;AACxB,SAAA;AAAA,IACLC,IAAIF,WAAWE;AAAAA,IACfC,OAAOH,WAAWG,MAAMC,IAAI,CAAC;AAAA,MAAEC;AAAAA,MAAUC;AAAAA,UAAa;;AAAA;AAAA,QACpDD;AAAAA,QACAC,OAAO;AAAA,UACLC,YAAYD,YAAMC,eAAND,YAAoBL;AAAAA,UAChCO,YAAYF,YAAME,eAANF,YAAoBL;AAAAA,UAChCQ,eAAeH,YAAMG,kBAANH,YAAuBL;AAAAA,UACtCS,YAAYJ,YAAMI,eAANJ,YAAoBL;AAAAA,UAChCU,WAAWL,YAAMK,cAANL,YAAmBL;AAAAA,UAC9BW,WAAWN,YAAMM,cAANN,YAAmBL;AAAAA,UAC9BY,WAAWP,YAAMO,cAANP,YAAmBL;AAAAA,UAC9Ba,eAAeR,YAAMQ,kBAANR,YAAuBL;AAAAA,UACtCc,QAAQT,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}
30
30
  return target;
31
31
  };
32
- import { V as useTypography, s as useBreakpoints, J as useSwatches, n as useStyle, o as useResponsiveStyle, r as colorToString } from "./index.es.js";
32
+ import { U as useTypography, s as useBreakpoints, I as useSwatches, n as useStyle, o as useResponsiveStyle, r as colorToString } from "./index.es.js";
33
33
  import { j as isNonNullable } from "./introspection.es.js";
34
34
  import { findBreakpointOverride, shallowMergeFallbacks } from "./state/breakpoints.es.js";
35
35
  import { jsx } from "react/jsx-runtime";
@@ -1 +1 @@
1
- {"version":3,"file":"leaf.es.js","sources":["../src/components/builtin/Text/components/Leaf/leaf.tsx"],"sourcesContent":["import { RenderLeafProps } from 'slate-react'\nimport { CSSObject } from '@emotion/serialize'\nimport { Swatch, Typography } from '../../../../../api'\nimport { DeviceOverride, ResponsiveValue } from '../../../../../prop-controllers'\nimport { useTypography, useSwatches } from '../../../../../runtimes/react/hooks/makeswift-api'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\nimport { colorToString } from '../../../../utils/colorToString'\nimport { isNonNullable } from '../../../../utils/isNonNullable'\nimport { useResponsiveStyle } from '../../../../utils/responsive-style'\nimport { ColorValue } from '../../../../utils/types'\nimport { RichTextTypography } from '../../../../../controls'\nimport {\n findBreakpointOverride,\n shallowMergeFallbacks,\n} from '../../../../../state/modules/breakpoints'\nimport { useBreakpoints } from '../../../../../runtimes/react'\n\nexport type RichTextTypographyValue = RichTextTypography['style'][number]['value']\n\nfunction typographyFragementToRichTextTypography(\n typography: Typography | null,\n): RichTextTypography | undefined {\n if (typography == null) return undefined\n return {\n id: typography.id,\n style: typography.style.map(({ deviceId, value }) => ({\n deviceId,\n value: {\n fontFamily: value.fontFamily ?? undefined,\n lineHeight: value.lineHeight ?? undefined,\n letterSpacing: value.letterSpacing ?? undefined,\n fontWeight: value.fontWeight ?? undefined,\n textAlign: value.textAlign ?? undefined,\n uppercase: value.uppercase ?? undefined,\n underline: value.underline ?? undefined,\n strikethrough: value.strikethrough ?? undefined,\n italic: value.italic ?? undefined,\n fontSize: value.fontSize ?? undefined,\n color: value.color ?? undefined,\n },\n })),\n }\n}\n\ntype EnhancedColor = {\n color?: ColorValue\n}\n\ntype EnhancedTypographyValue = Omit<RichTextTypographyValue, keyof EnhancedColor> & EnhancedColor\n\nexport type EnhancedTypography = Array<DeviceOverride<EnhancedTypographyValue>>\n\nexport function getTypographyStyleSwatchIds(\n style: RichTextTypography['style'] | Typography['style'] | null | undefined,\n): string[] {\n return (\n style\n ?.map(override => override.value)\n .flatMap(typographyStyle => typographyStyle.color?.swatchId)\n .filter(isNonNullable) ?? []\n )\n}\n\nconst withColor =\n (swatches: Swatch[]) =>\n (\n deviceRawTypographyValue: DeviceOverride<RichTextTypographyValue>,\n ): DeviceOverride<EnhancedTypographyValue> => {\n const { value, deviceId } = deviceRawTypographyValue\n\n if (value.color == null) {\n const { color, ...nextValue } = value\n return {\n deviceId,\n value: nextValue,\n }\n }\n return {\n deviceId,\n value: {\n ...value,\n color: {\n swatch: swatches.find(s => s && s.id === value.color?.swatchId),\n alpha: value.color?.alpha ?? undefined,\n },\n },\n }\n }\n\nconst getDeviceId = ({ deviceId }: DeviceOverride<unknown>) => deviceId\n\n/**\n * `enhanced` here just means typography ids have been replaced with the related entity.\n */\nexport default function useEnhancedTypography(value?: RichTextTypography): EnhancedTypography {\n const typography = typographyFragementToRichTextTypography(useTypography(value?.id ?? null))\n const source = typography?.style ?? []\n const override = value?.style ?? []\n const breakpoints = useBreakpoints()\n\n const swatchIds = [\n ...getTypographyStyleSwatchIds(value?.style),\n ...getTypographyStyleSwatchIds(typography?.style),\n ]\n const swatches = useSwatches(swatchIds).filter(isNonNullable)\n\n const enhancedSource = source.map(withColor(swatches))\n const enhancedOverride = override.map(withColor(swatches))\n\n const devices = [\n ...new Set(enhancedSource.map(getDeviceId).concat(enhancedOverride.map(getDeviceId))),\n ]\n\n return devices\n .map(deviceId => {\n const deviceSource = findBreakpointOverride(breakpoints, enhancedSource, deviceId)?.value\n const deviceOverride = findBreakpointOverride(breakpoints, enhancedOverride, deviceId)?.value\n\n if (deviceSource && deviceOverride) {\n return {\n deviceId,\n value: { ...deviceSource, ...deviceOverride },\n }\n } else if (deviceOverride) {\n return {\n deviceId,\n value: deviceOverride,\n }\n } else if (deviceSource) {\n return {\n deviceId,\n value: deviceSource,\n }\n }\n return null\n })\n .filter(isNonNullable)\n}\n\nexport function useTypographyClassName(value: EnhancedTypography): string {\n return useStyle(\n useResponsiveStyle<\n EnhancedTypographyValue,\n [ResponsiveValue<EnhancedTypographyValue> | null | undefined]\n >(\n [value],\n ([value]) => {\n if (value === undefined) return {}\n\n let styles: CSSObject = {}\n if (value.color != null) styles.color = colorToString(value.color)\n if (value.fontFamily != null) styles.fontFamily = value.fontFamily\n if (value.fontSize != null && value.fontSize.value != null && value.fontSize.unit != null)\n styles.fontSize = `${value.fontSize.value}${value.fontSize.unit}`\n if (value.fontWeight != null) styles.fontWeight = value.fontWeight\n if (value.lineHeight != null) styles.lineHeight = value.lineHeight\n if (value.letterSpacing != null) styles.letterSpacing = `${value.letterSpacing / 10}em`\n if (value.uppercase != null)\n styles.textTransform = value.uppercase === true ? 'uppercase' : 'initial'\n if (value.underline != null || value.strikethrough != null)\n styles.textDecoration = [\n Boolean(value.underline) && 'underline',\n Boolean(value.strikethrough) && 'line-through',\n ]\n .filter(Boolean)\n .join(' ')\n if (value.italic != null) styles.fontStyle = value.italic === true ? 'italic' : 'initial'\n\n return styles\n },\n shallowMergeFallbacks,\n ),\n )\n}\n\nexport function Leaf({ leaf, ...props }: RenderLeafProps) {\n const enhancedTypography = useEnhancedTypography(leaf.typography)\n const typographyClassName = useTypographyClassName(enhancedTypography)\n\n return (\n <span {...props.attributes} className={typographyClassName}>\n {props.children}\n </span>\n )\n}\n"],"names":["typography","undefined","id","style","map","deviceId","value","fontFamily","lineHeight","letterSpacing","fontWeight","textAlign","uppercase","underline","strikethrough","italic","fontSize","color","override","flatMap","typographyStyle","swatchId","filter","isNonNullable","withColor","swatches","deviceRawTypographyValue","nextValue","swatch","find","s","alpha","getDeviceId","typographyFragementToRichTextTypography","useTypography","source","breakpoints","useBreakpoints","swatchIds","getTypographyStyleSwatchIds","useSwatches","enhancedSource","enhancedOverride","devices","Set","concat","deviceSource","findBreakpointOverride","deviceOverride","useStyle","useResponsiveStyle","styles","colorToString","unit","textTransform","textDecoration","Boolean","join","fontStyle","shallowMergeFallbacks","leaf","props","enhancedTypography","useEnhancedTypography","typographyClassName","useTypographyClassName","attributes","children"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,iDACEA,YACgC;AAChC,MAAIA,cAAc;AAAaC,WAAAA;AACxB,SAAA;AAAA,IACLC,IAAIF,WAAWE;AAAAA,IACfC,OAAOH,WAAWG,MAAMC,IAAI,CAAC;AAAA,MAAEC;AAAAA,MAAUC;AAAAA,UAAa;;AAAA;AAAA,QACpDD;AAAAA,QACAC,OAAO;AAAA,UACLC,YAAYD,YAAMC,eAAND,YAAoBL;AAAAA,UAChCO,YAAYF,YAAME,eAANF,YAAoBL;AAAAA,UAChCQ,eAAeH,YAAMG,kBAANH,YAAuBL;AAAAA,UACtCS,YAAYJ,YAAMI,eAANJ,YAAoBL;AAAAA,UAChCU,WAAWL,YAAMK,cAANL,YAAmBL;AAAAA,UAC9BW,WAAWN,YAAMM,cAANN,YAAmBL;AAAAA,UAC9BY,WAAWP,YAAMO,cAANP,YAAmBL;AAAAA,UAC9Ba,eAAeR,YAAMQ,kBAANR,YAAuBL;AAAAA,UACtCc,QAAQT,YAAMS,WAANT,YAAgBL;AAAAA,UACxBe,UAAUV,YAAMU,aAANV,YAAkBL;AAAAA,UAC5BgB,OAAOX,YAAMW,UAANX,YAAeL;AAAAA,QAXjB;AAAA,MAAA;AAAA,KAFF;AAAA,EAAA;AAiBV;AAUM,qCACLE,OACU;;AAERA,SAAAA,qCACIC,IAAIc,CAAYA,aAAAA,SAASZ,OAC1Ba,QAAQC,CAAmBA,oBAAAA;;AAAAA,kCAAgBH,UAAhBG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iBAAiB;AAAaA,aAAAA,gBAAiB,GAAEH,OAAMG,gBAAgB;AACjF,QAAIH,OAAMM,aAAa;AACrBuC,aAAOG,gBAAgBhD,OAAMM,cAAc,OAAO,cAAc;AAClE,QAAIN,OAAMO,aAAa,QAAQP,OAAMQ,iBAAiB;AACpDqC,aAAOI,iBAAiB,CACtBC,QAAQlD,OAAMO,SAAP,KAAqB,aAC5B2C,QAAQlD,OAAMQ,aAAP,KAAyB,cAFV,EAIrBQ,OAAOkC,OAJc,EAKrBC,KAAK,GALgB;AAM1B,QAAInD,OAAMS,UAAU;AAAMoC,aAAOO,YAAYpD,OAAMS,WAAW,OAAO,WAAW;AAEzEoC,WAAAA;AAAAA,EAAAA,GAETQ,qBA7BgB,CADL;AAiChB;AAEoB,cAAA,IAAqC;AAArC,eAAEC;AAAAA;AAAAA,MAAF,IAAWC,kBAAX,IAAWA;AAAAA,IAATD;AAAAA;AACfE,QAAAA,qBAAqBC,sBAAsBH,KAAK5D,UAAN;AAC1CgE,QAAAA,sBAAsBC,uBAAuBH,kBAAD;AAGhD,6BAAA,QAAA,iCAAUD,MAAMK,aAAhB;AAAA,IAA4B,WAAWF;AAAAA,IAAvC,UACGH,MAAMM;AAAAA,EAAAA,EAFX;AAKD;;"}
1
+ {"version":3,"file":"leaf.es.js","sources":["../src/components/builtin/Text/components/Leaf/leaf.tsx"],"sourcesContent":["import { RenderLeafProps } from 'slate-react'\nimport { CSSObject } from '@emotion/serialize'\nimport { Swatch, Typography } from '../../../../../api'\nimport { DeviceOverride, ResponsiveValue } from '../../../../../prop-controllers'\nimport { useTypography, useSwatches } from '../../../../../runtimes/react/hooks/makeswift-api'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\nimport { colorToString } from '../../../../utils/colorToString'\nimport { isNonNullable } from '../../../../utils/isNonNullable'\nimport { useResponsiveStyle } from '../../../../utils/responsive-style'\nimport { ColorValue } from '../../../../utils/types'\nimport {\n findBreakpointOverride,\n shallowMergeFallbacks,\n} from '../../../../../state/modules/breakpoints'\nimport { useBreakpoints } from '../../../../../runtimes/react'\nimport { RichTextTypography } from '../../../../../../types/slate'\n\nexport type RichTextTypographyValue = RichTextTypography['style'][number]['value']\n\nfunction typographyFragementToRichTextTypography(\n typography: Typography | null,\n): RichTextTypography | undefined {\n if (typography == null) return undefined\n return {\n id: typography.id,\n style: typography.style.map(({ deviceId, value }) => ({\n deviceId,\n value: {\n fontFamily: value.fontFamily ?? undefined,\n lineHeight: value.lineHeight ?? undefined,\n letterSpacing: value.letterSpacing ?? undefined,\n fontWeight: value.fontWeight ?? undefined,\n textAlign: value.textAlign ?? undefined,\n uppercase: value.uppercase ?? undefined,\n underline: value.underline ?? undefined,\n strikethrough: value.strikethrough ?? undefined,\n italic: value.italic ?? undefined,\n fontSize: value.fontSize ?? undefined,\n color: value.color ?? undefined,\n },\n })),\n }\n}\n\ntype EnhancedColor = {\n color?: ColorValue\n}\n\ntype EnhancedTypographyValue = Omit<RichTextTypographyValue, keyof EnhancedColor> & EnhancedColor\n\nexport type EnhancedTypography = Array<DeviceOverride<EnhancedTypographyValue>>\n\nexport function getTypographyStyleSwatchIds(\n style: RichTextTypography['style'] | Typography['style'] | null | undefined,\n): string[] {\n return (\n style\n ?.map(override => override.value)\n .flatMap(typographyStyle => typographyStyle.color?.swatchId)\n .filter(isNonNullable) ?? []\n )\n}\n\nconst withColor =\n (swatches: Swatch[]) =>\n (\n deviceRawTypographyValue: DeviceOverride<RichTextTypographyValue>,\n ): DeviceOverride<EnhancedTypographyValue> => {\n const { value, deviceId } = deviceRawTypographyValue\n\n if (value.color == null) {\n const { color, ...nextValue } = value\n return {\n deviceId,\n value: nextValue,\n }\n }\n return {\n deviceId,\n value: {\n ...value,\n color: {\n swatch: swatches.find(s => s && s.id === value.color?.swatchId),\n alpha: value.color?.alpha ?? undefined,\n },\n },\n }\n }\n\nconst getDeviceId = ({ deviceId }: DeviceOverride<unknown>) => deviceId\n\n/**\n * `enhanced` here just means typography ids have been replaced with the related entity.\n */\nexport default function useEnhancedTypography(value?: RichTextTypography): EnhancedTypography {\n const typography = typographyFragementToRichTextTypography(useTypography(value?.id ?? null))\n const source = typography?.style ?? []\n const override = value?.style ?? []\n const breakpoints = useBreakpoints()\n\n const swatchIds = [\n ...getTypographyStyleSwatchIds(value?.style),\n ...getTypographyStyleSwatchIds(typography?.style),\n ]\n const swatches = useSwatches(swatchIds).filter(isNonNullable)\n\n const enhancedSource = source.map(withColor(swatches))\n const enhancedOverride = override.map(withColor(swatches))\n\n const devices = [\n ...new Set(enhancedSource.map(getDeviceId).concat(enhancedOverride.map(getDeviceId))),\n ]\n\n return devices\n .map(deviceId => {\n const deviceSource = findBreakpointOverride(breakpoints, enhancedSource, deviceId)?.value\n const deviceOverride = findBreakpointOverride(breakpoints, enhancedOverride, deviceId)?.value\n\n if (deviceSource && deviceOverride) {\n return {\n deviceId,\n value: { ...deviceSource, ...deviceOverride },\n }\n } else if (deviceOverride) {\n return {\n deviceId,\n value: deviceOverride,\n }\n } else if (deviceSource) {\n return {\n deviceId,\n value: deviceSource,\n }\n }\n return null\n })\n .filter(isNonNullable)\n}\n\nexport function useTypographyClassName(value: EnhancedTypography): string {\n return useStyle(\n useResponsiveStyle<\n EnhancedTypographyValue,\n [ResponsiveValue<EnhancedTypographyValue> | null | undefined]\n >(\n [value],\n ([value]) => {\n if (value === undefined) return {}\n\n let styles: CSSObject = {}\n if (value.color != null) styles.color = colorToString(value.color)\n if (value.fontFamily != null) styles.fontFamily = value.fontFamily\n if (value.fontSize != null && value.fontSize.value != null && value.fontSize.unit != null)\n styles.fontSize = `${value.fontSize.value}${value.fontSize.unit}`\n if (value.fontWeight != null) styles.fontWeight = value.fontWeight\n if (value.lineHeight != null) styles.lineHeight = value.lineHeight\n if (value.letterSpacing != null) styles.letterSpacing = `${value.letterSpacing / 10}em`\n if (value.uppercase != null)\n styles.textTransform = value.uppercase === true ? 'uppercase' : 'initial'\n if (value.underline != null || value.strikethrough != null)\n styles.textDecoration = [\n Boolean(value.underline) && 'underline',\n Boolean(value.strikethrough) && 'line-through',\n ]\n .filter(Boolean)\n .join(' ')\n if (value.italic != null) styles.fontStyle = value.italic === true ? 'italic' : 'initial'\n\n return styles\n },\n shallowMergeFallbacks,\n ),\n )\n}\n\nexport function Leaf({ leaf, ...props }: RenderLeafProps) {\n const enhancedTypography = useEnhancedTypography(leaf.typography)\n const typographyClassName = useTypographyClassName(enhancedTypography)\n\n return (\n <span {...props.attributes} className={typographyClassName}>\n {props.children}\n </span>\n )\n}\n"],"names":["typography","undefined","id","style","map","deviceId","value","fontFamily","lineHeight","letterSpacing","fontWeight","textAlign","uppercase","underline","strikethrough","italic","fontSize","color","override","flatMap","typographyStyle","swatchId","filter","isNonNullable","withColor","swatches","deviceRawTypographyValue","nextValue","swatch","find","s","alpha","getDeviceId","typographyFragementToRichTextTypography","useTypography","source","breakpoints","useBreakpoints","swatchIds","getTypographyStyleSwatchIds","useSwatches","enhancedSource","enhancedOverride","devices","Set","concat","deviceSource","findBreakpointOverride","deviceOverride","useStyle","useResponsiveStyle","styles","colorToString","unit","textTransform","textDecoration","Boolean","join","fontStyle","shallowMergeFallbacks","leaf","props","enhancedTypography","useEnhancedTypography","typographyClassName","useTypographyClassName","attributes","children"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,iDACEA,YACgC;AAChC,MAAIA,cAAc;AAAaC,WAAAA;AACxB,SAAA;AAAA,IACLC,IAAIF,WAAWE;AAAAA,IACfC,OAAOH,WAAWG,MAAMC,IAAI,CAAC;AAAA,MAAEC;AAAAA,MAAUC;AAAAA,UAAa;;AAAA;AAAA,QACpDD;AAAAA,QACAC,OAAO;AAAA,UACLC,YAAYD,YAAMC,eAAND,YAAoBL;AAAAA,UAChCO,YAAYF,YAAME,eAANF,YAAoBL;AAAAA,UAChCQ,eAAeH,YAAMG,kBAANH,YAAuBL;AAAAA,UACtCS,YAAYJ,YAAMI,eAANJ,YAAoBL;AAAAA,UAChCU,WAAWL,YAA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A,EAFX;AAKD;;"}
package/dist/main.cjs.js CHANGED
@@ -5,8 +5,7 @@ var constants = require("./constants.cjs.js");
5
5
  require("redux");
6
6
  require("redux-thunk");
7
7
  require("./descriptors.cjs.js");
8
- require("slate");
9
- require("slate-react");
8
+ require("./slate.cjs2.js");
10
9
  require("./state/breakpoints.cjs.js");
11
10
  require("./introspection.cjs.js");
12
11
  exports.ActionTypes = actions.ActionTypes;
@@ -1 +1 @@
1
- {"version":3,"file":"main.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"main.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/main.es.js CHANGED
@@ -3,8 +3,7 @@ export { M as MakeswiftComponentType, c as createDocument } from "./constants.es
3
3
  import "redux";
4
4
  import "redux-thunk";
5
5
  import "./descriptors.es.js";
6
- import "slate";
7
- import "slate-react";
6
+ import "./slate.es2.js";
8
7
  import "./state/breakpoints.es.js";
9
8
  import "./introspection.es.js";
10
9
  //# sourceMappingURL=main.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
1
+ {"version":3,"file":"main.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
package/dist/next.cjs.js CHANGED
@@ -10,8 +10,7 @@ require("redux");
10
10
  require("redux-thunk");
11
11
  require("./actions.cjs.js");
12
12
  require("./descriptors.cjs.js");
13
- require("slate");
14
- require("slate-react");
13
+ require("./slate.cjs2.js");
15
14
  require("./state/breakpoints.cjs.js");
16
15
  require("./introspection.cjs.js");
17
16
  require("@emotion/css");
@@ -25,8 +24,6 @@ require("./box-models.cjs.js");
25
24
  require("css-box-model");
26
25
  require("color");
27
26
  require("scroll-into-view-if-needed");
28
- require("is-hotkey");
29
- require("slate-history");
30
27
  require("react-dom");
31
28
  require("html-react-parser");
32
29
  require("next/head");
@@ -1 +1 @@
1
- {"version":3,"file":"next.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"next.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/next.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "react";
2
- export { a0 as Document, _ as Makeswift, a1 as MakeswiftApiHandler, Z as Page, $ as PreviewModeScript, G as forwardNextDynamicRef, Y as getServerSideProps, W as getStaticPaths, X as getStaticProps } from "./index.es.js";
2
+ export { $ as Document, Z as Makeswift, a0 as MakeswiftApiHandler, Y as Page, _ as PreviewModeScript, F as forwardNextDynamicRef, X as getServerSideProps, V as getStaticPaths, W as getStaticProps } from "./index.es.js";
3
3
  import "react/jsx-runtime";
4
4
  import "use-sync-external-store/shim/with-selector";
5
5
  import "next/dynamic";
@@ -8,8 +8,7 @@ import "redux";
8
8
  import "redux-thunk";
9
9
  import "./actions.es.js";
10
10
  import "./descriptors.es.js";
11
- import "slate";
12
- import "slate-react";
11
+ import "./slate.es2.js";
13
12
  import "./state/breakpoints.es.js";
14
13
  import "./introspection.es.js";
15
14
  import "@emotion/css";
@@ -23,8 +22,6 @@ import "./box-models.es.js";
23
22
  import "css-box-model";
24
23
  import "color";
25
24
  import "scroll-into-view-if-needed";
26
- import "is-hotkey";
27
- import "slate-history";
28
25
  import "react-dom";
29
26
  import "html-react-parser";
30
27
  import "next/head";
@@ -1 +1 @@
1
- {"version":3,"file":"next.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"next.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -2,9 +2,8 @@
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  var descriptors = require("./descriptors.cjs.js");
4
4
  var introspection = require("./introspection.cjs.js");
5
- require("slate");
6
- require("slate-react");
7
5
  require("./actions.cjs.js");
6
+ require("./slate.cjs2.js");
8
7
  exports.Props = descriptors.descriptors;
9
8
  exports.RichTextPropControllerMessageType = descriptors.RichTextPropControllerMessageType;
10
9
  exports.TableFormFieldsMessageType = descriptors.TableFormFieldsMessageType;
@@ -1 +1 @@
1
- {"version":3,"file":"prop-controllers.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
1
+ {"version":3,"file":"prop-controllers.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -1,6 +1,5 @@
1
1
  export { d as Props, R as RichTextPropControllerMessageType, e as TableFormFieldsMessageType } from "./descriptors.es.js";
2
2
  export { i as Introspection } from "./introspection.es.js";
3
- import "slate";
4
- import "slate-react";
5
3
  import "./actions.es.js";
4
+ import "./slate.es2.js";
6
5
  //# sourceMappingURL=prop-controllers.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prop-controllers.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
1
+ {"version":3,"file":"prop-controllers.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
package/dist/react.cjs.js CHANGED
@@ -9,8 +9,7 @@ require("./constants.cjs.js");
9
9
  require("redux");
10
10
  require("redux-thunk");
11
11
  require("./descriptors.cjs.js");
12
- require("slate");
13
- require("slate-react");
12
+ require("./slate.cjs2.js");
14
13
  require("./state/breakpoints.cjs.js");
15
14
  require("./introspection.cjs.js");
16
15
  require("@emotion/css");
@@ -25,8 +24,6 @@ require("./box-models.cjs.js");
25
24
  require("css-box-model");
26
25
  require("color");
27
26
  require("scroll-into-view-if-needed");
28
- require("is-hotkey");
29
- require("slate-history");
30
27
  require("react-dom");
31
28
  require("html-react-parser");
32
29
  require("next/head");
@@ -1 +1 @@
1
- {"version":3,"file":"react.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"react.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/react.es.js CHANGED
@@ -7,8 +7,7 @@ import "./constants.es.js";
7
7
  import "redux";
8
8
  import "redux-thunk";
9
9
  import "./descriptors.es.js";
10
- import "slate";
11
- import "slate-react";
10
+ import "./slate.es2.js";
12
11
  import "./state/breakpoints.es.js";
13
12
  import "./introspection.es.js";
14
13
  import "@emotion/css";
@@ -23,8 +22,6 @@ import "./box-models.es.js";
23
22
  import "css-box-model";
24
23
  import "color";
25
24
  import "scroll-into-view-if-needed";
26
- import "is-hotkey";
27
- import "slate-history";
28
25
  import "react-dom";
29
26
  import "html-react-parser";
30
27
  import "next/head";
@@ -1 +1 @@
1
- {"version":3,"file":"react.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"react.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/slate.cjs.js CHANGED
@@ -1,17 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  var index = require("./index.cjs5.js");
4
+ var index$1 = require("./index.cjs6.js");
4
5
  require("slate");
5
6
  require("is-hotkey");
6
- require("./descriptors.cjs.js");
7
- require("slate-react");
8
- require("./actions.cjs.js");
7
+ require("./element.cjs.js");
8
+ require("./slate.cjs2.js");
9
9
  require("./state/breakpoints.cjs.js");
10
+ require("./actions.cjs.js");
11
+ require("slate-react");
10
12
  exports.Block = index.Block;
11
13
  exports.List = index.List;
12
14
  exports.Typography = index.Typography;
13
15
  exports.onKeyDown = index.onKeyDown;
14
16
  exports.withBlock = index.withBlock;
17
+ exports.withBuilder = index.withBuilder;
15
18
  exports.withList = index.withList;
16
19
  exports.withTypography = index.withTypography;
20
+ exports.InlineMode = index$1.InlineMode;
21
+ exports.withInlineMode = index$1.withInlineMode;
17
22
  //# sourceMappingURL=slate.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"slate.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"slate.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __defProps = Object.defineProperties;
4
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __spreadValues = (a, b) => {
10
+ for (var prop in b || (b = {}))
11
+ if (__hasOwnProp.call(b, prop))
12
+ __defNormalProp(a, prop, b[prop]);
13
+ if (__getOwnPropSymbols)
14
+ for (var prop of __getOwnPropSymbols(b)) {
15
+ if (__propIsEnum.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ }
18
+ return a;
19
+ };
20
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
21
+ const RootBlockType = {
22
+ Text: "text-block",
23
+ Paragraph: "paragraph",
24
+ Heading1: "heading-one",
25
+ Heading2: "heading-two",
26
+ Heading3: "heading-three",
27
+ Heading4: "heading-four",
28
+ Heading5: "heading-five",
29
+ Heading6: "heading-six",
30
+ BlockQuote: "blockquote",
31
+ UnorderedList: "unordered-list",
32
+ OrderedList: "ordered-list"
33
+ };
34
+ const BlockType = __spreadProps(__spreadValues({}, RootBlockType), {
35
+ ListItem: "list-item",
36
+ ListItemChild: "list-item-child"
37
+ });
38
+ const InlineType = {
39
+ Code: "code",
40
+ SuperScript: "superscript",
41
+ SubScript: "subscript",
42
+ Link: "link"
43
+ };
44
+ exports.BlockType = BlockType;
45
+ exports.InlineType = InlineType;
46
+ //# sourceMappingURL=slate.cjs2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slate.cjs2.js","sources":["../types/slate.ts"],"sourcesContent":["import { BaseEditor, Descendant } from 'slate'\nimport { ReactEditor } from 'slate-react'\nimport { LinkControlData } from '../src/controls'\nimport { HistoryEditor } from 'slate-history'\nimport { BuilderEditor } from '../src/slate'\nimport { ResponsiveValue } from '../src/prop-controllers'\n\nexport type RichTextTypography = {\n id?: string\n style: Array<{\n deviceId: string\n value: {\n fontFamily?: string | null\n lineHeight?: number | null\n letterSpacing?: number | null\n fontWeight?: number | null\n textAlign?: string | null\n uppercase?: boolean | null\n underline?: boolean | null\n strikethrough?: boolean | null\n italic?: boolean | null\n fontSize?: { value: number | null; unit: string | null } | null\n color?: { swatchId: string | null; alpha: number | null } | null\n }\n }>\n}\n\nexport type Text = {\n text: string\n typography?: RichTextTypography\n slice?: boolean\n}\n\nexport const RootBlockType = {\n Text: 'text-block',\n Paragraph: 'paragraph',\n Heading1: 'heading-one',\n Heading2: 'heading-two',\n Heading3: 'heading-three',\n Heading4: 'heading-four',\n Heading5: 'heading-five',\n Heading6: 'heading-six',\n BlockQuote: 'blockquote',\n UnorderedList: 'unordered-list',\n OrderedList: 'ordered-list',\n} as const\n\nexport type RootBlockType = typeof RootBlockType[keyof typeof RootBlockType]\n\nexport const BlockType = {\n ...RootBlockType,\n ListItem: 'list-item',\n ListItemChild: 'list-item-child',\n} as const\n\nexport type BlockType = typeof BlockType[keyof typeof BlockType]\n\nexport type TextElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Text\n}\n\nexport type ParagraphElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Paragraph\n}\n\nexport type Heading1Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading1\n}\n\nexport type Heading2Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading2\n}\n\nexport type Heading3Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading3\n}\n\nexport type Heading4Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading4\n}\n\nexport type Heading5Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading5\n}\n\nexport type Heading6Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading6\n}\n\nexport type BlockQuoteElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.BlockQuote\n}\n\nexport type UnorderedListElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.UnorderedList\n}\n\nexport type OrderedListElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.OrderedList\n}\n\nexport type ListElement = OrderedListElement | UnorderedListElement\n\nexport type ListItemElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.ListItem\n}\n\nexport type ListItemChildElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.ListItemChild\n}\n\nexport const InlineType = {\n Code: 'code',\n SuperScript: 'superscript',\n SubScript: 'subscript',\n Link: 'link',\n} as const\n\nexport type InlineType = typeof InlineType[keyof typeof InlineType]\n\nexport const BlockTextAlignment = {\n Left: 'left',\n Center: 'center',\n Right: 'right',\n Justify: 'justify',\n} as const\n\nexport type BlockTextAlignment = typeof BlockTextAlignment[keyof typeof BlockTextAlignment]\n\nexport type ResponsiveBlockTextAlignment = ResponsiveValue<BlockTextAlignment>\n\nexport type CodeElement = {\n children: Array<Text | Inline>\n type: typeof InlineType.Code\n}\n\nexport type SuperElement = {\n children: Array<Text | Inline>\n type: typeof InlineType.SuperScript\n}\n\nexport type SubElement = {\n children: Array<Text | Inline>\n type: typeof InlineType.SubScript\n}\n\nexport type LinkElement = {\n children: Array<Text | Inline>\n type: typeof InlineType.Link\n link: LinkControlData\n}\n\nexport type RootBlock =\n | TextElement\n | ParagraphElement\n | Heading1Element\n | Heading2Element\n | Heading3Element\n | Heading4Element\n | Heading5Element\n | Heading6Element\n | BlockQuoteElement\n | ListElement\n\nexport type Block = RootBlock | ListItemElement | ListItemChildElement\n\nexport type Inline = CodeElement | SuperElement | SubElement | LinkElement\n\nexport type Element = Block | Inline\n\nexport type RichTextDAO = Descendant[]\n\nexport type MakeswiftEditor = BaseEditor & ReactEditor & HistoryEditor & BuilderEditor\n\ndeclare module 'slate' {\n interface CustomTypes {\n Editor: MakeswiftEditor\n Element: Element\n Text: Text\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAiCO,MAAM,gBAAgB;AAAA,EAC3B,MAAM;AAAA,EACN,WAAW;AAAA,EACX,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,aAAa;AACf;AAIO,MAAM,YAAY,iCACpB,gBADoB;AAAA,EAEvB,UAAU;AAAA,EACV,eAAe;AACjB;AAoFO,MAAM,aAAa;AAAA,EACxB,MAAM;AAAA,EACN,aAAa;AAAA,EACb,WAAW;AAAA,EACX,MAAM;AACR;;;"}
package/dist/slate.es.js CHANGED
@@ -1,8 +1,10 @@
1
- export { B as Block, L as List, T as Typography, o as onKeyDown, b as withBlock, w as withList, a as withTypography } from "./index.es5.js";
1
+ export { B as Block, L as List, T as Typography, o as onKeyDown, b as withBlock, c as withBuilder, w as withList, a as withTypography } from "./index.es5.js";
2
+ export { I as InlineMode, w as withInlineMode } from "./index.es6.js";
2
3
  import "slate";
3
4
  import "is-hotkey";
4
- import "./descriptors.es.js";
5
- import "slate-react";
6
- import "./actions.es.js";
5
+ import "./element.es.js";
6
+ import "./slate.es2.js";
7
7
  import "./state/breakpoints.es.js";
8
+ import "./actions.es.js";
9
+ import "slate-react";
8
10
  //# sourceMappingURL=slate.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"slate.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
1
+ {"version":3,"file":"slate.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}
@@ -0,0 +1,44 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ const RootBlockType = {
21
+ Text: "text-block",
22
+ Paragraph: "paragraph",
23
+ Heading1: "heading-one",
24
+ Heading2: "heading-two",
25
+ Heading3: "heading-three",
26
+ Heading4: "heading-four",
27
+ Heading5: "heading-five",
28
+ Heading6: "heading-six",
29
+ BlockQuote: "blockquote",
30
+ UnorderedList: "unordered-list",
31
+ OrderedList: "ordered-list"
32
+ };
33
+ const BlockType = __spreadProps(__spreadValues({}, RootBlockType), {
34
+ ListItem: "list-item",
35
+ ListItemChild: "list-item-child"
36
+ });
37
+ const InlineType = {
38
+ Code: "code",
39
+ SuperScript: "superscript",
40
+ SubScript: "subscript",
41
+ Link: "link"
42
+ };
43
+ export { BlockType as B, InlineType as I };
44
+ //# sourceMappingURL=slate.es2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slate.es2.js","sources":["../types/slate.ts"],"sourcesContent":["import { BaseEditor, Descendant } from 'slate'\nimport { ReactEditor } from 'slate-react'\nimport { LinkControlData } from '../src/controls'\nimport { HistoryEditor } from 'slate-history'\nimport { BuilderEditor } from '../src/slate'\nimport { ResponsiveValue } from '../src/prop-controllers'\n\nexport type RichTextTypography = {\n id?: string\n style: Array<{\n deviceId: string\n value: {\n fontFamily?: string | null\n lineHeight?: number | null\n letterSpacing?: number | null\n fontWeight?: number | null\n textAlign?: string | null\n uppercase?: boolean | null\n underline?: boolean | null\n strikethrough?: boolean | null\n italic?: boolean | null\n fontSize?: { value: number | null; unit: string | null } | null\n color?: { swatchId: string | null; alpha: number | null } | null\n }\n }>\n}\n\nexport type Text = {\n text: string\n typography?: RichTextTypography\n slice?: boolean\n}\n\nexport const RootBlockType = {\n Text: 'text-block',\n Paragraph: 'paragraph',\n Heading1: 'heading-one',\n Heading2: 'heading-two',\n Heading3: 'heading-three',\n Heading4: 'heading-four',\n Heading5: 'heading-five',\n Heading6: 'heading-six',\n BlockQuote: 'blockquote',\n UnorderedList: 'unordered-list',\n OrderedList: 'ordered-list',\n} as const\n\nexport type RootBlockType = typeof RootBlockType[keyof typeof RootBlockType]\n\nexport const BlockType = {\n ...RootBlockType,\n ListItem: 'list-item',\n ListItemChild: 'list-item-child',\n} as const\n\nexport type BlockType = typeof BlockType[keyof typeof BlockType]\n\nexport type TextElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Text\n}\n\nexport type ParagraphElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Paragraph\n}\n\nexport type Heading1Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading1\n}\n\nexport type Heading2Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading2\n}\n\nexport type Heading3Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading3\n}\n\nexport type Heading4Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading4\n}\n\nexport type Heading5Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading5\n}\n\nexport type Heading6Element = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.Heading6\n}\n\nexport type BlockQuoteElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.BlockQuote\n}\n\nexport type UnorderedListElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.UnorderedList\n}\n\nexport type OrderedListElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.OrderedList\n}\n\nexport type ListElement = OrderedListElement | UnorderedListElement\n\nexport type ListItemElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.ListItem\n}\n\nexport type ListItemChildElement = {\n textAlign?: ResponsiveBlockTextAlignment\n children: Array<Element | Text>\n type: typeof BlockType.ListItemChild\n}\n\nexport const InlineType = {\n Code: 'code',\n SuperScript: 'superscript',\n SubScript: 'subscript',\n Link: 'link',\n} as const\n\nexport type InlineType = typeof InlineType[keyof typeof InlineType]\n\nexport const BlockTextAlignment = {\n Left: 'left',\n Center: 'center',\n Right: 'right',\n Justify: 'justify',\n} as const\n\nexport type BlockTextAlignment = typeof BlockTextAlignment[keyof typeof BlockTextAlignment]\n\nexport type ResponsiveBlockTextAlignment = ResponsiveValue<BlockTextAlignment>\n\nexport type CodeElement = {\n children: Array<Text | Inline>\n type: typeof InlineType.Code\n}\n\nexport type SuperElement = {\n children: Array<Text | Inline>\n type: typeof InlineType.SuperScript\n}\n\nexport type SubElement = {\n children: Array<Text | Inline>\n type: typeof InlineType.SubScript\n}\n\nexport type LinkElement = {\n children: Array<Text | Inline>\n type: typeof InlineType.Link\n link: LinkControlData\n}\n\nexport type RootBlock =\n | TextElement\n | ParagraphElement\n | Heading1Element\n | Heading2Element\n | Heading3Element\n | Heading4Element\n | Heading5Element\n | Heading6Element\n | BlockQuoteElement\n | ListElement\n\nexport type Block = RootBlock | ListItemElement | ListItemChildElement\n\nexport type Inline = CodeElement | SuperElement | SubElement | LinkElement\n\nexport type Element = Block | Inline\n\nexport type RichTextDAO = Descendant[]\n\nexport type MakeswiftEditor = BaseEditor & ReactEditor & HistoryEditor & BuilderEditor\n\ndeclare module 'slate' {\n interface CustomTypes {\n Editor: MakeswiftEditor\n Element: Element\n Text: Text\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAiCO,MAAM,gBAAgB;AAAA,EAC3B,MAAM;AAAA,EACN,WAAW;AAAA,EACX,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,eAAe;AAAA,EACf,aAAa;AACf;AAIO,MAAM,YAAY,iCACpB,gBADoB;AAAA,EAEvB,UAAU;AAAA,EACV,eAAe;AACjB;AAoFO,MAAM,aAAa;AAAA,EACxB,MAAM;AAAA,EACN,aAAa;AAAA,EACb,WAAW;AAAA,EACX,MAAM;AACR;;"}
@@ -88,7 +88,7 @@ declare const Button: import("react").ForwardRefExoticComponent<BaseProps<Elemen
88
88
  };
89
89
  }) | undefined;
90
90
  onClick?: ((event: import("react").MouseEvent<HTMLAnchorElement, MouseEvent>) => unknown) | undefined;
91
- }> & import("react").RefAttributes<HTMLAnchorElement>, "type" | "property" | "key" | "is" | "id" | "color" | "translate" | "style" | "children" | "hidden" | "defaultValue" | "resource" | "slot" | "title" | "dir" | "rel" | "href" | "itemProp" | "dangerouslySetInnerHTML" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "referrerPolicy" | "download" | "hrefLang" | "media" | "ping" | "target" | keyof {
91
+ }> & import("react").RefAttributes<HTMLAnchorElement>, "type" | "property" | "key" | "is" | "id" | "color" | "translate" | "style" | "onChange" | "children" | "hidden" | "defaultValue" | "resource" | "slot" | "title" | "dir" | "rel" | "href" | "itemProp" | "dangerouslySetInnerHTML" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "referrerPolicy" | "download" | "hrefLang" | "media" | "ping" | "target" | keyof {
92
92
  link?: ({
93
93
  type: "OPEN_PAGE";
94
94
  payload: {
@@ -8,6 +8,6 @@ declare type BaseProps = {
8
8
  };
9
9
  declare const _default: import("react").ForwardRefExoticComponent<BaseProps & Omit<Pick<Partial<Pick<FormContextValue, "size" | "contrast" | "brandColor">> & {
10
10
  error?: boolean | undefined;
11
- } & Omit<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "size" | "error" | "contrast" | "brandColor"> & import("react").RefAttributes<HTMLInputElement>, "type" | "property" | "key" | "is" | "id" | "color" | "height" | "translate" | "width" | "style" | "value" | "children" | "name" | "size" | "hidden" | "defaultValue" | "min" | "max" | "step" | "resource" | "form" | "slot" | "title" | "pattern" | "error" | "dir" | "list" | "itemProp" | "dangerouslySetInnerHTML" | "crossOrigin" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "multiple" | "disabled" | "alt" | "src" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "accept" | "autoComplete" | "capture" | "checked" | "enterKeyHint" | "maxLength" | "minLength" | "readOnly" | "required" | "contrast" | "brandColor">, keyof BaseProps> & import("react").RefAttributes<HTMLInputElement>>;
11
+ } & Omit<Pick<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof import("react").InputHTMLAttributes<HTMLInputElement>>, "size" | "error" | "contrast" | "brandColor"> & import("react").RefAttributes<HTMLInputElement>, "type" | "property" | "key" | "is" | "id" | "color" | "height" | "translate" | "width" | "style" | "value" | "onChange" | "children" | "name" | "size" | "hidden" | "defaultValue" | "min" | "max" | "step" | "resource" | "form" | "slot" | "title" | "pattern" | "error" | "dir" | "list" | "itemProp" | "dangerouslySetInnerHTML" | "crossOrigin" | "defaultChecked" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "multiple" | "disabled" | "alt" | "src" | "autoFocus" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "accept" | "autoComplete" | "capture" | "checked" | "enterKeyHint" | "maxLength" | "minLength" | "readOnly" | "required" | "contrast" | "brandColor">, keyof BaseProps> & import("react").RefAttributes<HTMLInputElement>>;
12
12
  export default _default;
13
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"editable-text.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/builtin/Text/EditableText/editable-text.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAA;AAGxF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAA;AAE3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAA;AAYzF,aAAK,KAAK,GAAG;IACX,EAAE,CAAC,EAAE,cAAc,CAAA;IACnB,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAID,eAAO,MAAM,YAAY,sHAmFvB,CAAA;AAEF,eAAe,YAAY,CAAA"}
1
+ {"version":3,"file":"editable-text.d.ts","sourceRoot":"","sources":["../../../../../../../src/components/builtin/Text/EditableText/editable-text.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,0CAA0C,CAAA;AAGxF,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAA;AAE3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAA;AAazF,aAAK,KAAK,GAAG;IACX,EAAE,CAAC,EAAE,cAAc,CAAA;IACnB,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAID,eAAO,MAAM,YAAY,sHAqFvB,CAAA;AAEF,eAAe,YAAY,CAAA"}
@@ -1,6 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { Block, Inline, Text } from '../../../controls';
2
+ import { Text } from 'slate';
3
3
  import type { ElementIDValue, RichTextValue } from '../../../prop-controllers/descriptors';
4
+ import { Inline, Block } from '../../../../types/slate';
4
5
  declare type Props = {
5
6
  id?: ElementIDValue;
6
7
  text?: RichTextValue;
@@ -1 +1 @@
1
- {"version":3,"file":"ReadOnlyText.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Text/ReadOnlyText.tsx"],"names":[],"mappings":";AAEA,OAAO,EACL,KAAK,EAEL,MAAM,EAGN,IAAI,EAEL,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAA;AAO1F,aAAK,KAAK,GAAG;IACX,EAAE,CAAC,EAAE,cAAc,CAAA;IACnB,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,QAAA,MAAM,YAAY,kGAYhB,CAAA;AAEF,eAAe,YAAY,CAAA;AAmB3B,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,IAAI,CAAA;CACjB;AAED,wBAAgB,WAAW,CAAC,EAAE,UAAU,EAAE,EAAE,SAAS,eASpD;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAA;CACnB;AAoCD,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,KAAK,CAAA;CAClB;AAED,wBAAgB,YAAY,CAAC,EAAE,UAAU,EAAE,EAAE,UAAU,eAgGtD"}
1
+ {"version":3,"file":"ReadOnlyText.d.ts","sourceRoot":"","sources":["../../../../../../src/components/builtin/Text/ReadOnlyText.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAc,IAAI,EAAE,MAAM,OAAO,CAAA;AAExC,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAA;AAM1F,OAAO,EAAE,MAAM,EAAc,KAAK,EAAa,MAAM,yBAAyB,CAAA;AAG9E,aAAK,KAAK,GAAG;IACX,EAAE,CAAC,EAAE,cAAc,CAAA;IACnB,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,QAAA,MAAM,YAAY,kGAYhB,CAAA;AAEF,eAAe,YAAY,CAAA;AAmB3B,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,IAAI,CAAA;CACjB;AAED,wBAAgB,WAAW,CAAC,EAAE,UAAU,EAAE,EAAE,SAAS,eASpD;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAA;CACnB;AAoCD,MAAM,WAAW,UAAU;IACzB,UAAU,EAAE,KAAK,CAAA;CAClB;AAED,wBAAgB,YAAY,CAAC,EAAE,UAAU,EAAE,EAAE,UAAU,eAgGtD"}
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { RenderElementProps } from 'slate-react';
3
- import { Block } from '../../../../../controls';
3
+ import { Block } from '../../../../../../types/slate';
4
4
  export interface InlineRenderElementProps extends RenderElementProps {
5
5
  element: Block;
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/builtin/Text/components/Element/block.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,KAAK,EAAa,MAAM,yBAAyB,CAAA;AAI1D,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAClE,OAAO,EAAE,KAAK,CAAA;CACf;AAED,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,wBAAwB,eAiGvF"}
1
+ {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../../../../../../src/components/builtin/Text/components/Element/block.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAGhD,OAAO,EAAE,KAAK,EAAa,MAAM,+BAA+B,CAAA;AAEhE,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAClE,OAAO,EAAE,KAAK,CAAA;CACf;AAED,wBAAgB,YAAY,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,EAAE,wBAAwB,eAiGvF"}