@makeswift/runtime 0.9.3 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/Box.cjs.js +1 -1
  2. package/dist/Box.es.js +2 -2
  3. package/dist/Button.cjs.js +1 -1
  4. package/dist/Button.es.js +2 -2
  5. package/dist/Carousel.cjs.js +1 -1
  6. package/dist/Carousel.es.js +2 -2
  7. package/dist/Countdown.cjs.js +1 -1
  8. package/dist/Countdown.es.js +2 -2
  9. package/dist/Divider.cjs.js +1 -1
  10. package/dist/Divider.es.js +2 -2
  11. package/dist/Embed.es.js +1 -1
  12. package/dist/Form.cjs.js +1 -1
  13. package/dist/Form.es.js +2 -2
  14. package/dist/Image.cjs.js +1 -1
  15. package/dist/Image.es.js +2 -2
  16. package/dist/LiveProvider.cjs.js +1 -1
  17. package/dist/LiveProvider.es.js +1 -1
  18. package/dist/Navigation.cjs.js +1 -1
  19. package/dist/Navigation.es.js +2 -2
  20. package/dist/PreviewProvider.cjs.js +1 -1
  21. package/dist/PreviewProvider.es.js +2 -2
  22. package/dist/ReadOnlyText.cjs.js +3 -4
  23. package/dist/ReadOnlyText.cjs.js.map +1 -1
  24. package/dist/ReadOnlyText.es.js +3 -4
  25. package/dist/ReadOnlyText.es.js.map +1 -1
  26. package/dist/ReadOnlyTextV2.cjs.js +10 -11
  27. package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
  28. package/dist/ReadOnlyTextV2.es.js +9 -10
  29. package/dist/ReadOnlyTextV2.es.js.map +1 -1
  30. package/dist/Root.cjs.js +1 -1
  31. package/dist/Root.es.js +2 -2
  32. package/dist/SocialLinks.cjs.js +1 -1
  33. package/dist/SocialLinks.es.js +2 -2
  34. package/dist/Text.cjs.js +1 -1
  35. package/dist/Text.es.js +1 -1
  36. package/dist/Video.es.js +1 -1
  37. package/dist/components.cjs.js +1 -1
  38. package/dist/components.es.js +1 -1
  39. package/dist/control-serialization.es.js +1 -1
  40. package/dist/controls.cjs.js +18 -14
  41. package/dist/controls.cjs.js.map +1 -1
  42. package/dist/controls.es.js +2 -2
  43. package/dist/index.cjs.js +161 -49
  44. package/dist/index.cjs.js.map +1 -1
  45. package/dist/index.cjs10.js +22 -10
  46. package/dist/index.cjs10.js.map +1 -1
  47. package/dist/index.cjs5.js +99 -5
  48. package/dist/index.cjs5.js.map +1 -1
  49. package/dist/index.cjs8.js +1 -1
  50. package/dist/index.cjs9.js +1 -1
  51. package/dist/index.es.js +148 -37
  52. package/dist/index.es.js.map +1 -1
  53. package/dist/index.es10.js +23 -11
  54. package/dist/index.es10.js.map +1 -1
  55. package/dist/index.es2.js +1 -1
  56. package/dist/index.es4.js +1 -1
  57. package/dist/index.es5.js +91 -2
  58. package/dist/index.es5.js.map +1 -1
  59. package/dist/index.es6.js +1 -1
  60. package/dist/index.es8.js +1 -1
  61. package/dist/index.es9.js +2 -2
  62. package/dist/next.cjs.js +1 -1
  63. package/dist/next.es.js +2 -2
  64. package/dist/react-page.cjs.js +97 -8
  65. package/dist/react-page.cjs.js.map +1 -1
  66. package/dist/react-page.es.js +95 -8
  67. package/dist/react-page.es.js.map +1 -1
  68. package/dist/react.cjs.js +1 -1
  69. package/dist/react.es.js +1 -1
  70. package/dist/slate.cjs.js +17 -70
  71. package/dist/slate.cjs.js.map +1 -1
  72. package/dist/slate.es.js +20 -74
  73. package/dist/slate.es.js.map +1 -1
  74. package/dist/types/src/components/builtin/Button/Button.d.ts +1 -1
  75. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +1 -1
  76. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +1 -1
  77. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts +0 -17
  78. package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +1 -1
  79. package/dist/types/src/controls/control.d.ts +3 -2
  80. package/dist/types/src/controls/control.d.ts.map +1 -1
  81. package/dist/types/src/controls/index.d.ts +1 -0
  82. package/dist/types/src/controls/index.d.ts.map +1 -1
  83. package/dist/types/src/controls/list.d.ts +2 -0
  84. package/dist/types/src/controls/list.d.ts.map +1 -1
  85. package/dist/types/src/controls/shape.d.ts +2 -0
  86. package/dist/types/src/controls/shape.d.ts.map +1 -1
  87. package/dist/types/src/controls/typography.d.ts +31 -0
  88. package/dist/types/src/controls/typography.d.ts.map +1 -0
  89. package/dist/types/src/next/client.d.ts.map +1 -1
  90. package/dist/types/src/prop-controllers/descriptors.d.ts +6 -3
  91. package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
  92. package/dist/types/src/prop-controllers/introspection.d.ts +1 -1
  93. package/dist/types/src/prop-controllers/introspection.d.ts.map +1 -1
  94. package/dist/types/src/runtimes/react/controls/control.d.ts +3 -2
  95. package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
  96. package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -1
  97. package/dist/types/src/runtimes/react/controls/typography.d.ts +21 -0
  98. package/dist/types/src/runtimes/react/controls/typography.d.ts.map +1 -0
  99. package/dist/types/src/runtimes/react/controls.d.ts.map +1 -1
  100. package/dist/types/src/slate/TypographyPlugin/index.d.ts +9 -0
  101. package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -1
  102. package/dist/types.cjs2.js +5 -5
  103. package/dist/types.cjs2.js.map +1 -1
  104. package/dist/types.es2.js +2 -2
  105. package/dist/{text-input.cjs.js → typography.cjs.js} +9 -1
  106. package/dist/typography.cjs.js.map +1 -0
  107. package/dist/{text-input.es.js → typography.es.js} +8 -2
  108. package/dist/typography.es.js.map +1 -0
  109. package/package.json +1 -1
  110. package/dist/leaf.cjs.js +0 -182
  111. package/dist/leaf.cjs.js.map +0 -1
  112. package/dist/leaf.es.js +0 -179
  113. package/dist/leaf.es.js.map +0 -1
  114. package/dist/text-input.cjs.js.map +0 -1
  115. package/dist/text-input.es.js.map +0 -1
package/dist/Box.cjs.js CHANGED
@@ -42,7 +42,7 @@ var boxModels = require("./box-models.cjs.js");
42
42
  require("use-sync-external-store/shim/with-selector");
43
43
  require("next/dynamic");
44
44
  require("./actions.cjs.js");
45
- require("./text-input.cjs.js");
45
+ require("./typography.cjs.js");
46
46
  require("./combobox.cjs.js");
47
47
  require("slate");
48
48
  require("use-sync-external-store/shim");
