@makeswift/runtime 0.9.6 → 0.9.7

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/index.es.js CHANGED
@@ -38,7 +38,7 @@ import * as React from "react";
38
38
  import { useEffect, createContext, useContext, useState, useMemo, useRef, Children, createElement, forwardRef, memo, useId, useCallback, useImperativeHandle, Component, Suspense } from "react";
39
39
  import { useSyncExternalStoreWithSelector } from "use-sync-external-store/shim/with-selector";
40
40
  import dynamic from "next/dynamic";
41
- import { a as createDocumentReference, g as getPropControllerDescriptors, b as isElementReference, e as getSwatchIds, f as getFileIds, h as getTypographyIds, j as getTableIds, k as getPageIds, l as getElementChildren, E as ElementID, B as Backgrounds, W as Width, m as ResponsiveIconRadioGroup, M as Margin, P as Padding, n as Border, o as BorderRadius, S as Shadows, G as GapY, p as GapX, q as ResponsiveSelect, r as ResponsiveNumber, s as Checkbox, t as Grid, u as TextInput, L as Link, v as ResponsiveColor, w as TextStyle, C as ComponentIcon, I as Images, N as Number$1, D as Date$1, F as Font, x as ResponsiveLength, y as TextArea, z as Table, A as TableFormFields, H as Image, J as ResponsiveOpacity, K as NavigationLinks, O as SocialLinks, Q as RichText, V as Video, U as useStyle, X as getBorderSwatchIds, Y as isNonNullable$1, Z as getBoxShadowsSwatchIds, _ as getResponsiveColorSwatchIds, $ as StyleControlProperty, a0 as ImageControlValueFormat, a1 as isPropControllersHandle, a2 as StyleControlType, a3 as RichTextV2ControlType, a4 as RichTextControlType, a5 as SlotControlType, a6 as StyleV2ControlType, a7 as ListControlType, a8 as ShapeControlType, a9 as LinkControlType, aa as ImageControlType, ab as ColorControlType, ac as getComponentPropControllerDescriptors, ad as getPropControllers, ae as Types, af as BorderPropControllerFormat, ag as ShadowsPropControllerFormat, ah as BorderRadiusPropControllerFormat, ai as MarginPropControllerFormat, aj as PaddingPropControllerFormat, ak as WidthPropControllerFormat, al as configureStore$1, am as copyElementTree, an as getBreakpoints, ao as parseLocalesInput, ap as getDocument, aq as getElementId, ar as getIsPreview, as as getIsInBuilder, at as getReactComponent, au as getBuilderEditMode } from "./react-page.es.js";
41
+ import { a as createDocumentReference, g as getPropControllerDescriptors, b as isElementReference, e as getSwatchIds, f as getFileIds, h as getTypographyIds, j as getTableIds, k as getPageIds, l as getElementChildren, E as ElementID, B as Backgrounds, W as Width, m as ResponsiveIconRadioGroup, M as Margin, P as Padding, n as Border, o as BorderRadius, S as Shadows, G as GapY, p as GapX, q as ResponsiveSelect, r as ResponsiveNumber, s as Checkbox, t as Grid, u as TextInput, L as Link, v as ResponsiveColor, w as TextStyle, C as ComponentIcon, I as Images, N as Number$1, D as Date$1, F as Font, x as ResponsiveLength, y as TextArea, z as Table, A as TableFormFields, H as Image, J as ResponsiveOpacity, K as NavigationLinks, O as SocialLinks, Q as RichText, V as Video, U as useStyle, X as getBorderSwatchIds, Y as isNonNullable$1, Z as getBoxShadowsSwatchIds, _ as getResponsiveColorSwatchIds, $ as StyleControlProperty, a0 as ImageControlValueFormat, a1 as isPropControllersHandle, a2 as isRichTextV1Data, a3 as StyleControlType, a4 as RichTextV2ControlType, a5 as RichTextControlType, a6 as SlotControlType, a7 as StyleV2ControlType, a8 as ListControlType, a9 as ShapeControlType, aa as LinkControlType, ab as ImageControlType, ac as ColorControlType, ad as getComponentPropControllerDescriptors, ae as getPropControllers, af as Types, ag as BorderPropControllerFormat, ah as ShadowsPropControllerFormat, ai as BorderRadiusPropControllerFormat, aj as MarginPropControllerFormat, ak as PaddingPropControllerFormat, al as WidthPropControllerFormat, am as configureStore$1, an as copyElementTree, ao as getBreakpoints, ap as parseLocalesInput, aq as getDocument, ar as getElementId, as as getIsPreview, at as getIsInBuilder, au as getReactComponent, av as getBuilderEditMode } from "./react-page.es.js";
42
42
  import { A as ActionTypes, o as apiResourceFulfilled, p as registerComponentEffect, q as registerReactComponentEffect, t as registerComponentHandleEffect, v as mountComponentEffect } from "./actions.es.js";
43
43
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
44
44
  import { T as TypographyControlType, I as IconRadioGroupControlType, S as SelectControlType, a as TextAreaControlType, b as TextInputControlType, N as NumberControlType, C as CheckboxControlType } from "./typography.es.js";
@@ -1144,7 +1144,7 @@ async function fonts(_req, res, { getFonts } = {}) {
1144
1144
  const fonts2 = (_a = await (getFonts == null ? void 0 : getFonts())) != null ? _a : [];
1145
1145
  return res.json(fonts2);
1146
1146
  }
1147
- const version = "0.9.6";
1147
+ const version = "0.9.7";
1148
1148
  async function handler(req, res, { apiKey, unstable_siteVersions }) {
1149
1149
  if (req.query.secret !== apiKey) {
1150
1150
  return res.status(401).json({ message: "Unauthorized" });
@@ -3114,8 +3114,14 @@ function useRichText(data, control) {
3114
3114
  }
3115
3115
  const EditableText = forwardNextDynamicRef((patch) => dynamic(() => patch(import("./index.es9.js"))));
3116
3116
  const ReadOnlyText = forwardNextDynamicRef((patch) => dynamic(() => patch(import("./ReadOnlyTextV2.es.js"))));
3117
+ const ReadOnlyTextV1 = forwardNextDynamicRef((patch) => dynamic(() => patch(import("./ReadOnlyText.es.js"))));
3117
3118
  function useRichTextV2(data, definition, control) {
3118
3119
  const isPreview = useIsPreview();
3120
+ if (isRichTextV1Data(data)) {
3121
+ return /* @__PURE__ */ jsx(ReadOnlyTextV1, {
3122
+ text: data
3123
+ });
3124
+ }
3119
3125
  return isPreview ? /* @__PURE__ */ jsx(EditableText, {
3120
3126
  text: data,
3121
3127
  definition,