@makeswift/runtime 0.24.5 → 0.24.6-canary.1
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/cjs/components/shared/ErrorBoundary.js +42 -0
- package/dist/cjs/components/shared/ErrorBoundary.js.map +1 -0
- package/dist/cjs/next/api-handler/handlers/manifest.js +1 -1
- package/dist/cjs/runtimes/react/components/Element.js +7 -2
- package/dist/cjs/runtimes/react/components/Element.js.map +1 -1
- package/dist/esm/components/shared/ErrorBoundary.js +18 -0
- package/dist/esm/components/shared/ErrorBoundary.js.map +1 -0
- package/dist/esm/next/api-handler/handlers/manifest.js +1 -1
- package/dist/esm/runtimes/react/components/Element.js +7 -2
- package/dist/esm/runtimes/react/components/Element.js.map +1 -1
- package/dist/types/components/shared/ErrorBoundary.d.ts +20 -0
- package/dist/types/components/shared/ErrorBoundary.d.ts.map +1 -0
- package/dist/types/runtimes/react/components/Element.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,42 @@
|
|
|
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 ErrorBoundary_exports = {};
|
|
20
|
+
__export(ErrorBoundary_exports, {
|
|
21
|
+
ErrorBoundary: () => ErrorBoundary
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(ErrorBoundary_exports);
|
|
24
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
+
var import_react = require("react");
|
|
26
|
+
class ErrorBoundary extends import_react.Component {
|
|
27
|
+
static getDerivedStateFromError() {
|
|
28
|
+
return { hasError: true };
|
|
29
|
+
}
|
|
30
|
+
state = { hasError: false };
|
|
31
|
+
render() {
|
|
32
|
+
const { FallbackComponent } = this.props;
|
|
33
|
+
if (this.state.hasError)
|
|
34
|
+
return FallbackComponent ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FallbackComponent, {}) : null;
|
|
35
|
+
return this.props.children;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
+
0 && (module.exports = {
|
|
40
|
+
ErrorBoundary
|
|
41
|
+
});
|
|
42
|
+
//# sourceMappingURL=ErrorBoundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/shared/ErrorBoundary.tsx"],"sourcesContent":["import { Component, ElementType, ReactNode } from 'react'\n\ntype ErrorProps = {\n FallbackComponent: ElementType\n children: ReactNode\n}\n\ntype State = {\n hasError: boolean\n}\n\nexport class ErrorBoundary extends Component<ErrorProps, State> {\n static getDerivedStateFromError() {\n return { hasError: true }\n }\n\n state = { hasError: false }\n\n render() {\n const { FallbackComponent } = this.props\n\n if (this.state.hasError) return FallbackComponent ? <FallbackComponent /> : null\n\n return this.props.children\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAqBwD;AArBxD,mBAAkD;AAW3C,MAAM,sBAAsB,uBAA6B;AAAA,EAC9D,OAAO,2BAA2B;AAChC,WAAO,EAAE,UAAU,KAAK;AAAA,EAC1B;AAAA,EAEA,QAAQ,EAAE,UAAU,MAAM;AAAA,EAE1B,SAAS;AACP,UAAM,EAAE,kBAAkB,IAAI,KAAK;AAEnC,QAAI,KAAK,MAAM;AAAU,aAAO,oBAAoB,4CAAC,qBAAkB,IAAK;AAE5E,WAAO,KAAK,MAAM;AAAA,EACpB;AACF;","names":[]}
|
|
@@ -37,7 +37,7 @@ async function handler(...args) {
|
|
|
37
37
|
const supportsDraftMode = (0, import_ts_pattern.match)(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
|
|
38
38
|
const supportsWebhook = (0, import_ts_pattern.match)(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
|
|
39
39
|
const body = {
|
|
40
|
-
version: "0.24.
|
|
40
|
+
version: "0.24.6-canary.1",
|
|
41
41
|
previewMode: supportsPreviewMode,
|
|
42
42
|
draftMode: supportsDraftMode,
|
|
43
43
|
interactionMode: true,
|
|
@@ -30,6 +30,8 @@ var import_ElementReference = require("./ElementReference");
|
|
|
30
30
|
var import_ElementData = require("./ElementData");
|
|
31
31
|
var import_element_imperative_handle = require("../element-imperative-handle");
|
|
32
32
|
var import_find_dom_node = require("../find-dom-node");
|
|
33
|
+
var import_FallbackComponent = require("../../../components/shared/FallbackComponent");
|
|
34
|
+
var import_ErrorBoundary = require("../../../components/shared/ErrorBoundary");
|
|
33
35
|
const Element = (0, import_react.memo)(
|
|
34
36
|
(0, import_react.forwardRef)(function Element2({ element }, ref) {
|
|
35
37
|
const useFindDomNodeRef = (0, import_react.useRef)(true);
|
|
@@ -44,16 +46,19 @@ const Element = (0, import_react.memo)(
|
|
|
44
46
|
imperativeHandleRef.current.callback(() => current);
|
|
45
47
|
}, []);
|
|
46
48
|
(0, import_react.useImperativeHandle)(ref, () => imperativeHandleRef.current, []);
|
|
47
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ElementRegistration.ElementRegistration, { componentHandle: imperativeHandleRef.current, elementKey: element.key, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_find_dom_node.FindDomNode, { ref: findDomNodeCallbackRef, children: (0, import_react_page.isElementReference)(element) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
49
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ElementRegistration.ElementRegistration, { componentHandle: imperativeHandleRef.current, elementKey: element.key, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_find_dom_node.FindDomNode, { ref: findDomNodeCallbackRef, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ErrorBoundary.ErrorBoundary, { FallbackComponent: ErrorFallback, children: (0, import_react_page.isElementReference)(element) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
48
50
|
import_ElementReference.ElementReference,
|
|
49
51
|
{
|
|
50
52
|
ref: elementCallbackRef,
|
|
51
53
|
elementReference: element
|
|
52
54
|
},
|
|
53
55
|
element.key
|
|
54
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ElementData.ElementData, { ref: elementCallbackRef, elementData: element }, element.key) }) });
|
|
56
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ElementData.ElementData, { ref: elementCallbackRef, elementData: element }, element.key) }) }) });
|
|
55
57
|
})
|
|
56
58
|
);
|
|
59
|
+
function ErrorFallback() {
|
|
60
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_FallbackComponent.FallbackComponent, { text: `Error rendering component` });
|
|
61
|
+
}
|
|
57
62
|
// Annotate the CommonJS export names for ESM import in node:
|
|
58
63
|
0 && (module.exports = {
|
|
59
64
|
Element
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/runtimes/react/components/Element.tsx"],"sourcesContent":["'use client'\n\nimport { forwardRef, memo, Ref, useCallback, useImperativeHandle, useRef } from 'react'\nimport { isElementReference, type Element as ElementDataOrRef } from '../../../state/react-page'\nimport { ElementRegistration } from './ElementRegistration'\nimport { ElementReference } from './ElementReference'\nimport { ElementData } from './ElementData'\nimport { ElementImperativeHandle } from '../element-imperative-handle'\nimport { FindDomNode } from '../find-dom-node'\n\ntype Props = {\n element: ElementDataOrRef\n}\n\nexport const Element = memo(\n forwardRef(function Element(\n { element }: Props,\n ref: Ref<ElementImperativeHandle>,\n ): JSX.Element | null {\n const useFindDomNodeRef = useRef(true)\n const imperativeHandleRef = useRef(new ElementImperativeHandle())\n\n const findDomNodeCallbackRef = useCallback((current: (() => Element | Text | null) | null) => {\n if (useFindDomNodeRef.current === true) {\n imperativeHandleRef.current.callback(() => current?.() ?? null)\n }\n }, [])\n\n const elementCallbackRef = useCallback((current: unknown | null) => {\n useFindDomNodeRef.current = false\n\n imperativeHandleRef.current.callback(() => current)\n }, [])\n\n useImperativeHandle(ref, () => imperativeHandleRef.current, [])\n\n return (\n <ElementRegistration componentHandle={imperativeHandleRef.current} elementKey={element.key}>\n <FindDomNode ref={findDomNodeCallbackRef}>\n {isElementReference(element) ? (\n
|
|
1
|
+
{"version":3,"sources":["../../../../../src/runtimes/react/components/Element.tsx"],"sourcesContent":["'use client'\n\nimport { forwardRef, memo, Ref, useCallback, useImperativeHandle, useRef } from 'react'\nimport { isElementReference, type Element as ElementDataOrRef } from '../../../state/react-page'\nimport { ElementRegistration } from './ElementRegistration'\nimport { ElementReference } from './ElementReference'\nimport { ElementData } from './ElementData'\nimport { ElementImperativeHandle } from '../element-imperative-handle'\nimport { FindDomNode } from '../find-dom-node'\nimport { FallbackComponent } from '../../../components/shared/FallbackComponent'\nimport { ErrorBoundary } from '../../../components/shared/ErrorBoundary'\n\ntype Props = {\n element: ElementDataOrRef\n}\n\nexport const Element = memo(\n forwardRef(function Element(\n { element }: Props,\n ref: Ref<ElementImperativeHandle>,\n ): JSX.Element | null {\n const useFindDomNodeRef = useRef(true)\n const imperativeHandleRef = useRef(new ElementImperativeHandle())\n\n const findDomNodeCallbackRef = useCallback((current: (() => Element | Text | null) | null) => {\n if (useFindDomNodeRef.current === true) {\n imperativeHandleRef.current.callback(() => current?.() ?? null)\n }\n }, [])\n\n const elementCallbackRef = useCallback((current: unknown | null) => {\n useFindDomNodeRef.current = false\n\n imperativeHandleRef.current.callback(() => current)\n }, [])\n\n useImperativeHandle(ref, () => imperativeHandleRef.current, [])\n\n return (\n <ElementRegistration componentHandle={imperativeHandleRef.current} elementKey={element.key}>\n <FindDomNode ref={findDomNodeCallbackRef}>\n <ErrorBoundary FallbackComponent={ErrorFallback}>\n {isElementReference(element) ? (\n <ElementReference\n key={element.key}\n ref={elementCallbackRef}\n elementReference={element}\n />\n ) : (\n <ElementData key={element.key} ref={elementCallbackRef} elementData={element} />\n )}\n </ErrorBoundary>\n </FindDomNode>\n </ElementRegistration>\n )\n }),\n)\n\nfunction ErrorFallback() {\n return <FallbackComponent text={`Error rendering component`} />\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA2Cc;AAzCd,mBAAgF;AAChF,wBAAqE;AACrE,iCAAoC;AACpC,8BAAiC;AACjC,yBAA4B;AAC5B,uCAAwC;AACxC,2BAA4B;AAC5B,+BAAkC;AAClC,2BAA8B;AAMvB,MAAM,cAAU;AAAA,MACrB,yBAAW,SAASA,SAClB,EAAE,QAAQ,GACV,KACoB;AACpB,UAAM,wBAAoB,qBAAO,IAAI;AACrC,UAAM,0BAAsB,qBAAO,IAAI,yDAAwB,CAAC;AAEhE,UAAM,6BAAyB,0BAAY,CAAC,YAAkD;AAC5F,UAAI,kBAAkB,YAAY,MAAM;AACtC,4BAAoB,QAAQ,SAAS,MAAM,UAAU,KAAK,IAAI;AAAA,MAChE;AAAA,IACF,GAAG,CAAC,CAAC;AAEL,UAAM,yBAAqB,0BAAY,CAAC,YAA4B;AAClE,wBAAkB,UAAU;AAE5B,0BAAoB,QAAQ,SAAS,MAAM,OAAO;AAAA,IACpD,GAAG,CAAC,CAAC;AAEL,0CAAoB,KAAK,MAAM,oBAAoB,SAAS,CAAC,CAAC;AAE9D,WACE,4CAAC,kDAAoB,iBAAiB,oBAAoB,SAAS,YAAY,QAAQ,KACrF,sDAAC,oCAAY,KAAK,wBAChB,sDAAC,sCAAc,mBAAmB,eAC/B,oDAAmB,OAAO,IACzB;AAAA,MAAC;AAAA;AAAA,QAEC,KAAK;AAAA,QACL,kBAAkB;AAAA;AAAA,MAFb,QAAQ;AAAA,IAGf,IAEA,4CAAC,kCAA8B,KAAK,oBAAoB,aAAa,WAAnD,QAAQ,GAAoD,GAElF,GACF,GACF;AAAA,EAEJ,CAAC;AACH;AAEA,SAAS,gBAAgB;AACvB,SAAO,4CAAC,8CAAkB,MAAM,6BAA6B;AAC/D;","names":["Element"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Component } from "react";
|
|
3
|
+
class ErrorBoundary extends Component {
|
|
4
|
+
static getDerivedStateFromError() {
|
|
5
|
+
return { hasError: true };
|
|
6
|
+
}
|
|
7
|
+
state = { hasError: false };
|
|
8
|
+
render() {
|
|
9
|
+
const { FallbackComponent } = this.props;
|
|
10
|
+
if (this.state.hasError)
|
|
11
|
+
return FallbackComponent ? /* @__PURE__ */ jsx(FallbackComponent, {}) : null;
|
|
12
|
+
return this.props.children;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
ErrorBoundary
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=ErrorBoundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/shared/ErrorBoundary.tsx"],"sourcesContent":["import { Component, ElementType, ReactNode } from 'react'\n\ntype ErrorProps = {\n FallbackComponent: ElementType\n children: ReactNode\n}\n\ntype State = {\n hasError: boolean\n}\n\nexport class ErrorBoundary extends Component<ErrorProps, State> {\n static getDerivedStateFromError() {\n return { hasError: true }\n }\n\n state = { hasError: false }\n\n render() {\n const { FallbackComponent } = this.props\n\n if (this.state.hasError) return FallbackComponent ? <FallbackComponent /> : null\n\n return this.props.children\n }\n}\n"],"mappings":"AAqBwD;AArBxD,SAAS,iBAAyC;AAW3C,MAAM,sBAAsB,UAA6B;AAAA,EAC9D,OAAO,2BAA2B;AAChC,WAAO,EAAE,UAAU,KAAK;AAAA,EAC1B;AAAA,EAEA,QAAQ,EAAE,UAAU,MAAM;AAAA,EAE1B,SAAS;AACP,UAAM,EAAE,kBAAkB,IAAI,KAAK;AAEnC,QAAI,KAAK,MAAM;AAAU,aAAO,oBAAoB,oBAAC,qBAAkB,IAAK;AAE5E,WAAO,KAAK,MAAM;AAAA,EACpB;AACF;","names":[]}
|
|
@@ -14,7 +14,7 @@ async function handler(...args) {
|
|
|
14
14
|
const supportsDraftMode = match(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
|
|
15
15
|
const supportsWebhook = match(args).with(routeHandlerPattern, () => true).with(apiRoutePattern, () => false).exhaustive();
|
|
16
16
|
const body = {
|
|
17
|
-
version: "0.24.
|
|
17
|
+
version: "0.24.6-canary.1",
|
|
18
18
|
previewMode: supportsPreviewMode,
|
|
19
19
|
draftMode: supportsDraftMode,
|
|
20
20
|
interactionMode: true,
|
|
@@ -7,6 +7,8 @@ import { ElementReference } from "./ElementReference";
|
|
|
7
7
|
import { ElementData } from "./ElementData";
|
|
8
8
|
import { ElementImperativeHandle } from "../element-imperative-handle";
|
|
9
9
|
import { FindDomNode } from "../find-dom-node";
|
|
10
|
+
import { FallbackComponent } from "../../../components/shared/FallbackComponent";
|
|
11
|
+
import { ErrorBoundary } from "../../../components/shared/ErrorBoundary";
|
|
10
12
|
const Element = memo(
|
|
11
13
|
forwardRef(function Element2({ element }, ref) {
|
|
12
14
|
const useFindDomNodeRef = useRef(true);
|
|
@@ -21,16 +23,19 @@ const Element = memo(
|
|
|
21
23
|
imperativeHandleRef.current.callback(() => current);
|
|
22
24
|
}, []);
|
|
23
25
|
useImperativeHandle(ref, () => imperativeHandleRef.current, []);
|
|
24
|
-
return /* @__PURE__ */ jsx(ElementRegistration, { componentHandle: imperativeHandleRef.current, elementKey: element.key, children: /* @__PURE__ */ jsx(FindDomNode, { ref: findDomNodeCallbackRef, children: isElementReference(element) ? /* @__PURE__ */ jsx(
|
|
26
|
+
return /* @__PURE__ */ jsx(ElementRegistration, { componentHandle: imperativeHandleRef.current, elementKey: element.key, children: /* @__PURE__ */ jsx(FindDomNode, { ref: findDomNodeCallbackRef, children: /* @__PURE__ */ jsx(ErrorBoundary, { FallbackComponent: ErrorFallback, children: isElementReference(element) ? /* @__PURE__ */ jsx(
|
|
25
27
|
ElementReference,
|
|
26
28
|
{
|
|
27
29
|
ref: elementCallbackRef,
|
|
28
30
|
elementReference: element
|
|
29
31
|
},
|
|
30
32
|
element.key
|
|
31
|
-
) : /* @__PURE__ */ jsx(ElementData, { ref: elementCallbackRef, elementData: element }, element.key) }) });
|
|
33
|
+
) : /* @__PURE__ */ jsx(ElementData, { ref: elementCallbackRef, elementData: element }, element.key) }) }) });
|
|
32
34
|
})
|
|
33
35
|
);
|
|
36
|
+
function ErrorFallback() {
|
|
37
|
+
return /* @__PURE__ */ jsx(FallbackComponent, { text: `Error rendering component` });
|
|
38
|
+
}
|
|
34
39
|
export {
|
|
35
40
|
Element
|
|
36
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/runtimes/react/components/Element.tsx"],"sourcesContent":["'use client'\n\nimport { forwardRef, memo, Ref, useCallback, useImperativeHandle, useRef } from 'react'\nimport { isElementReference, type Element as ElementDataOrRef } from '../../../state/react-page'\nimport { ElementRegistration } from './ElementRegistration'\nimport { ElementReference } from './ElementReference'\nimport { ElementData } from './ElementData'\nimport { ElementImperativeHandle } from '../element-imperative-handle'\nimport { FindDomNode } from '../find-dom-node'\n\ntype Props = {\n element: ElementDataOrRef\n}\n\nexport const Element = memo(\n forwardRef(function Element(\n { element }: Props,\n ref: Ref<ElementImperativeHandle>,\n ): JSX.Element | null {\n const useFindDomNodeRef = useRef(true)\n const imperativeHandleRef = useRef(new ElementImperativeHandle())\n\n const findDomNodeCallbackRef = useCallback((current: (() => Element | Text | null) | null) => {\n if (useFindDomNodeRef.current === true) {\n imperativeHandleRef.current.callback(() => current?.() ?? null)\n }\n }, [])\n\n const elementCallbackRef = useCallback((current: unknown | null) => {\n useFindDomNodeRef.current = false\n\n imperativeHandleRef.current.callback(() => current)\n }, [])\n\n useImperativeHandle(ref, () => imperativeHandleRef.current, [])\n\n return (\n <ElementRegistration componentHandle={imperativeHandleRef.current} elementKey={element.key}>\n <FindDomNode ref={findDomNodeCallbackRef}>\n {isElementReference(element) ? (\n
|
|
1
|
+
{"version":3,"sources":["../../../../../src/runtimes/react/components/Element.tsx"],"sourcesContent":["'use client'\n\nimport { forwardRef, memo, Ref, useCallback, useImperativeHandle, useRef } from 'react'\nimport { isElementReference, type Element as ElementDataOrRef } from '../../../state/react-page'\nimport { ElementRegistration } from './ElementRegistration'\nimport { ElementReference } from './ElementReference'\nimport { ElementData } from './ElementData'\nimport { ElementImperativeHandle } from '../element-imperative-handle'\nimport { FindDomNode } from '../find-dom-node'\nimport { FallbackComponent } from '../../../components/shared/FallbackComponent'\nimport { ErrorBoundary } from '../../../components/shared/ErrorBoundary'\n\ntype Props = {\n element: ElementDataOrRef\n}\n\nexport const Element = memo(\n forwardRef(function Element(\n { element }: Props,\n ref: Ref<ElementImperativeHandle>,\n ): JSX.Element | null {\n const useFindDomNodeRef = useRef(true)\n const imperativeHandleRef = useRef(new ElementImperativeHandle())\n\n const findDomNodeCallbackRef = useCallback((current: (() => Element | Text | null) | null) => {\n if (useFindDomNodeRef.current === true) {\n imperativeHandleRef.current.callback(() => current?.() ?? null)\n }\n }, [])\n\n const elementCallbackRef = useCallback((current: unknown | null) => {\n useFindDomNodeRef.current = false\n\n imperativeHandleRef.current.callback(() => current)\n }, [])\n\n useImperativeHandle(ref, () => imperativeHandleRef.current, [])\n\n return (\n <ElementRegistration componentHandle={imperativeHandleRef.current} elementKey={element.key}>\n <FindDomNode ref={findDomNodeCallbackRef}>\n <ErrorBoundary FallbackComponent={ErrorFallback}>\n {isElementReference(element) ? (\n <ElementReference\n key={element.key}\n ref={elementCallbackRef}\n elementReference={element}\n />\n ) : (\n <ElementData key={element.key} ref={elementCallbackRef} elementData={element} />\n )}\n </ErrorBoundary>\n </FindDomNode>\n </ElementRegistration>\n )\n }),\n)\n\nfunction ErrorFallback() {\n return <FallbackComponent text={`Error rendering component`} />\n}\n"],"mappings":";AA2Cc;AAzCd,SAAS,YAAY,MAAW,aAAa,qBAAqB,cAAc;AAChF,SAAS,0BAA4D;AACrE,SAAS,2BAA2B;AACpC,SAAS,wBAAwB;AACjC,SAAS,mBAAmB;AAC5B,SAAS,+BAA+B;AACxC,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AAClC,SAAS,qBAAqB;AAMvB,MAAM,UAAU;AAAA,EACrB,WAAW,SAASA,SAClB,EAAE,QAAQ,GACV,KACoB;AACpB,UAAM,oBAAoB,OAAO,IAAI;AACrC,UAAM,sBAAsB,OAAO,IAAI,wBAAwB,CAAC;AAEhE,UAAM,yBAAyB,YAAY,CAAC,YAAkD;AAC5F,UAAI,kBAAkB,YAAY,MAAM;AACtC,4BAAoB,QAAQ,SAAS,MAAM,UAAU,KAAK,IAAI;AAAA,MAChE;AAAA,IACF,GAAG,CAAC,CAAC;AAEL,UAAM,qBAAqB,YAAY,CAAC,YAA4B;AAClE,wBAAkB,UAAU;AAE5B,0BAAoB,QAAQ,SAAS,MAAM,OAAO;AAAA,IACpD,GAAG,CAAC,CAAC;AAEL,wBAAoB,KAAK,MAAM,oBAAoB,SAAS,CAAC,CAAC;AAE9D,WACE,oBAAC,uBAAoB,iBAAiB,oBAAoB,SAAS,YAAY,QAAQ,KACrF,8BAAC,eAAY,KAAK,wBAChB,8BAAC,iBAAc,mBAAmB,eAC/B,6BAAmB,OAAO,IACzB;AAAA,MAAC;AAAA;AAAA,QAEC,KAAK;AAAA,QACL,kBAAkB;AAAA;AAAA,MAFb,QAAQ;AAAA,IAGf,IAEA,oBAAC,eAA8B,KAAK,oBAAoB,aAAa,WAAnD,QAAQ,GAAoD,GAElF,GACF,GACF;AAAA,EAEJ,CAAC;AACH;AAEA,SAAS,gBAAgB;AACvB,SAAO,oBAAC,qBAAkB,MAAM,6BAA6B;AAC/D;","names":["Element"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference types="react/experimental" />
|
|
2
|
+
import { Component, ElementType, ReactNode } from 'react';
|
|
3
|
+
type ErrorProps = {
|
|
4
|
+
FallbackComponent: ElementType;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
type State = {
|
|
8
|
+
hasError: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare class ErrorBoundary extends Component<ErrorProps, State> {
|
|
11
|
+
static getDerivedStateFromError(): {
|
|
12
|
+
hasError: boolean;
|
|
13
|
+
};
|
|
14
|
+
state: {
|
|
15
|
+
hasError: boolean;
|
|
16
|
+
};
|
|
17
|
+
render(): string | number | boolean | Iterable<ReactNode> | import("react").PromiseLikeOfReactNode | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=ErrorBoundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/ErrorBoundary.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEzD,KAAK,UAAU,GAAG;IAChB,iBAAiB,EAAE,WAAW,CAAA;IAC9B,QAAQ,EAAE,SAAS,CAAA;CACpB,CAAA;AAED,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,qBAAa,aAAc,SAAQ,SAAS,CAAC,UAAU,EAAE,KAAK,CAAC;IAC7D,MAAM,CAAC,wBAAwB;;;IAI/B,KAAK;;MAAsB;IAE3B,MAAM;CAOP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Element.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/components/Element.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAsB,KAAK,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAIhG,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"Element.d.ts","sourceRoot":"","sources":["../../../../../src/runtimes/react/components/Element.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAsB,KAAK,OAAO,IAAI,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAIhG,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAA;AAKtE,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,gBAAgB,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,OAAO,6MAwCnB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@makeswift/runtime",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.6-canary.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -164,9 +164,9 @@
|
|
|
164
164
|
"use-sync-external-store": "^1.0.0-rc.0",
|
|
165
165
|
"uuid": "^9.0.0",
|
|
166
166
|
"zod": "^3.21.4",
|
|
167
|
-
"@makeswift/controls": "0.1.
|
|
167
|
+
"@makeswift/controls": "0.1.10-canary.0",
|
|
168
168
|
"@makeswift/next-plugin": "0.4.1",
|
|
169
|
-
"@makeswift/prop-controllers": "0.4.
|
|
169
|
+
"@makeswift/prop-controllers": "0.4.3-canary.0"
|
|
170
170
|
},
|
|
171
171
|
"devDependencies": {
|
|
172
172
|
"@emotion/jest": "^11.11.0",
|