@makeswift/runtime 0.9.11 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Box.cjs.js +4 -1
- package/dist/Box.cjs.js.map +1 -1
- package/dist/Box.es.js +5 -2
- package/dist/Box.es.js.map +1 -1
- package/dist/Button.cjs.js +4 -3
- package/dist/Button.cjs.js.map +1 -1
- package/dist/Button.es.js +5 -4
- package/dist/Button.es.js.map +1 -1
- package/dist/Carousel.cjs.js +4 -3
- package/dist/Carousel.cjs.js.map +1 -1
- package/dist/Carousel.es.js +5 -4
- package/dist/Carousel.es.js.map +1 -1
- package/dist/Countdown.cjs.js +4 -1
- package/dist/Countdown.cjs.js.map +1 -1
- package/dist/Countdown.es.js +5 -2
- package/dist/Countdown.es.js.map +1 -1
- package/dist/Divider.cjs.js +4 -1
- package/dist/Divider.cjs.js.map +1 -1
- package/dist/Divider.es.js +5 -2
- package/dist/Divider.es.js.map +1 -1
- package/dist/Embed.cjs.js +1 -0
- package/dist/Embed.cjs.js.map +1 -1
- package/dist/Embed.es.js +2 -1
- package/dist/Embed.es.js.map +1 -1
- package/dist/Form.cjs.js +14 -13
- package/dist/Form.cjs.js.map +1 -1
- package/dist/Form.es.js +6 -5
- package/dist/Form.es.js.map +1 -1
- package/dist/Image.cjs.js +12 -11
- package/dist/Image.cjs.js.map +1 -1
- package/dist/Image.es.js +12 -11
- package/dist/Image.es.js.map +1 -1
- package/dist/LiveProvider.cjs.js +4 -1
- package/dist/LiveProvider.cjs.js.map +1 -1
- package/dist/LiveProvider.es.js +6 -3
- package/dist/LiveProvider.es.js.map +1 -1
- package/dist/Navigation.cjs.js +12 -11
- package/dist/Navigation.cjs.js.map +1 -1
- package/dist/Navigation.es.js +12 -11
- package/dist/Navigation.es.js.map +1 -1
- package/dist/PreviewProvider.cjs.js +7 -4
- package/dist/PreviewProvider.cjs.js.map +1 -1
- package/dist/PreviewProvider.es.js +6 -3
- package/dist/PreviewProvider.es.js.map +1 -1
- package/dist/ReadOnlyText.cjs.js +34 -26
- package/dist/ReadOnlyText.cjs.js.map +1 -1
- package/dist/ReadOnlyText.es.js +30 -22
- package/dist/ReadOnlyText.es.js.map +1 -1
- package/dist/ReadOnlyTextV2.cjs.js +125 -246
- package/dist/ReadOnlyTextV2.cjs.js.map +1 -1
- package/dist/ReadOnlyTextV2.es.js +126 -246
- package/dist/ReadOnlyTextV2.es.js.map +1 -1
- package/dist/Root.cjs.js +4 -1
- package/dist/Root.cjs.js.map +1 -1
- package/dist/Root.es.js +5 -2
- package/dist/Root.es.js.map +1 -1
- package/dist/SocialLinks.cjs.js +7 -6
- package/dist/SocialLinks.cjs.js.map +1 -1
- package/dist/SocialLinks.es.js +8 -7
- package/dist/SocialLinks.es.js.map +1 -1
- package/dist/Text.cjs.js +12 -71
- package/dist/Text.cjs.js.map +1 -1
- package/dist/Text.es.js +13 -64
- package/dist/Text.es.js.map +1 -1
- package/dist/Video.cjs.js +1 -0
- package/dist/Video.cjs.js.map +1 -1
- package/dist/Video.es.js +2 -1
- package/dist/Video.es.js.map +1 -1
- package/dist/builder.cjs.js +2 -0
- package/dist/builder.cjs.js.map +1 -1
- package/dist/builder.es.js +2 -0
- package/dist/builder.es.js.map +1 -1
- package/dist/components.cjs.js +4 -3
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.es.js +4 -3
- package/dist/components.es.js.map +1 -1
- package/dist/control-serialization.es.js +1 -1
- package/dist/controls.cjs.js +31 -21
- package/dist/controls.cjs.js.map +1 -1
- package/dist/controls.es.js +4 -2
- package/dist/controls.es.js.map +1 -1
- package/dist/index.cjs.js +307 -243
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.cjs2.js +3 -3
- package/dist/index.cjs2.js.map +1 -1
- package/dist/index.cjs3.js +21 -107
- package/dist/index.cjs3.js.map +1 -1
- package/dist/index.cjs4.js +16 -57
- package/dist/index.cjs4.js.map +1 -1
- package/dist/index.cjs5.js +53 -243
- package/dist/index.cjs5.js.map +1 -1
- package/dist/index.cjs6.js +16 -37
- package/dist/index.cjs6.js.map +1 -1
- package/dist/index.cjs7.js +376 -14
- package/dist/index.cjs7.js.map +1 -1
- package/dist/index.cjs8.js +276 -12
- package/dist/index.cjs8.js.map +1 -1
- package/dist/index.es.js +279 -215
- package/dist/index.es.js.map +1 -1
- package/dist/index.es2.js +2 -2
- package/dist/index.es3.js +22 -103
- package/dist/index.es3.js.map +1 -1
- package/dist/index.es4.js +16 -57
- package/dist/index.es4.js.map +1 -1
- package/dist/index.es5.js +53 -241
- package/dist/index.es5.js.map +1 -1
- package/dist/index.es6.js +16 -32
- package/dist/index.es6.js.map +1 -1
- package/dist/index.es7.js +372 -16
- package/dist/index.es7.js.map +1 -1
- package/dist/index.es8.js +271 -11
- package/dist/index.es8.js.map +1 -1
- package/dist/main.cjs.js +2 -0
- package/dist/main.cjs.js.map +1 -1
- package/dist/main.es.js +2 -0
- package/dist/main.es.js.map +1 -1
- package/dist/next.cjs.js +4 -1
- package/dist/next.cjs.js.map +1 -1
- package/dist/next.es.js +5 -2
- package/dist/next.es.js.map +1 -1
- package/dist/prop-controllers.cjs.js +2 -0
- package/dist/prop-controllers.cjs.js.map +1 -1
- package/dist/prop-controllers.es.js +2 -0
- package/dist/prop-controllers.es.js.map +1 -1
- package/dist/react-page.cjs.js +1731 -183
- package/dist/react-page.cjs.js.map +1 -1
- package/dist/react-page.es.js +1694 -182
- package/dist/react-page.es.js.map +1 -1
- package/dist/react.cjs.js +4 -1
- package/dist/react.cjs.js.map +1 -1
- package/dist/react.es.js +4 -1
- package/dist/react.es.js.map +1 -1
- package/dist/slate.cjs.js +32 -377
- package/dist/slate.cjs.js.map +1 -1
- package/dist/slate.es.js +14 -363
- package/dist/slate.es.js.map +1 -1
- package/dist/text-input.cjs.js +26 -0
- package/dist/text-input.cjs.js.map +1 -0
- package/dist/text-input.es.js +18 -0
- package/dist/text-input.es.js.map +1 -0
- package/dist/types/src/components/builtin/Text/Text.d.ts +3 -4
- package/dist/types/src/components/builtin/Text/Text.d.ts.map +1 -1
- package/dist/types/src/components/builtin/Text/register.d.ts.map +1 -1
- package/dist/types/src/controls/list.d.ts +5 -2
- package/dist/types/src/controls/list.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/fixtures/v2-data-types.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/introspection.d.ts +5 -0
- package/dist/types/src/controls/rich-text/introspection.d.ts.map +1 -0
- package/dist/types/src/controls/rich-text/introspection.test.d.ts +2 -0
- package/dist/types/src/controls/rich-text/introspection.test.d.ts.map +1 -0
- package/dist/types/src/controls/rich-text/rich-text.d.ts +0 -1
- package/dist/types/src/controls/rich-text/rich-text.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text/translation.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text-v2/introspection.d.ts +5 -0
- package/dist/types/src/controls/rich-text-v2/introspection.d.ts.map +1 -0
- package/dist/types/src/controls/rich-text-v2/introspection.test.d.ts +2 -0
- package/dist/types/src/controls/rich-text-v2/introspection.test.d.ts.map +1 -0
- package/dist/types/src/controls/rich-text-v2/plugin.d.ts +29 -0
- package/dist/types/src/controls/rich-text-v2/plugin.d.ts.map +1 -0
- package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts +32 -34
- package/dist/types/src/controls/rich-text-v2/rich-text-v2.d.ts.map +1 -1
- package/dist/types/src/controls/rich-text-v2/translation.d.ts +1 -1
- package/dist/types/src/controls/rich-text-v2/translation.d.ts.map +1 -1
- package/dist/types/src/controls/shape.d.ts +5 -2
- package/dist/types/src/controls/shape.d.ts.map +1 -1
- package/dist/types/src/controls/typography.d.ts +2 -0
- package/dist/types/src/controls/typography.d.ts.map +1 -1
- package/dist/types/src/next/client.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/descriptors.d.ts +11 -1
- package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
- package/dist/types/src/prop-controllers/introspection.d.ts +0 -2
- package/dist/types/src/prop-controllers/introspection.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/control.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -1
- package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/EditableText/editable-text.d.ts +4 -3
- package/dist/types/src/runtimes/react/controls/rich-text/EditableText/editable-text.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text/EditableText/index.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text/EditableText/useSyncDOMSelection.d.ts.map +1 -0
- package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/EditableText/useSyncWithBuilder.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text/EditableText/useSyncWithBuilder.d.ts.map +1 -0
- package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/ReadOnlyText.d.ts +2 -2
- package/dist/types/src/runtimes/react/controls/rich-text/ReadOnlyText.d.ts.map +1 -0
- package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Element/block.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text/components/Element/block.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text/components/Element/element.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text/components/Element/index.d.ts.map +1 -0
- package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Element/inline.d.ts +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text/components/Element/inline.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text/components/Leaf/index.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text/components/Leaf/leaf.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text/components/index.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text/index.d.ts +2 -0
- package/dist/types/src/runtimes/react/controls/rich-text/index.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/{rich-text.d.ts → rich-text/rich-text.d.ts} +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text/rich-text.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/editable-text-v2.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts +3 -2
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-element.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts +2 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/render-leaf.d.ts.map +1 -1
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/useRemoteChanges.d.ts +4 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/EditableTextV2/useRemoteChanges.d.ts.map +1 -0
- package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts +8 -16
- package/dist/types/src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.d.ts.map +1 -1
- package/dist/types/src/slate/BlockPlugin/index.d.ts +3 -3
- package/dist/types/src/slate/BlockPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/InlineModePlugin/index.d.ts +6 -4
- package/dist/types/src/slate/InlineModePlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/InlinePlugin/index.d.ts +3 -3
- package/dist/types/src/slate/InlinePlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/InlinePlugin/types.d.ts +1 -1
- package/dist/types/src/slate/InlinePlugin/types.d.ts.map +1 -1
- package/dist/types/src/slate/LinkPlugin/index.d.ts +3 -3
- package/dist/types/src/slate/LinkPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/LinkPlugin/linkPluginWithoutRenderElement.d.ts +16 -0
- package/dist/types/src/slate/LinkPlugin/linkPluginWithoutRenderElement.d.ts.map +1 -0
- package/dist/types/src/slate/LocalChangesPlugin/index.d.ts +16 -0
- package/dist/types/src/slate/LocalChangesPlugin/index.d.ts.map +1 -0
- package/dist/types/src/slate/TextAlignPlugin/index.d.ts +3 -3
- package/dist/types/src/slate/TextAlignPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/TypographyPlugin/index.d.ts +3 -3
- package/dist/types/src/slate/TypographyPlugin/index.d.ts.map +1 -1
- package/dist/types/src/slate/index.d.ts +1 -0
- package/dist/types/src/slate/index.d.ts.map +1 -1
- package/dist/types/src/slate/types.d.ts +3 -12
- package/dist/types/src/slate/types.d.ts.map +1 -1
- package/dist/types/src/slate/utils/element.d.ts.map +1 -1
- package/dist/types/src/state/modules/locales.d.ts.map +1 -1
- package/package.json +1 -2
- package/dist/index.cjs10.js +0 -390
- package/dist/index.cjs10.js.map +0 -1
- package/dist/index.cjs9.js +0 -299
- package/dist/index.cjs9.js.map +0 -1
- package/dist/index.es10.js +0 -383
- package/dist/index.es10.js.map +0 -1
- package/dist/index.es9.js +0 -292
- package/dist/index.es9.js.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/editable-text.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/index.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/useSyncDOMSelection.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/EditableText/useSyncWithBuilder.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/components/Element/block.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/components/Element/element.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/components/Element/index.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/components/Element/inline.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/components/Leaf/index.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/components/Leaf/leaf.d.ts.map +0 -1
- package/dist/types/src/components/builtin/Text/components/index.d.ts.map +0 -1
- package/dist/types/src/runtimes/react/controls/rich-text.d.ts.map +0 -1
- package/dist/types.cjs2.js +0 -746
- package/dist/types.cjs2.js.map +0 -1
- package/dist/types.es2.js +0 -729
- package/dist/types.es2.js.map +0 -1
- package/dist/typography.cjs.js +0 -56
- package/dist/typography.cjs.js.map +0 -1
- package/dist/typography.es.js +0 -41
- package/dist/typography.es.js.map +0 -1
- /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/EditableText/index.d.ts +0 -0
- /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/EditableText/useSyncDOMSelection.d.ts +0 -0
- /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Element/element.d.ts +0 -0
- /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Element/index.d.ts +0 -0
- /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Leaf/index.d.ts +0 -0
- /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/Leaf/leaf.d.ts +0 -0
- /package/dist/types/src/{components/builtin/Text → runtimes/react/controls/rich-text}/components/index.d.ts +0 -0
|
@@ -1,22 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
2
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
3
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var __objRest = (source, exclude) => {
|
|
5
|
+
var target = {};
|
|
6
|
+
for (var prop in source)
|
|
7
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
8
|
+
target[prop] = source[prop];
|
|
9
|
+
if (source != null && __getOwnPropSymbols)
|
|
10
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
11
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
12
|
+
target[prop] = source[prop];
|
|
13
|
+
}
|
|
14
|
+
return target;
|
|
15
|
+
};
|
|
2
16
|
import { forwardRef } from "react";
|
|
3
|
-
import {
|
|
4
|
-
import { b9 as RichTextV2Mode, U as useStyle, bi as BlockType, bg as InlineType } from "./react-page.es.js";
|
|
17
|
+
import { bq as RichTextV2Mode, bI as InlineModePlugin, bG as BlockPlugin, bB as TypographyPlugin, bK as TextAlignPlugin, bP as InlinePlugin, _ as useStyle, Y as BlockType, bM as InlineType } from "./react-page.es.js";
|
|
5
18
|
import "./actions.es.js";
|
|
6
|
-
import { L as Link } from "./index.es3.js";
|
|
7
19
|
import "slate";
|
|
8
|
-
import "./state/breakpoints.es.js";
|
|
9
|
-
import "./types.es2.js";
|
|
10
|
-
import "is-hotkey";
|
|
11
20
|
import "slate-react";
|
|
21
|
+
import { L as LinkPlugin } from "./index.es5.js";
|
|
22
|
+
import "uuid";
|
|
23
|
+
import { Q as ControlValue } from "./index.es.js";
|
|
12
24
|
import { jsx, Fragment } from "react/jsx-runtime";
|
|
25
|
+
import "redux";
|
|
26
|
+
import "redux-thunk";
|
|
27
|
+
import "./state/breakpoints.es.js";
|
|
28
|
+
import "zod";
|
|
29
|
+
import "@emotion/css";
|
|
30
|
+
import "@emotion/serialize";
|
|
31
|
+
import "@emotion/utils";
|
|
32
|
+
import "is-hotkey";
|
|
13
33
|
import "use-sync-external-store/shim/with-selector";
|
|
14
34
|
import "next/dynamic";
|
|
15
|
-
import "./
|
|
35
|
+
import "./text-input.es.js";
|
|
16
36
|
import "./combobox.es.js";
|
|
17
37
|
import "use-sync-external-store/shim";
|
|
18
|
-
import "redux";
|
|
19
|
-
import "redux-thunk";
|
|
20
38
|
import "./types.es.js";
|
|
21
39
|
import "./box-models.es.js";
|
|
22
40
|
import "css-box-model";
|
|
@@ -25,7 +43,6 @@ import "scroll-into-view-if-needed";
|
|
|
25
43
|
import "react-dom";
|
|
26
44
|
import "html-react-parser";
|
|
27
45
|
import "next/head";
|
|
28
|
-
import "zod";
|
|
29
46
|
import "@emotion/server/create-instance";
|
|
30
47
|
import "next/document";
|
|
31
48
|
import "cors";
|
|
@@ -34,25 +51,26 @@ import "cookie";
|
|
|
34
51
|
import "http-proxy";
|
|
35
52
|
import "set-cookie-parser";
|
|
36
53
|
import "./constants.es.js";
|
|
37
|
-
import "uuid";
|
|
38
54
|
import "corporate-ipsum";
|
|
39
|
-
import "@emotion/serialize";
|
|
40
|
-
import "@emotion/utils";
|
|
41
55
|
import "next/link";
|
|
42
56
|
const ReadOnlyTextV2 = forwardRef(function ReadOnlyText({
|
|
43
57
|
text: {
|
|
44
58
|
descendants
|
|
45
59
|
},
|
|
46
|
-
|
|
60
|
+
definition
|
|
47
61
|
}, ref) {
|
|
48
|
-
var _a;
|
|
49
|
-
const descendantsAsString = getText(descendants);
|
|
50
|
-
const mode = (_a = control == null ? void 0 : control.descriptor.config.mode) != null ? _a : RichTextV2Mode.Block;
|
|
62
|
+
var _a, _b;
|
|
63
|
+
const descendantsAsString = getText(descendants, (_a = definition == null ? void 0 : definition.config.mode) != null ? _a : RichTextV2Mode.Block);
|
|
51
64
|
return /* @__PURE__ */ jsx("div", {
|
|
52
65
|
ref,
|
|
66
|
+
style: {
|
|
67
|
+
position: "relative",
|
|
68
|
+
whiteSpace: "pre-wrap",
|
|
69
|
+
wordWrap: "break-word"
|
|
70
|
+
},
|
|
53
71
|
children: descendantsAsString === "" ? /* @__PURE__ */ jsx(Placeholder, {}) : /* @__PURE__ */ jsx(Descendants, {
|
|
54
|
-
|
|
55
|
-
|
|
72
|
+
plugins: ((_b = definition == null ? void 0 : definition.config) == null ? void 0 : _b.mode) === RichTextV2Mode.Inline ? [InlineModePlugin()] : [BlockPlugin(), TypographyPlugin(), TextAlignPlugin(), InlinePlugin(), LinkPlugin()],
|
|
73
|
+
descendants
|
|
56
74
|
})
|
|
57
75
|
});
|
|
58
76
|
});
|
|
@@ -71,199 +89,74 @@ function Placeholder({
|
|
|
71
89
|
children: text
|
|
72
90
|
});
|
|
73
91
|
}
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
92
|
+
function LeafComponent(_a) {
|
|
93
|
+
var _b = _a, {
|
|
94
|
+
plugins
|
|
95
|
+
} = _b, props = __objRest(_b, [
|
|
96
|
+
"plugins"
|
|
97
|
+
]);
|
|
98
|
+
function initialRenderLeaf({
|
|
99
|
+
leaf
|
|
100
|
+
}) {
|
|
101
|
+
return /* @__PURE__ */ jsx("span", {
|
|
102
|
+
className: leaf.className,
|
|
103
|
+
children: leaf.text === "" ? "\uFEFF" : leaf.text
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
const renderLeaf = plugins.reduce((renderFn, plugin) => (props2) => {
|
|
107
|
+
const {
|
|
108
|
+
control,
|
|
109
|
+
renderLeaf: renderLeaf2
|
|
110
|
+
} = plugin;
|
|
111
|
+
if ((control == null ? void 0 : control.definition) == null || renderLeaf2 == null)
|
|
112
|
+
return renderFn(props2);
|
|
113
|
+
if (control.getLeafValue == null)
|
|
114
|
+
return renderLeaf2(renderFn, void 0)(props2);
|
|
115
|
+
return /* @__PURE__ */ jsx(ControlValue, {
|
|
116
|
+
definition: control.definition,
|
|
117
|
+
data: control.getLeafValue(props2.leaf),
|
|
118
|
+
children: (value) => renderLeaf2(renderFn, value)(props2)
|
|
119
|
+
});
|
|
120
|
+
}, initialRenderLeaf);
|
|
121
|
+
return renderLeaf({
|
|
122
|
+
attributes: {},
|
|
123
|
+
leaf: props.leaf,
|
|
124
|
+
children: null,
|
|
125
|
+
text: props.leaf
|
|
82
126
|
});
|
|
83
127
|
}
|
|
84
|
-
function
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
children: /* @__PURE__ */ jsx(Descendants, {
|
|
96
|
-
descendants: descendant.children,
|
|
97
|
-
mode
|
|
98
|
-
})
|
|
99
|
-
});
|
|
100
|
-
case InlineType.SuperScript:
|
|
101
|
-
return /* @__PURE__ */ jsx("sup", {
|
|
102
|
-
children: /* @__PURE__ */ jsx(Descendants, {
|
|
103
|
-
descendants: descendant.children,
|
|
104
|
-
mode
|
|
105
|
-
})
|
|
106
|
-
});
|
|
107
|
-
case InlineType.SubScript:
|
|
108
|
-
return /* @__PURE__ */ jsx("sub", {
|
|
109
|
-
children: /* @__PURE__ */ jsx(Descendants, {
|
|
110
|
-
descendants: descendant.children,
|
|
111
|
-
mode
|
|
112
|
-
})
|
|
113
|
-
});
|
|
114
|
-
case InlineType.Link:
|
|
115
|
-
return /* @__PURE__ */ jsx(Link, {
|
|
116
|
-
className: linkClassName,
|
|
117
|
-
link: (_a = descendant.link) != null ? _a : void 0,
|
|
118
|
-
children: /* @__PURE__ */ jsx(Descendants, {
|
|
119
|
-
descendants: descendant.children,
|
|
120
|
-
mode
|
|
121
|
-
})
|
|
122
|
-
});
|
|
128
|
+
function ElementComponent(_c) {
|
|
129
|
+
var _d = _c, {
|
|
130
|
+
plugins
|
|
131
|
+
} = _d, props = __objRest(_d, [
|
|
132
|
+
"plugins"
|
|
133
|
+
]);
|
|
134
|
+
function initialRenderElement(props2) {
|
|
135
|
+
return /* @__PURE__ */ jsx(Descendants, {
|
|
136
|
+
descendants: props2.element.children,
|
|
137
|
+
plugins
|
|
138
|
+
});
|
|
123
139
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
140
|
+
const renderElement = plugins.reduce((renderFn, plugin) => (props2) => {
|
|
141
|
+
const {
|
|
142
|
+
control,
|
|
143
|
+
renderElement: renderElement2
|
|
144
|
+
} = plugin;
|
|
145
|
+
if ((control == null ? void 0 : control.definition) == null || renderElement2 == null)
|
|
146
|
+
return renderFn(props2);
|
|
147
|
+
if (control.getElementValue == null)
|
|
148
|
+
return renderElement2(renderFn, void 0)(props2);
|
|
149
|
+
return /* @__PURE__ */ jsx(ControlValue, {
|
|
150
|
+
definition: control.definition,
|
|
151
|
+
data: control.getElementValue(props2.element),
|
|
152
|
+
children: (value) => renderElement2(renderFn, value)(props2)
|
|
153
|
+
});
|
|
154
|
+
}, initialRenderElement);
|
|
155
|
+
return renderElement({
|
|
156
|
+
attributes: {},
|
|
157
|
+
children: null,
|
|
158
|
+
element: props.descendant
|
|
139
159
|
});
|
|
140
|
-
const listStyles = useStyle({
|
|
141
|
-
listStylePosition: "inside",
|
|
142
|
-
paddingInlineStart: "20px",
|
|
143
|
-
listStyleType: "disc"
|
|
144
|
-
});
|
|
145
|
-
switch (descendant.type) {
|
|
146
|
-
case BlockType.Text:
|
|
147
|
-
return /* @__PURE__ */ jsx("span", {
|
|
148
|
-
className: cx(...blockStyles),
|
|
149
|
-
children: /* @__PURE__ */ jsx(Descendants, {
|
|
150
|
-
descendants: descendant.children,
|
|
151
|
-
mode
|
|
152
|
-
})
|
|
153
|
-
});
|
|
154
|
-
case BlockType.Paragraph:
|
|
155
|
-
return /* @__PURE__ */ jsx("p", {
|
|
156
|
-
className: cx(...blockStyles),
|
|
157
|
-
children: /* @__PURE__ */ jsx(Descendants, {
|
|
158
|
-
descendants: descendant.children,
|
|
159
|
-
mode
|
|
160
|
-
})
|
|
161
|
-
});
|
|
162
|
-
case BlockType.Heading1:
|
|
163
|
-
return /* @__PURE__ */ jsx("h1", {
|
|
164
|
-
className: cx(...blockStyles),
|
|
165
|
-
children: /* @__PURE__ */ jsx(Descendants, {
|
|
166
|
-
descendants: descendant.children,
|
|
167
|
-
mode
|
|
168
|
-
})
|
|
169
|
-
});
|
|
170
|
-
case BlockType.Heading2:
|
|
171
|
-
return /* @__PURE__ */ jsx("h2", {
|
|
172
|
-
className: cx(...blockStyles),
|
|
173
|
-
children: /* @__PURE__ */ jsx(Descendants, {
|
|
174
|
-
descendants: descendant.children,
|
|
175
|
-
mode
|
|
176
|
-
})
|
|
177
|
-
});
|
|
178
|
-
case BlockType.Heading3:
|
|
179
|
-
return /* @__PURE__ */ jsx("h3", {
|
|
180
|
-
className: cx(...blockStyles),
|
|
181
|
-
children: /* @__PURE__ */ jsx(Descendants, {
|
|
182
|
-
descendants: descendant.children,
|
|
183
|
-
mode
|
|
184
|
-
})
|
|
185
|
-
});
|
|
186
|
-
case BlockType.Heading4:
|
|
187
|
-
return /* @__PURE__ */ jsx("h4", {
|
|
188
|
-
className: cx(...blockStyles),
|
|
189
|
-
children: /* @__PURE__ */ jsx(Descendants, {
|
|
190
|
-
descendants: descendant.children,
|
|
191
|
-
mode
|
|
192
|
-
})
|
|
193
|
-
});
|
|
194
|
-
case BlockType.Heading5:
|
|
195
|
-
return /* @__PURE__ */ jsx("h5", {
|
|
196
|
-
className: cx(...blockStyles),
|
|
197
|
-
children: /* @__PURE__ */ jsx(Descendants, {
|
|
198
|
-
descendants: descendant.children,
|
|
199
|
-
mode
|
|
200
|
-
})
|
|
201
|
-
});
|
|
202
|
-
case BlockType.Heading6:
|
|
203
|
-
return /* @__PURE__ */ jsx("h6", {
|
|
204
|
-
className: cx(...blockStyles),
|
|
205
|
-
children: /* @__PURE__ */ jsx(Descendants, {
|
|
206
|
-
descendants: descendant.children,
|
|
207
|
-
mode
|
|
208
|
-
})
|
|
209
|
-
});
|
|
210
|
-
case BlockType.BlockQuote:
|
|
211
|
-
return /* @__PURE__ */ jsx("blockquote", {
|
|
212
|
-
className: cx(...blockStyles, quoteStyle),
|
|
213
|
-
children: /* @__PURE__ */ jsx(Descendants, {
|
|
214
|
-
descendants: descendant.children,
|
|
215
|
-
mode
|
|
216
|
-
})
|
|
217
|
-
});
|
|
218
|
-
case BlockType.OrderedList:
|
|
219
|
-
return /* @__PURE__ */ jsx("ol", {
|
|
220
|
-
className: cx(...blockStyles, listStyles),
|
|
221
|
-
children: /* @__PURE__ */ jsx(Descendants, {
|
|
222
|
-
descendants: descendant.children,
|
|
223
|
-
mode
|
|
224
|
-
})
|
|
225
|
-
});
|
|
226
|
-
case BlockType.UnorderedList:
|
|
227
|
-
return /* @__PURE__ */ jsx("ul", {
|
|
228
|
-
className: cx(...blockStyles, listStyles),
|
|
229
|
-
children: /* @__PURE__ */ jsx(Descendants, {
|
|
230
|
-
descendants: descendant.children,
|
|
231
|
-
mode
|
|
232
|
-
})
|
|
233
|
-
});
|
|
234
|
-
case BlockType.ListItem:
|
|
235
|
-
return /* @__PURE__ */ jsx("li", {
|
|
236
|
-
className: cx(...blockStyles),
|
|
237
|
-
children: /* @__PURE__ */ jsx(Descendants, {
|
|
238
|
-
descendants: descendant.children,
|
|
239
|
-
mode
|
|
240
|
-
})
|
|
241
|
-
});
|
|
242
|
-
case BlockType.ListItemChild:
|
|
243
|
-
return /* @__PURE__ */ jsx("span", {
|
|
244
|
-
className: cx(...blockStyles),
|
|
245
|
-
children: /* @__PURE__ */ jsx(Descendants, {
|
|
246
|
-
descendants: descendant.children,
|
|
247
|
-
mode
|
|
248
|
-
})
|
|
249
|
-
});
|
|
250
|
-
default:
|
|
251
|
-
if (mode === RichTextV2Mode.Inline)
|
|
252
|
-
return /* @__PURE__ */ jsx("span", {
|
|
253
|
-
className: cx(...blockStyles),
|
|
254
|
-
children: /* @__PURE__ */ jsx(Descendants, {
|
|
255
|
-
descendants: descendant.children,
|
|
256
|
-
mode
|
|
257
|
-
})
|
|
258
|
-
});
|
|
259
|
-
return /* @__PURE__ */ jsx("p", {
|
|
260
|
-
className: cx(...blockStyles),
|
|
261
|
-
children: /* @__PURE__ */ jsx(Descendants, {
|
|
262
|
-
descendants: descendant.children,
|
|
263
|
-
mode
|
|
264
|
-
})
|
|
265
|
-
});
|
|
266
|
-
}
|
|
267
160
|
}
|
|
268
161
|
function isText(node) {
|
|
269
162
|
if (typeof node === "object" && "text" in node)
|
|
@@ -272,41 +165,20 @@ function isText(node) {
|
|
|
272
165
|
}
|
|
273
166
|
function Descendants({
|
|
274
167
|
descendants,
|
|
275
|
-
|
|
168
|
+
plugins
|
|
276
169
|
}) {
|
|
277
170
|
return /* @__PURE__ */ jsx(Fragment, {
|
|
278
171
|
children: descendants.map((descendant, index) => {
|
|
279
172
|
if (isText(descendant)) {
|
|
280
|
-
return /* @__PURE__ */ jsx(
|
|
281
|
-
|
|
173
|
+
return /* @__PURE__ */ jsx(LeafComponent, {
|
|
174
|
+
plugins,
|
|
175
|
+
leaf: descendant
|
|
282
176
|
}, index);
|
|
283
177
|
}
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
case InlineType.SuperScript:
|
|
289
|
-
return /* @__PURE__ */ jsx(InlineElement, {
|
|
290
|
-
descendant,
|
|
291
|
-
mode
|
|
292
|
-
}, index);
|
|
293
|
-
case BlockType.Heading1:
|
|
294
|
-
case BlockType.Heading2:
|
|
295
|
-
case BlockType.Heading3:
|
|
296
|
-
case BlockType.BlockQuote:
|
|
297
|
-
case BlockType.Text:
|
|
298
|
-
case BlockType.Paragraph:
|
|
299
|
-
case BlockType.OrderedList:
|
|
300
|
-
case BlockType.UnorderedList:
|
|
301
|
-
case BlockType.ListItem:
|
|
302
|
-
case BlockType.ListItemChild:
|
|
303
|
-
return /* @__PURE__ */ jsx(BlockElement, {
|
|
304
|
-
descendant,
|
|
305
|
-
mode
|
|
306
|
-
}, index);
|
|
307
|
-
default:
|
|
308
|
-
return null;
|
|
309
|
-
}
|
|
178
|
+
return /* @__PURE__ */ jsx(ElementComponent, {
|
|
179
|
+
descendant,
|
|
180
|
+
plugins
|
|
181
|
+
}, index);
|
|
310
182
|
})
|
|
311
183
|
});
|
|
312
184
|
}
|
|
@@ -317,45 +189,53 @@ function isBlock(descendant) {
|
|
|
317
189
|
case BlockType.Heading1:
|
|
318
190
|
case BlockType.Heading2:
|
|
319
191
|
case BlockType.Heading3:
|
|
192
|
+
case BlockType.Heading4:
|
|
193
|
+
case BlockType.Heading5:
|
|
194
|
+
case BlockType.Heading6:
|
|
320
195
|
case BlockType.BlockQuote:
|
|
321
196
|
case BlockType.Paragraph:
|
|
197
|
+
case BlockType.Default:
|
|
322
198
|
case BlockType.OrderedList:
|
|
323
199
|
case BlockType.UnorderedList:
|
|
324
200
|
case BlockType.ListItem:
|
|
325
201
|
case BlockType.ListItemChild:
|
|
326
|
-
case BlockType.Text:
|
|
327
202
|
return true;
|
|
328
203
|
default:
|
|
329
204
|
return false;
|
|
330
205
|
}
|
|
331
206
|
}
|
|
332
|
-
function getTextByDescendant(descendant) {
|
|
333
|
-
var _a, _b, _c;
|
|
207
|
+
function getTextByDescendant(descendant, mode) {
|
|
208
|
+
var _a, _b, _c, _d, _e;
|
|
334
209
|
if (isText(descendant)) {
|
|
335
210
|
return (_a = descendant.text) != null ? _a : "";
|
|
336
211
|
}
|
|
337
212
|
switch (descendant.type) {
|
|
213
|
+
case BlockType.Default:
|
|
214
|
+
return mode === RichTextV2Mode.Inline ? (_b = descendant.children.map((descendant2) => getTextByDescendant(descendant2, mode)).join("")) != null ? _b : "" : (_c = descendant.children.map((descendant2) => getTextByDescendant(descendant2, mode)).join(descendant.children.every(isBlock) ? "\n" : "")) != null ? _c : "";
|
|
338
215
|
case InlineType.Link:
|
|
339
216
|
case InlineType.Code:
|
|
340
217
|
case InlineType.SubScript:
|
|
341
218
|
case InlineType.SuperScript:
|
|
342
|
-
return (
|
|
219
|
+
return (_d = descendant.children.map((descendant2) => getTextByDescendant(descendant2, mode)).join("")) != null ? _d : "";
|
|
343
220
|
case BlockType.Heading1:
|
|
344
221
|
case BlockType.Heading2:
|
|
345
222
|
case BlockType.Heading3:
|
|
223
|
+
case BlockType.Heading4:
|
|
224
|
+
case BlockType.Heading5:
|
|
225
|
+
case BlockType.Heading6:
|
|
346
226
|
case BlockType.BlockQuote:
|
|
347
227
|
case BlockType.Paragraph:
|
|
348
228
|
case BlockType.OrderedList:
|
|
349
229
|
case BlockType.UnorderedList:
|
|
350
230
|
case BlockType.ListItem:
|
|
351
231
|
case BlockType.ListItemChild:
|
|
352
|
-
return (
|
|
232
|
+
return (_e = descendant.children.map((descendant2) => getTextByDescendant(descendant2, mode)).join(descendant.children.every(isBlock) ? "\n" : "")) != null ? _e : "";
|
|
353
233
|
default:
|
|
354
234
|
return "";
|
|
355
235
|
}
|
|
356
236
|
}
|
|
357
|
-
function getText(descendant) {
|
|
358
|
-
return descendant.map(getTextByDescendant).join("\n");
|
|
237
|
+
function getText(descendant, mode) {
|
|
238
|
+
return descendant.map((node) => getTextByDescendant(node, mode)).join("\n");
|
|
359
239
|
}
|
|
360
|
-
export {
|
|
240
|
+
export { LeafComponent, ReadOnlyTextV2 as default };
|
|
361
241
|
//# sourceMappingURL=ReadOnlyTextV2.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReadOnlyTextV2.es.js","sources":["../src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.tsx"],"sourcesContent":["import { cx } from '@emotion/css'\nimport { ForwardedRef, forwardRef } from 'react'\nimport { useResponsiveStyle } from '../../../../components/utils/responsive-style'\nimport { RichTextV2Control, RichTextV2ControlData, RichTextV2Mode } from '../../../../controls'\nimport { useStyle } from '../../use-style'\nimport { Descendant, Text } from 'slate'\nimport { Link } from '../../../../components/shared/Link'\nimport { Inline, InlineType, Block, BlockType } from '../../../../slate'\nimport useEnhancedTypography, { useTypographyClassName } from '../typography'\n\ntype Props = {\n text: RichTextV2ControlData\n control: RichTextV2Control | null\n}\n\nconst ReadOnlyTextV2 = forwardRef(function ReadOnlyText(\n { text: { descendants }, control }: Props,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const descendantsAsString = getText(descendants)\n\n const mode = control?.descriptor.config.mode ?? RichTextV2Mode.Block\n\n return (\n <div ref={ref}>\n {descendantsAsString === '' ? (\n <Placeholder />\n ) : (\n <Descendants descendants={descendants} mode={mode} />\n )}\n </div>\n )\n})\n\nexport default ReadOnlyTextV2\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 mode: RichTextV2Mode\n}\n\nfunction InlineElement({ descendant, mode }: 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} mode={mode} />\n </code>\n )\n\n case InlineType.SuperScript:\n return (\n <sup>\n <Descendants descendants={descendant.children} mode={mode} />\n </sup>\n )\n\n case InlineType.SubScript:\n return (\n <sub>\n <Descendants descendants={descendant.children} mode={mode} />\n </sub>\n )\n\n case InlineType.Link:\n return (\n <Link className={linkClassName} link={descendant.link ?? undefined}>\n <Descendants descendants={descendant.children} mode={mode} />\n </Link>\n )\n }\n}\n\nexport interface BlockProps {\n descendant: Block\n mode: RichTextV2Mode\n}\n\nexport function BlockElement({ descendant, mode }: 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 const listStyles = useStyle({\n listStylePosition: 'inside',\n paddingInlineStart: '20px',\n listStyleType: 'disc',\n })\n\n switch (descendant.type) {\n case BlockType.Text:\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </span>\n )\n case BlockType.Paragraph:\n return (\n <p className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </p>\n )\n case BlockType.Heading1:\n return (\n <h1 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </h1>\n )\n case BlockType.Heading2:\n return (\n <h2 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </h2>\n )\n case BlockType.Heading3:\n return (\n <h3 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </h3>\n )\n case BlockType.Heading4:\n return (\n <h4 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </h4>\n )\n case BlockType.Heading5:\n return (\n <h5 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </h5>\n )\n case BlockType.Heading6:\n return (\n <h6 className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </h6>\n )\n case BlockType.BlockQuote:\n return (\n <blockquote className={cx(...blockStyles, quoteStyle)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </blockquote>\n )\n case BlockType.OrderedList:\n return (\n <ol className={cx(...blockStyles, listStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </ol>\n )\n case BlockType.UnorderedList:\n return (\n <ul className={cx(...blockStyles, listStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </ul>\n )\n case BlockType.ListItem:\n return (\n <li className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </li>\n )\n case BlockType.ListItemChild:\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </span>\n )\n default:\n if (mode === RichTextV2Mode.Inline)\n return (\n <span className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </span>\n )\n return (\n <p className={cx(...blockStyles)}>\n <Descendants descendants={descendant.children} mode={mode} />\n </p>\n )\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, mode }: { descendants: Descendant[]; mode: RichTextV2Mode }) {\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} mode={mode} />\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} mode={mode} />\n default:\n return null\n }\n })}\n </>\n )\n}\n\nfunction isBlock(descendant: Descendant): descendant is Block {\n if (isText(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 case BlockType.Text:\n return true\n\n default:\n return false\n }\n}\n\nfunction getTextByDescendant(descendant: Descendant): string {\n if (isText(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":["ReadOnlyTextV2","forwardRef","text","descendants","control","ref","descendantsAsString","getText","mode","descriptor","config","RichTextV2Mode","Block","_jsx","useStyle","display","width","maxWidth","whiteSpace","opacity","verticalAlign","descendant","enhancedTypography","useEnhancedTypography","typography","typographyClassName","useTypographyClassName","linkClassName","textDecoration","type","InlineType","Code","children","SuperScript","SubScript","Link","link","undefined","blockStyles","margin","useResponsiveStyle","textAlign","quoteStyle","padding","fontSize","fontWeight","borderLeft","listStyles","listStylePosition","paddingInlineStart","listStyleType","BlockType","Text","cx","Paragraph","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","OrderedList","UnorderedList","ListItem","ListItemChild","Inline","node","_Fragment","map","index","isText","getTextByDescendant","join","every","isBlock"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeMA,MAAAA,iBAAiBC,WAAW,sBAChC;AAAA,EAAEC,MAAM;AAAA,IAAEC;AAAAA;AAAAA,EAAeC;AAAAA,GACzBC,KACA;;AACMC,QAAAA,sBAAsBC,QAAQJ,WAAD;AAEnC,QAAMK,OAAOJ,yCAASK,WAAWC,OAAOF,SAA3BJ,YAAmCO,eAAeC;AAG7D,6BAAA,OAAA;AAAA,IAAK;AAAA,IACFN,UAAAA,wBAAwB,KACvBO,oBAAC,aAAD,EAAA,IAEAA,oBAAC,aAAD;AAAA,MAAa;AAAA,MAA0B;AAAA,IAAA,CAAvC;AAAA,EAAA,CALN;AASD,CAjBgC;AAqBjC,qBAAqB;AAAA,EAAEX,OAAO;AAAA,GAA2C;AAErE,6BAAA,QAAA;AAAA,IACE,WAAWY,SAAS;AAAA,MAClBC,SAAS;AAAA,MACTC,OAAO;AAAA,MACPC,UAAU;AAAA,MACVC,YAAY;AAAA,MACZC,SAAS;AAAA,MACTC,eAAe;AAAA,IAAA,CANE;AAAA,IASlBlB,UAAAA;AAAAA,EAAAA,CAXL;AAcD;AAM2B,qBAAA;AAAA,EAAEmB;AAAAA,GAAyB;AAC/CC,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B,IAAqC,OAAO,EAFpD,MAAAtD,YAE2D;AAAA;AAGtD,aAAA;AAAA;AAEZ;AAED,iBAAiBA,YAAkC;AAC1CA,SAAAA,WAAWgD,IAAIG,mBAAf,EAAoCC,KAAK,IAAzC;AACR;;"}
|
|
1
|
+
{"version":3,"file":"ReadOnlyTextV2.es.js","sources":["../src/runtimes/react/controls/rich-text-v2/ReadOnlyTextV2.tsx"],"sourcesContent":["import { ForwardedRef, forwardRef } from 'react'\nimport {\n RichTextV2ControlData,\n RichTextV2ControlDefinition,\n RichTextV2Mode,\n} from '../../../../controls'\nimport { useStyle } from '../../use-style'\nimport { Descendant, Element, Text } from 'slate'\nimport {\n InlineType,\n Block,\n BlockType,\n BlockPlugin,\n InlineModePlugin,\n InlinePlugin,\n LinkPlugin,\n TextAlignPlugin,\n TypographyPlugin,\n} from '../../../../slate'\nimport { ControlValue } from '../control'\nimport { RenderElementProps, RenderLeafProps } from 'slate-react'\nimport { RichTextV2Plugin } from '../../../../controls/rich-text-v2/plugin'\n\ntype Props = {\n text: RichTextV2ControlData\n definition: RichTextV2ControlDefinition | null\n}\n\nconst ReadOnlyTextV2 = forwardRef(function ReadOnlyText(\n { text: { descendants }, definition }: Props,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const descendantsAsString = getText(descendants, definition?.config.mode ?? RichTextV2Mode.Block)\n\n return (\n <div\n ref={ref}\n style={{\n /**\n * These are the default styles that Slate uses for its editable div.\n * https://github.com/ianstormtaylor/slate/blob/4bd15ed3950e3a0871f5d0ecb391bb637c05e59d/packages/slate-react/src/components/editable.tsx\n * Search for `disableDefaultStyles`\n */\n position: 'relative',\n whiteSpace: 'pre-wrap',\n wordWrap: 'break-word',\n }}\n >\n {descendantsAsString === '' ? (\n <Placeholder />\n ) : (\n <Descendants\n plugins={\n /**\n * TODO: we are manually referencing our default plugins for each mode here because\n * Referencing the real LinkPlugin causes a circular dependency.\n * When circular dependencies calm down we should update the plugin definition to use real plugins,\n * and just use the plugins that are defined by our config.\n */\n // definition?.config?.plugins ,\n definition?.config?.mode === RichTextV2Mode.Inline\n ? [InlineModePlugin()]\n : [BlockPlugin(), TypographyPlugin(), TextAlignPlugin(), InlinePlugin(), LinkPlugin()]\n }\n descendants={descendants}\n />\n )}\n </div>\n )\n})\n\nexport default ReadOnlyTextV2\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\ntype LeafProps = {\n leaf: Text\n plugins: RichTextV2Plugin[]\n}\n\nexport function LeafComponent({ plugins, ...props }: LeafProps) {\n function initialRenderLeaf({ leaf }: RenderLeafProps) {\n return <span className={leaf.className}>{leaf.text === '' ? '\\uFEFF' : leaf.text}</span>\n }\n\n const renderLeaf = plugins.reduce(\n (renderFn, plugin) => (props: RenderLeafProps) => {\n const { control, renderLeaf } = plugin\n\n if (control?.definition == null || renderLeaf == null) return renderFn(props)\n\n if (control.getLeafValue == null) return renderLeaf(renderFn, undefined)(props)\n\n return (\n <ControlValue definition={control.definition} data={control.getLeafValue(props.leaf)}>\n {value => renderLeaf(renderFn, value)(props)}\n </ControlValue>\n )\n },\n initialRenderLeaf,\n )\n\n return renderLeaf({ attributes: {} as any, leaf: props.leaf, children: null, text: props.leaf })\n}\n\ntype ElementProps = {\n descendant: Element\n plugins: RichTextV2Plugin[]\n}\n\nfunction ElementComponent({ plugins, ...props }: ElementProps) {\n function initialRenderElement(props: RenderElementProps) {\n return <Descendants descendants={props.element.children} plugins={plugins} />\n }\n\n const renderElement = plugins.reduce(\n (renderFn, plugin) => (props: RenderElementProps) => {\n const { control, renderElement } = plugin\n\n if (control?.definition == null || renderElement == null) return renderFn(props)\n\n if (control.getElementValue == null) return renderElement(renderFn, undefined)(props)\n\n return (\n <ControlValue definition={control.definition} data={control.getElementValue(props.element)}>\n {value => renderElement(renderFn, value)(props)}\n </ControlValue>\n )\n },\n initialRenderElement,\n )\n\n return renderElement({ attributes: {} as any, children: null, element: props.descendant })\n}\n\n// reimplemented from slate source for code splitting\nfunction isText(node: Descendant): node is Text {\n if (typeof node === 'object' && 'text' in node) return true\n\n return false\n}\n\nfunction Descendants({\n descendants,\n plugins,\n}: {\n plugins: RichTextV2Plugin[]\n descendants: Descendant[]\n}) {\n return (\n <>\n {descendants.map((descendant, index) => {\n if (isText(descendant)) {\n return <LeafComponent key={index} plugins={plugins} leaf={descendant} />\n }\n\n return <ElementComponent key={index} descendant={descendant} plugins={plugins} />\n })}\n </>\n )\n}\n\nfunction isBlock(descendant: Descendant): descendant is Block {\n if (isText(descendant)) return false\n\n switch (descendant.type) {\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.Heading4:\n case BlockType.Heading5:\n case BlockType.Heading6:\n case BlockType.BlockQuote:\n case BlockType.Paragraph:\n case BlockType.Default:\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, mode: RichTextV2Mode): string {\n if (isText(descendant)) {\n return descendant.text ?? ''\n }\n\n switch (descendant.type) {\n case BlockType.Default:\n return mode === RichTextV2Mode.Inline\n ? descendant.children.map(descendant => getTextByDescendant(descendant, mode)).join('') ??\n ''\n : descendant.children\n .map(descendant => getTextByDescendant(descendant, mode))\n .join(descendant.children.every(isBlock) ? '\\n' : '') ?? ''\n\n case InlineType.Link:\n case InlineType.Code:\n case InlineType.SubScript:\n case InlineType.SuperScript:\n return (\n descendant.children.map(descendant => getTextByDescendant(descendant, mode)).join('') ?? ''\n )\n case BlockType.Heading1:\n case BlockType.Heading2:\n case BlockType.Heading3:\n case BlockType.Heading4:\n case BlockType.Heading5:\n case BlockType.Heading6:\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, mode))\n .join(descendant.children.every(isBlock) ? '\\n' : '') ?? ''\n )\n default:\n return ''\n }\n}\n\nfunction getText(descendant: Descendant[], mode: RichTextV2Mode): string {\n return descendant.map(node => getTextByDescendant(node, mode)).join('\\n')\n}\n"],"names":["ReadOnlyTextV2","forwardRef","text","descendants","definition","ref","descendantsAsString","getText","config","mode","RichTextV2Mode","Block","position","whiteSpace","wordWrap","_jsx","Inline","InlineModePlugin","BlockPlugin","TypographyPlugin","TextAlignPlugin","InlinePlugin","LinkPlugin","useStyle","display","width","maxWidth","opacity","verticalAlign","plugins","props","leaf","className","renderLeaf","reduce","renderFn","plugin","control","getLeafValue","undefined","value","initialRenderLeaf","attributes","children","element","renderElement","getElementValue","initialRenderElement","descendant","node","_Fragment","map","index","isText","type","BlockType","Heading1","Heading2","Heading3","Heading4","Heading5","Heading6","BlockQuote","Paragraph","Default","OrderedList","UnorderedList","ListItem","ListItemChild","getTextByDescendant","join","every","isBlock","InlineType","Link","Code","SubScript","SuperScript"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BMA,MAAAA,iBAAiBC,WAAW,sBAChC;AAAA,EAAEC,MAAM;AAAA,IAAEC;AAAAA;AAAAA,EAAeC;AAAAA,GACzBC,KACA;;AACA,QAAMC,sBAAsBC,QAAQJ,aAAaC,+CAAYI,OAAOC,SAAnBL,YAA2BM,eAAeC,KAAxD;AAGjC,6BAAA,OAAA;AAAA,IACE;AAAA,IACA,OAAO;AAAA,MAMLC,UAAU;AAAA,MACVC,YAAY;AAAA,MACZC,UAAU;AAAA,IAVd;AAAA,IAaGR,UAAAA,wBAAwB,KACvBS,oBAAC,aAAD,EAAA,IAEAA,oBAAC,aAAD;AAAA,MACE,SAQEX,gDAAYI,WAAZJ,mBAAoBK,UAASC,eAAeM,SACxC,CAAC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,YAAyF;AAAA,SAExFO,UAAUC;AAAAA,SACVD,UAAUE;AAAAA,SACVF,UAAUG;AAAAA,SACVH,UAAUI;AAAAA,SACVJ,UAAUK;AAAAA,SACVL,UAAUM;AAAAA,SACVN,UAAUO;AAAAA,SACVP,UAAUQ;AAAAA,SACVR,UAAUU;AAAAA,SACVV,UAAUW;AAAAA,SACVX,UAAUY;AAAAA,SACVZ,UAAUa;AACb,aACEpB,iBAAWL,SACRQ,IAAIH,CAAcqB,gBAAAA,oBAAoBrB,aAAYvC,IAAb,CADxC,EAEG6D,KAAKtB,WAAWL,SAAS4B,MAAMC,OAA1B,IAAqC,OAAO,EAFpD,MAAAxB,YAE2D;AAAA;AAGtD,aAAA;AAAA;AAEZ;AAED,iBAAiBA,YAA0BvC,MAA8B;AAChEuC,SAAAA,WAAWG,IAAIF,CAAQoB,SAAAA,oBAAoBpB,MAAMxC,IAAP,CAA1C,EAAwD6D,KAAK,IAA7D;AACR;;"}
|
package/dist/Root.cjs.js
CHANGED
|
@@ -16,9 +16,10 @@ require("./actions.cjs.js");
|
|
|
16
16
|
require("zod");
|
|
17
17
|
require("./state/breakpoints.cjs.js");
|
|
18
18
|
require("slate");
|
|
19
|
+
require("is-hotkey");
|
|
19
20
|
require("use-sync-external-store/shim/with-selector");
|
|
20
21
|
require("next/dynamic");
|
|
21
|
-
require("./
|
|
22
|
+
require("./text-input.cjs.js");
|
|
22
23
|
require("./combobox.cjs.js");
|
|
23
24
|
require("use-sync-external-store/shim");
|
|
24
25
|
require("./types.cjs.js");
|
|
@@ -39,6 +40,8 @@ require("set-cookie-parser");
|
|
|
39
40
|
require("./constants.cjs.js");
|
|
40
41
|
require("uuid");
|
|
41
42
|
require("corporate-ipsum");
|
|
43
|
+
require("slate-react");
|
|
44
|
+
require("next/link");
|
|
42
45
|
require("./useMediaQuery.cjs.js");
|
|
43
46
|
require("next/image");
|
|
44
47
|
require("./useIsomorphicLayoutEffect.cjs.js");
|
package/dist/Root.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Root.cjs.js","sources":["../src/components/builtin/Root/components/Placeholder/index.tsx","../src/runtimes/react/use-global-style.ts","../src/components/builtin/Root/Root.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\n\nexport default forwardRef<HTMLDivElement>(function Placeholder(_props, ref) {\n return (\n <div\n ref={ref}\n className={useStyle({\n width: '100%',\n background: 'rgba(161, 168, 194, 0.18)',\n height: 80,\n padding: 8,\n })}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"100%\"\n height=\"100%\"\n style={{ overflow: 'visible' }}\n >\n <rect\n x={0}\n y={0}\n width=\"100%\"\n height=\"100%\"\n strokeWidth={2}\n strokeDasharray=\"4 2\"\n fill=\"none\"\n stroke=\"rgba(161, 168, 194, 0.40)\"\n rx=\"4\"\n ry=\"4\"\n />\n </svg>\n </div>\n )\n})\n","import * as React from 'react'\nimport { useRef } from 'react'\nimport { cache, injectGlobal } from '@emotion/css'\nimport { CSSInterpolation, serializeStyles } from '@emotion/serialize'\nimport { StyleSheet } from '@emotion/sheet'\nimport { insertStyles } from '@emotion/utils'\n\nconst isServer = typeof window === 'undefined'\nconst useInsertionEffectSpecifier = 'useInsertionEffect'\nconst useInsertionEffect = React[useInsertionEffectSpecifier] ?? React.useLayoutEffect\n\nexport function useGlobalStyle(...args: CSSInterpolation[]): void {\n if (isServer) return injectGlobal(args)\n\n const serialized = serializeStyles(args, cache.registered)\n const sheetRef = useRef<[StyleSheet, boolean]>()\n\n // Hydration\n useInsertionEffect(() => {\n const key = `${cache.key}-global`\n\n const cacheSheet = cache.sheet as StyleSheet\n const sheet = new (cacheSheet.constructor as typeof StyleSheet)({\n key,\n nonce: cacheSheet.nonce,\n container: cacheSheet.container,\n speedy: cacheSheet.isSpeedy,\n })\n\n const node = document.querySelector<HTMLStyleElement>(\n `style[data-emotion=\"${key} ${serialized.name}\"]`,\n )\n\n if (cache.sheet.tags.length > 0) {\n sheet.before = cache.sheet.tags[0]\n }\n\n let rehydrating = false\n\n if (node != null) {\n rehydrating = true\n node.setAttribute('data-emotion', key)\n sheet.hydrate([node])\n }\n\n sheetRef.current = [sheet, rehydrating]\n\n return () => {\n sheet.flush()\n }\n })\n\n // Insertion\n useInsertionEffect(() => {\n const [sheet, rehydrating] = sheetRef.current ?? []\n\n if (sheet == null || rehydrating == null) return\n\n if (rehydrating) {\n sheetRef.current = [sheet, false]\n\n return\n }\n\n if (serialized.next != null) {\n insertStyles(cache, serialized.next, true)\n }\n\n if (sheet.tags.length > 0) {\n const element = sheet.tags[sheet.tags.length - 1].nextElementSibling\n\n sheet.before = element\n\n sheet.flush()\n }\n\n cache.insert('', serialized, sheet, false)\n })\n}\n","import { normalize } from 'polished'\nimport { forwardRef, Ref } from 'react'\n\nimport Placeholder from './components/Placeholder'\nimport type {\n GridValue,\n BackgroundsValue,\n GapXValue,\n GapYValue,\n} from '../../../prop-controllers/descriptors'\nimport { Element } from '../../../runtimes/react'\nimport BackgroundsContainer from '../../shared/BackgroundsContainer'\nimport { useGlobalStyle } from '../../../runtimes/react/use-global-style'\nimport { GridItem } from '../../shared/grid-item'\nimport { useStyle } from '../../../runtimes/react/use-style'\n\ntype Props = {\n children?: GridValue\n backgrounds?: BackgroundsValue\n rowGap?: GapYValue\n columnGap?: GapXValue\n}\n\nconst Root = forwardRef(function Page(\n { children, backgrounds, rowGap, columnGap }: Props,\n ref: Ref<HTMLDivElement>,\n) {\n useGlobalStyle({\n html: {\n boxSizing: 'border-box',\n },\n '*, *::before, *::after': {\n boxSizing: 'inherit',\n },\n })\n\n useGlobalStyle(normalize())\n\n return (\n <BackgroundsContainer ref={ref} style={{ background: 'white' }} backgrounds={backgrounds}>\n <div className={useStyle({ display: 'flex', flexWrap: 'wrap', width: '100%' })}>\n {children && children.elements.length > 0 ? (\n children.elements.map((child, index) => (\n <GridItem\n key={child.key}\n grid={children.columns}\n index={index}\n columnGap={columnGap}\n rowGap={rowGap}\n >\n <Element element={child} />\n </GridItem>\n ))\n ) : (\n <Placeholder />\n )}\n </div>\n </BackgroundsContainer>\n )\n})\n\nexport default Root\n"],"names":["forwardRef","_props","ref","useStyle","width","background","height","padding","overflow","React","injectGlobal","serializeStyles","cache","useRef","insertStyles","Root","children","backgrounds","rowGap","columnGap","html","boxSizing","useGlobalStyle","normalize","BackgroundsContainer","display","flexWrap","elements","length","map","child","index","GridItem","columns","Element","key","_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Root.cjs.js","sources":["../src/components/builtin/Root/components/Placeholder/index.tsx","../src/runtimes/react/use-global-style.ts","../src/components/builtin/Root/Root.tsx"],"sourcesContent":["import { forwardRef } from 'react'\nimport { useStyle } from '../../../../../runtimes/react/use-style'\n\nexport default forwardRef<HTMLDivElement>(function Placeholder(_props, ref) {\n return (\n <div\n ref={ref}\n className={useStyle({\n width: '100%',\n background: 'rgba(161, 168, 194, 0.18)',\n height: 80,\n padding: 8,\n })}\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"100%\"\n height=\"100%\"\n style={{ overflow: 'visible' }}\n >\n <rect\n x={0}\n y={0}\n width=\"100%\"\n height=\"100%\"\n strokeWidth={2}\n strokeDasharray=\"4 2\"\n fill=\"none\"\n stroke=\"rgba(161, 168, 194, 0.40)\"\n rx=\"4\"\n ry=\"4\"\n />\n </svg>\n </div>\n )\n})\n","import * as React from 'react'\nimport { useRef } from 'react'\nimport { cache, injectGlobal } from '@emotion/css'\nimport { CSSInterpolation, serializeStyles } from '@emotion/serialize'\nimport { StyleSheet } from '@emotion/sheet'\nimport { insertStyles } from '@emotion/utils'\n\nconst isServer = typeof window === 'undefined'\nconst useInsertionEffectSpecifier = 'useInsertionEffect'\nconst useInsertionEffect = React[useInsertionEffectSpecifier] ?? React.useLayoutEffect\n\nexport function useGlobalStyle(...args: CSSInterpolation[]): void {\n if (isServer) return injectGlobal(args)\n\n const serialized = serializeStyles(args, cache.registered)\n const sheetRef = useRef<[StyleSheet, boolean]>()\n\n // Hydration\n useInsertionEffect(() => {\n const key = `${cache.key}-global`\n\n const cacheSheet = cache.sheet as StyleSheet\n const sheet = new (cacheSheet.constructor as typeof StyleSheet)({\n key,\n nonce: cacheSheet.nonce,\n container: cacheSheet.container,\n speedy: cacheSheet.isSpeedy,\n })\n\n const node = document.querySelector<HTMLStyleElement>(\n `style[data-emotion=\"${key} ${serialized.name}\"]`,\n )\n\n if (cache.sheet.tags.length > 0) {\n sheet.before = cache.sheet.tags[0]\n }\n\n let rehydrating = false\n\n if (node != null) {\n rehydrating = true\n node.setAttribute('data-emotion', key)\n sheet.hydrate([node])\n }\n\n sheetRef.current = [sheet, rehydrating]\n\n return () => {\n sheet.flush()\n }\n })\n\n // Insertion\n useInsertionEffect(() => {\n const [sheet, rehydrating] = sheetRef.current ?? []\n\n if (sheet == null || rehydrating == null) return\n\n if (rehydrating) {\n sheetRef.current = [sheet, false]\n\n return\n }\n\n if (serialized.next != null) {\n insertStyles(cache, serialized.next, true)\n }\n\n if (sheet.tags.length > 0) {\n const element = sheet.tags[sheet.tags.length - 1].nextElementSibling\n\n sheet.before = element\n\n sheet.flush()\n }\n\n cache.insert('', serialized, sheet, false)\n })\n}\n","import { normalize } from 'polished'\nimport { forwardRef, Ref } from 'react'\n\nimport Placeholder from './components/Placeholder'\nimport type {\n GridValue,\n BackgroundsValue,\n GapXValue,\n GapYValue,\n} from '../../../prop-controllers/descriptors'\nimport { Element } from '../../../runtimes/react'\nimport BackgroundsContainer from '../../shared/BackgroundsContainer'\nimport { useGlobalStyle } from '../../../runtimes/react/use-global-style'\nimport { GridItem } from '../../shared/grid-item'\nimport { useStyle } from '../../../runtimes/react/use-style'\n\ntype Props = {\n children?: GridValue\n backgrounds?: BackgroundsValue\n rowGap?: GapYValue\n columnGap?: GapXValue\n}\n\nconst Root = forwardRef(function Page(\n { children, backgrounds, rowGap, columnGap }: Props,\n ref: Ref<HTMLDivElement>,\n) {\n useGlobalStyle({\n html: {\n boxSizing: 'border-box',\n },\n '*, *::before, *::after': {\n boxSizing: 'inherit',\n },\n })\n\n useGlobalStyle(normalize())\n\n return (\n <BackgroundsContainer ref={ref} style={{ background: 'white' }} backgrounds={backgrounds}>\n <div className={useStyle({ display: 'flex', flexWrap: 'wrap', width: '100%' })}>\n {children && children.elements.length > 0 ? (\n children.elements.map((child, index) => (\n <GridItem\n key={child.key}\n grid={children.columns}\n index={index}\n columnGap={columnGap}\n rowGap={rowGap}\n >\n <Element element={child} />\n </GridItem>\n ))\n ) : (\n <Placeholder />\n )}\n </div>\n </BackgroundsContainer>\n )\n})\n\nexport default Root\n"],"names":["forwardRef","_props","ref","useStyle","width","background","height","padding","overflow","React","injectGlobal","serializeStyles","cache","useRef","insertStyles","Root","children","backgrounds","rowGap","columnGap","html","boxSizing","useGlobalStyle","normalize","BackgroundsContainer","display","flexWrap","elements","length","map","child","index","GridItem","columns","Element","key","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAeA,cAAAA,MAAAA,WAA2B,sBAAqBC,QAAQC,KAAK;AAExE,wCAAA,OAAA;AAAA,IACE;AAAA,IACA,WAAWC,UAAAA,SAAS;AAAA,MAClBC,OAAO;AAAA,MACPC,YAAY;AAAA,MACZC,QAAQ;AAAA,MACRC,SAAS;AAAA,IAAA,CAJQ;AAAA,IAOnB,yCAAA,OAAA;AAAA,MACE,OAAM;AAAA,MACN,OAAM;AAAA,MACN,QAAO;AAAA,MACP,OAAO;AAAA,QAAEC,UAAU;AAAA,MAJrB;AAAA,MAME,yCAAA,QAAA;AAAA,QACE,GAAG;AAAA,QACH,GAAG;AAAA,QACH,OAAM;AAAA,QACN,QAAO;AAAA,QACP,aAAa;AAAA,QACb,iBAAgB;AAAA,QAChB,MAAK;AAAA,QACL,QAAO;AAAA,QACP,IAAG;AAAA,QACH,IAAG;AAAA,MAAA,CAVL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AAA,MAAM,KAAK,SAAS,GAAG;AACzB,YAAM,UAAU,MAAM,KAAK,MAAM,KAAK,SAAS,GAAG;AAElD,YAAM,SAAS;AAEf,YAAM,MAAM;AAAA,IACd;AAEAA,QAAA,MAAM,OAAO,IAAI,YAAY,OAAO,KAAK;AAAA,EAAA,CAC1C;AACH;ACvDMG,MAAAA,OAAOf,MAAAA,WAAW,cACtB;AAAA,EAAEgB;AAAAA,EAAUC;AAAAA,EAAaC;AAAAA,EAAQC;AAAAA,GACjCjB,KACA;AACe,iBAAA;AAAA,IACbkB,MAAM;AAAA,MACJC,WAAW;AAAA,IAFA;AAAA,IAIa,0BAAA;AAAA,MACxBA,WAAW;AAAA,IADa;AAAA,EAAA,CAJd;AASdC,iBAAeC,oBAAD;AAEd,wCACGC,MAAAA,sBAAD;AAAA,IAAsB;AAAA,IAAU,OAAO;AAAA,MAAEnB,YAAY;AAAA,IAArD;AAAA,IAAgE;AAAA,IAC9D,yCAAA,OAAA;AAAA,MAAK,WAAWF,UAAAA,SAAS;AAAA,QAAEsB,SAAS;AAAA,QAAQC,UAAU;AAAA,QAAQtB,OAAO;AAAA,MAAA,CAA7C;AAAA,MACrBY,UAAAA,YAAYA,SAASW,SAASC,SAAS,IACtCZ,SAASW,SAASE,IAAI,CAACC,OAAOC,2CAC3BC,MAAAA,UAAD;AAAA,QAEE,MAAMhB,SAASiB;AAAAA,QAAAA,OACfF;AAAAA,QACA;AAAA,QACA;AAAA,QALF,yCAOGG,cAAD;AAAA,UAAS,SAASJ;AAAAA,QAAAA,CAAlB;AAAA,MAAA,GANKA,MAAMK,GADb,CADF,IAYCC,2BAAAA,IAAA,aAAD,CAAA,CAAA;AAAA,IAAA,CAdJ;AAAA,EAAA,CAFJ;AAqBD,CApCsB;;"}
|
package/dist/Root.es.js
CHANGED
|
@@ -2,7 +2,7 @@ var _a;
|
|
|
2
2
|
import { normalize } from "polished";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { forwardRef, useRef } from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { _ as useStyle } from "./react-page.es.js";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { E as Element } from "./index.es.js";
|
|
8
8
|
import { B as BackgroundsContainer, G as GridItem } from "./index.es2.js";
|
|
@@ -15,9 +15,10 @@ import "./actions.es.js";
|
|
|
15
15
|
import "zod";
|
|
16
16
|
import "./state/breakpoints.es.js";
|
|
17
17
|
import "slate";
|
|
18
|
+
import "is-hotkey";
|
|
18
19
|
import "use-sync-external-store/shim/with-selector";
|
|
19
20
|
import "next/dynamic";
|
|
20
|
-
import "./
|
|
21
|
+
import "./text-input.es.js";
|
|
21
22
|
import "./combobox.es.js";
|
|
22
23
|
import "use-sync-external-store/shim";
|
|
23
24
|
import "./types.es.js";
|
|
@@ -38,6 +39,8 @@ import "set-cookie-parser";
|
|
|
38
39
|
import "./constants.es.js";
|
|
39
40
|
import "uuid";
|
|
40
41
|
import "corporate-ipsum";
|
|
42
|
+
import "slate-react";
|
|
43
|
+
import "next/link";
|
|
41
44
|
import "./useMediaQuery.es.js";
|
|
42
45
|
import "next/image";
|
|
43
46
|
import "./useIsomorphicLayoutEffect.es.js";
|