@makeswift/runtime 0.20.2 → 0.20.3

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.
@@ -36,7 +36,7 @@ async function handler(...args) {
36
36
  const supportsPreviewMode = (0, import_ts_pattern.match)(args).with(routeHandlerPattern, () => false).with(apiRoutePattern, () => true).exhaustive();
37
37
  const supportsDraftMode = (0, import_ts_pattern.match)(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
38
38
  const body = {
39
- version: "0.20.2",
39
+ version: "0.20.3",
40
40
  previewMode: supportsPreviewMode,
41
41
  draftMode: supportsDraftMode,
42
42
  interactionMode: true,
@@ -25,17 +25,17 @@ var import_jsx_runtime = require("react/jsx-runtime");
25
25
  var import_react = require("react");
26
26
  var import_react2 = require("react");
27
27
  var import_use_component = require("../hooks/use-component");
28
- var import_suppress_ref_warning = require("../utils/suppress-ref-warning");
28
+ var import_can_accept_ref = require("../utils/can-accept-ref");
29
29
  var import_FallbackComponent = require("../../../components/shared/FallbackComponent");
30
30
  var import_controls = require("../controls");
31
31
  const ElementData = (0, import_react2.memo)(
32
32
  (0, import_react2.forwardRef)(function ElementData2({ elementData }, ref) {
33
33
  const Component = (0, import_use_component.useComponent)(elementData.type);
34
- (0, import_suppress_ref_warning.suppressRefWarning)(`\`ForwardRef(${ElementData2.name})\``);
35
34
  if (Component == null) {
36
35
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_FallbackComponent.FallbackComponent, { ref, text: "Component not found" });
37
36
  }
38
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.Suspense, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_controls.PropsValue, { element: elementData, children: (props) => /* @__PURE__ */ (0, import_react.createElement)(Component, { ...props, key: elementData.key, ref }) }) });
37
+ const forwardRef2 = (0, import_can_accept_ref.canAcceptRef)(Component);
38
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react2.Suspense, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_controls.PropsValue, { element: elementData, children: (props) => forwardRef2 ? /* @__PURE__ */ (0, import_react.createElement)(Component, { ...props, key: elementData.key, ref }) : /* @__PURE__ */ (0, import_react.createElement)(Component, { ...props, key: elementData.key }) }) });
39
39
  })
40
40
  );
