@reearth/core 0.0.7-alpha.38 → 0.0.7-alpha.39

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/core.js CHANGED
@@ -4721,13 +4721,13 @@ class Node {
4721
4721
  }
4722
4722
  _evaluateVariableString(n) {
4723
4723
  const o = /\${(.*?)}/g;
4724
- let s = this._value, c = o.exec(s);
4725
- for (; c !== null; ) {
4726
- const d = c[0], h = c[1];
4727
- let p = n == null ? void 0 : n.properties[h];
4728
- typeof p > "u" && (p = ""), s = s.replace(d, p), c = o.exec(s);
4729
- }
4730
- return s;
4724
+ return this._value.replace(
4725
+ o,
4726
+ (c, d) => {
4727
+ let h = n == null ? void 0 : n.properties[d];
4728
+ return typeof h > "u" && (h = ""), h;
4729
+ }
4730
+ );
4731
4731
  }
4732
4732
  _evaluateVariable(n) {
4733
4733
  let o;
@@ -26196,7 +26196,7 @@ const rangeTypes = {
26196
26196
  modifier: KeyboardEventModifier.SHIFT
26197
26197
  }
26198
26198
  ]
26199
- }, layerIdField = "__reearth_layer_id", defaultImageSize = 50, drawIcon = (t, n, o, s = "none", c = !1, d = "rgba(0, 0, 0, 0.7)", h = 3, p = 0, y = 0) => {
26199
+ }, layerIdField = "__reearth_layer_id", defaultImageSize = 50, emptyCredites = { engine: {}, lightbox: [], screen: [] }, drawIcon = (t, n, o, s = "none", c = !1, d = "rgba(0, 0, 0, 0.7)", h = 3, p = 0, y = 0) => {
26200
26200
  const S = document.createElement("canvas"), P = S.getContext("2d");
26201
26201
  if (!(!t || !P))
26202
26202
  return P.save(), S.width = n + h * 2, S.height = o + h * 2, P.shadowBlur = h, P.shadowOffsetX = p, P.shadowOffsetY = y, P.globalCompositeOperation = "source-over", P.clearRect(0, 0, S.width, S.height), P.drawImage(t, (S.width - n) / 2, (S.height - o) / 2, n, o), s === "circle" ? (P.fillStyle = "black", P.globalCompositeOperation = "destination-in", P.arc(S.width / 2, S.height / 2, Math.min(n, o) / 2, 0, 2 * Math.PI), P.fill(), c && (P.shadowColor = d, P.globalCompositeOperation = "destination-over", P.fillStyle = "black", P.arc(S.width / 2, S.height / 2, Math.min(n, o) / 2, 0, 2 * Math.PI), P.fill())) : c && (P.shadowColor = d, P.globalCompositeOperation = "destination-over", P.fillStyle = "black", P.rect((S.width - n) / 2, (S.height - o) / 2, n, o), P.fill()), P.restore(), S.toDataURL();
@@ -26615,10 +26615,10 @@ function getExtrudedHeight(t, n, o, s = !1) {
26615
26615
  }
26616
26616
  function getCredits(t) {
26617
26617
  if (!t)
26618
- return;
26618
+ return emptyCredites;
26619
26619
  const n = t.creditDisplay;
26620
26620
  if (!n)
26621
- return;
26621
+ return emptyCredites;
26622
26622
  const { lightboxCredits: o, screenCredits: s } = (n == null ? void 0 : n._currentFrameCredits) || {}, c = n._currentCesiumCredit;
26623
26623
  return {
26624
26624
  engine: {
@@ -91388,7 +91388,7 @@ function Error$1({ error: t, resetErrorBoundary: n }) {
91388
91388
  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { style: { color: "#fff" }, onClick: n, children: "Retry" }) })
91389
91389
  ] });
91390
91390
  }
91391
- const version = "0.0.7-alpha.38", useCoreAPI = ({ viewerProperty: t }) => {
91391
+ const version = "0.0.7-alpha.39", useCoreAPI = ({ viewerProperty: t }) => {
91392
91392
  const n = useRef(t);
91393
91393
  n.current = t;
91394
91394
  const o = useMemo(