@reearth/core 0.0.7-alpha.51 → 0.0.7-alpha.53

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
@@ -84053,7 +84053,6 @@ function Resource({
84053
84053
  onComputedFeatureFetch: s,
84054
84054
  onComputedFeatureDelete: c
84055
84055
  }) {
84056
- var ui, ba, ms, yu, pu, Nl;
84057
84056
  const {
84058
84057
  show: l = !0,
84059
84058
  clampToGround: d,
@@ -84064,66 +84063,47 @@ function Resource({
84064
84063
  fill: P,
84065
84064
  hideIndicator: L
84066
84065
  } = n ?? {}, [N, z, W] = useMemo(() => {
84067
- var gd;
84068
- const pd = extractSimpleLayerData(o), Sc = n == null ? void 0 : n.type, Ru = n == null ? void 0 : n.url;
84066
+ var ms;
84067
+ const ea = extractSimpleLayerData(o), ui = n == null ? void 0 : n.type, ba = n == null ? void 0 : n.url;
84069
84068
  return [
84070
- Sc ?? (pd == null ? void 0 : pd.type),
84071
- Ru ?? (pd == null ? void 0 : pd.url),
84072
- ((gd = pd == null ? void 0 : pd.time) == null ? void 0 : gd.updateClockOnLoad) ?? !0
84069
+ ui ?? (ea == null ? void 0 : ea.type),
84070
+ ba ?? (ea == null ? void 0 : ea.url),
84071
+ ((ms = ea == null ? void 0 : ea.time) == null ? void 0 : ms.updateClockOnLoad) ?? !0
84073
84072
  ];
84074
84073
  }, [n, o]), { viewer: ai } = ae$1(), mt = useRef([]), J = useRef(/* @__PURE__ */ new Set()), pi = useMemo(() => !N || N === "auto" ? guessType(z) : void 0, [N, z]), fa = pi ? types[pi] : N !== "auto" ? N : void 0, ma = fa ? comps[fa] : void 0, { requestRender: Sa, timelineManagerRef: Ra } = useContext(), Vs = useCallback(
84075
- (pd) => {
84074
+ (ea) => {
84076
84075
  if (!ai)
84077
84076
  return;
84078
- const Sc = [], Ru = [];
84079
- pd.entities.values.forEach((gd) => {
84080
- var hf;
84081
- const Zd = attachStyle(gd, o, evalFeature, ai.clock.currentTime), [ef, df] = Zd || [];
84082
- attachTag(gd, {
84077
+ const ui = [], ba = [];
84078
+ ea.entities.values.forEach((ms) => {
84079
+ var pd;
84080
+ const yu = attachStyle(ms, o, evalFeature, ai.clock.currentTime), [pu, Nl] = yu || [];
84081
+ attachTag(ms, {
84083
84082
  layerId: o == null ? void 0 : o.id,
84084
- featureId: ef == null ? void 0 : ef.id,
84085
- hideIndicator: (hf = df == null ? void 0 : df.resource) == null ? void 0 : hf.hideIndicator
84086
- }), ef && !J.current.has(ef.id) && (Sc.push(ef), mt.current.push({ feature: ef, raw: gd }), J.current.add(ef.id)), df && Ru.push(df);
84087
- }), N !== "geojson" && (s == null || s(Sc, Ru)), Sa == null || Sa();
84083
+ featureId: pu == null ? void 0 : pu.id,
84084
+ hideIndicator: (pd = Nl == null ? void 0 : Nl.resource) == null ? void 0 : pd.hideIndicator
84085
+ }), pu && !J.current.has(pu.id) && (ui.push(pu), mt.current.push({ feature: pu, raw: ms }), J.current.add(pu.id)), Nl && ba.push(Nl);
84086
+ }), N !== "geojson" && (s == null || s(ui, ba)), Sa == null || Sa();
84088
84087
  },
84089
84088
  [o, ai, s, N, Sa]
84090
- ), La = useRef({
84091
- start: (ba = (ui = Ra == null ? void 0 : Ra.current) == null ? void 0 : ui.timeline) == null ? void 0 : ba.start,
84092
- stop: (yu = (ms = Ra == null ? void 0 : Ra.current) == null ? void 0 : ms.timeline) == null ? void 0 : yu.stop,
84093
- current: (Nl = (pu = Ra == null ? void 0 : Ra.current) == null ? void 0 : pu.timeline) == null ? void 0 : Nl.current
84094
- }), Zs = useCallback(
84095
- (pd) => {
84096
- var Sc, Ru;
84097
- if (pd.entities.values.forEach(
84098
- (gd) => requestAnimationFrame(() => {
84099
- const Zd = getTag(gd);
84100
- attachTag(gd, {
84089
+ ), La = useCallback(
84090
+ (ea) => {
84091
+ var ui;
84092
+ ea.entities.values.forEach(
84093
+ (ba) => requestAnimationFrame(() => {
84094
+ const ms = getTag(ba);
84095
+ attachTag(ba, {
84101
84096
  layerId: o == null ? void 0 : o.id,
84102
- featureId: makeFeatureId$1(gd),
84103
- hideIndicator: L ?? (Zd == null ? void 0 : Zd.hideIndicator)
84097
+ featureId: makeFeatureId$1(ba),
84098
+ hideIndicator: L ?? (ms == null ? void 0 : ms.hideIndicator)
84104
84099
  });
84105
84100
  })
84106
- ), !W) {
84107
- La.current.current && La.current.start && La.current.stop && ((Sc = Ra == null ? void 0 : Ra.current) == null || Sc.commit({
84108
- cmd: "SET_TIME",
84109
- payload: {
84110
- start: La.current.start,
84111
- stop: La.current.stop,
84112
- current: La.current.current
84113
- },
84114
- committer: {
84115
- source: "featureResource",
84116
- id: o == null ? void 0 : o.id
84117
- }
84118
- }));
84119
- return;
84120
- }
84121
- pd.clock && ((Ru = Ra == null ? void 0 : Ra.current) == null || Ru.commit({
84101
+ ), W && ea.clock && ((ui = Ra == null ? void 0 : Ra.current) == null || ui.commit({
84122
84102
  cmd: "SET_TIME",
84123
84103
  payload: {
84124
- start: JulianDate$1.toDate(pd.clock.startTime),
84125
- stop: JulianDate$1.toDate(pd.clock.stopTime),
84126
- current: JulianDate$1.toDate(pd.clock.currentTime)
84104
+ start: JulianDate$1.toDate(ea.clock.startTime),
84105
+ stop: JulianDate$1.toDate(ea.clock.stopTime),
84106
+ current: JulianDate$1.toDate(ea.clock.currentTime)
84127
84107
  },
84128
84108
  committer: {
84129
84109
  source: "featureResource",
@@ -84132,16 +84112,16 @@ function Resource({
84132
84112
  })), Sa == null || Sa();
84133
84113
  },
84134
84114
  [W, Ra, o == null ? void 0 : o.id, Sa, L]
84135
- ), Xs = useMemo(
84115
+ ), Zs = useMemo(
84136
84116
  () => h ? Color$3.fromCssColorString(h) : void 0,
84137
84117
  [h]
84138
- ), Wa = useMemo(() => P ? Color$3.fromCssColorString(P) : void 0, [P]), ea = useMemo(
84118
+ ), Xs = useMemo(() => P ? Color$3.fromCssColorString(P) : void 0, [P]), Wa = useMemo(
84139
84119
  () => y ? Color$3.fromCssColorString(y) : void 0,
84140
84120
  [y]
84141
84121
  );
84142
84122
  return useEffect(() => {
84143
- ai && mt.current.forEach((pd) => {
84144
- attachStyle(pd.raw, o, evalFeature, ai.clock.currentTime);
84123
+ ai && mt.current.forEach((ea) => {
84124
+ attachStyle(ea.raw, o, evalFeature, ai.clock.currentTime);
84145
84125
  });
84146
84126
  }, [o, ai]), useEffect(
84147
84127
  () => () => {
@@ -84158,12 +84138,12 @@ function Resource({
84158
84138
  show: !0,
84159
84139
  clampToGround: d,
84160
84140
  onChange: Vs,
84161
- onLoad: Zs,
84162
- stroke: Xs,
84163
- fill: Wa,
84141
+ onLoad: La,
84142
+ stroke: Zs,
84143
+ fill: Xs,
84164
84144
  strokeWidth: p,
84165
84145
  markerSize: S,
84166
- markerColor: ea
84146
+ markerColor: Wa
84167
84147
  }
84168
84148
  );
84169
84149
  }
@@ -93496,6 +93476,7 @@ const Cesium = ({
93496
93476
  onMouseEnter: pu.mouseEnter,
93497
93477
  onMouseLeave: pu.mouseLeave,
93498
93478
  onWheel: pu.wheel,
93479
+ automaticallyTrackDataSourceClocks: !1,
93499
93480
  children: [
93500
93481
  /* @__PURE__ */ jsxRuntimeExports.jsx(Event, { onMount: _f, onUnmount: al }),
93501
93482
  /* @__PURE__ */ jsxRuntimeExports.jsx(ReearthClock, { timelineManagerRef: J }),
@@ -93657,7 +93638,7 @@ function Error$1({ error: t, resetErrorBoundary: n }) {
93657
93638
  /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("button", { style: { color: "#fff" }, onClick: n, children: "Retry" }) })
93658
93639
  ] });
93659
93640
  }
93660
- const version = "0.0.7-alpha.51", useCoreAPI = ({ viewerProperty: t }) => {
93641
+ const version = "0.0.7-alpha.53", useCoreAPI = ({ viewerProperty: t }) => {
93661
93642
  const n = useRef(t);
93662
93643
  n.current = t;
93663
93644
  const o = useMemo(