41
41
  // Annotate the CommonJS export names for ESM import in node:
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/runtimes/react/components/ElementData.tsx"],"sourcesContent":["import { Ref, Suspense, forwardRef, memo } from 'react'\nimport { ElementData as ReactPageElementData } from '../../../state/react-page'\nimport { useComponent } from '../hooks/use-component'\nimport { suppressRefWarning } from '../utils/suppress-ref-warning'\nimport { FallbackComponent } from '../../../components/shared/FallbackComponent'\nimport { PropsValue } from '../controls'\n\ntype ElementDataProps = {\n elementData: ReactPageElementData\n}\n\nexport const ElementData = memo(\n forwardRef(function ElementData(\n { elementData }: ElementDataProps,\n ref: Ref<unknown>,\n ): JSX.Element {\n const Component = useComponent(elementData.type)\n\n suppressRefWarning(`\\`ForwardRef(${ElementData.name})\\``)\n\n if (Component == null) {\n return <FallbackComponent ref={ref as Ref<HTMLDivElement>} text=\"Component not found\" />\n }\n\n return (\n <Suspense>\n <PropsValue element={elementData}>\n {props => <Component {...props} key={elementData.key} ref={ref} />}\n </PropsValue>\n </Suspense>\n )\n }),\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBa;AAMO;AA3BpB,IAAAA,gBAAgD;AAEhD,2BAA6B;AAC7B,kCAAmC;AACnC,+BAAkC;AAClC,sBAA2B;AAMpB,MAAM,kBAAc;AAAA,MACzB,0BAAW,SAASC,aAClB,EAAE,YAAY,GACd,KACa;AACb,UAAM,gBAAY,mCAAa,YAAY,IAAI;AAE/C,wDAAmB,gBAAgBA,aAAY,IAAI,KAAK;AAExD,QAAI,aAAa,MAAM;AACrB,aAAO,4CAAC,8CAAkB,KAAiC,MAAK,uBAAsB;AAAA,IACxF;AAEA,WACE,4CAAC,0BACC,sDAAC,8BAAW,SAAS,aAClB,qBAAS,gDAAC,aAAW,GAAG,OAAO,KAAK,YAAY,KAAK,KAAU,GAClE,GACF;AAAA,EAEJ,CAAC;AACH;","names":["import_react","ElementData"]}
1
+ {"version":3,"sources":["../../../../../src/runtimes/react/components/ElementData.tsx"],"sourcesContent":["import { Ref, Suspense, forwardRef, memo } from 'react'\nimport { ElementData as ReactPageElementData } from '../../../state/react-page'\nimport { useComponent } from '../hooks/use-component'\nimport { canAcceptRef } from '../utils/can-accept-ref'\nimport { FallbackComponent } from '../../../components/shared/FallbackComponent'\nimport { PropsValue } from '../controls'\n\ntype ElementDataProps = {\n elementData: ReactPageElementData\n}\n\nexport const ElementData = memo(\n forwardRef(function ElementData(\n { elementData }: ElementDataProps,\n ref: Ref<unknown>,\n ): JSX.Element {\n const Component = useComponent(elementData.type)\n\n if (Component == null) {\n return <FallbackComponent ref={ref as Ref<HTMLDivElement>} text=\"Component not found\" />\n }\n\n const forwardRef = canAcceptRef(Component)\n\n return (\n <Suspense>\n <PropsValue element={elementData}>\n {props =>\n forwardRef ? (\n <Component {...props} key={elementData.key} ref={ref} />\n ) : (\n <Component {...props} key={elementData.key} />\n )\n }\n </PropsValue>\n </Suspense>\n )\n }),\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBa;AAUC;AA7Bd,IAAAA,gBAAgD;AAEhD,2BAA6B;AAC7B,4BAA6B;AAC7B,+BAAkC;AAClC,sBAA2B;AAMpB,MAAM,kBAAc;AAAA,MACzB,0BAAW,SAASC,aAClB,EAAE,YAAY,GACd,KACa;AACb,UAAM,gBAAY,mCAAa,YAAY,IAAI;AAE/C,QAAI,aAAa,MAAM;AACrB,aAAO,4CAAC,8CAAkB,KAAiC,MAAK,uBAAsB;AAAA,IACxF;AAEA,UAAMC,kBAAa,oCAAa,SAAS;AAEzC,WACE,4CAAC,0BACC,sDAAC,8BAAW,SAAS,aAClB,qBACCA,cACE,gDAAC,aAAW,GAAG,OAAO,KAAK,YAAY,KAAK,KAAU,IAEtD,gDAAC,aAAW,GAAG,OAAO,KAAK,YAAY,KAAK,GAGlD,GACF;AAAA,EAEJ,CAAC;AACH;","names":["import_react","ElementData","forwardRef"]}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var can_accept_ref_exports = {};
20
+ __export(can_accept_ref_exports, {
21
+ canAcceptRef: () => canAcceptRef
22
+ });
23
+ module.exports = __toCommonJS(can_accept_ref_exports);
24
+ const REACT_MEMO_TYPE = Symbol.for("react.memo");
25
+ const REACT_LAZY_TYPE = Symbol.for("react.lazy");
26
+ const REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
27
+ function hasTypeofSymbol(c, type) {
28
+ return c != null && "$$typeof" in c && c.$$typeof === type;
29
+ }
30
+ function isMemoComponent(c) {
31
+ return hasTypeofSymbol(c, REACT_MEMO_TYPE);
32
+ }
33
+ function isLazyComponent(c) {
34
+ return hasTypeofSymbol(c, REACT_LAZY_TYPE);
35
+ }
36
+ function isForwardRef(c) {
37
+ return hasTypeofSymbol(c, REACT_FORWARD_REF_TYPE);
38
+ }
39
+ function unwrapIfMemo(c) {
40
+ return isMemoComponent(c) ? c.type : c;
41
+ }
42
+ function isClassComponent(c) {
43
+ return typeof c === "function" && c.prototype && Boolean(c.prototype.isReactComponent);
44
+ }
45
+ function canAcceptRefImpl(c) {
46
+ return isClassComponent(c) || isForwardRef(c) || // will try to pass a ref to all lazy components since we can't know if they accept refs without loading them
47
+ isLazyComponent(c);
48
+ }
49
+ function canAcceptRef(c) {
50
+ return canAcceptRefImpl(unwrapIfMemo(c));
51
+ }
52
+ // Annotate the CommonJS export names for ESM import in node:
53
+ 0 && (module.exports = {
54
+ canAcceptRef
55
+ });
56
+ //# sourceMappingURL=can-accept-ref.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/runtimes/react/utils/can-accept-ref.ts"],"sourcesContent":["import type { Component, PropsWithoutRef, RefAttributes } from 'react'\nimport { type ComponentType } from '../../../state/react-page'\n\ntype WrapperComponent = {\n $$typeof: string\n new (props: PropsWithoutRef<any> & RefAttributes<any>, context?: any): Component<any>\n}\n\ntype MemoComponent = WrapperComponent & {\n type: ComponentType\n}\n\n// See https://github.com/facebook/react/blob/main/packages/shared/ReactSymbols.js\nconst REACT_MEMO_TYPE: symbol = Symbol.for('react.memo')\nconst REACT_LAZY_TYPE: symbol = Symbol.for('react.lazy')\nconst REACT_FORWARD_REF_TYPE: symbol = Symbol.for('react.forward_ref')\n\nfunction hasTypeofSymbol(c: ComponentType, type: symbol): c is WrapperComponent {\n // React uses `$$typeof` field on its wrapper components to identify them,\n // see https://github.com/facebook/react/blob/main/packages/shared/ReactElementType.js\n // and https://github.com/search?q=repo%3Afacebook%2Freact%20%24%24typeof&type=code\n return c != null && '$$typeof' in c && c.$$typeof === type\n}\n\nfunction isMemoComponent(c: ComponentType): c is MemoComponent {\n return hasTypeofSymbol(c, REACT_MEMO_TYPE)\n}\n\nfunction isLazyComponent(c: ComponentType) {\n return hasTypeofSymbol(c, REACT_LAZY_TYPE)\n}\n\nfunction isForwardRef(c: ComponentType) {\n return hasTypeofSymbol(c, REACT_FORWARD_REF_TYPE)\n}\n\nfunction unwrapIfMemo(c: ComponentType): ComponentType {\n return isMemoComponent(c) ? c.type : c\n}\n\nfunction isClassComponent(c: ComponentType) {\n return typeof c === 'function' && c.prototype && Boolean(c.prototype.isReactComponent)\n}\n\nfunction canAcceptRefImpl(c: ComponentType) {\n return (\n isClassComponent(c) ||\n isForwardRef(c) ||\n // will try to pass a ref to all lazy components since we can't know if they accept refs without loading them\n isLazyComponent(c)\n )\n}\n\nexport function canAcceptRef(c: ComponentType) {\n return canAcceptRefImpl(unwrapIfMemo(c))\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,MAAM,kBAA0B,OAAO,IAAI,YAAY;AACvD,MAAM,kBAA0B,OAAO,IAAI,YAAY;AACvD,MAAM,yBAAiC,OAAO,IAAI,mBAAmB;AAErE,SAAS,gBAAgB,GAAkB,MAAqC;AAI9E,SAAO,KAAK,QAAQ,cAAc,KAAK,EAAE,aAAa;AACxD;AAEA,SAAS,gBAAgB,GAAsC;AAC7D,SAAO,gBAAgB,GAAG,eAAe;AAC3C;AAEA,SAAS,gBAAgB,GAAkB;AACzC,SAAO,gBAAgB,GAAG,eAAe;AAC3C;AAEA,SAAS,aAAa,GAAkB;AACtC,SAAO,gBAAgB,GAAG,sBAAsB;AAClD;AAEA,SAAS,aAAa,GAAiC;AACrD,SAAO,gBAAgB,CAAC,IAAI,EAAE,OAAO;AACvC;AAEA,SAAS,iBAAiB,GAAkB;AAC1C,SAAO,OAAO,MAAM,cAAc,EAAE,aAAa,QAAQ,EAAE,UAAU,gBAAgB;AACvF;AAEA,SAAS,iBAAiB,GAAkB;AAC1C,SACE,iBAAiB,CAAC,KAClB,aAAa,CAAC;AAAA,EAEd,gBAAgB,CAAC;AAErB;AAEO,SAAS,aAAa,GAAkB;AAC7C,SAAO,iBAAiB,aAAa,CAAC,CAAC;AACzC;","names":[]}
@@ -13,7 +13,7 @@ async function handler(...args) {
13
13
  const supportsPreviewMode = match(args).with(routeHandlerPattern, () => false).with(apiRoutePattern, () => true).exhaustive();
14
14
  const supportsDraftMode = match(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
15
15
  const body = {
16
- version: "0.20.2",
16
+ version: "0.20.3",
17
17
  previewMode: supportsPreviewMode,
18
18
  draftMode: supportsDraftMode,
19
19
  interactionMode: true,
@@ -2,17 +2,17 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { createElement } from "react";
3
3
  import { Suspense, forwardRef, memo } from "react";
4
4
  import { useComponent } from "../hooks/use-component";
5
- import { suppressRefWarning } from "../utils/suppress-ref-warning";
5
+ import { canAcceptRef } from "../utils/can-accept-ref";
6
6
  import { FallbackComponent } from "../../../components/shared/FallbackComponent";
7
7
  import { PropsValue } from "../controls";
8
8
  const ElementData = memo(
9
9
  forwardRef(function ElementData2({ elementData }, ref) {
10
10
  const Component = useComponent(elementData.type);
11
- suppressRefWarning(`\`ForwardRef(${ElementData2.name})\``);
12
11
  if (Component == null) {
13
12
  return /* @__PURE__ */ jsx(FallbackComponent, { ref, text: "Component not found" });
14
13
  }
15
- return /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(PropsValue, { element: elementData, children: (props) => /* @__PURE__ */ createElement(Component, { ...props, key: elementData.key, ref }) }) });
14
+ const forwardRef2 = canAcceptRef(Component);
15
+ return /* @__PURE__ */ jsx(Suspense, { children: /* @__PURE__ */ jsx(PropsValue, { element: elementData, children: (props) => forwardRef2 ? /* @__PURE__ */ createElement(Component, { ...props, key: elementData.key, ref }) : /* @__PURE__ */ createElement(Component, { ...props, key: elementData.key }) }) });
16
16
  })
17
17
  );
18
18
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/runtimes/react/components/ElementData.tsx"],"sourcesContent":["import { Ref, Suspense, forwardRef, memo } from 'react'\nimport { ElementData as ReactPageElementData } from '../../../state/react-page'\nimport { useComponent } from '../hooks/use-component'\nimport { suppressRefWarning } from '../utils/suppress-ref-warning'\nimport { FallbackComponent } from '../../../components/shared/FallbackComponent'\nimport { PropsValue } from '../controls'\n\ntype ElementDataProps = {\n elementData: ReactPageElementData\n}\n\nexport const ElementData = memo(\n forwardRef(function ElementData(\n { elementData }: ElementDataProps,\n ref: Ref<unknown>,\n ): JSX.Element {\n const Component = useComponent(elementData.type)\n\n suppressRefWarning(`\\`ForwardRef(${ElementData.name})\\``)\n\n if (Component == null) {\n return <FallbackComponent ref={ref as Ref<HTMLDivElement>} text=\"Component not found\" />\n }\n\n return (\n <Suspense>\n <PropsValue element={elementData}>\n {props => <Component {...props} key={elementData.key} ref={ref} />}\n </PropsValue>\n </Suspense>\n )\n }),\n)\n"],"mappings":"AAqBa;AAMO;AA3BpB,SAAc,UAAU,YAAY,YAAY;AAEhD,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AACnC,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAMpB,MAAM,cAAc;AAAA,EACzB,WAAW,SAASA,aAClB,EAAE,YAAY,GACd,KACa;AACb,UAAM,YAAY,aAAa,YAAY,IAAI;AAE/C,uBAAmB,gBAAgBA,aAAY,IAAI,KAAK;AAExD,QAAI,aAAa,MAAM;AACrB,aAAO,oBAAC,qBAAkB,KAAiC,MAAK,uBAAsB;AAAA,IACxF;AAEA,WACE,oBAAC,YACC,8BAAC,cAAW,SAAS,aAClB,qBAAS,8BAAC,aAAW,GAAG,OAAO,KAAK,YAAY,KAAK,KAAU,GAClE,GACF;AAAA,EAEJ,CAAC;AACH;","names":["ElementData"]}
1
+ {"version":3,"sources":["../../../../../src/runtimes/react/components/ElementData.tsx"],"sourcesContent":["import { Ref, Suspense, forwardRef, memo } from 'react'\nimport { ElementData as ReactPageElementData } from '../../../state/react-page'\nimport { useComponent } from '../hooks/use-component'\nimport { canAcceptRef } from '../utils/can-accept-ref'\nimport { FallbackComponent } from '../../../components/shared/FallbackComponent'\nimport { PropsValue } from '../controls'\n\ntype ElementDataProps = {\n elementData: ReactPageElementData\n}\n\nexport const ElementData = memo(\n forwardRef(function ElementData(\n { elementData }: ElementDataProps,\n ref: Ref<unknown>,\n ): JSX.Element {\n const Component = useComponent(elementData.type)\n\n if (Component == null) {\n return <FallbackComponent ref={ref as Ref<HTMLDivElement>} text=\"Component not found\" />\n }\n\n const forwardRef = canAcceptRef(Component)\n\n return (\n <Suspense>\n <PropsValue element={elementData}>\n {props =>\n forwardRef ? (\n <Component {...props} key={elementData.key} ref={ref} />\n ) : (\n <Component {...props} key={elementData.key} />\n )\n }\n </PropsValue>\n </Suspense>\n )\n }),\n)\n"],"mappings":"AAmBa;AAUC;AA7Bd,SAAc,UAAU,YAAY,YAAY;AAEhD,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAMpB,MAAM,cAAc;AAAA,EACzB,WAAW,SAASA,aAClB,EAAE,YAAY,GACd,KACa;AACb,UAAM,YAAY,aAAa,YAAY,IAAI;AAE/C,QAAI,aAAa,MAAM;AACrB,aAAO,oBAAC,qBAAkB,KAAiC,MAAK,uBAAsB;AAAA,IACxF;AAEA,UAAMC,cAAa,aAAa,SAAS;AAEzC,WACE,oBAAC,YACC,8BAAC,cAAW,SAAS,aAClB,qBACCA,cACE,8BAAC,aAAW,GAAG,OAAO,KAAK,YAAY,KAAK,KAAU,IAEtD,8BAAC,aAAW,GAAG,OAAO,KAAK,YAAY,KAAK,GAGlD,GACF;AAAA,EAEJ,CAAC;AACH;","names":["ElementData","forwardRef"]}
@@ -0,0 +1,32 @@
1
+ const REACT_MEMO_TYPE = Symbol.for("react.memo");
2
+ const REACT_LAZY_TYPE = Symbol.for("react.lazy");
3
+ const REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
4
+ function hasTypeofSymbol(c, type) {
5
+ return c != null && "$$typeof" in c && c.$$typeof === type;
6
+ }
7
+ function isMemoComponent(c) {
8
+ return hasTypeofSymbol(c, REACT_MEMO_TYPE);
9
+ }
10
+ function isLazyComponent(c) {
11
+ return hasTypeofSymbol(c, REACT_LAZY_TYPE);
12
+ }
13
+ function isForwardRef(c) {
14
+ return hasTypeofSymbol(c, REACT_FORWARD_REF_TYPE);
15
+ }
16
+ function unwrapIfMemo(c) {
17
+ return isMemoComponent(c) ? c.type : c;
18
+ }
19
+ function isClassComponent(c) {
20
+ return typeof c === "function" && c.prototype && Boolean(c.prototype.isReactComponent);
21
+ }
22
+ function canAcceptRefImpl(c) {
23
+ return isClassComponent(c) || isForwardRef(c) || // will try to pass a ref to all lazy components since we can't know if they accept refs without loading them
24
+ isLazyComponent(c);
25
+ }
26
+ function canAcceptRef(c) {
27
+ return canAcceptRefImpl(unwrapIfMemo(c));
28
+ }
29
+ export {
30
+ canAcceptRef
31
+ };
32
+ //# sourceMappingURL=can-accept-ref.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/runtimes/react/utils/can-accept-ref.ts"],"sourcesContent":["import type { Component, PropsWithoutRef, RefAttributes } from 'react'\nimport { type ComponentType } from '../../../state/react-page'\n\ntype WrapperComponent = {\n $$typeof: string\n new (props: PropsWithoutRef<any> & RefAttributes<any>, context?: any): Component<any>\n}\n\ntype MemoComponent = WrapperComponent & {\n type: ComponentType\n}\n\n// See https://github.com/facebook/react/blob/main/packages/shared/ReactSymbols.js\nconst REACT_MEMO_TYPE: symbol = Symbol.for('react.memo')\nconst REACT_LAZY_TYPE: symbol = Symbol.for('react.lazy')\nconst REACT_FORWARD_REF_TYPE: symbol = Symbol.for('react.forward_ref')\n\nfunction hasTypeofSymbol(c: ComponentType, type: symbol): c is WrapperComponent {\n // React uses `$$typeof` field on its wrapper components to identify them,\n // see https://github.com/facebook/react/blob/main/packages/shared/ReactElementType.js\n // and https://github.com/search?q=repo%3Afacebook%2Freact%20%24%24typeof&type=code\n return c != null && '$$typeof' in c && c.$$typeof === type\n}\n\nfunction isMemoComponent(c: ComponentType): c is MemoComponent {\n return hasTypeofSymbol(c, REACT_MEMO_TYPE)\n}\n\nfunction isLazyComponent(c: ComponentType) {\n return hasTypeofSymbol(c, REACT_LAZY_TYPE)\n}\n\nfunction isForwardRef(c: ComponentType) {\n return hasTypeofSymbol(c, REACT_FORWARD_REF_TYPE)\n}\n\nfunction unwrapIfMemo(c: ComponentType): ComponentType {\n return isMemoComponent(c) ? c.type : c\n}\n\nfunction isClassComponent(c: ComponentType) {\n return typeof c === 'function' && c.prototype && Boolean(c.prototype.isReactComponent)\n}\n\nfunction canAcceptRefImpl(c: ComponentType) {\n return (\n isClassComponent(c) ||\n isForwardRef(c) ||\n // will try to pass a ref to all lazy components since we can't know if they accept refs without loading them\n isLazyComponent(c)\n )\n}\n\nexport function canAcceptRef(c: ComponentType) {\n return canAcceptRefImpl(unwrapIfMemo(c))\n}\n"],"mappings":"AAaA,MAAM,kBAA0B,OAAO,IAAI,YAAY;AACvD,MAAM,kBAA0B,OAAO,IAAI,YAAY;AACvD,MAAM,yBAAiC,OAAO,IAAI,mBAAmB;AAErE,SAAS,gBAAgB,GAAkB,MAAqC;AAI9E,SAAO,KAAK,QAAQ,cAAc,KAAK,EAAE,aAAa;AACxD;AAEA,SAAS,gBAAgB,GAAsC;AAC7D,SAAO,gBAAgB,GAAG,eAAe;AAC3C;AAEA,SAAS,gBAAgB,GAAkB;AACzC,SAAO,gBAAgB,GAAG,eAAe;AAC3C;AAEA,SAAS,aAAa,GAAkB;AACtC,SAAO,gBAAgB,GAAG,sBAAsB;AAClD;AAEA,SAAS,aAAa,GAAiC;AACrD,SAAO,gBAAgB,CAAC,IAAI,EAAE,OAAO;AACvC;AAEA,SAAS,iBAAiB,GAAkB;AAC1C,SAAO,OAAO,MAAM,cAAc,EAAE,aAAa,QAAQ,EAAE,UAAU,gBAAgB;AACvF;AAEA,SAAS,iBAAiB,GAAkB;AAC1C,SACE,iBAAiB,CAAC,KAClB,aAAa,CAAC;AAAA,EAEd,gBAAgB,CAAC;AAErB;AAEO,SAAS,aAAa,GAAkB;AAC7C,SAAO,iBAAiB,aAAa,CAAC,CAAC;AACzC;","names":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"ElementData.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/components/ElementData.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAM/E,KAAK,gBAAgB,GAAG;IACtB,WAAW,EAAE,oBAAoB,CAAA;CAClC,CAAA;AAED,eAAO,MAAM,WAAW,2IAqBvB,CAAA"}
1
+ {"version":3,"file":"ElementData.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/components/ElementData.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAM/E,KAAK,gBAAgB,GAAG;IACtB,WAAW,EAAE,oBAAoB,CAAA;CAClC,CAAA;AAED,eAAO,MAAM,WAAW,2IA2BvB,CAAA"}
@@ -0,0 +1,3 @@
1
+ import { type ComponentType } from '../../../state/react-page';
2
+ export declare function canAcceptRef(c: ComponentType): any;
3
+ //# sourceMappingURL=can-accept-ref.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"can-accept-ref.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/utils/can-accept-ref.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAoD9D,wBAAgB,YAAY,CAAC,CAAC,EAAE,aAAa,OAE5C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=can-accept-ref.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"can-accept-ref.test.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/utils/can-accept-ref.test.tsx"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makeswift/runtime",
3
- "version": "0.20.2",
3
+ "version": "0.20.3",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist",