@makeswift/runtime 0.0.2 → 0.0.5

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 (33) hide show
  1. package/dist/components.cjs.js +1 -0
  2. package/dist/components.cjs.js.map +1 -1
  3. package/dist/components.es.js +1 -0
  4. package/dist/components.es.js.map +1 -1
  5. package/dist/descriptors.cjs.js.map +1 -1
  6. package/dist/descriptors.es.js.map +1 -1
  7. package/dist/index.cjs.js +382 -15
  8. package/dist/index.cjs.js.map +1 -1
  9. package/dist/index.es.js +389 -22
  10. package/dist/index.es.js.map +1 -1
  11. package/dist/next.cjs.js +1 -0
  12. package/dist/next.cjs.js.map +1 -1
  13. package/dist/next.es.js +1 -0
  14. package/dist/next.es.js.map +1 -1
  15. package/dist/react.cjs.js +1 -0
  16. package/dist/react.cjs.js.map +1 -1
  17. package/dist/react.es.js +1 -0
  18. package/dist/react.es.js.map +1 -1
  19. package/dist/types/components/builtin/Navigation/Navigation.d.ts.map +1 -1
  20. package/dist/types/components/builtin/Navigation/components/DropDownButton/index.d.ts +1 -1
  21. package/dist/types/components/builtin/Navigation/components/DropDownButton/index.d.ts.map +1 -1
  22. package/dist/types/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts +1 -1
  23. package/dist/types/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts.map +1 -1
  24. package/dist/types/components/builtin/Navigation/components/MobileMenu/index.d.ts.map +1 -1
  25. package/dist/types/components/builtin/Text/components/RichTextEditor/components/Block/index.d.ts +2 -13
  26. package/dist/types/components/builtin/Text/components/RichTextEditor/components/Block/index.d.ts.map +1 -1
  27. package/dist/types/prop-controllers/descriptors.d.ts +1 -1
  28. package/dist/types/prop-controllers/descriptors.d.ts.map +1 -1
  29. package/dist/types/runtimes/react/controls/style.d.ts.map +1 -1
  30. package/dist/types/runtimes/react/find-dom-node.d.ts +7 -0
  31. package/dist/types/runtimes/react/find-dom-node.d.ts.map +1 -0
  32. package/dist/types/runtimes/react/index.d.ts.map +1 -1
  33. package/package.json +7 -8
package/dist/index.cjs.js CHANGED
@@ -34,6 +34,7 @@ var __publicField = (obj, key, value) => {
34
34
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
35
35
  return value;
36
36
  };
37
+ var _ea;
37
38
  var React = require("react");
38
39
  var withSelector = require("use-sync-external-store/shim/with-selector");
39
40
  var client = require("@apollo/client");
@@ -64,6 +65,7 @@ var ipsum = require("corporate-ipsum");
64
65
  var slateReact = require("slate-react");
65
66
  var Lists = require("@convertkit/slate-lists");
66
67
  var style = require("./style.cjs.js");
68
+ var reactDom = require("react-dom");
67
69
  function _interopDefaultLegacy(e) {
68
70
  return e && typeof e === "object" && "default" in e ? e : { "default": e };
69
71
  }
@@ -1957,7 +1959,7 @@ function responsiveStyle(responsiveValues, join$1, strategy) {
1957
1959
  }
1958
1960
  function responsiveWidth(widthData, defaultValue = "100%") {
1959
1961
  return __spreadValues({
1960
- width: "100%"
1962
+ maxWidth: "100%"
1961
1963
  }, responsiveStyle([widthData], ([width = defaultValue]) => ({
1962
1964
  width: typeof width === "object" ? `${width.value}${width.unit}` : width
1963
1965
  })));
@@ -5662,11 +5664,15 @@ function DropDownButton(_U) {
5662
5664
  var _V = _U, {
5663
5665
  label,
5664
5666
  caret = "caret",
5665
- links: links2 = []
5667
+ links: links2 = [],
5668
+ textColor,
5669
+ color
5666
5670
  } = _V, restOfProps = __objRest(_V, [
5667
5671
  "label",
5668
5672
  "caret",
5669
- "links"
5673
+ "links",
5674
+ "textColor",
5675
+ "color"
5670
5676
  ]);
5671
5677
  const container = React.useRef(null);
5672
5678
  const [position, setPosition] = React.useState("left");
@@ -5680,6 +5686,8 @@ function DropDownButton(_U) {
5680
5686
  return /* @__PURE__ */ jsxRuntime.jsxs(DropDownContainer, {
5681
5687
  ref: container,
5682
5688
  children: [/* @__PURE__ */ jsxRuntime.jsx(Button$1, __spreadProps(__spreadValues({}, restOfProps), {
5689
+ textColor: useColor(textColor),
5690
+ color: useColor(color),
5683
5691
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", {
5684
5692
  style: {
5685
5693
  display: "flex",
@@ -5769,16 +5777,22 @@ function MobileDropDownButton(_Y) {
5769
5777
  caret,
5770
5778
  links: links2 = [],
5771
5779
  onClose = () => {
5772
- }
5780
+ },
5781
+ color,
5782
+ textColor
5773
5783
  } = _Z, restOfProps = __objRest(_Z, [
5774
5784
  "label",
5775
5785
  "caret",
5776
5786
  "links",
5777
- "onClose"
5787
+ "onClose",
5788
+ "color",
5789
+ "textColor"
5778
5790
  ]);
5779
5791
  const [isOpen, setIsOpen] = React.useState(false);
5780
5792
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
5781
5793
  children: [/* @__PURE__ */ jsxRuntime.jsx(ButtonLink$1, __spreadProps(__spreadValues({}, restOfProps), {
5794
+ textColor: useColor(textColor),
5795
+ color: useColor(color),
5782
5796
  onPointerDown: () => setIsOpen((prev) => !prev),
5783
5797
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", {
5784
5798
  style: {
@@ -5812,7 +5826,20 @@ function MobileDropDownButton(_Y) {
5812
5826
  })]
5813
5827
  });
5814
5828
  }
5815
- const ButtonLink = styled__default["default"](Button$1)`
5829
+ function NavigationButton$1(props) {
5830
+ const _a = props, {
5831
+ textColor,
5832
+ color
5833
+ } = _a, restOfProps = __objRest(_a, [
5834
+ "textColor",
5835
+ "color"
5836
+ ]);
5837
+ return /* @__PURE__ */ jsxRuntime.jsx(Button$1, __spreadProps(__spreadValues({}, restOfProps), {
5838
+ textColor: useColor(textColor),
5839
+ color: useColor(color)
5840
+ }));
5841
+ }
5842
+ const ButtonLink = styled__default["default"](NavigationButton$1)`
5816
5843
  margin: 8px 0;
5817
5844
  `;
5818
5845
  const Container$3 = styled__default["default"].div`
@@ -5925,6 +5952,19 @@ const OpenIconContainer = styled__default["default"].button`
5925
5952
  color: ${color == null ? "rgba(161, 168, 194, 0.5)" : colorToString(color)};
5926
5953
  `)}
5927
5954
  `;
5955
+ function NavigationButton(props) {
5956
+ const _a = props, {
5957
+ textColor,
5958
+ color
5959
+ } = _a, restOfProps = __objRest(_a, [
5960
+ "textColor",
5961
+ "color"
5962
+ ]);
5963
+ return /* @__PURE__ */ jsxRuntime.jsx(Button$1, __spreadProps(__spreadValues({}, restOfProps), {
5964
+ textColor: useColor(textColor),
5965
+ color: useColor(color)
5966
+ }));
5967
+ }
5928
5968
  const placeholder = {
5929
5969
  src: "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='93.12' height='36' viewBox='0 0 93.12 36'%3E%3Cg id='Layer_2' data-name='Layer 2'%3E%3Cg id='Layer_1-2' data-name='Layer 1'%3E%3Cpath d='M18,0A18,18,0,1,1,0,18,18,18,0,0,1,18,0ZM49.36,21.94h6.36V24H46.8V10h2.56Zm9.06.72a4.88,4.88,0,0,1-1.64-3.72,5,5,0,0,1,1.64-3.74,5.57,5.57,0,0,1,7.7,0,5.09,5.09,0,0,1,.26,7.18l-.26.26a5.56,5.56,0,0,1-7.7,0Zm1.68-6a3.39,3.39,0,0,0,0,4.52,3,3,0,0,0,4.24.08l.08-.08a3.39,3.39,0,0,0,0-4.52,3,3,0,0,0-4.24-.08Zm10,10.68,1-1.92a5.28,5.28,0,0,0,3.3,1.22,3.6,3.6,0,0,0,2.32-.72,2.73,2.73,0,0,0,.9-2.26V22.5a3.61,3.61,0,0,1-1.45,1.26,4.35,4.35,0,0,1-2,.46,4.57,4.57,0,0,1-3.58-1.54A5.48,5.48,0,0,1,69.2,18.9a5.42,5.42,0,0,1,1.36-3.74,4.64,4.64,0,0,1,3.62-1.5,4,4,0,0,1,3.44,1.72v-1.5h2.46v9a6.13,6.13,0,0,1-1.43,4.46,5.27,5.27,0,0,1-4,1.44,7.09,7.09,0,0,1-4.53-1.42Zm1.54-8.44a3.4,3.4,0,0,0,.82,2.3,2.72,2.72,0,0,0,2.17.94,3.13,3.13,0,0,0,1.21-.22,2.89,2.89,0,0,0,1-.62,3.08,3.08,0,0,0,.63-1,3.62,3.62,0,0,0,.21-1.3,4,4,0,0,0-.23-1.33,3.3,3.3,0,0,0-.63-1.05,2.74,2.74,0,0,0-1-.68,3.35,3.35,0,0,0-1.25-.24,2.92,2.92,0,0,0-1.2.24,2.58,2.58,0,0,0-.93.67,3,3,0,0,0-.59,1,3.89,3.89,0,0,0-.19,1.31ZM83.8,22.66a4.88,4.88,0,0,1-1.64-3.72A5,5,0,0,1,83.8,15.2a5.57,5.57,0,0,1,7.7,0,5.09,5.09,0,0,1,.26,7.18,3.19,3.19,0,0,1-.26.26,5.56,5.56,0,0,1-7.7,0Zm1.68-6a3.39,3.39,0,0,0,0,4.52,3,3,0,0,0,4.24.08l.08-.08a3.39,3.39,0,0,0,0-4.52,3,3,0,0,0-4.24-.08Z' fill='%23a1a8c2' opacity='0.4' style='isolation: isolate'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E%0A",
5930
5970
  dimensions: {
@@ -5976,7 +6016,7 @@ const Navigation = React.forwardRef(function Navigation2({
5976
6016
  gutter,
5977
6017
  first: i === 0,
5978
6018
  last: i === links2.length - 1,
5979
- children: [link.type === "button" && /* @__PURE__ */ jsxRuntime.jsx(Button$1, __spreadProps(__spreadValues({}, link.payload), {
6019
+ children: [link.type === "button" && /* @__PURE__ */ jsxRuntime.jsx(NavigationButton, __spreadProps(__spreadValues({}, link.payload), {
5980
6020
  children: link.payload.label
5981
6021
  })), link.type === "dropdown" && /* @__PURE__ */ jsxRuntime.jsx(DropDownButton, __spreadValues({}, link.payload))]
5982
6022
  }, link.id)) : /* @__PURE__ */ jsxRuntime.jsx(LinksPlaceholder, {
@@ -7806,9 +7846,267 @@ const FallbackComponent = React.forwardRef(function FallbackComponent2({
7806
7846
  })]
7807
7847
  });
7808
7848
  });
7809
- function useStyleControlDataClass(style$1, controlDefinition) {
7849
+ function murmur2(str) {
7850
+ var h = 0;
7851
+ var k, i = 0, len = str.length;
7852
+ for (; len >= 4; ++i, len -= 4) {
7853
+ k = str.charCodeAt(i) & 255 | (str.charCodeAt(++i) & 255) << 8 | (str.charCodeAt(++i) & 255) << 16 | (str.charCodeAt(++i) & 255) << 24;
7854
+ k = (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16);
7855
+ k ^= k >>> 24;
7856
+ h = (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16) ^ (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
7857
+ }
7858
+ switch (len) {
7859
+ case 3:
7860
+ h ^= (str.charCodeAt(i + 2) & 255) << 16;
7861
+ case 2:
7862
+ h ^= (str.charCodeAt(i + 1) & 255) << 8;
7863
+ case 1:
7864
+ h ^= str.charCodeAt(i) & 255;
7865
+ h = (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
7866
+ }
7867
+ h ^= h >>> 13;
7868
+ h = (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
7869
+ return ((h ^ h >>> 15) >>> 0).toString(36);
7870
+ }
7871
+ var unitlessKeys = {
7872
+ animationIterationCount: 1,
7873
+ borderImageOutset: 1,
7874
+ borderImageSlice: 1,
7875
+ borderImageWidth: 1,
7876
+ boxFlex: 1,
7877
+ boxFlexGroup: 1,
7878
+ boxOrdinalGroup: 1,
7879
+ columnCount: 1,
7880
+ columns: 1,
7881
+ flex: 1,
7882
+ flexGrow: 1,
7883
+ flexPositive: 1,
7884
+ flexShrink: 1,
7885
+ flexNegative: 1,
7886
+ flexOrder: 1,
7887
+ gridRow: 1,
7888
+ gridRowEnd: 1,
7889
+ gridRowSpan: 1,
7890
+ gridRowStart: 1,
7891
+ gridColumn: 1,
7892
+ gridColumnEnd: 1,
7893
+ gridColumnSpan: 1,
7894
+ gridColumnStart: 1,
7895
+ msGridRow: 1,
7896
+ msGridRowSpan: 1,
7897
+ msGridColumn: 1,
7898
+ msGridColumnSpan: 1,
7899
+ fontWeight: 1,
7900
+ lineHeight: 1,
7901
+ opacity: 1,
7902
+ order: 1,
7903
+ orphans: 1,
7904
+ tabSize: 1,
7905
+ widows: 1,
7906
+ zIndex: 1,
7907
+ zoom: 1,
7908
+ WebkitLineClamp: 1,
7909
+ fillOpacity: 1,
7910
+ floodOpacity: 1,
7911
+ stopOpacity: 1,
7912
+ strokeDasharray: 1,
7913
+ strokeDashoffset: 1,
7914
+ strokeMiterlimit: 1,
7915
+ strokeOpacity: 1,
7916
+ strokeWidth: 1
7917
+ };
7918
+ function memoize(fn) {
7919
+ var cache = /* @__PURE__ */ Object.create(null);
7920
+ return function(arg) {
7921
+ if (cache[arg] === void 0)
7922
+ cache[arg] = fn(arg);
7923
+ return cache[arg];
7924
+ };
7925
+ }
7926
+ var hyphenateRegex = /[A-Z]|^ms/g;
7927
+ var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
7928
+ var isCustomProperty = function isCustomProperty2(property) {
7929
+ return property.charCodeAt(1) === 45;
7930
+ };
7931
+ var isProcessableValue = function isProcessableValue2(value) {
7932
+ return value != null && typeof value !== "boolean";
7933
+ };
7934
+ var processStyleName = /* @__PURE__ */ memoize(function(styleName) {
7935
+ return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, "-$&").toLowerCase();
7936
+ });
7937
+ var processStyleValue = function processStyleValue2(key, value) {
7938
+ switch (key) {
7939
+ case "animation":
7940
+ case "animationName": {
7941
+ if (typeof value === "string") {
7942
+ return value.replace(animationRegex, function(match, p1, p2) {
7943
+ cursor = {
7944
+ name: p1,
7945
+ styles: p2,
7946
+ next: cursor
7947
+ };
7948
+ return p1;
7949
+ });
7950
+ }
7951
+ }
7952
+ }
7953
+ if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === "number" && value !== 0) {
7954
+ return value + "px";
7955
+ }
7956
+ return value;
7957
+ };
7958
+ function handleInterpolation(mergedProps, registered, interpolation) {
7959
+ if (interpolation == null) {
7960
+ return "";
7961
+ }
7962
+ if (interpolation.__emotion_styles !== void 0) {
7963
+ return interpolation;
7964
+ }
7965
+ switch (typeof interpolation) {
7966
+ case "boolean": {
7967
+ return "";
7968
+ }
7969
+ case "object": {
7970
+ if (interpolation.anim === 1) {
7971
+ cursor = {
7972
+ name: interpolation.name,
7973
+ styles: interpolation.styles,
7974
+ next: cursor
7975
+ };
7976
+ return interpolation.name;
7977
+ }
7978
+ if (interpolation.styles !== void 0) {
7979
+ var next = interpolation.next;
7980
+ if (next !== void 0) {
7981
+ while (next !== void 0) {
7982
+ cursor = {
7983
+ name: next.name,
7984
+ styles: next.styles,
7985
+ next: cursor
7986
+ };
7987
+ next = next.next;
7988
+ }
7989
+ }
7990
+ var styles = interpolation.styles + ";";
7991
+ return styles;
7992
+ }
7993
+ return createStringFromObject(mergedProps, registered, interpolation);
7994
+ }
7995
+ case "function": {
7996
+ if (mergedProps !== void 0) {
7997
+ var previousCursor = cursor;
7998
+ var result = interpolation(mergedProps);
7999
+ cursor = previousCursor;
8000
+ return handleInterpolation(mergedProps, registered, result);
8001
+ }
8002
+ break;
8003
+ }
8004
+ }
8005
+ if (registered == null) {
8006
+ return interpolation;
8007
+ }
8008
+ var cached = registered[interpolation];
8009
+ return cached !== void 0 ? cached : interpolation;
8010
+ }
8011
+ function createStringFromObject(mergedProps, registered, obj) {
8012
+ var string = "";
8013
+ if (Array.isArray(obj)) {
8014
+ for (var i = 0; i < obj.length; i++) {
8015
+ string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
8016
+ }
8017
+ } else {
8018
+ for (var _key in obj) {
8019
+ var value = obj[_key];
8020
+ if (typeof value !== "object") {
8021
+ if (registered != null && registered[value] !== void 0) {
8022
+ string += _key + "{" + registered[value] + "}";
8023
+ } else if (isProcessableValue(value)) {
8024
+ string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
8025
+ }
8026
+ } else {
8027
+ if (_key === "NO_COMPONENT_SELECTOR" && false) {
8028
+ throw new Error("Component selectors can only be used in conjunction with @emotion/babel-plugin.");
8029
+ }
8030
+ if (Array.isArray(value) && typeof value[0] === "string" && (registered == null || registered[value[0]] === void 0)) {
8031
+ for (var _i = 0; _i < value.length; _i++) {
8032
+ if (isProcessableValue(value[_i])) {
8033
+ string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
8034
+ }
8035
+ }
8036
+ } else {
8037
+ var interpolated = handleInterpolation(mergedProps, registered, value);
8038
+ switch (_key) {
8039
+ case "animation":
8040
+ case "animationName": {
8041
+ string += processStyleName(_key) + ":" + interpolated + ";";
8042
+ break;
8043
+ }
8044
+ default: {
8045
+ string += _key + "{" + interpolated + "}";
8046
+ }
8047
+ }
8048
+ }
8049
+ }
8050
+ }
8051
+ }
8052
+ return string;
8053
+ }
8054
+ var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
8055
+ var cursor;
8056
+ var serializeStyles = function serializeStyles2(args, registered, mergedProps) {
8057
+ if (args.length === 1 && typeof args[0] === "object" && args[0] !== null && args[0].styles !== void 0) {
8058
+ return args[0];
8059
+ }
8060
+ var stringMode = true;
8061
+ var styles = "";
8062
+ cursor = void 0;
8063
+ var strings = args[0];
8064
+ if (strings == null || strings.raw === void 0) {
8065
+ stringMode = false;
8066
+ styles += handleInterpolation(mergedProps, registered, strings);
8067
+ } else {
8068
+ styles += strings[0];
8069
+ }
8070
+ for (var i = 1; i < args.length; i++) {
8071
+ styles += handleInterpolation(mergedProps, registered, args[i]);
8072
+ if (stringMode) {
8073
+ styles += strings[i];
8074
+ }
8075
+ }
8076
+ labelPattern.lastIndex = 0;
8077
+ var identifierName = "";
8078
+ var match;
8079
+ while ((match = labelPattern.exec(styles)) !== null) {
8080
+ identifierName += "-" + match[1];
8081
+ }
8082
+ var name = murmur2(styles) + identifierName;
8083
+ return {
8084
+ name,
8085
+ styles,
8086
+ next: cursor
8087
+ };
8088
+ };
8089
+ var isBrowser = true;
8090
+ var registerStyles = function registerStyles2(cache, serialized, isStringTag) {
8091
+ var className = cache.key + "-" + serialized.name;
8092
+ if ((isStringTag === false || isBrowser === false) && cache.registered[className] === void 0) {
8093
+ cache.registered[className] = serialized.styles;
8094
+ }
8095
+ };
8096
+ var insertStyles = function insertStyles2(cache, serialized, isStringTag) {
8097
+ registerStyles(cache, serialized, isStringTag);
8098
+ var className = cache.key + "-" + serialized.name;
8099
+ if (cache.inserted[serialized.name] === void 0) {
8100
+ var current = serialized;
8101
+ do {
8102
+ cache.insert(serialized === current ? "." + className : "", current, cache.sheet, true);
8103
+ current = current.next;
8104
+ } while (current !== void 0);
8105
+ }
8106
+ };
8107
+ function useStyleControlCssObject(style$1, controlDefinition) {
7810
8108
  const { properties } = controlDefinition.config;
7811
- return css.css(__spreadValues(__spreadValues({}, properties.includes(style.StyleControlProperty.Width) && {
8109
+ return __spreadValues(__spreadValues({}, properties.includes(style.StyleControlProperty.Width) && {
7812
8110
  maxWidth: "100%"
7813
8111
  }), responsiveStyle([
7814
8112
  style$1 == null ? void 0 : style$1.width,
@@ -7841,7 +8139,7 @@ function useStyleControlDataClass(style$1, controlDefinition) {
7841
8139
  borderBottomRightRadius: (_p = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomRightRadius)) != null ? _p : 0,
7842
8140
  borderBottomLeftRadius: (_q = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomLeftRadius)) != null ? _q : 0
7843
8141
  });
7844
- })));
8142
+ }));
7845
8143
  function widthToString(widthProperty) {
7846
8144
  if (widthProperty == null)
7847
8145
  return null;
@@ -7871,8 +8169,14 @@ function useStyleControlDataClass(style$1, controlDefinition) {
7871
8169
  return `${borderRadius.value}${borderRadius.unit}`;
7872
8170
  }
7873
8171
  }
8172
+ const useInsertionEffect = (_ea = React__namespace.useInsertionEffect) != null ? _ea : React__namespace.useLayoutEffect;
7874
8173
  function useFormattedStyle(styleControlData, controlDefinition) {
7875
- return useStyleControlDataClass(styleControlData, controlDefinition);
8174
+ const style2 = useStyleControlCssObject(styleControlData, controlDefinition);
8175
+ const serialized = serializeStyles([style2], css.cache.registered);
8176
+ useInsertionEffect(() => {
8177
+ insertStyles(css.cache, serialized, false);
8178
+ });
8179
+ return `${css.cache.key}-${serialized.name}`;
7876
8180
  }
7877
8181
  function useDeviceMode() {
7878
8182
  return "desktop";
@@ -7905,6 +8209,48 @@ function useProps(element) {
7905
8209
  }
7906
8210
  }));
7907
8211
  }
8212
+ function suppressWarningAndFindDomNode(instance) {
8213
+ const error = console.error;
8214
+ console.error = (...args) => {
8215
+ const [msg, ...substitutions] = args;
8216
+ const text = substitutions.reduce((text2, substitution) => text2.replace("%s", substitution), msg);
8217
+ if (!text.includes("findDOMNode is deprecated in StrictMode.")) {
8218
+ error.apply(console, args);
8219
+ }
8220
+ };
8221
+ const foundDomNode = reactDom.findDOMNode(instance);
8222
+ console.error = error;
8223
+ return foundDomNode;
8224
+ }
8225
+ class FindDomNodeClassComponent extends React.Component {
8226
+ componentDidMount() {
8227
+ this.setInnerRef(suppressWarningAndFindDomNode(this));
8228
+ }
8229
+ componentDidUpdate() {
8230
+ this.setInnerRef(suppressWarningAndFindDomNode(this));
8231
+ }
8232
+ setInnerRef(current) {
8233
+ const {
8234
+ innerRef
8235
+ } = this.props;
8236
+ if (innerRef == null)
8237
+ return;
8238
+ if (typeof innerRef === "function")
8239
+ innerRef(current);
8240
+ else
8241
+ innerRef.current = current;
8242
+ }
8243
+ render() {
8244
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
8245
+ children: this.props.children
8246
+ });
8247
+ }
8248
+ }
8249
+ const FindDomNode = React.forwardRef(function FindDomNode2(props, ref) {
8250
+ return /* @__PURE__ */ jsxRuntime.jsx(FindDomNodeClassComponent, __spreadProps(__spreadValues({}, props), {
8251
+ innerRef: ref
8252
+ }));
8253
+ });
7908
8254
  const contextDefaultValue = reactPage.configureStore();
7909
8255
  function createReactRuntime(store) {
7910
8256
  return {
@@ -8046,21 +8392,42 @@ function useDispatch() {
8046
8392
  const store = React.useContext(Context);
8047
8393
  return store.dispatch;
8048
8394
  }
8395
+ function useSuppressRefWarning(ownerName) {
8396
+ const originalErrorRef = React.useRef(console.error);
8397
+ const patchedRef = React.useRef(false);
8398
+ if (patchedRef.current === false) {
8399
+ console.error = (...args) => {
8400
+ const [msg, ...substitutions] = args;
8401
+ const text = substitutions.reduce((text2, substitution) => text2.replace("%s", substitution), msg);
8402
+ if (!text.includes("Function components cannot be given refs.") || !text.includes(`Check the render method of \`${ownerName}\`.`)) {
8403
+ originalErrorRef.current(...args);
8404
+ }
8405
+ };
8406
+ patchedRef.current = true;
8407
+ }
8408
+ }
8049
8409
  const ElementData = React.memo(React.forwardRef(function ElementData2({
8050
8410
  elementData
8051
8411
  }, ref) {
8052
8412
  const Component = useComponent(elementData.type);
8053
8413
  const props = useProps(elementData);
8414
+ const [handle, setHandle] = React.useState(null);
8415
+ const [foundDomNode, setFoundDomNode] = React.useState(null);
8416
+ React.useImperativeHandle(ref, () => handle != null ? handle : foundDomNode, [handle, foundDomNode]);
8417
+ useSuppressRefWarning(`\`ForwardRef(${ElementData2.name})\``);
8054
8418
  if (Component == null) {
8055
8419
  return /* @__PURE__ */ jsxRuntime.jsx(FallbackComponent, {
8056
8420
  ref,
8057
8421
  text: "Component not found"
8058
8422
  });
8059
8423
  }
8060
- return /* @__PURE__ */ React.createElement(Component, __spreadProps(__spreadValues({}, props), {
8061
- key: elementData.key,
8062
- ref
8063
- }));
8424
+ return /* @__PURE__ */ jsxRuntime.jsx(FindDomNode, {
8425
+ ref: setFoundDomNode,
8426
+ children: /* @__PURE__ */ React.createElement(Component, __spreadProps(__spreadValues({}, props), {
8427
+ key: elementData.key,
8428
+ ref: setHandle
8429
+ }))
8430
+ });
8064
8431
  }));
8065
8432
  const ElementReference = React.memo(React.forwardRef(function ElementReference2({
8066
8433
  elementReference