package/dist/Box.es.js CHANGED
@@ -33,14 +33,14 @@ import { forwardRef, useRef, useCallback, useImperativeHandle, useState, useEffe
33
33
  import { cx } from "@emotion/css";
34
34
  import { v4 } from "uuid";
35
35
  import { n as useResponsiveStyle, E as Element } from "./index.es.js";
36
- import { Z as useStyle } from "./react-page.es.js";
36
+ import { U as useStyle } from "./react-page.es.js";
37
37
  import { jsx } from "react/jsx-runtime";
38
38
  import { a as useBoxAnimation, b as areBoxAnimationPropsEqual, B as BackgroundsContainer, G as GridItem } from "./index.es2.js";
39
39
  import { p as parse, c as createBox } from "./box-models.es.js";
40
40
  import "use-sync-external-store/shim/with-selector";
41
41
  import "next/dynamic";
42
42
  import "./actions.es.js";
43
- import "./text-input.es.js";
43
+ import "./typography.es.js";
44
44
  import "./combobox.es.js";
45
45
  import "slate";
46
46
  import "use-sync-external-store/shim";
@@ -41,7 +41,7 @@ var jsxRuntime = require("react/jsx-runtime");
41
41
  require("use-sync-external-store/shim/with-selector");
42
42
  require("next/dynamic");
43
43
  require("./actions.cjs.js");
44
- require("./text-input.cjs.js");
44
+ require("./typography.cjs.js");
45
45
  require("./combobox.cjs.js");
46
46
  require("slate");
47
47
  require("use-sync-external-store/shim");
package/dist/Button.es.js CHANGED
@@ -33,13 +33,13 @@ import { forwardRef } from "react";
33
33
  import ColorHelper from "color";
34
34
  import { o as useResponsiveWidth, n as useResponsiveStyle, p as useResponsiveTextStyle, q as colorToString } from "./index.es.js";
35
35
  import { L as Link } from "./index.es3.js";
36
- import { Z as useStyle } from "./react-page.es.js";
36
+ import { U as useStyle } from "./react-page.es.js";
37
37
  import { cx } from "@emotion/css";
38
38
  import { jsx } from "react/jsx-runtime";
39
39
  import "use-sync-external-store/shim/with-selector";
40
40
  import "next/dynamic";
41
41
  import "./actions.es.js";
42
- import "./text-input.es.js";
42
+ import "./typography.es.js";
43
43
  import "./combobox.es.js";
44
44
  import "slate";
45
45
  import "use-sync-external-store/shim";
@@ -47,7 +47,7 @@ var jsxRuntime = require("react/jsx-runtime");
47
47
  require("use-sync-external-store/shim/with-selector");
48
48
  require("next/dynamic");
49
49
  require("./actions.cjs.js");
50
- require("./text-input.cjs.js");
50
+ require("./typography.cjs.js");
51
51
  require("./combobox.cjs.js");
52
52
  require("redux");
53
53
  require("redux-thunk");
@@ -35,7 +35,7 @@ import { useGesture } from "@use-gesture/react";
35
35
  import { wrap } from "@popmotion/popcorn";
36
36
  import { r as useBreakpoints, n as useResponsiveStyle, q as colorToString } from "./index.es.js";
37
37
  import "use-sync-external-store/shim";
38
- import { Z as useStyle } from "./react-page.es.js";
38
+ import { U as useStyle } from "./react-page.es.js";
39
39
  import "slate";
40
40
  import { u as useMediaQuery } from "./useMediaQuery.es.js";
41
41
  import ImageComponent from "./Image.es.js";
@@ -45,7 +45,7 @@ import { jsxs, jsx } from "react/jsx-runtime";
45
45
  import "use-sync-external-store/shim/with-selector";
46
46
  import "next/dynamic";
47
47
  import "./actions.es.js";
48
- import "./text-input.es.js";
48
+ import "./typography.es.js";
49
49
  import "./combobox.es.js";
50
50
  import "redux";
51
51
  import "redux-thunk";
@@ -45,7 +45,7 @@ require("@emotion/utils");
45
45
  require("slate");
46
46
  require("use-sync-external-store/shim/with-selector");
47
47
  require("next/dynamic");
48
- require("./text-input.cjs.js");
48
+ require("./typography.cjs.js");
49
49
  require("./combobox.cjs.js");
50
50
  require("use-sync-external-store/shim");
51
51
  require("./types.cjs.js");
@@ -31,7 +31,7 @@ var __objRest = (source, exclude) => {
31
31
  };
32
32
  import { cx } from "@emotion/css";
33
33
  import { forwardRef, useState, useEffect } from "react";
34
- import { Z as useStyle } from "./react-page.es.js";
34
+ import { U as useStyle } from "./react-page.es.js";
35
35
  import { n as useResponsiveStyle, q as colorToString } from "./index.es.js";
36
36
  import { jsx, jsxs } from "react/jsx-runtime";
37
37
  import "redux";
@@ -43,7 +43,7 @@ import "@emotion/utils";
43
43
  import "slate";
44
44
  import "use-sync-external-store/shim/with-selector";
45
45
  import "next/dynamic";
46
- import "./text-input.es.js";
46
+ import "./typography.es.js";
47
47
  import "./combobox.es.js";
48
48
  import "use-sync-external-store/shim";
49
49
  import "./types.es.js";
@@ -8,7 +8,7 @@ var jsxRuntime = require("react/jsx-runtime");
8
8
  require("use-sync-external-store/shim/with-selector");
9
9
  require("next/dynamic");
10
10
  require("./actions.cjs.js");
11
- require("./text-input.cjs.js");
11
+ require("./typography.cjs.js");
12
12
  require("./combobox.cjs.js");
13
13
  require("slate");
14
14
  require("use-sync-external-store/shim");
@@ -1,12 +1,12 @@
1
1
  import { forwardRef } from "react";
2
2
  import { n as useResponsiveStyle, q as colorToString } from "./index.es.js";
3
- import { Z as useStyle } from "./react-page.es.js";
3
+ import { U as useStyle } from "./react-page.es.js";
4
4
  import { cx } from "@emotion/css";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import "use-sync-external-store/shim/with-selector";
7
7
  import "next/dynamic";
8
8
  import "./actions.es.js";
9
- import "./text-input.es.js";
9
+ import "./typography.es.js";
10
10
  import "./combobox.es.js";
11
11
  import "slate";
12
12
  import "use-sync-external-store/shim";
package/dist/Embed.es.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { forwardRef, useState, useImperativeHandle, useEffect } from "react";
2
2
  import { u as useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect.es.js";
3
- import { Z as useStyle } from "./react-page.es.js";
3
+ import { U as useStyle } from "./react-page.es.js";
4
4
  import { cx } from "@emotion/css";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  import "redux";
package/dist/Form.cjs.js CHANGED
@@ -50,7 +50,7 @@ require("@emotion/utils");
50
50
  require("slate");
51
51
  require("use-sync-external-store/shim/with-selector");
52
52
  require("next/dynamic");
53
- require("./text-input.cjs.js");
53
+ require("./typography.cjs.js");
54
54
  require("./combobox.cjs.js");
55
55
  require("use-sync-external-store/shim");
56
56
  require("./types.cjs.js");
package/dist/Form.es.js CHANGED
@@ -33,7 +33,7 @@ import * as React from "react";
33
33
  import { forwardRef, useRef, useImperativeHandle, useState, useEffect, useMemo } from "react";
34
34
  import { Field as Field$1, getIn, Formik } from "formik";
35
35
  import { cx, keyframes } from "@emotion/css";
36
- import { Z as useStyle } from "./react-page.es.js";
36
+ import { U as useStyle } from "./react-page.es.js";
37
37
  import { n as useResponsiveStyle, S as Shapes, s as Sizes, C as Contrasts, q as colorToString, t as useFormContext, p as useResponsiveTextStyle, u as useIsInBuilder, v as useResponsiveGridItem, w as useTable, x as useMakeswiftClient, y as Provider, A as Alignments } from "./index.es.js";
38
38
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
39
39
  import ColorHelper from "color";
@@ -49,7 +49,7 @@ import "@emotion/utils";
49
49
  import "slate";
50
50
  import "use-sync-external-store/shim/with-selector";
51
51
  import "next/dynamic";
52
- import "./text-input.es.js";
52
+ import "./typography.es.js";
53
53
  import "./combobox.es.js";
54
54
  import "use-sync-external-store/shim";
55
55
  import "./types.es.js";
package/dist/Image.cjs.js CHANGED
@@ -20,7 +20,7 @@ require("@emotion/utils");
20
20
  require("slate");
21
21
  require("use-sync-external-store/shim/with-selector");
22
22
  require("next/dynamic");
23
- require("./text-input.cjs.js");
23
+ require("./typography.cjs.js");
24
24
  require("./combobox.cjs.js");
25
25
  require("use-sync-external-store/shim");
26
26
  require("./types.cjs.js");
package/dist/Image.es.js CHANGED
@@ -4,7 +4,7 @@ import { findBreakpointOverride } from "./state/breakpoints.es.js";
4
4
  import { p as placeholders } from "./placeholders.es.js";
5
5
  import { L as Link } from "./index.es3.js";
6
6
  import { cx } from "@emotion/css";
7
- import { Z as useStyle } from "./react-page.es.js";
7
+ import { U as useStyle } from "./react-page.es.js";
8
8
  import { z as useFile, r as useBreakpoints, o as useResponsiveWidth, n as useResponsiveStyle } from "./index.es.js";
9
9
  import { m as major } from "./next-version.es.js";
10
10
  import { jsx } from "react/jsx-runtime";
@@ -18,7 +18,7 @@ import "@emotion/utils";
18
18
  import "slate";
19
19
  import "use-sync-external-store/shim/with-selector";
20
20
  import "next/dynamic";
21
- import "./text-input.es.js";
21
+ import "./typography.es.js";
22
22
  import "./combobox.es.js";
23
23
  import "use-sync-external-store/shim";
24
24
  import "./types.es.js";
@@ -7,7 +7,7 @@ var jsxRuntime = require("react/jsx-runtime");
7
7
  require("use-sync-external-store/shim/with-selector");
8
8
  require("next/dynamic");
9
9
  require("./actions.cjs.js");
10
- require("./text-input.cjs.js");
10
+ require("./typography.cjs.js");
11
11
  require("./combobox.cjs.js");
12
12
  require("slate");
13
13
  require("use-sync-external-store/shim");
@@ -5,7 +5,7 @@ import { jsx } from "react/jsx-runtime";
5
5
  import "use-sync-external-store/shim/with-selector";
6
6
  import "next/dynamic";
7
7
  import "./actions.es.js";
8
- import "./text-input.es.js";
8
+ import "./typography.es.js";
9
9
  import "./combobox.es.js";
10
10
  import "slate";
11
11
  import "use-sync-external-store/shim";
@@ -57,7 +57,7 @@ require("@emotion/serialize");
57
57
  require("@emotion/utils");
58
58
  require("use-sync-external-store/shim/with-selector");
59
59
  require("next/dynamic");
60
- require("./text-input.cjs.js");
60
+ require("./typography.cjs.js");
61
61
  require("./combobox.cjs.js");
62
62
  require("./types.cjs.js");
63
63
  require("./box-models.cjs.js");
@@ -34,7 +34,7 @@ import { forwardRef, useRef, useState, createElement, Fragment as Fragment$1 } f
34
34
  import { G as GutterContainer } from "./index.es4.js";
35
35
  import ImageComponent from "./Image.es.js";
36
36
  import Button from "./Button.es.js";
37
- import { Z as useStyle } from "./react-page.es.js";
37
+ import { U as useStyle } from "./react-page.es.js";
38
38
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
39
39
  import { l as useResponsiveColor, p as useResponsiveTextStyle, n as useResponsiveStyle, q as colorToString } from "./index.es.js";
40
40
  import "use-sync-external-store/shim";
@@ -56,7 +56,7 @@ import "@emotion/serialize";
56
56
  import "@emotion/utils";
57
57
  import "use-sync-external-store/shim/with-selector";
58
58
  import "next/dynamic";
59
- import "./text-input.es.js";
59
+ import "./typography.es.js";
60
60
  import "./combobox.es.js";
61
61
  import "./types.es.js";
62
62
  import "./box-models.es.js";
@@ -33,7 +33,7 @@ var controlSerialization = require("./control-serialization.cjs.js");
33
33
  var jsxRuntime = require("react/jsx-runtime");
34
34
  require("use-sync-external-store/shim/with-selector");
35
35
  require("next/dynamic");
36
- require("./text-input.cjs.js");
36
+ require("./typography.cjs.js");
37
37
  require("./combobox.cjs.js");
38
38
  require("slate");
39
39
  require("use-sync-external-store/shim");
@@ -24,7 +24,7 @@ import { createStore, applyMiddleware, combineReducers } from "redux";
24
24
  import thunk from "redux-thunk";
25
25
  import Router from "next/router";
26
26
  import { removeIn, setIn } from "immutable";
27
- import { be as getInitialState$3, bf as reducer$4, bg as getDocument$1, c as createDocument, bh as getComponentsMeta$1, bi as getComponentPropControllerDescriptors$1, an as getBreakpoints, bj as getLocales, at as getBuilderEditMode, bk as BuilderEditMode, bl as getDocumentKeysSortedByDepth, bm as getPropController, bn as getPropControllersHandle, bo as getElement, bp as getElementPropControllerDescriptors, bq as createPropController, b as isElementReference, a4 as isPropControllersHandle, br as reducer$5, bs as reducer$7, bt as reducer$8, bu as reducer$9, bv as reducer$a, bw as reducer$b, bx as reducer$c, by as reducer$e, bz as getInitialState$4 } from "./react-page.es.js";
27
+ import { bg as getInitialState$3, bh as reducer$4, bi as getDocument$1, c as createDocument, bj as getComponentsMeta$1, bk as getComponentPropControllerDescriptors$1, an as getBreakpoints, bl as getLocales, at as getBuilderEditMode, bm as BuilderEditMode, bn as getDocumentKeysSortedByDepth, bo as getPropController, bp as getPropControllersHandle, bq as getElement, br as getElementPropControllerDescriptors, bs as createPropController, b as isElementReference, a1 as isPropControllersHandle, bt as reducer$5, bu as reducer$7, bv as reducer$8, bw as reducer$9, bx as reducer$a, by as reducer$b, bz as reducer$c, bA as reducer$e, bB as getInitialState$4 } from "./react-page.es.js";
28
28
  import { A as ActionTypes, v as unregisterMeasurable, w as registerMeasurable, x as registerBuilderComponent, j as setBreakpoints, l as setLocales, y as setDefaultLocale, k as setLocale, z as changePathnameStart, B as changePathnameComplete, C as changeElementBoxModels, D as changeDocumentElementSize, E as handleWheel, F as handlePointerMove, G as elementFromPointChange, H as setIsInBuilder, I as unregisterBuilderComponent, J as unregisterPropControllers, K as registerPropControllers, L as registerPropControllersHandle, r as registerDocument, M as registerComponentHandle, N as messageBuilderPropController, O as registerDocumentEffect } from "./actions.es.js";
29
29
  import { i as isMeasurable, a as getMeasurables$1, b as getBoxModels$1, m as measure, d as getBoxModel$1, r as reducer$6 } from "./box-models.es.js";
30
30
  import { reducer as reducer$d } from "./state/breakpoints.es.js";
@@ -32,7 +32,7 @@ import { a as serializeControls } from "./control-serialization.es.js";
32
32
  import { jsx } from "react/jsx-runtime";
33
33
  import "use-sync-external-store/shim/with-selector";
34
34
  import "next/dynamic";
35
- import "./text-input.es.js";
35
+ import "./typography.es.js";
36
36
  import "./combobox.es.js";
37
37
  import "slate";
38
38
  import "use-sync-external-store/shim";
@@ -11,7 +11,6 @@ require("./types.cjs2.js");
11
11
  require("is-hotkey");
12
12
  require("slate-react");
13
13
  var jsxRuntime = require("react/jsx-runtime");
14
- var leaf = require("./leaf.cjs.js");
15
14
  require("redux");
16
15
  require("redux-thunk");
17
16
  require("./actions.cjs.js");
@@ -21,7 +20,7 @@ require("scroll-into-view-if-needed");
21
20
  require("next/link");
22
21
  require("use-sync-external-store/shim/with-selector");
23
22
  require("next/dynamic");
24
- require("./text-input.cjs.js");
23
+ require("./typography.cjs.js");
25
24
  require("./combobox.cjs.js");
26
25
  require("use-sync-external-store/shim");
27
26
  require("./types.cjs.js");
@@ -77,8 +76,8 @@ function Placeholder({
77
76
  function TextElement({
78
77
  descendant
79
78
  }) {
80
- const enhancedTypography = leaf.useEnhancedTypography(descendant.typography);
81
- const typographyClassName = leaf.useTypographyClassName(enhancedTypography);
79
+ const enhancedTypography = next.useEnhancedTypography(descendant.typography);
80
+ const typographyClassName = next.useTypographyClassName(enhancedTypography);
82
81
  return /* @__PURE__ */ jsxRuntime.jsx("span", {
83
82
  className: typographyClassName,
84
83
  children: descendant.text === "" ? "\uFEFF" : descendant.text
@@ -1 +1 @@
1
- {"version":3,"file":"ReadOnlyText.cjs.js","sources":["../src/components/builtin/Text/ReadOnlyText.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { ForwardedRef, forwardRef } from 'react'\nimport { Descendant, Text } from 'slate'\n\nimport type { ElementIDValue, RichTextValue } from '../../../prop-controllers/descriptors'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { Link } from '../../shared/Link'\nimport { useResponsiveStyle } from '../../utils/responsive-style'\nimport { useTypographyClassName } from './components'\nimport useEnhancedTypography from './components/Leaf/leaf'\nimport { Inline, InlineType, Block, BlockType } from '../../../slate'\nimport { richTextDTOtoDAO } from '../../../controls'\n\ntype Props = {\n id?: ElementIDValue\n text?: RichTextValue\n width?: string\n margin?: string\n}\n\nconst ReadOnlyText = forwardRef(function ReadOnlyText(\n { id, text, width, margin }: Props,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const descendants = text == null ? [] : richTextDTOtoDAO(text)\n const descendantsAsString = getText(descendants)\n\n return (\n <div ref={ref} id={id} className={cx(width, margin)}>\n {descendantsAsString === '' ? <Placeholder /> : <Descendants descendants={descendants} />}\n </div>\n )\n})\n\nexport default ReadOnlyText\n\nfunction Placeholder({ text = 'Write some text...' }: { text?: string }) {\n return (\n <span\n className={useStyle({\n display: 'inline-block',\n width: 0,\n maxWidth: '100%',\n whiteSpace: 'nowrap',\n opacity: 0.333,\n verticalAlign: 'text-top',\n })}\n >\n {text}\n </span>\n )\n}\n\nexport interface TextProps {\n descendant: Text\n}\n\nexport function TextElement({ descendant }: TextProps) {\n const enhancedTypography = useEnhancedTypography(descendant.typography)\n const typographyClassName = useTypographyClassName(enhancedTypography)\n\n return (\n <span className={typographyClassName}>\n {descendant.text === '' ? '\\uFEFF' : descendant.text}\n </span>\n )\n}\n\nexport interface InlineProps {\n descendant: Inline\n}\n\nfunction InlineElement({ descendant }: InlineProps) {\n const linkClassName = useStyle({ textDecoration: 'none' })\n\n switch (descendant.type) {\n case InlineType.Code:\n return (\n <code>\n <Descendants descendants={descendant.children} />\n </code>\n )\n\n case InlineType.SuperScript:\n return (\n <sup>\n <Descendants descendants={descendant.children} />\n </sup>\n )\n\n case InlineType.SubScript:\n return (\n <sub>\n <Descendants descendants={descendant.children} />\n </sub>\n )\n\n case InlineType.Link:\n return (\n <Link className={linkClassName} link={descendant.link}>\n <Descendants descendants={descendant.children} />\n </Link>\n )\n }\n}\n\nexport interface BlockProps {\n descendant: Block\n}\n\nexport function BlockElement({ descendant }: BlockProps) {\n const blockStyles = [\n useStyle({ margin: 0 }),\n useStyle(useResponsiveStyle([descendant.textAlign], ([textAlign = 'left']) => ({ textAlign }))),\n ]\n const quoteStyle = useStyle({\n padding: '0.5em 10px',\n fontSize: '1.25em',\n fontWeight: '300',\n borderLeft: '5px solid rgba(0, 0, 0, 0.1)',\n })\n\n switch (descendant.type) {\n case BlockType.Text:\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </span>\n )\n case BlockType.Paragraph:\n return (\n <p className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </p>\n )\n case BlockType.Heading1:\n return (\n <h1 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h1>\n )\n case BlockType.Heading2:\n return (\n <h2 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h2>\n )\n case BlockType.Heading3:\n return (\n <h3 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h3>\n )\n case BlockType.Heading4:\n return (\n <h4 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h4>\n )\n case BlockType.Heading5:\n return (\n <h5 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h5>\n )\n case BlockType.Heading6:\n return (\n <h6 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h6>\n )\n case BlockType.BlockQuote:\n return (\n <blockquote className={cx(...blockStyles, quoteStyle)}>\n <Descendants descendants={descendant.children} />\n </blockquote>\n )\n case BlockType.OrderedList:\n return (\n <ol className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n <Descendants descendants={descendant.children} />\n </ol>\n )\n case BlockType.UnorderedList:\n return (\n <ul className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n <Descendants descendants={descendant.children} />\n </ul>\n )\n case BlockType.ListItem:\n return (\n <li className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </li>\n )\n case BlockType.ListItemChild:\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </span>\n )\n default:\n return null\n }\n}\n\n// reimplemented from slate source for code splitting\nfunction isText(node: any): node is Text {\n if (typeof node === 'object' && 'text' in node) return true\n\n return false\n}\n\nfunction Descendants({ descendants }: { descendants: Descendant[] }) {\n return (\n <>\n {descendants.map((descendant, index) => {\n if (isText(descendant)) {\n return <TextElement key={index} descendant={descendant} />\n }\n\n switch (descendant.type) {\n case InlineType.Link:\n case InlineType.Code:\n case InlineType.SubScript:\n case InlineType.SuperScript:\n return <InlineElement key={index} descendant={descendant} />\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.BlockQuote:\n case BlockType.Text:\n case BlockType.Paragraph:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return <BlockElement key={index} descendant={descendant} />\n default:\n return null\n }\n })}\n </>\n )\n}\n\nfunction isBlock(descendant: Descendant): descendant is Block {\n if ('text' in descendant) return false\n\n switch (descendant.type) {\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.BlockQuote:\n case BlockType.Paragraph:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return true\n\n default:\n return false\n }\n}\n\nfunction getTextByDescendant(descendant: Descendant): string {\n if ('text' in descendant) {\n return descendant.text ?? ''\n }\n\n switch (descendant.type) {\n case InlineType.Link:\n case InlineType.Code:\n case InlineType.SubScript:\n case InlineType.SuperScript:\n return descendant.children.map(descendant => getTextByDescendant(descendant)).join('') ?? ''\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.BlockQuote:\n case BlockType.Paragraph:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return (\n descendant.children\n .map(descendant => getTextByDescendant(descendant))\n .join(descendant.children.every(isBlock) ? '\\n' : '') ?? ''\n )\n default:\n return ''\n }\n}\n\nfunction getText(descendant: Descendant[]): string {\n return descendant.map(getTextByDescendant).join('\\n')\n}\n"],"names":["ReadOnlyText","forwardRef","id","text","width","margin","ref","descendants","richTextDTOtoDAO","descendantsAsString","getText","cx","_jsx","useStyle","display","maxWidth","whiteSpace","opacity","verticalAlign","descendant","enhancedTypography","useEnhancedTypography","typography","typographyClassName","useTypographyClassName","linkClassName","textDecoration","type","InlineType","Code","children","SuperScript","SubScript","Link","link","blockStyles","useResponsiveStyle","textAlign","quoteStyle","padding","fontSize","fontWeight","borderLeft","BlockType","Text","Paragraph","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","OrderedList","listStylePosition","UnorderedList","ListItem","ListItemChild","node","_Fragment","map","index","isText","getTextByDescendant","join","every","isBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBMA,MAAAA,eAAeC,MAAAA,WAAW,uBAC9B;AAAA,EAAEC;AAAAA,EAAIC;AAAAA,EAAMC;AAAAA,EAAOC;AAAAA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A,WAAWI;AAAAA,SACXJ,UAAWG,WAAAA;AACPZ,aAAAA,iBAAWW,SAAS8B,IAAIzC,CAAc4C,gBAAAA,oBAAoB5C,WAAD,CAAzD,EAAuE6C,KAAK,EAA5E,MAAA7C,YAAmF;AAAA,SACvFwB,UAAAA,UAAUG;AAAAA,SACVH,UAAAA,UAAUI;AAAAA,SACVJ,UAAAA,UAAUK;AAAAA,SACVL,UAAAA,UAAUS;AAAAA,SACVT,UAAAA,UAAUE;AAAAA,SACVF,UAAAA,UAAUU;AAAAA,SACVV,UAAAA,UAAUY;AAAAA,SACVZ,UAAAA,UAAUa;AAAAA,SACVb,UAAUc,UAAAA;AAEXtC,aAAAA,iBAAWW,SACR8B,IAAIzC,CAAc4C,gBAAAA,oBAAoB5C,WAAD,CADxC,EAEG6C,KAAK7C,WAAWW,SAASmC,MAAMC,OAA1B,IAAqC,OAAO,EAFpD,MAAA/C,YAE2D;AAAA;AAGtD,aAAA;AAAA;AAEZ;AAED,iBAAiBA,YAAkC;AAC1CA,SAAAA,WAAWyC,IAAIG,mBAAf,EAAoCC,KAAK,IAAzC;AACR;;;;"}
1
+ {"version":3,"file":"ReadOnlyText.cjs.js","sources":["../src/components/builtin/Text/ReadOnlyText.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { ForwardedRef, forwardRef } from 'react'\nimport { Descendant, Text } from 'slate'\n\nimport type { ElementIDValue, RichTextValue } from '../../../prop-controllers/descriptors'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { Link } from '../../shared/Link'\nimport { useResponsiveStyle } from '../../utils/responsive-style'\nimport { Inline, InlineType, Block, BlockType } from '../../../slate'\nimport { richTextDTOtoDAO } from '../../../controls'\nimport useEnhancedTypography, {\n useTypographyClassName,\n} from '../../../runtimes/react/controls/typography'\n\ntype Props = {\n id?: ElementIDValue\n text?: RichTextValue\n width?: string\n margin?: string\n}\n\nconst ReadOnlyText = forwardRef(function ReadOnlyText(\n { id, text, width, margin }: Props,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const descendants = text == null ? [] : richTextDTOtoDAO(text)\n const descendantsAsString = getText(descendants)\n\n return (\n <div ref={ref} id={id} className={cx(width, margin)}>\n {descendantsAsString === '' ? <Placeholder /> : <Descendants descendants={descendants} />}\n </div>\n )\n})\n\nexport default ReadOnlyText\n\nfunction Placeholder({ text = 'Write some text...' }: { text?: string }) {\n return (\n <span\n className={useStyle({\n display: 'inline-block',\n width: 0,\n maxWidth: '100%',\n whiteSpace: 'nowrap',\n opacity: 0.333,\n verticalAlign: 'text-top',\n })}\n >\n {text}\n </span>\n )\n}\n\nexport interface TextProps {\n descendant: Text\n}\n\nexport function TextElement({ descendant }: TextProps) {\n const enhancedTypography = useEnhancedTypography(descendant.typography)\n const typographyClassName = useTypographyClassName(enhancedTypography)\n\n return (\n <span className={typographyClassName}>\n {descendant.text === '' ? '\\uFEFF' : descendant.text}\n </span>\n )\n}\n\nexport interface InlineProps {\n descendant: Inline\n}\n\nfunction InlineElement({ descendant }: InlineProps) {\n const linkClassName = useStyle({ textDecoration: 'none' })\n\n switch (descendant.type) {\n case InlineType.Code:\n return (\n <code>\n <Descendants descendants={descendant.children} />\n </code>\n )\n\n case InlineType.SuperScript:\n return (\n <sup>\n <Descendants descendants={descendant.children} />\n </sup>\n )\n\n case InlineType.SubScript:\n return (\n <sub>\n <Descendants descendants={descendant.children} />\n </sub>\n )\n\n case InlineType.Link:\n return (\n <Link className={linkClassName} link={descendant.link}>\n <Descendants descendants={descendant.children} />\n </Link>\n )\n }\n}\n\nexport interface BlockProps {\n descendant: Block\n}\n\nexport function BlockElement({ descendant }: BlockProps) {\n const blockStyles = [\n useStyle({ margin: 0 }),\n useStyle(useResponsiveStyle([descendant.textAlign], ([textAlign = 'left']) => ({ textAlign }))),\n ]\n const quoteStyle = useStyle({\n padding: '0.5em 10px',\n fontSize: '1.25em',\n fontWeight: '300',\n borderLeft: '5px solid rgba(0, 0, 0, 0.1)',\n })\n\n switch (descendant.type) {\n case BlockType.Text:\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </span>\n )\n case BlockType.Paragraph:\n return (\n <p className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </p>\n )\n case BlockType.Heading1:\n return (\n <h1 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h1>\n )\n case BlockType.Heading2:\n return (\n <h2 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h2>\n )\n case BlockType.Heading3:\n return (\n <h3 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h3>\n )\n case BlockType.Heading4:\n return (\n <h4 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h4>\n )\n case BlockType.Heading5:\n return (\n <h5 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h5>\n )\n case BlockType.Heading6:\n return (\n <h6 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h6>\n )\n case BlockType.BlockQuote:\n return (\n <blockquote className={cx(...blockStyles, quoteStyle)}>\n <Descendants descendants={descendant.children} />\n </blockquote>\n )\n case BlockType.OrderedList:\n return (\n <ol className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n <Descendants descendants={descendant.children} />\n </ol>\n )\n case BlockType.UnorderedList:\n return (\n <ul className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n <Descendants descendants={descendant.children} />\n </ul>\n )\n case BlockType.ListItem:\n return (\n <li className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </li>\n )\n case BlockType.ListItemChild:\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </span>\n )\n default:\n return null\n }\n}\n\n// reimplemented from slate source for code splitting\nfunction isText(node: any): node is Text {\n if (typeof node === 'object' && 'text' in node) return true\n\n return false\n}\n\nfunction Descendants({ descendants }: { descendants: Descendant[] }) {\n return (\n <>\n {descendants.map((descendant, index) => {\n if (isText(descendant)) {\n return <TextElement key={index} descendant={descendant} />\n }\n\n switch (descendant.type) {\n case InlineType.Link:\n case InlineType.Code:\n case InlineType.SubScript:\n case InlineType.SuperScript:\n return <InlineElement key={index} descendant={descendant} />\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.BlockQuote:\n case BlockType.Text:\n case BlockType.Paragraph:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return <BlockElement key={index} descendant={descendant} />\n default:\n return null\n }\n })}\n </>\n )\n}\n\nfunction isBlock(descendant: Descendant): descendant is Block {\n if ('text' in descendant) return false\n\n switch (descendant.type) {\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.BlockQuote:\n case BlockType.Paragraph:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return true\n\n default:\n return false\n }\n}\n\nfunction getTextByDescendant(descendant: Descendant): string {\n if ('text' in descendant) {\n return descendant.text ?? ''\n }\n\n switch (descendant.type) {\n case InlineType.Link:\n case InlineType.Code:\n case InlineType.SubScript:\n case InlineType.SuperScript:\n return descendant.children.map(descendant => getTextByDescendant(descendant)).join('') ?? ''\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.BlockQuote:\n case BlockType.Paragraph:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return (\n descendant.children\n .map(descendant => getTextByDescendant(descendant))\n .join(descendant.children.every(isBlock) ? '\\n' : '') ?? ''\n )\n default:\n return ''\n }\n}\n\nfunction getText(descendant: Descendant[]): string {\n return descendant.map(getTextByDescendant).join('\\n')\n}\n"],"names":["ReadOnlyText","forwardRef","id","text","width","margin","ref","descendants","richTextDTOtoDAO","descendantsAsString","getText","cx","_jsx","useStyle","display","maxWidth","whiteSpace","opacity","verticalAlign","descendant","enhancedTypography","useEnhancedTypography","typography","typographyClassName","useTypographyClassName","linkClassName","textDecoration","type","InlineType","Code","children","SuperScript","SubScript","Link","link","blockStyles","useResponsiveStyle","textAlign","quoteStyle","padding","fontSize","fontWeight","borderLeft","BlockType","Text","Paragraph","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","OrderedList","listStylePosition","UnorderedList","ListItem","ListItemChild","node","_Fragment","map","index","isText","getTextByDescendant","join","every","isBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBMA,MAAAA,eAAeC,MAAAA,WAAW,uBAC9B;AAAA,EAAEC;AAAAA,EAAIC;AAAAA,EAAMC;AAAAA,EAAOC;AAAAA,GACnBC,KACA;AACMC,QAAAA,cAAcJ,QAAQ,OAAO,CAAA,IAAKK,UAAAA,iBAAiBL,IAAD;AAClDM,QAAAA,sBAAsBC,QAAQH,WAAD;AAGjC,wCAAA,OAAA;AAAA,IAAK;AAAA,IAAU;AAAA,IAAQ,WAAWI,IAAAA,GAAGP,OAAOC,MAAR;AAAA,IACjCI,UAAAA,wBAAwB,KAAKG,2BAAA,IAAC,aAAD,EAAA,IAAkBA,2BAAA,IAAC,aAAD;AAAA,MAAa;AAAA,IAAA,CAAb;AAAA,EAAA,CAFpD;AAKD,CAZ8B;AAgB/B,qBAAqB;AAAA,EAAET,OAAO;AAAA,GAA2C;AAErE,wCAAA,QAAA;AAAA,IACE,WAAWU,UAAAA,SAAS;AAAA,MAClBC,SAAS;AAAA,MACTV,OAAO;AAAA,MACPW,UAAU;AAAA,MACVC,YAAY;AAAA,MACZC,SAAS;AAAA,MACTC,eAAe;AAAA,IAAA,CANE;AAAA,IASlBf,UAAAA;AAAAA,EAAAA,CAXL;AAcD;AAM2B,qBAAA;AAAA,EAAEgB;AAAAA,GAAyB;AAC/CC,QAAAA,qBAAqBC,KAAAA,sBAAsBF,WAAWG,UAAZ;AAC1CC,QAAAA,sBAAsBC,4BAAuBJ,kBAAD;AAGhD,wCAAA,QAA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as BlockType, ba as InlineType } from "./react-page.es.js";
3
+ import { b4 as richTextDTOtoDAO, U as useStyle, be as BlockType, bc as InlineType } from "./react-page.es.js";
4
4
  import { L as Link } from "./index.es3.js";
5
- import { n as useResponsiveStyle } from "./index.es.js";
5
+ import { U as useEnhancedTypography, V as useTypographyClassName, n as useResponsiveStyle } from "./index.es.js";
6
6
  import "slate";
7
7
  import "./state/breakpoints.es.js";
8
8
  import "./types.es2.js";
9
9
  import "is-hotkey";
10
10
  import "slate-react";
11
11
  import { jsx, Fragment } from "react/jsx-runtime";
12
- import { u as useEnhancedTypography, a as useTypographyClassName } from "./leaf.es.js";
13
12
  import "redux";
14
13
  import "redux-thunk";
15
14
  import "./actions.es.js";
@@ -19,7 +18,7 @@ import "scroll-into-view-if-needed";
19
18
  import "next/link";
20
19
  import "use-sync-external-store/shim/with-selector";
21
20
  import "next/dynamic";
22
- import "./text-input.es.js";
21
+ import "./typography.es.js";
23
22
  import "./combobox.es.js";
24
23
  import "use-sync-external-store/shim";
25
24
  import "./types.es.js";
@@ -1 +1 @@
1
- {"version":3,"file":"ReadOnlyText.es.js","sources":["../src/components/builtin/Text/ReadOnlyText.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { ForwardedRef, forwardRef } from 'react'\nimport { Descendant, Text } from 'slate'\n\nimport type { ElementIDValue, RichTextValue } from '../../../prop-controllers/descriptors'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { Link } from '../../shared/Link'\nimport { useResponsiveStyle } from '../../utils/responsive-style'\nimport { useTypographyClassName } from './components'\nimport useEnhancedTypography from './components/Leaf/leaf'\nimport { Inline, InlineType, Block, BlockType } from '../../../slate'\nimport { richTextDTOtoDAO } from '../../../controls'\n\ntype Props = {\n id?: ElementIDValue\n text?: RichTextValue\n width?: string\n margin?: string\n}\n\nconst ReadOnlyText = forwardRef(function ReadOnlyText(\n { id, text, width, margin }: Props,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const descendants = text == null ? [] : richTextDTOtoDAO(text)\n const descendantsAsString = getText(descendants)\n\n return (\n <div ref={ref} id={id} className={cx(width, margin)}>\n {descendantsAsString === '' ? <Placeholder /> : <Descendants descendants={descendants} />}\n </div>\n )\n})\n\nexport default ReadOnlyText\n\nfunction Placeholder({ text = 'Write some text...' }: { text?: string }) {\n return (\n <span\n className={useStyle({\n display: 'inline-block',\n width: 0,\n maxWidth: '100%',\n whiteSpace: 'nowrap',\n opacity: 0.333,\n verticalAlign: 'text-top',\n })}\n >\n {text}\n </span>\n )\n}\n\nexport interface TextProps {\n descendant: Text\n}\n\nexport function TextElement({ descendant }: TextProps) {\n const enhancedTypography = useEnhancedTypography(descendant.typography)\n const typographyClassName = useTypographyClassName(enhancedTypography)\n\n return (\n <span className={typographyClassName}>\n {descendant.text === '' ? '\\uFEFF' : descendant.text}\n </span>\n )\n}\n\nexport interface InlineProps {\n descendant: Inline\n}\n\nfunction InlineElement({ descendant }: InlineProps) {\n const linkClassName = useStyle({ textDecoration: 'none' })\n\n switch (descendant.type) {\n case InlineType.Code:\n return (\n <code>\n <Descendants descendants={descendant.children} />\n </code>\n )\n\n case InlineType.SuperScript:\n return (\n <sup>\n <Descendants descendants={descendant.children} />\n </sup>\n )\n\n case InlineType.SubScript:\n return (\n <sub>\n <Descendants descendants={descendant.children} />\n </sub>\n )\n\n case InlineType.Link:\n return (\n <Link className={linkClassName} link={descendant.link}>\n <Descendants descendants={descendant.children} />\n </Link>\n )\n }\n}\n\nexport interface BlockProps {\n descendant: Block\n}\n\nexport function BlockElement({ descendant }: BlockProps) {\n const blockStyles = [\n useStyle({ margin: 0 }),\n useStyle(useResponsiveStyle([descendant.textAlign], ([textAlign = 'left']) => ({ textAlign }))),\n ]\n const quoteStyle = useStyle({\n padding: '0.5em 10px',\n fontSize: '1.25em',\n fontWeight: '300',\n borderLeft: '5px solid rgba(0, 0, 0, 0.1)',\n })\n\n switch (descendant.type) {\n case BlockType.Text:\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </span>\n )\n case BlockType.Paragraph:\n return (\n <p className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </p>\n )\n case BlockType.Heading1:\n return (\n <h1 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h1>\n )\n case BlockType.Heading2:\n return (\n <h2 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h2>\n )\n case BlockType.Heading3:\n return (\n <h3 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h3>\n )\n case BlockType.Heading4:\n return (\n <h4 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h4>\n )\n case BlockType.Heading5:\n return (\n <h5 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h5>\n )\n case BlockType.Heading6:\n return (\n <h6 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h6>\n )\n case BlockType.BlockQuote:\n return (\n <blockquote className={cx(...blockStyles, quoteStyle)}>\n <Descendants descendants={descendant.children} />\n </blockquote>\n )\n case BlockType.OrderedList:\n return (\n <ol className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n <Descendants descendants={descendant.children} />\n </ol>\n )\n case BlockType.UnorderedList:\n return (\n <ul className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n <Descendants descendants={descendant.children} />\n </ul>\n )\n case BlockType.ListItem:\n return (\n <li className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </li>\n )\n case BlockType.ListItemChild:\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </span>\n )\n default:\n return null\n }\n}\n\n// reimplemented from slate source for code splitting\nfunction isText(node: any): node is Text {\n if (typeof node === 'object' && 'text' in node) return true\n\n return false\n}\n\nfunction Descendants({ descendants }: { descendants: Descendant[] }) {\n return (\n <>\n {descendants.map((descendant, index) => {\n if (isText(descendant)) {\n return <TextElement key={index} descendant={descendant} />\n }\n\n switch (descendant.type) {\n case InlineType.Link:\n case InlineType.Code:\n case InlineType.SubScript:\n case InlineType.SuperScript:\n return <InlineElement key={index} descendant={descendant} />\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.BlockQuote:\n case BlockType.Text:\n case BlockType.Paragraph:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return <BlockElement key={index} descendant={descendant} />\n default:\n return null\n }\n })}\n </>\n )\n}\n\nfunction isBlock(descendant: Descendant): descendant is Block {\n if ('text' in descendant) return false\n\n switch (descendant.type) {\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.BlockQuote:\n case BlockType.Paragraph:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return true\n\n default:\n return false\n }\n}\n\nfunction getTextByDescendant(descendant: Descendant): string {\n if ('text' in descendant) {\n return descendant.text ?? ''\n }\n\n switch (descendant.type) {\n case InlineType.Link:\n case InlineType.Code:\n case InlineType.SubScript:\n case InlineType.SuperScript:\n return descendant.children.map(descendant => getTextByDescendant(descendant)).join('') ?? ''\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.BlockQuote:\n case BlockType.Paragraph:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return (\n descendant.children\n .map(descendant => getTextByDescendant(descendant))\n .join(descendant.children.every(isBlock) ? '\\n' : '') ?? ''\n )\n default:\n return ''\n }\n}\n\nfunction getText(descendant: Descendant[]): string {\n return descendant.map(getTextByDescendant).join('\\n')\n}\n"],"names":["ReadOnlyText","forwardRef","id","text","width","margin","ref","descendants","richTextDTOtoDAO","descendantsAsString","getText","cx","_jsx","useStyle","display","maxWidth","whiteSpace","opacity","verticalAlign","descendant","enhancedTypography","useEnhancedTypography","typography","typographyClassName","useTypographyClassName","linkClassName","textDecoration","type","InlineType","Code","children","SuperScript","SubScript","Link","link","blockStyles","useResponsiveStyle","textAlign","quoteStyle","padding","fontSize","fontWeight","borderLeft","BlockType","Text","Paragraph","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","OrderedList","listStylePosition","UnorderedList","ListItem","ListItemChild","node","_Fragment","map","index","isText","getTextByDescendant","join","every","isBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBMA,MAAAA,eAAeC,WAAW,uBAC9B;AAAA,EAAEC;AAAAA,EAAIC;AAAAA,EAAMC;AAAAA,EAAOC;AAAAA,GACnBC,KACA;AACMC,QAAAA,cAAcJ,QAAQ,OAAO,CAAA,IAAKK,iBAAiBL,IAAD;AAClDM,QAAAA,sBAAsBC,QAAQH,WAAD;AAGjC,6BAAA,OAAA;AAAA,IAAK;AAAA,IAAU;AAAA,IAAQ,WAAWI,GAAGP,OAAOC,MAAR;AAAA,IACjCI,UAAAA,wBAAwB,KAAKG,oBAAC,aAAD,EAAA,IAAkBA,oBAAC,aAAD;AAAA,MAAa;AAAA,IAAA,CAAb;AAAA,EAAA,CAFpD;AAKD,CAZ8B;AAgB/B,qBAAqB;AAAA,EAAET,OAAO;AAAA,GAA2C;AAErE,6BAAA,QAAA;AAAA,IACE,WAAWU,SAAS;AAAA,MAClBC,SAAS;AAAA,MACTV,OAAO;AAAA,MACPW,UAAU;AAAA,MACVC,YAAY;AAAA,MACZC,SAAS;AAAA,MACTC,eAAe;AAAA,IAAA,CANE;AAAA,IASlBf,UAAAA;AAAAA,EAAAA,CAXL;AAcD;AAM2B,qBAAA;AAAA,EAAEgB;AAAAA,GAAyB;AAC/CC,QAAAA,qBAAqBC,sBAAsBF,WAAWG,UAAZ;AAC1CC,QAAAA,sBAAsBC,uBAAuBJ,kBAAD;AAGhD,6BAAA,QAAA;AAAA,IAAM,WAAWG;AAAAA,IACdJ,UAAAA,WAAWhB,SAAS,KAAK,WAAWgB,WAAWhB;AAAAA,EAAAA,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EAAuE6C,KAAK,EAA5E,MAAA7C,YAAmF;AAAA,SACvFwB,UAAUG;AAAAA,SACVH,UAAUI;AAAAA,SACVJ,UAAUK;AAAAA,SACVL,UAAUS;AAAAA,SACVT,UAAUE;AAAAA,SACVF,UAAUU;AAAAA,SACVV,UAAUY;AAAAA,SACVZ,UAAUa;AAAAA,SACVb,UAAUc;AAEXtC,aAAAA,iBAAWW,SACR8B,IAAIzC,CAAc4C,gBAAAA,oBAAoB5C,WAAD,CADxC,EAEG6C,KAAK7C,WAAWW,SAASmC,MAAMC,OAA1B,IAAqC,OAAO,EAFpD,MAAA/C,YAE2D;AAAA;AAGtD,aAAA;AAAA;AAEZ;AAED,iBAAiBA,YAAkC;AAC1CA,SAAAA,WAAWyC,IAAIG,mBAAf,EAAoCC,KAAK,IAAzC;AACR;;"}
1
+ {"version":3,"file":"ReadOnlyText.es.js","sources":["../src/components/builtin/Text/ReadOnlyText.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { ForwardedRef, forwardRef } from 'react'\nimport { Descendant, Text } from 'slate'\n\nimport type { ElementIDValue, RichTextValue } from '../../../prop-controllers/descriptors'\nimport { useStyle } from '../../../runtimes/react/use-style'\nimport { Link } from '../../shared/Link'\nimport { useResponsiveStyle } from '../../utils/responsive-style'\nimport { Inline, InlineType, Block, BlockType } from '../../../slate'\nimport { richTextDTOtoDAO } from '../../../controls'\nimport useEnhancedTypography, {\n useTypographyClassName,\n} from '../../../runtimes/react/controls/typography'\n\ntype Props = {\n id?: ElementIDValue\n text?: RichTextValue\n width?: string\n margin?: string\n}\n\nconst ReadOnlyText = forwardRef(function ReadOnlyText(\n { id, text, width, margin }: Props,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const descendants = text == null ? [] : richTextDTOtoDAO(text)\n const descendantsAsString = getText(descendants)\n\n return (\n <div ref={ref} id={id} className={cx(width, margin)}>\n {descendantsAsString === '' ? <Placeholder /> : <Descendants descendants={descendants} />}\n </div>\n )\n})\n\nexport default ReadOnlyText\n\nfunction Placeholder({ text = 'Write some text...' }: { text?: string }) {\n return (\n <span\n className={useStyle({\n display: 'inline-block',\n width: 0,\n maxWidth: '100%',\n whiteSpace: 'nowrap',\n opacity: 0.333,\n verticalAlign: 'text-top',\n })}\n >\n {text}\n </span>\n )\n}\n\nexport interface TextProps {\n descendant: Text\n}\n\nexport function TextElement({ descendant }: TextProps) {\n const enhancedTypography = useEnhancedTypography(descendant.typography)\n const typographyClassName = useTypographyClassName(enhancedTypography)\n\n return (\n <span className={typographyClassName}>\n {descendant.text === '' ? '\\uFEFF' : descendant.text}\n </span>\n )\n}\n\nexport interface InlineProps {\n descendant: Inline\n}\n\nfunction InlineElement({ descendant }: InlineProps) {\n const linkClassName = useStyle({ textDecoration: 'none' })\n\n switch (descendant.type) {\n case InlineType.Code:\n return (\n <code>\n <Descendants descendants={descendant.children} />\n </code>\n )\n\n case InlineType.SuperScript:\n return (\n <sup>\n <Descendants descendants={descendant.children} />\n </sup>\n )\n\n case InlineType.SubScript:\n return (\n <sub>\n <Descendants descendants={descendant.children} />\n </sub>\n )\n\n case InlineType.Link:\n return (\n <Link className={linkClassName} link={descendant.link}>\n <Descendants descendants={descendant.children} />\n </Link>\n )\n }\n}\n\nexport interface BlockProps {\n descendant: Block\n}\n\nexport function BlockElement({ descendant }: BlockProps) {\n const blockStyles = [\n useStyle({ margin: 0 }),\n useStyle(useResponsiveStyle([descendant.textAlign], ([textAlign = 'left']) => ({ textAlign }))),\n ]\n const quoteStyle = useStyle({\n padding: '0.5em 10px',\n fontSize: '1.25em',\n fontWeight: '300',\n borderLeft: '5px solid rgba(0, 0, 0, 0.1)',\n })\n\n switch (descendant.type) {\n case BlockType.Text:\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </span>\n )\n case BlockType.Paragraph:\n return (\n <p className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </p>\n )\n case BlockType.Heading1:\n return (\n <h1 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h1>\n )\n case BlockType.Heading2:\n return (\n <h2 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h2>\n )\n case BlockType.Heading3:\n return (\n <h3 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h3>\n )\n case BlockType.Heading4:\n return (\n <h4 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h4>\n )\n case BlockType.Heading5:\n return (\n <h5 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h5>\n )\n case BlockType.Heading6:\n return (\n <h6 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </h6>\n )\n case BlockType.BlockQuote:\n return (\n <blockquote className={cx(...blockStyles, quoteStyle)}>\n <Descendants descendants={descendant.children} />\n </blockquote>\n )\n case BlockType.OrderedList:\n return (\n <ol className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n <Descendants descendants={descendant.children} />\n </ol>\n )\n case BlockType.UnorderedList:\n return (\n <ul className={cx(...blockStyles)} style={{ listStylePosition: 'inside' }}>\n <Descendants descendants={descendant.children} />\n </ul>\n )\n case BlockType.ListItem:\n return (\n <li className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </li>\n )\n case BlockType.ListItemChild:\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} />\n </span>\n )\n default:\n return null\n }\n}\n\n// reimplemented from slate source for code splitting\nfunction isText(node: any): node is Text {\n if (typeof node === 'object' && 'text' in node) return true\n\n return false\n}\n\nfunction Descendants({ descendants }: { descendants: Descendant[] }) {\n return (\n <>\n {descendants.map((descendant, index) => {\n if (isText(descendant)) {\n return <TextElement key={index} descendant={descendant} />\n }\n\n switch (descendant.type) {\n case InlineType.Link:\n case InlineType.Code:\n case InlineType.SubScript:\n case InlineType.SuperScript:\n return <InlineElement key={index} descendant={descendant} />\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.BlockQuote:\n case BlockType.Text:\n case BlockType.Paragraph:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return <BlockElement key={index} descendant={descendant} />\n default:\n return null\n }\n })}\n </>\n )\n}\n\nfunction isBlock(descendant: Descendant): descendant is Block {\n if ('text' in descendant) return false\n\n switch (descendant.type) {\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.BlockQuote:\n case BlockType.Paragraph:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return true\n\n default:\n return false\n }\n}\n\nfunction getTextByDescendant(descendant: Descendant): string {\n if ('text' in descendant) {\n return descendant.text ?? ''\n }\n\n switch (descendant.type) {\n case InlineType.Link:\n case InlineType.Code:\n case InlineType.SubScript:\n case InlineType.SuperScript:\n return descendant.children.map(descendant => getTextByDescendant(descendant)).join('') ?? ''\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.BlockQuote:\n case BlockType.Paragraph:\n case BlockType.OrderedList:\n case BlockType.UnorderedList:\n case BlockType.ListItem:\n case BlockType.ListItemChild:\n return (\n descendant.children\n .map(descendant => getTextByDescendant(descendant))\n .join(descendant.children.every(isBlock) ? '\\n' : '') ?? ''\n )\n default:\n return ''\n }\n}\n\nfunction getText(descendant: Descendant[]): string {\n return descendant.map(getTextByDescendant).join('\\n')\n}\n"],"names":["ReadOnlyText","forwardRef","id","text","width","margin","ref","descendants","richTextDTOtoDAO","descendantsAsString","getText","cx","_jsx","useStyle","display","maxWidth","whiteSpace","opacity","verticalAlign","descendant","enhancedTypography","useEnhancedTypography","typography","typographyClassName","useTypographyClassName","linkClassName","textDecoration","type","InlineType","Code","children","SuperScript","SubScript","Link","link","blockStyles","useResponsiveStyle","textAlign","quoteStyle","padding","fontSize","fontWeight","borderLeft","BlockType","Text","Paragraph","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","OrderedList","listStylePosition","UnorderedList","ListItem","ListItemChild","node","_Fragment","map","index","isText","getTextByDescendant","join","every","isBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBMA,MAAAA,eAAeC,WAAW,uBAC9B;AAAA,EAAEC;AAAAA,EAAIC;AAAAA,EAAMC;AAAAA,EAAOC;AAAAA,GACnBC,KACA;AACMC,QAAAA,cAAcJ,QAAQ,OAAO,CAAA,IAAKK,iBAAiBL,IAAD;AAClDM,QAAAA,sBAAsBC,QAAQH,WAAD;AAGjC,6BAAA,OAAA;AAAA,IAAK;AAAA,IAAU;AAAA,IAAQ,WAAWI,GAAGP,OAAOC,MAAR;AAAA,IACjCI,UAAAA,wBAAwB,KAAKG,oBAAC,aAAD,EAAA,IAAkBA,oBAAC,aAAD;AAAA,MAAa;AAAA,IAAA,CAAb;AAAA,EAAA,CAFpD;AAKD,CAZ8B;AAgB/B,qBAAqB;AAAA,EAAET,OAAO;AAAA,GAA2C;AAErE,6BAAA,QAAA;AAAA,IACE,WAAWU,SAAS;AAAA,MAClBC,SAAS;AAAA,MACTV,OAAO;AAAA,MACPW,UAAU;AAAA,MACVC,YAAY;AAAA,MACZC,SAAS;AAAA,MACTC,eAAe;AAAA,IAAA,CANE;AAAA,IASlBf,UAAAA;AAAAA,EAAAA,CAXL;AAcD;AAM2B,qBAAA;AAAA,EAAEgB;AAAAA,GAAyB;AAC/CC,QAAAA,qBAAqBC,sBAAsBF,WAAWG,UAAZ;AAC1CC,QAAAA,sBAAsBC,uBAAuBJ,kBAAD;AAGhD,6BAAA,QAAA;AAAA,IAAM,WAAWG;AAAAA,IACdJ,UAAAA,WAAWhB,SAAS,KAAK,WAAWgB,WAAWhB;AAAAA,EAAAA,CAFpD;AAKD;AAMD,uBAAuB;AAAA,EAAEgB;AAAAA,GAA2B;AAC5CM,QAAAA,gBAAgBZ,SAAS;AAAA,IAAEa,gBAAgB;AAAA,EAAA,CAAnB;AAEtBP,UAAAA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AAAA,SACVF,UAAUU;AAAAA,SACVV,UAAUY;AAAAA,SACVZ,UAAUa;AAAAA,SACVb,UAAUc;AAEXtC,aAAAA,iBAAWW,SACR8B,IAAIzC,CAAc4C,gBAAAA,oBAAoB5C,WAAD,CADxC,EAEG6C,KAAK7C,WAAWW,SAASmC,MAAMC,OAA1B,IAAqC,OAAO,EAFpD,MAAA/C,YAE2D;AAAA;AAGtD,aAAA;AAAA;AAEZ;AAED,iBAAiBA,YAAkC;AAC1CA,SAAAA,WAAWyC,IAAIG,mBAAf,EAAoCC,KAAK,IAAzC;AACR;;"}
@@ -2,30 +2,29 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  var css = require("@emotion/css");
4
4
  var React = require("react");
5
- var reactPage = require("./react-page.cjs.js");
6
5
  var next = require("./index.cjs.js");
6
+ var reactPage = require("./react-page.cjs.js");
7
+ var index = require("./index.cjs3.js");
7
8
  require("slate");
8
9
  require("./state/breakpoints.cjs.js");
9
10
  require("./types.cjs2.js");
10
11
  require("is-hotkey");
11
12
  require("slate-react");
12
13
  var jsxRuntime = require("react/jsx-runtime");
13
- var index = require("./index.cjs3.js");
14
- var leaf = require("./leaf.cjs.js");
15
- require("redux");
16
- require("redux-thunk");
17
- require("./actions.cjs.js");
18
- require("@emotion/serialize");
19
- require("@emotion/utils");
20
14
  require("use-sync-external-store/shim/with-selector");
21
15
  require("next/dynamic");
22
- require("./text-input.cjs.js");
16
+ require("./actions.cjs.js");
17
+ require("./typography.cjs.js");
23
18
  require("./combobox.cjs.js");
24
19
  require("use-sync-external-store/shim");
20
+ require("redux");
21
+ require("redux-thunk");
25
22
  require("./types.cjs.js");
26
23
  require("./box-models.cjs.js");
27
24
  require("css-box-model");
28
25
  require("color");
26
+ require("@emotion/serialize");
27
+ require("@emotion/utils");
29
28
  require("scroll-into-view-if-needed");
30
29
  require("react-dom");
31
30
  require("html-react-parser");
@@ -75,8 +74,8 @@ function Placeholder({
75
74
  function TextElement({
76
75
  descendant
77
76
  }) {
78
- const enhancedTypography = leaf.useEnhancedTypography(descendant.typography);
79
- const typographyClassName = leaf.useTypographyClassName(enhancedTypography);
77
+ const enhancedTypography = next.useEnhancedTypography(descendant.typography);
78
+ const typographyClassName = next.useTypographyClassName(enhancedTypography);
80
79
  return /* @__PURE__ */ jsxRuntime.jsx("span", {
81
80
  className: typographyClassName,
82
81
  children: descendant.text === "" ? "\uFEFF" : descendant.text