@makeswift/runtime 0.6.2 → 0.6.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 (135) hide show
  1. package/dist/Box.cjs.js +1 -1
  2. package/dist/Box.es.js +1 -1
  3. package/dist/Button.cjs.js +1 -1
  4. package/dist/Button.es.js +1 -1
  5. package/dist/Carousel.cjs.js +1 -1
  6. package/dist/Carousel.es.js +1 -1
  7. package/dist/Countdown.cjs.js +1 -1
  8. package/dist/Countdown.es.js +1 -1
  9. package/dist/Divider.cjs.js +1 -1
  10. package/dist/Divider.es.js +1 -1
  11. package/dist/EditableText.cjs.js +22 -4
  12. package/dist/EditableText.cjs.js.map +1 -1
  13. package/dist/EditableText.es.js +24 -6
  14. package/dist/EditableText.es.js.map +1 -1
  15. package/dist/Embed.cjs.js +1 -1
  16. package/dist/Embed.es.js +1 -1
  17. package/dist/Form.cjs.js +1 -1
  18. package/dist/Form.es.js +1 -1
  19. package/dist/Image.cjs.js +3 -6
  20. package/dist/Image.cjs.js.map +1 -1
  21. package/dist/Image.es.js +4 -7
  22. package/dist/Image.es.js.map +1 -1
  23. package/dist/LiveProvider.cjs.js +1 -1
  24. package/dist/LiveProvider.es.js +1 -1
  25. package/dist/Navigation.cjs.js +1 -1
  26. package/dist/Navigation.es.js +1 -1
  27. package/dist/PreviewProvider.cjs.js +55 -18
  28. package/dist/PreviewProvider.cjs.js.map +1 -1
  29. package/dist/PreviewProvider.es.js +55 -19
  30. package/dist/PreviewProvider.es.js.map +1 -1
  31. package/dist/ReadOnlyText.cjs.js +7 -4
  32. package/dist/ReadOnlyText.cjs.js.map +1 -1
  33. package/dist/ReadOnlyText.es.js +7 -4
  34. package/dist/ReadOnlyText.es.js.map +1 -1
  35. package/dist/Root.cjs.js +1 -1
  36. package/dist/Root.es.js +1 -1
  37. package/dist/SocialLinks.cjs.js +1 -1
  38. package/dist/SocialLinks.es.js +1 -1
  39. package/dist/Text.cjs.js +1 -1
  40. package/dist/Text.es.js +1 -1
  41. package/dist/Video.cjs.js +1 -1
  42. package/dist/Video.es.js +1 -1
  43. package/dist/actions.cjs.js +11 -1
  44. package/dist/actions.cjs.js.map +1 -1
  45. package/dist/actions.es.js +11 -2
  46. package/dist/actions.es.js.map +1 -1
  47. package/dist/builder.cjs.js +2 -1
  48. package/dist/builder.cjs.js.map +1 -1
  49. package/dist/builder.es.js +2 -1
  50. package/dist/builder.es.js.map +1 -1
  51. package/dist/components.cjs.js +1 -1
  52. package/dist/components.es.js +1 -1
  53. package/dist/constants.cjs.js +26 -21
  54. package/dist/constants.cjs.js.map +1 -1
  55. package/dist/constants.es.js +7 -3
  56. package/dist/constants.es.js.map +1 -1
  57. package/dist/control-serialization.cjs.js +37 -37
  58. package/dist/control-serialization.cjs.js.map +1 -1
  59. package/dist/control-serialization.es.js +1 -1
  60. package/dist/control.cjs.js +22 -22
  61. package/dist/control.cjs.js.map +1 -1
  62. package/dist/control.es.js +1 -1
  63. package/dist/controls.cjs.js +22 -17
  64. package/dist/controls.cjs.js.map +1 -1
  65. package/dist/controls.es.js +2 -1
  66. package/dist/controls.es.js.map +1 -1
  67. package/dist/index.cjs.js +279 -216
  68. package/dist/index.cjs.js.map +1 -1
  69. package/dist/index.cjs2.js +1 -1
  70. package/dist/index.cjs5.js +36 -139
  71. package/dist/index.cjs5.js.map +1 -1
  72. package/dist/index.cjs6.js +141 -0
  73. package/dist/index.cjs6.js.map +1 -0
  74. package/dist/index.es.js +92 -33
  75. package/dist/index.es.js.map +1 -1
  76. package/dist/index.es2.js +2 -2
  77. package/dist/index.es5.js +34 -138
  78. package/dist/index.es5.js.map +1 -1
  79. package/dist/index.es6.js +139 -0
  80. package/dist/index.es6.js.map +1 -0
  81. package/dist/main.cjs.js +2 -1
  82. package/dist/main.cjs.js.map +1 -1
  83. package/dist/main.es.js +2 -2
  84. package/dist/next.cjs.js +1 -1
  85. package/dist/next.es.js +2 -2
  86. package/dist/prop-controllers.cjs.js +5 -4
  87. package/dist/prop-controllers.cjs.js.map +1 -1
  88. package/dist/prop-controllers.es.js +2 -1
  89. package/dist/prop-controllers.es.js.map +1 -1
  90. package/dist/react.cjs.js +1 -1
  91. package/dist/react.es.js +1 -1
  92. package/dist/{slot.cjs.js → rich-text.cjs.js} +104 -12
  93. package/dist/rich-text.cjs.js.map +1 -0
  94. package/dist/{slot.es.js → rich-text.es.js} +98 -12
  95. package/dist/rich-text.es.js.map +1 -0
  96. package/dist/types/src/components/builtin/Image/Image.d.ts.map +1 -1
  97. package/dist/types/src/components/builtin/Text/EditableText.d.ts.map +1 -1
  98. package/dist/types/src/components/builtin/Text/ReadOnlyText.d.ts.map +1 -1
  99. package/dist/types/src/components/builtin/Text/register.d.ts.map +1 -1
  100. package/dist/types/src/controls/index.d.ts +1 -0
  101. package/dist/types/src/controls/index.d.ts.map +1 -1
  102. package/dist/types/src/controls/rich-text.d.ts +66 -0
  103. package/dist/types/src/controls/rich-text.d.ts.map +1 -0
  104. package/dist/types/src/controls/style.d.ts +16 -4
  105. package/dist/types/src/controls/style.d.ts.map +1 -1
  106. package/dist/types/src/index.d.ts +1 -1
  107. package/dist/types/src/index.d.ts.map +1 -1
  108. package/dist/types/src/next/api-handler.d.ts +1 -0
  109. package/dist/types/src/next/api-handler.d.ts.map +1 -1
  110. package/dist/types/src/next/preview-mode.d.ts.map +1 -1
  111. package/dist/types/src/prop-controllers/descriptors.d.ts +4 -2
  112. package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -1
  113. package/dist/types/src/prop-controllers/instances.d.ts +14 -4
  114. package/dist/types/src/prop-controllers/instances.d.ts.map +1 -1
  115. package/dist/types/src/runtimes/react/controls/rich-text.d.ts +8 -0
  116. package/dist/types/src/runtimes/react/controls/rich-text.d.ts.map +1 -0
  117. package/dist/types/src/runtimes/react/controls/slot.d.ts.map +1 -1
  118. package/dist/types/src/runtimes/react/controls.d.ts.map +1 -1
  119. package/dist/types/src/runtimes/react/index.d.ts +2 -0
  120. package/dist/types/src/runtimes/react/index.d.ts.map +1 -1
  121. package/dist/types/src/runtimes/react/poll-box-model.d.ts +6 -0
  122. package/dist/types/src/runtimes/react/poll-box-model.d.ts.map +1 -0
  123. package/dist/types/src/state/actions.d.ts +12 -1
  124. package/dist/types/src/state/actions.d.ts.map +1 -1
  125. package/dist/types/src/state/modules/builder-edit-mode.d.ts +11 -0
  126. package/dist/types/src/state/modules/builder-edit-mode.d.ts.map +1 -0
  127. package/dist/types/src/state/react-builder-preview.d.ts +2 -0
  128. package/dist/types/src/state/react-builder-preview.d.ts.map +1 -1
  129. package/dist/types/src/state/react-page.d.ts +3 -0
  130. package/dist/types/src/state/react-page.d.ts.map +1 -1
  131. package/package.json +1 -1
  132. package/dist/slot.cjs.js.map +0 -1
  133. package/dist/slot.es.js.map +0 -1
  134. package/dist/types/src/utils/constants.d.ts +0 -6
  135. package/dist/types/src/utils/constants.d.ts.map +0 -1
package/dist/index.es2.js CHANGED
@@ -32,10 +32,10 @@ var __objRest = (source, exclude) => {
32
32
  import { useMemo, useState, useEffect, useCallback, useRef, forwardRef, createElement, Children } from "react";
33
33
  import { J as useFiles, K as useSwatches, o as useStyle, w as responsiveGridItem, m as useMediaQuery, c as DEFAULT_BOX_ANIMATE_TYPE, f as DEFAULT_ITEM_ANIMATE_TYPE, e as DEFAULT_BOX_ANIMATE_DURATION, d as DEFAULT_BOX_ANIMATE_DELAY, i as DEFAULT_ITEM_STAGGER_DURATION, r as responsiveStyle, s as colorToString } from "./index.es.js";
34
34
  import "use-sync-external-store/shim";
35
- import "./slot.es.js";
35
+ import "./rich-text.es.js";
36
36
  import { cx } from "@emotion/css";
37
37
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
38
- import { l as isNonNullable, y as getBackgroundsFileIds, z as getBackgroundsSwatchIds } from "./constants.es.js";
38
+ import { l as isNonNullable, z as getBackgroundsFileIds, A as getBackgroundsSwatchIds } from "./constants.es.js";
39
39
  import NextImage from "next/image";
40
40
  import { u as useIsomorphicLayoutEffect } from "./useIsomorphicLayoutEffect.es.js";
41
41
  import ReactPlayer from "react-player";
package/dist/index.es5.js CHANGED
@@ -1,139 +1,35 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __objRest = (source, exclude) => {
21
- var target = {};
22
- for (var prop in source)
23
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
- target[prop] = source[prop];
25
- if (source != null && __getOwnPropSymbols)
26
- for (var prop of __getOwnPropSymbols(source)) {
27
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
- target[prop] = source[prop];
29
- }
30
- return target;
31
- };
32
- import { U as useTypography, K as useSwatches, G as findDeviceOverride, o as useStyle, r as responsiveStyle, V as shallowMergeFallbacks, s as colorToString } from "./index.es.js";
33
- import { R as getTypographyStyleSwatchIds, l as isNonNullable } from "./constants.es.js";
34
- import { cx } from "@emotion/css";
35
- import { jsx } from "react/jsx-runtime";
36
- import { forwardRef } from "react";
37
- const getDeviceId = ({ deviceId }) => deviceId;
38
- const withColor = (swatches) => (_a) => {
39
- var _b = _a, {
40
- value: _c
41
- } = _b, _d = _c, { color } = _d, restOfValue = __objRest(_d, ["color"]), rest = __objRest(_b, [
42
- "value"
43
- ]);
44
- return __spreadProps(__spreadValues({}, rest), {
45
- value: __spreadValues(__spreadValues({}, restOfValue), color ? {
46
- color: {
47
- swatch: swatches.find((s) => s && s.id === color.swatchId),
48
- alpha: color.alpha
49
- }
50
- } : {})
51
- });
52
- };
53
- const overrideTypographyStyle = (source, override) => {
54
- const devices = [...new Set(source.map(getDeviceId).concat(override.map(getDeviceId)))];
55
- return devices.map((deviceId) => ({
56
- deviceId,
57
- value: __spreadValues(__spreadValues({}, (findDeviceOverride(source, deviceId) || { value: {} }).value), (findDeviceOverride(override, deviceId, (v) => v) || { value: {} }).value)
58
- }));
59
- };
60
- function useTypographyMark(value) {
61
- var _a, _b, _c;
62
- const typography = useTypography((_a = value == null ? void 0 : value.id) != null ? _a : null);
63
- const swatchIds = [
64
- ...getTypographyStyleSwatchIds(value == null ? void 0 : value.style),
65
- ...getTypographyStyleSwatchIds(typography == null ? void 0 : typography.style)
66
- ];
67
- const swatches = useSwatches(swatchIds);
68
- return overrideTypographyStyle((_b = typography == null ? void 0 : typography.style.map(withColor(swatches.filter(isNonNullable)))) != null ? _b : [], (_c = value == null ? void 0 : value.style.map(withColor(swatches.filter(isNonNullable)))) != null ? _c : []);
69
- }
70
- function Mark(_a) {
71
- var _b = _a, {
72
- value,
73
- className
74
- } = _b, restOfProps = __objRest(_b, [
75
- "value",
76
- "className"
77
- ]);
78
- const typographyStyle = useTypographyMark(value);
79
- const typographyClassName = useStyle(responsiveStyle([typographyStyle], ([{
80
- color,
81
- fontFamily,
82
- fontSize,
83
- fontWeight,
84
- lineHeight,
85
- letterSpacing,
86
- uppercase,
87
- underline,
88
- strikethrough,
89
- italic
90
- } = {}]) => __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, color == null ? {} : {
91
- color: colorToString(color)
92
- }), fontFamily == null ? {} : {
93
- fontFamily
94
- }), fontSize == null || fontSize.value == null || fontSize.unit == null ? {} : {
95
- fontSize: `${fontSize.value}${fontSize.unit}`
96
- }), fontWeight == null ? {} : {
97
- fontWeight
98
- }), lineHeight == null ? {} : {
99
- lineHeight
100
- }), letterSpacing == null ? {} : {
101
- letterSpacing: `${letterSpacing / 10}em`
102
- }), uppercase == null ? {} : {
103
- textTransform: uppercase === true ? "uppercase" : "initial"
104
- }), underline == null && strikethrough == null ? {} : {
105
- textDecoration: [Boolean(underline) && "underline", Boolean(strikethrough) && "line-through"].filter(Boolean).join(" ")
106
- }), italic == null ? {} : {
107
- fontStyle: italic === true ? "italic" : "initial"
108
- }), shallowMergeFallbacks));
109
- return /* @__PURE__ */ jsx("span", __spreadProps(__spreadValues({}, restOfProps), {
110
- className: cx(typographyClassName, className)
111
- }));
112
- }
113
- var DeviceOverrideBlock = forwardRef(function Block(_c, ref) {
114
- var _d = _c, {
115
- textAlign,
116
- className,
117
- as
118
- } = _d, restOfProps = __objRest(_d, [
119
- "textAlign",
120
- "className",
121
- "as"
122
- ]);
123
- const Component = as != null ? as : "div";
124
- return /* @__PURE__ */ jsx(Component, __spreadProps(__spreadValues({}, restOfProps), {
125
- ref,
126
- className: cx(useStyle({
127
- margin: 0
128
- }), useStyle(responsiveStyle([textAlign], ([textAlign2 = "left"]) => ({
129
- textAlign: textAlign2
130
- }))), useStyle(as === "blockquote" ? {
131
- padding: "0.5em 10px",
132
- fontSize: "1.25em",
133
- fontWeight: "300",
134
- borderLeft: "5px solid rgba(0, 0, 0, 0.1)"
135
- } : {}), className)
136
- }));
137
- });
138
- export { DeviceOverrideBlock as D, Mark as M };
1
+ export { default } from "./Text.es.js";
2
+ import "next/dynamic";
3
+ import "react";
4
+ import "./index.es.js";
5
+ import "use-sync-external-store/shim/with-selector";
6
+ import "./constants.es.js";
7
+ import "redux";
8
+ import "redux-thunk";
9
+ import "./actions.es.js";
10
+ import "./rich-text.es.js";
11
+ import "./control.es.js";
12
+ import "@emotion/css";
13
+ import "@emotion/serialize";
14
+ import "@emotion/utils";
15
+ import "react/jsx-runtime";
16
+ import "./text-input.es.js";
17
+ import "./combobox.es.js";
18
+ import "use-sync-external-store/shim";
19
+ import "./types.es.js";
20
+ import "color";
21
+ import "scroll-into-view-if-needed";
22
+ import "./box-models.es.js";
23
+ import "css-box-model";
24
+ import "react-dom";
25
+ import "html-react-parser";
26
+ import "next/head";
27
+ import "@emotion/server/create-instance";
28
+ import "next/document";
29
+ import "cookie";
30
+ import "cors";
31
+ import "http-proxy";
32
+ import "set-cookie-parser";
33
+ import "uuid/v4";
34
+ import "corporate-ipsum";
139
35
  //# sourceMappingURL=index.es5.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es5.js","sources":["../src/components/builtin/Text/components/RichTextEditor/components/Mark/hooks/useTypographyMark.ts","../src/components/builtin/Text/components/RichTextEditor/components/Mark/index.tsx","../src/components/builtin/Text/components/RichTextEditor/components/Block/index.tsx"],"sourcesContent":["import { Length as LengthValue } from '../../../../../../../../prop-controllers'\nimport { ColorValue as Color } from '../../../../../../../utils/types'\nimport { findDeviceOverride } from '../../../../../../../utils/devices'\nimport type { DeviceOverride } from '../../../../../../../../prop-controllers'\nimport {\n useSwatches,\n useTypography,\n} from '../../../../../../../../runtimes/react/hooks/makeswift-api'\nimport { Swatch, Typography } from '../../../../../../../../api'\nimport { getTypographyStyleSwatchIds } from '../../../../../../../../prop-controllers/introspection'\nimport { isNonNullable } from '../../../../../../../utils/isNonNullable'\n\nexport type TypographyMarkDataValue = {\n fontWeight?: number\n fontSize?: LengthValue\n fontFamily?: string\n color?: Color\n textAlign?: string\n lineHeight?: number\n letterSpacing?: number\n uppercase?: boolean\n italic?: boolean\n underline?: boolean\n strikethrough?: boolean\n}\n\nexport type TypographyMarkValue = {\n id: string | null | undefined\n style: Typography['style']\n}\n\nexport type TypographyMarkData = Array<DeviceOverride<TypographyMarkDataValue>>\n\nconst getDeviceId = ({ deviceId }: DeviceOverride<unknown>) => deviceId\n\nconst withColor =\n (swatches: Swatch[]) =>\n ({\n value: { color, ...restOfValue },\n ...rest\n }: Typography['style'][number]): DeviceOverride<TypographyMarkDataValue> =>\n ({\n ...rest,\n value: {\n ...restOfValue,\n ...(color\n ? {\n color: {\n swatch: swatches.find(s => s && s.id === color.swatchId),\n alpha: color.alpha,\n },\n }\n : {}),\n } as TypographyMarkDataValue,\n } as DeviceOverride<TypographyMarkDataValue>)\n\nexport const overrideTypographyStyle = <A>(\n source: Array<DeviceOverride<A>>,\n override: Array<DeviceOverride<A>>,\n): Array<DeviceOverride<A>> => {\n const devices = [...new Set(source.map(getDeviceId).concat(override.map(getDeviceId)))]\n\n return devices.map(deviceId => ({\n deviceId,\n value: {\n ...(findDeviceOverride(source, deviceId) || { value: {} }).value,\n ...(findDeviceOverride(override, deviceId, v => v) || { value: {} }).value,\n },\n })) as DeviceOverride<A>[]\n}\n\nexport default function useTypographyMark(\n value: TypographyMarkValue | null | undefined,\n): TypographyMarkData | null | undefined {\n const typography = useTypography(value?.id ?? null)\n const swatchIds = [\n ...getTypographyStyleSwatchIds(value?.style),\n ...getTypographyStyleSwatchIds(typography?.style),\n ]\n const swatches = useSwatches(swatchIds)\n\n return overrideTypographyStyle(\n typography?.style.map(withColor(swatches.filter(isNonNullable))) ?? [],\n value?.style.map(withColor(swatches.filter(isNonNullable))) ?? [],\n )\n}\n","import { ComponentPropsWithoutRef } from 'react'\n\nimport useTypographyMark, {\n TypographyMarkValue,\n overrideTypographyStyle,\n TypographyMarkDataValue,\n} from './hooks/useTypographyMark'\nimport { colorToString } from '../../../../../../utils/colorToString'\nimport { shallowMergeFallbacks } from '../../../../../../utils/devices'\nimport { cx } from '@emotion/css'\nimport { useStyle } from '../../../../../../../runtimes/react/use-style'\nimport { responsiveStyle } from '../../../../../../utils/responsive-style'\nimport { ResponsiveValue } from '../../../../../../../prop-controllers/descriptors'\n\nexport type { TypographyMarkValue }\nexport { overrideTypographyStyle }\n\ntype BaseProps = { value: TypographyMarkValue }\n\ntype Props = BaseProps & Omit<ComponentPropsWithoutRef<'span'>, keyof BaseProps>\n\nexport default function Mark({ value, className, ...restOfProps }: Props): JSX.Element {\n const typographyStyle = useTypographyMark(value)\n const typographyClassName = useStyle(\n responsiveStyle<\n TypographyMarkDataValue,\n [ResponsiveValue<TypographyMarkDataValue> | null | undefined]\n >(\n [typographyStyle],\n ([\n {\n color,\n fontFamily,\n fontSize,\n fontWeight,\n lineHeight,\n letterSpacing,\n uppercase,\n underline,\n strikethrough,\n italic,\n } = {} as TypographyMarkDataValue,\n ]) => ({\n ...(color == null ? {} : { color: colorToString(color) }),\n ...(fontFamily == null ? {} : { fontFamily }),\n ...(fontSize == null || fontSize.value == null || fontSize.unit == null\n ? {}\n : { fontSize: `${fontSize.value}${fontSize.unit}` }),\n ...(fontWeight == null ? {} : { fontWeight }),\n ...(lineHeight == null ? {} : { lineHeight }),\n ...(letterSpacing == null ? {} : { letterSpacing: `${letterSpacing / 10}em` }),\n ...(uppercase == null\n ? {}\n : { textTransform: uppercase === true ? 'uppercase' : 'initial' }),\n ...(underline == null && strikethrough == null\n ? {}\n : {\n textDecoration: [\n Boolean(underline) && 'underline',\n Boolean(strikethrough) && 'line-through',\n ]\n .filter(Boolean)\n .join(' '),\n }),\n ...(italic == null ? {} : { fontStyle: italic === true ? 'italic' : 'initial' }),\n }),\n shallowMergeFallbacks,\n ),\n )\n\n return <span {...restOfProps} className={cx(typographyClassName, className)} />\n}\n","import { cx } from '@emotion/css'\nimport { forwardRef, ComponentPropsWithoutRef, ForwardedRef, ElementRef, ElementType } from 'react'\n\nimport type { ResponsiveValue } from '../../../../../../../prop-controllers'\nimport { useStyle } from '../../../../../../../runtimes/react/use-style'\nimport { responsiveStyle } from '../../../../../../utils/responsive-style'\n\ntype BaseProps<T extends ElementType> = {\n as?: T\n textAlign?: ResponsiveValue<'left' | 'center' | 'right' | 'justify'>\n}\n\ntype Props<T extends ElementType> = BaseProps<T> &\n Omit<ComponentPropsWithoutRef<T>, keyof BaseProps<T>>\n\nexport default forwardRef(function Block<T extends ElementType>(\n { textAlign, className, as, ...restOfProps }: Props<T>,\n ref: ForwardedRef<ElementRef<T>>,\n) {\n const Component = as ?? 'div'\n\n return (\n // @ts-ignore: `ref` types don't match.\n <Component\n {...restOfProps}\n ref={ref}\n className={cx(\n useStyle({ margin: 0 }),\n useStyle(responsiveStyle([textAlign], ([textAlign = 'left']) => ({ textAlign }))),\n useStyle(\n as === 'blockquote'\n ? {\n padding: '0.5em 10px',\n fontSize: '1.25em',\n fontWeight: '300',\n borderLeft: '5px solid rgba(0, 0, 0, 0.1)',\n }\n : {},\n ),\n className,\n )}\n />\n )\n})\n"],"names":["value","className","restOfProps","typographyStyle","useTypographyMark","typographyClassName","useStyle","responsiveStyle","color","fontFamily","fontSize","fontWeight","lineHeight","letterSpacing","uppercase","underline","strikethrough","italic","colorToString","unit","textTransform","textDecoration","Boolean","filter","join","fontStyle","shallowMergeFallbacks","cx","forwardRef","ref","textAlign","as","Component","margin","padding","borderLeft"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAM,cAAc,CAAC,EAAE,eAAwC;AAE/D,MAAM,YACJ,CAAC,aACD,CAAC,OAIE;AAJF,eACQ;AAAA,IAAP,OAAO;AAAA,MADR,IACQ,SAAE,YAAF,IAAY,wBAAZ,IAAY,CAAV,WACN,iBAFJ,IAEI;AAAA,IADH;AAAA;AAGC,0CACI,OADJ;AAAA,IAEC,OAAO,kCACF,cACC,QACA;AAAA,MACE,OAAO;AAAA,QACL,QAAQ,SAAS,KAAK,CAAA,MAAK,KAAK,EAAE,OAAO,MAAM,QAAQ;AAAA,QACvD,OAAO,MAAM;AAAA,MACf;AAAA,IAAA,IAEF,CAAC;AAAA,EAET;AAAA;AAES,MAAA,0BAA0B,CACrC,QACA,aAC6B;AAC7B,QAAM,UAAU,CAAC,GAAG,IAAI,IAAI,OAAO,IAAI,WAAW,EAAE,OAAO,SAAS,IAAI,WAAW,CAAC,CAAC,CAAC;AAE/E,SAAA,QAAQ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
1
+ {"version":3,"file":"index.es5.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,139 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
32
+ import { W as useTypography, K as useSwatches, G as findDeviceOverride, o as useStyle, r as responsiveStyle, X as shallowMergeFallbacks, s as colorToString } from "./index.es.js";
33
+ import { S as getTypographyStyleSwatchIds, l as isNonNullable } from "./constants.es.js";
34
+ import { cx } from "@emotion/css";
35
+ import { jsx } from "react/jsx-runtime";
36
+ import { forwardRef } from "react";
37
+ const getDeviceId = ({ deviceId }) => deviceId;
38
+ const withColor = (swatches) => (_a) => {
39
+ var _b = _a, {
40
+ value: _c
41
+ } = _b, _d = _c, { color } = _d, restOfValue = __objRest(_d, ["color"]), rest = __objRest(_b, [
42
+ "value"
43
+ ]);
44
+ return __spreadProps(__spreadValues({}, rest), {
45
+ value: __spreadValues(__spreadValues({}, restOfValue), color ? {
46
+ color: {
47
+ swatch: swatches.find((s) => s && s.id === color.swatchId),
48
+ alpha: color.alpha
49
+ }
50
+ } : {})
51
+ });
52
+ };
53
+ const overrideTypographyStyle = (source, override) => {
54
+ const devices = [...new Set(source.map(getDeviceId).concat(override.map(getDeviceId)))];
55
+ return devices.map((deviceId) => ({
56
+ deviceId,
57
+ value: __spreadValues(__spreadValues({}, (findDeviceOverride(source, deviceId) || { value: {} }).value), (findDeviceOverride(override, deviceId, (v) => v) || { value: {} }).value)
58
+ }));
59
+ };
60
+ function useTypographyMark(value) {
61
+ var _a, _b, _c;
62
+ const typography = useTypography((_a = value == null ? void 0 : value.id) != null ? _a : null);
63
+ const swatchIds = [
64
+ ...getTypographyStyleSwatchIds(value == null ? void 0 : value.style),
65
+ ...getTypographyStyleSwatchIds(typography == null ? void 0 : typography.style)
66
+ ];
67
+ const swatches = useSwatches(swatchIds);
68
+ return overrideTypographyStyle((_b = typography == null ? void 0 : typography.style.map(withColor(swatches.filter(isNonNullable)))) != null ? _b : [], (_c = value == null ? void 0 : value.style.map(withColor(swatches.filter(isNonNullable)))) != null ? _c : []);
69
+ }
70
+ function Mark(_a) {
71
+ var _b = _a, {
72
+ value,
73
+ className
74
+ } = _b, restOfProps = __objRest(_b, [
75
+ "value",
76
+ "className"
77
+ ]);
78
+ const typographyStyle = useTypographyMark(value);
79
+ const typographyClassName = useStyle(responsiveStyle([typographyStyle], ([{
80
+ color,
81
+ fontFamily,
82
+ fontSize,
83
+ fontWeight,
84
+ lineHeight,
85
+ letterSpacing,
86
+ uppercase,
87
+ underline,
88
+ strikethrough,
89
+ italic
90
+ } = {}]) => __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, color == null ? {} : {
91
+ color: colorToString(color)
92
+ }), fontFamily == null ? {} : {
93
+ fontFamily
94
+ }), fontSize == null || fontSize.value == null || fontSize.unit == null ? {} : {
95
+ fontSize: `${fontSize.value}${fontSize.unit}`
96
+ }), fontWeight == null ? {} : {
97
+ fontWeight
98
+ }), lineHeight == null ? {} : {
99
+ lineHeight
100
+ }), letterSpacing == null ? {} : {
101
+ letterSpacing: `${letterSpacing / 10}em`
102
+ }), uppercase == null ? {} : {
103
+ textTransform: uppercase === true ? "uppercase" : "initial"
104
+ }), underline == null && strikethrough == null ? {} : {
105
+ textDecoration: [Boolean(underline) && "underline", Boolean(strikethrough) && "line-through"].filter(Boolean).join(" ")
106
+ }), italic == null ? {} : {
107
+ fontStyle: italic === true ? "italic" : "initial"
108
+ }), shallowMergeFallbacks));
109
+ return /* @__PURE__ */ jsx("span", __spreadProps(__spreadValues({}, restOfProps), {
110
+ className: cx(typographyClassName, className)
111
+ }));
112
+ }
113
+ var DeviceOverrideBlock = forwardRef(function Block(_c, ref) {
114
+ var _d = _c, {
115
+ textAlign,
116
+ className,
117
+ as
118
+ } = _d, restOfProps = __objRest(_d, [
119
+ "textAlign",
120
+ "className",
121
+ "as"
122
+ ]);
123
+ const Component = as != null ? as : "div";
124
+ return /* @__PURE__ */ jsx(Component, __spreadProps(__spreadValues({}, restOfProps), {
125
+ ref,
126
+ className: cx(useStyle({
127
+ margin: 0
128
+ }), useStyle(responsiveStyle([textAlign], ([textAlign2 = "left"]) => ({
129
+ textAlign: textAlign2
130
+ }))), useStyle(as === "blockquote" ? {
131
+ padding: "0.5em 10px",
132
+ fontSize: "1.25em",
133
+ fontWeight: "300",
134
+ borderLeft: "5px solid rgba(0, 0, 0, 0.1)"
135
+ } : {}), className)
136
+ }));
137
+ });
138
+ export { DeviceOverrideBlock as D, Mark as M };
139
+ //# sourceMappingURL=index.es6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es6.js","sources":["../src/components/builtin/Text/components/RichTextEditor/components/Mark/hooks/useTypographyMark.ts","../src/components/builtin/Text/components/RichTextEditor/components/Mark/index.tsx","../src/components/builtin/Text/components/RichTextEditor/components/Block/index.tsx"],"sourcesContent":["import { Length as LengthValue } from '../../../../../../../../prop-controllers'\nimport { ColorValue as Color } from '../../../../../../../utils/types'\nimport { findDeviceOverride } from '../../../../../../../utils/devices'\nimport type { DeviceOverride } from '../../../../../../../../prop-controllers'\nimport {\n useSwatches,\n useTypography,\n} from '../../../../../../../../runtimes/react/hooks/makeswift-api'\nimport { Swatch, Typography } from '../../../../../../../../api'\nimport { getTypographyStyleSwatchIds } from '../../../../../../../../prop-controllers/introspection'\nimport { isNonNullable } from '../../../../../../../utils/isNonNullable'\n\nexport type TypographyMarkDataValue = {\n fontWeight?: number\n fontSize?: LengthValue\n fontFamily?: string\n color?: Color\n textAlign?: string\n lineHeight?: number\n letterSpacing?: number\n uppercase?: boolean\n italic?: boolean\n underline?: boolean\n strikethrough?: boolean\n}\n\nexport type TypographyMarkValue = {\n id: string | null | undefined\n style: Typography['style']\n}\n\nexport type TypographyMarkData = Array<DeviceOverride<TypographyMarkDataValue>>\n\nconst getDeviceId = ({ deviceId }: DeviceOverride<unknown>) => deviceId\n\nconst withColor =\n (swatches: Swatch[]) =>\n ({\n value: { color, ...restOfValue },\n ...rest\n }: Typography['style'][number]): DeviceOverride<TypographyMarkDataValue> =>\n ({\n ...rest,\n value: {\n ...restOfValue,\n ...(color\n ? {\n color: {\n swatch: swatches.find(s => s && s.id === color.swatchId),\n alpha: color.alpha,\n },\n }\n : {}),\n } as TypographyMarkDataValue,\n } as DeviceOverride<TypographyMarkDataValue>)\n\nexport const overrideTypographyStyle = <A>(\n source: Array<DeviceOverride<A>>,\n override: Array<DeviceOverride<A>>,\n): Array<DeviceOverride<A>> => {\n const devices = [...new Set(source.map(getDeviceId).concat(override.map(getDeviceId)))]\n\n return devices.map(deviceId => ({\n deviceId,\n value: {\n ...(findDeviceOverride(source, deviceId) || { value: {} }).value,\n ...(findDeviceOverride(override, deviceId, v => v) || { value: {} }).value,\n },\n })) as DeviceOverride<A>[]\n}\n\nexport default function useTypographyMark(\n value: TypographyMarkValue | null | undefined,\n): TypographyMarkData | null | undefined {\n const typography = useTypography(value?.id ?? null)\n const swatchIds = [\n ...getTypographyStyleSwatchIds(value?.style),\n ...getTypographyStyleSwatchIds(typography?.style),\n ]\n const swatches = useSwatches(swatchIds)\n\n return overrideTypographyStyle(\n typography?.style.map(withColor(swatches.filter(isNonNullable))) ?? [],\n value?.style.map(withColor(swatches.filter(isNonNullable))) ?? [],\n )\n}\n","import { ComponentPropsWithoutRef } from 'react'\n\nimport useTypographyMark, {\n TypographyMarkValue,\n overrideTypographyStyle,\n TypographyMarkDataValue,\n} from './hooks/useTypographyMark'\nimport { colorToString } from '../../../../../../utils/colorToString'\nimport { shallowMergeFallbacks } from '../../../../../../utils/devices'\nimport { cx } from '@emotion/css'\nimport { useStyle } from '../../../../../../../runtimes/react/use-style'\nimport { responsiveStyle } from '../../../../../../utils/responsive-style'\nimport { ResponsiveValue } from '../../../../../../../prop-controllers/descriptors'\n\nexport type { TypographyMarkValue }\nexport { overrideTypographyStyle }\n\ntype BaseProps = { value: TypographyMarkValue }\n\ntype Props = BaseProps & Omit<ComponentPropsWithoutRef<'span'>, keyof BaseProps>\n\nexport default function Mark({ value, className, ...restOfProps }: Props): JSX.Element {\n const typographyStyle = useTypographyMark(value)\n const typographyClassName = useStyle(\n responsiveStyle<\n TypographyMarkDataValue,\n [ResponsiveValue<TypographyMarkDataValue> | null | undefined]\n >(\n [typographyStyle],\n ([\n {\n color,\n fontFamily,\n fontSize,\n fontWeight,\n lineHeight,\n letterSpacing,\n uppercase,\n underline,\n strikethrough,\n italic,\n } = {} as TypographyMarkDataValue,\n ]) => ({\n ...(color == null ? {} : { color: colorToString(color) }),\n ...(fontFamily == null ? {} : { fontFamily }),\n ...(fontSize == null || fontSize.value == null || fontSize.unit == null\n ? {}\n : { fontSize: `${fontSize.value}${fontSize.unit}` }),\n ...(fontWeight == null ? {} : { fontWeight }),\n ...(lineHeight == null ? {} : { lineHeight }),\n ...(letterSpacing == null ? {} : { letterSpacing: `${letterSpacing / 10}em` }),\n ...(uppercase == null\n ? {}\n : { textTransform: uppercase === true ? 'uppercase' : 'initial' }),\n ...(underline == null && strikethrough == null\n ? {}\n : {\n textDecoration: [\n Boolean(underline) && 'underline',\n Boolean(strikethrough) && 'line-through',\n ]\n .filter(Boolean)\n .join(' '),\n }),\n ...(italic == null ? {} : { fontStyle: italic === true ? 'italic' : 'initial' }),\n }),\n shallowMergeFallbacks,\n ),\n )\n\n return <span {...restOfProps} className={cx(typographyClassName, className)} />\n}\n","import { cx } from '@emotion/css'\nimport { forwardRef, ComponentPropsWithoutRef, ForwardedRef, ElementRef, ElementType } from 'react'\n\nimport type { ResponsiveValue } from '../../../../../../../prop-controllers'\nimport { useStyle } from '../../../../../../../runtimes/react/use-style'\nimport { responsiveStyle } from '../../../../../../utils/responsive-style'\n\ntype BaseProps<T extends ElementType> = {\n as?: T\n textAlign?: ResponsiveValue<'left' | 'center' | 'right' | 'justify'>\n}\n\ntype Props<T extends ElementType> = BaseProps<T> &\n Omit<ComponentPropsWithoutRef<T>, keyof BaseProps<T>>\n\nexport default forwardRef(function Block<T extends ElementType>(\n { textAlign, className, as, ...restOfProps }: Props<T>,\n ref: ForwardedRef<ElementRef<T>>,\n) {\n const Component = as ?? 'div'\n\n return (\n // @ts-ignore: `ref` types don't match.\n <Component\n {...restOfProps}\n ref={ref}\n className={cx(\n useStyle({ margin: 0 }),\n useStyle(responsiveStyle([textAlign], ([textAlign = 'left']) => ({ textAlign }))),\n useStyle(\n as === 'blockquote'\n ? {\n padding: '0.5em 10px',\n fontSize: '1.25em',\n fontWeight: '300',\n borderLeft: '5px solid rgba(0, 0, 0, 0.1)',\n }\n : {},\n ),\n className,\n )}\n />\n )\n})\n"],"names":["value","className","restOfProps","typographyStyle","useTypographyMark","typographyClassName","useStyle","responsiveStyle","color","fontFamily","fontSize","fontWeight","lineHeight","letterSpacing","uppercase","underline","strikethrough","italic","colorToString","unit","textTransform","textDecoration","Boolean","filter","join","fontStyle","shallowMergeFallbacks","cx","forwardRef","ref","textAlign","as","Component","margin","padding","borderLeft"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCA,MAAM,cAAc,CAAC,EAAE,eAAwC;AAE/D,MAAM,YACJ,CAAC,aACD,CAAC,OAIE;AAJF,eACQ;AAAA,IAAP,OAAO;AAAA,MADR,IACQ,SAAE,YAAF,IAAY,wBAAZ,IAAY,CAAV,WACN,iBAFJ,IAEI;AAAA,IADH;AAAA;AAGC,0CACI,OADJ;AAAA,IAEC,OAAO,kCACF,cACC,QACA;AAAA,MACE,OAAO;AAAA,QACL,QAAQ,SAAS,KAAK,CAAA,MAAK,KAAK,EAAE,OAAO,MAAM,QAAQ;AAAA,QACvD,OAAO,MAAM;AAAA,MACf;AAAA,IAAA,IAEF,CAAC;AAAA,EAET;AAAA;AAES,MAAA,0BAA0B,CACrC,QACA,aAC6B;AAC7B,QAAM,UAAU,CAAC,GAAG,IAAI,IAAI,OAAO,IAAI,WAAW,EAAE,OAAO,SAAS,IAAI,WAAW,CAAC,CAAC,CAAC;AAE/E,SAAA,QAAQ,IAAI,CAAa,aAAA;AAAA,IAC9B;AAAA,IACA,OAAO,kCACD,oBAAmB,QAAQ,QAAQ,KAAK,EAAE,OAAO,MAAM,QACvD,oBAAmB,UAAU,UAAU,CAAK,MAAA,CAAC,KAAK,EAAE,OAAO,CAAC,EAAA,GAAK;AAAA,EAEvE,EAAA;AACJ;AAEA,2BACE,OACuC;;AACvC,QAAM,aAAa,cAAc,qCAAO,OAAP,YAAa,IAAI;AAClD,QAAM,YAAY;AAAA,IAChB,GAAG,4BAA4B,+BAAO,KAAK;AAAA,IAC3C,GAAG,4BAA4B,yCAAY,KAAK;AAAA,EAAA;AAE5C,QAAA,W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EAKbE,KAAK,GALQ;AAAA,EADlB,IAQAP,UAAU,OAAO,KAAK;AAAA,IAAEQ,WAAWR,WAAW,OAAO,WAAW;AAAA,EAApE,IAEFS,qBA1Ca,CADmB;AA+CpC,sEAAiBxB;IAAa,WAAWyB,GAAGtB,qBAAqBJ,SAAtB;AAAA,EAAA,EAA3C;AACD;ACxDD,IAAA,sBAAe2B,WAAW,eACxB,IACAC,KACA;AAFA,eAAEC;AAAAA;AAAAA,IAAW7B;AAAAA,IAAW8B;AAAAA,MAAxB,IAA+B7B,wBAA/B,IAA+BA;AAAAA,IAA7B4B;AAAAA,IAAW7B;AAAAA,IAAW8B;AAAAA;AAGxB,QAAMC,YAAYD,kBAAM;AAExB,6BAEG,4CACK7B;IACJ;AAAA,IACA,WAAWyB,GACTrB,SAAS;AAAA,MAAE2B,QAAQ;AAAA,IAAA,CAAX,GACR3B,SAASC,gBAAgB,CAACuB,SAAD,GAAa,CAAC,CAACA,aAAY,YAAa;AAAA,MAAEA,WAAAA;AAAAA,IAA3C,EAAA,CAAhB,GACRxB,SACEyB,OAAO,eACH;AAAA,MACEG,SAAS;AAAA,MACTxB,UAAU;AAAA,MACVC,YAAY;AAAA,MACZwB,YAAY;AAAA,IAAA,IAEd,CAAA,CARE,GAURlC,SAbW;AAAA,EAAA,EAHf;AAoBH,CA5BwB;;"}
package/dist/main.cjs.js CHANGED
@@ -4,7 +4,7 @@ var actions = require("./actions.cjs.js");
4
4
  var constants = require("./constants.cjs.js");
5
5
  require("redux");
6
6
  require("redux-thunk");
7
- require("./slot.cjs.js");
7
+ require("./rich-text.cjs.js");
8
8
  require("./control.cjs.js");
9
9
  exports.ActionTypes = actions.ActionTypes;
10
10
  exports.changeApiResource = actions.changeApiResource;
@@ -16,6 +16,7 @@ exports.init = actions.init;
16
16
  exports.messageHostPropController = actions.messageHostPropController;
17
17
  exports.registerDocument = actions.registerDocument;
18
18
  exports.scrollDocumentElement = actions.scrollDocumentElement;
19
+ exports.setBuilderEditMode = actions.setBuilderEditMode;
19
20
  exports.unregisterDocument = actions.unregisterDocument;
20
21
  exports.MakeswiftComponentType = constants.MakeswiftComponentType;
21
22
  exports.createDocument = constants.createDocument;
@@ -1 +1 @@
1
- {"version":3,"file":"main.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"main.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
package/dist/main.es.js CHANGED
@@ -1,7 +1,7 @@
1
- export { A as ActionTypes, d as changeApiResource, c as changeDocument, a as changeDocumentElementScrollTop, b as cleanUp, e as evictApiResource, i as init, m as messageHostPropController, r as registerDocument, s as scrollDocumentElement, u as unregisterDocument } from "./actions.es.js";
1
+ export { A as ActionTypes, d as changeApiResource, c as changeDocument, a as changeDocumentElementScrollTop, b as cleanUp, e as evictApiResource, i as init, m as messageHostPropController, r as registerDocument, s as scrollDocumentElement, f as setBuilderEditMode, u as unregisterDocument } from "./actions.es.js";
2
2
  export { M as MakeswiftComponentType, c as createDocument } from "./constants.es.js";
3
3
  import "redux";
4
4
  import "redux-thunk";
5
- import "./slot.es.js";
5
+ import "./rich-text.es.js";
6
6
  import "./control.es.js";
7
7
  //# sourceMappingURL=main.es.js.map
package/dist/next.cjs.js CHANGED
@@ -9,7 +9,7 @@ require("./constants.cjs.js");
9
9
  require("redux");
10
10
  require("redux-thunk");
11
11
  require("./actions.cjs.js");
12
- require("./slot.cjs.js");
12
+ require("./rich-text.cjs.js");
13
13
  require("./control.cjs.js");
14
14
  require("@emotion/css");
15
15
  require("@emotion/serialize");
package/dist/next.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import "react";
2
- export { a1 as Document, $ as Makeswift, a2 as MakeswiftApiHandler, W as MakeswiftClient, _ as Page, a0 as PreviewModeScript, H as forwardNextDynamicRef, Z as getServerSideProps, X as getStaticPaths, Y as getStaticProps } from "./index.es.js";
2
+ export { a3 as Document, a1 as Makeswift, a4 as MakeswiftApiHandler, Y as MakeswiftClient, a0 as Page, a2 as PreviewModeScript, H as forwardNextDynamicRef, $ as getServerSideProps, Z as getStaticPaths, _ as getStaticProps } from "./index.es.js";
3
3
  import "react/jsx-runtime";
4
4
  import "use-sync-external-store/shim/with-selector";
5
5
  import "next/dynamic";
@@ -7,7 +7,7 @@ import "./constants.es.js";
7
7
  import "redux";
8
8
  import "redux-thunk";
9
9
  import "./actions.es.js";
10
- import "./slot.es.js";
10
+ import "./rich-text.es.js";
11
11
  import "./control.es.js";
12
12
  import "@emotion/css";
13
13
  import "@emotion/serialize";
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- var slot = require("./slot.cjs.js");
4
- exports.Props = slot.descriptors;
5
- exports.RichTextPropControllerMessageType = slot.RichTextPropControllerMessageType;
6
- exports.TableFormFieldsMessageType = slot.TableFormFieldsMessageType;
3
+ var richText = require("./rich-text.cjs.js");
4
+ require("./actions.cjs.js");
5
+ exports.Props = richText.descriptors;
6
+ exports.RichTextPropControllerMessageType = richText.RichTextPropControllerMessageType;
7
+ exports.TableFormFieldsMessageType = richText.TableFormFieldsMessageType;
7
8
  //# sourceMappingURL=prop-controllers.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prop-controllers.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
1
+ {"version":3,"file":"prop-controllers.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -1,2 +1,3 @@
1
- export { f as Props, R as RichTextPropControllerMessageType, g as TableFormFieldsMessageType } from "./slot.es.js";
1
+ export { f as Props, R as RichTextPropControllerMessageType, g as TableFormFieldsMessageType } from "./rich-text.es.js";
2
+ import "./actions.es.js";
2
3
  //# sourceMappingURL=prop-controllers.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prop-controllers.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"prop-controllers.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
package/dist/react.cjs.js CHANGED
@@ -8,7 +8,7 @@ require("next/dynamic");
8
8
  require("./constants.cjs.js");
9
9
  require("redux");
10
10
  require("redux-thunk");
11
- require("./slot.cjs.js");
11
+ require("./rich-text.cjs.js");
12
12
  require("./control.cjs.js");
13
13
  require("@emotion/css");
14
14
  require("@emotion/serialize");
package/dist/react.es.js CHANGED
@@ -6,7 +6,7 @@ import "next/dynamic";
6
6
  import "./constants.es.js";
7
7
  import "redux";
8
8
  import "redux-thunk";
9
- import "./slot.es.js";
9
+ import "./rich-text.es.js";
10
10
  import "./control.es.js";
11
11
  import "@emotion/css";
12
12
  import "@emotion/serialize";