@reearth/core 0.0.7-alpha.37 → 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,26 +26615,28 @@ 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
- return [
26624
- ...c != null && c.html ? [{ html: c.html }] : [],
26625
- ...Array.from((o == null ? void 0 : o._array) ?? []).map((h) => {
26623
+ return {
26624
+ engine: {
26625
+ cesium: c != null && c.html ? { html: c.html } : void 0
26626
+ },
26627
+ lightbox: Array.from((o == null ? void 0 : o._array) ?? []).map((h) => {
26626
26628
  var p;
26627
26629
  return {
26628
26630
  html: (p = h == null ? void 0 : h.credit) == null ? void 0 : p.html
26629
26631
  };
26630
26632
  }),
26631
- ...Array.from((s == null ? void 0 : s._array) ?? []).map((h) => {
26633
+ screen: Array.from((s == null ? void 0 : s._array) ?? []).map((h) => {
26632
26634
  var p;
26633
26635
  return {
26634
26636
  html: (p = h == null ? void 0 : h.credit) == null ? void 0 : p.html
26635
26637
  };
26636
26638
  })
26637
- ];
26639
+ };
26638
26640
  }
26639
26641
  function Globe({
26640
26642
  property: t,
@@ -85203,7 +85205,7 @@ const useIBL = ({
85203
85205
  const Tf = (bf = Ra.current) == null ? void 0 : bf.cesiumElement;
85204
85206
  if (!Tf || Tf.isDestroyed())
85205
85207
  return;
85206
- const rf = getCredits(Tf) ?? [];
85208
+ const rf = getCredits(Tf);
85207
85209
  Ru.current(rf);
85208
85210
  }, 3e3);
85209
85211
  }, []), Gd = useMemo(
@@ -91386,7 +91388,7 @@ function Error$1({ error: t, resetErrorBoundary: n }) {
91386
91388
  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { style: { color: "#fff" }, onClick: n, children: "Retry" }) })
91387
91389
  ] });
91388
91390
  }
91389
- const version = "0.0.7-alpha.37", useCoreAPI = ({ viewerProperty: t }) => {
91391
+ const version = "0.0.7-alpha.39", useCoreAPI = ({ viewerProperty: t }) => {
91390
91392
  const n = useRef(t);
91391
91393
  n.current = t;
91392
91394
  const o = useMemo(