baselode 0.1.19 → 0.1.21

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/style.css CHANGED
@@ -1 +1 @@
1
- .baselode-3d-controls{position:absolute;bottom:20px;left:20px;display:flex;gap:10px;flex-wrap:wrap;background:#ffffffe6;border:1px solid #e0e0e0;border-radius:10px;padding:10px;box-shadow:0 8px 24px #0000001a}.baselode-3d-controls .ghost-button,.baselode-3d-controls button{border:1px solid #d0d0d0;background:#fff;color:#333;cursor:pointer;transition:background .15s,border-color .15s}.baselode-3d-controls button:hover{background:#f2f2f2;border-color:silver}.baselode-3d-controls .ghost-button{padding:8px 12px;border-radius:8px}.baselode-3d-controls-checkbox{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:#333;cursor:pointer;-webkit-user-select:none;user-select:none;padding:0 4px}.bm-widget{display:flex;flex-direction:column;gap:8px;background:#fffffff2;border:1px solid #e0e0e0;border-radius:10px;padding:12px 14px;box-shadow:0 4px 16px #0000001a;min-width:200px;font-size:13px;color:#333}.bm-widget__label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:#666;margin-bottom:2px}.bm-widget__select{width:100%;padding:5px 8px;border:1px solid #d0d0d0;border-radius:6px;background:#fff;color:#333;font-size:13px;cursor:pointer}.bm-widget__select:focus{outline:none;border-color:#888}.bm-widget__scale{display:flex;align-items:center;gap:6px;margin:2px 0 4px}.bm-widget__scale-bar{flex:1;height:10px;border-radius:4px;background:linear-gradient(to right,#1919e6,#19e619,#e61919)}.bm-widget__scale-label{font-size:11px;color:#555;white-space:nowrap}.bm-widget__categories{display:flex;flex-wrap:wrap;gap:4px;margin:2px 0 4px}.bm-widget__category-chip{display:inline-block;padding:2px 8px;border-radius:10px;font-size:11px;color:#fff}.bm-widget__slider{width:100%;cursor:pointer;accent-color:#555}.bm-widget__popup{margin-top:4px;border:1px solid #ddd;border-radius:8px;overflow:hidden;background:#fff}.bm-widget__popup-header{display:flex;justify-content:space-between;align-items:center;padding:6px 10px;background:#f5f5f5;border-bottom:1px solid #e0e0e0;font-weight:600;font-size:12px}.bm-widget__popup-close{border:none;background:transparent;cursor:pointer;font-size:16px;line-height:1;color:#666;padding:0 4px}.bm-widget__popup-close:hover{color:#111}.bm-widget__popup-table{width:100%;border-collapse:collapse;font-size:12px}.bm-widget__popup-table th,.bm-widget__popup-table td{padding:4px 10px;border-bottom:1px solid #f0f0f0;text-align:left}.bm-widget__popup-table th{color:#555;font-weight:600;width:40%}.bm-widget__popup-table tr:last-child th,.bm-widget__popup-table tr:last-child td{border-bottom:none}.core-photo-table{display:flex;flex-direction:column;height:100%;overflow:hidden;background:#fff;font-family:inherit;font-size:12px;color:#1e293b}.core-photo-controls{display:flex;align-items:center;gap:8px;padding:6px 12px;background:#fff;border-bottom:1px solid #cbd5e1;flex-shrink:0;flex-wrap:wrap}.core-photo-hole-id{font-weight:600;letter-spacing:.04em;color:#0f172a;margin-right:4px}.core-photo-zoom-btn{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border:1px solid #94a3b8;border-radius:4px;background:#fff;color:#0f172a;font-size:16px;line-height:1;cursor:pointer;padding:0;transition:background .15s}.core-photo-zoom-btn:hover:not(:disabled){background:#e2e8f0}.core-photo-zoom-btn:disabled{opacity:.4;cursor:default}.core-photo-zoom-label{min-width:52px;text-align:center;color:#475569}.core-photo-col-headers{display:flex;flex-direction:row;flex-shrink:0;border-bottom:1px solid #cbd5e1;background:#fff}.core-photo-ruler-spacer{flex-shrink:0;width:64px;border-right:2px solid #334155}.core-photo-set-header{flex-shrink:0;padding:4px 8px;text-align:center;font-weight:600;color:#334155;letter-spacing:.05em;border-right:1px solid #cbd5e1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box}.core-photo-scroll{flex:1;overflow:hidden;cursor:grab;-webkit-user-select:none;user-select:none}.core-photo-scroll.is-dragging{cursor:grabbing}.core-photo-inner{display:flex;flex-direction:row;position:relative;min-width:min-content}.core-photo-depth-ruler{position:relative;flex-shrink:0;width:64px;border-right:2px solid #334155;background:#fff}.core-photo-depth-marker{position:absolute;left:0;width:60px;padding-right:6px;font-size:10px;text-align:right;color:#475569;transform:translateY(-50%);white-space:nowrap;pointer-events:none;line-height:1}.core-photo-depth-marker:after{content:"";position:absolute;right:-4px;top:50%;width:4px;height:1px;background:#94a3b8}.core-photo-col-body{position:relative;flex-shrink:0;border-right:1px solid #e2e8f0}.core-photo-item{position:absolute;box-sizing:border-box;border:1px solid rgba(0,0,0,.15);overflow:hidden;background:#fff}.core-photo-item img{display:block;width:100%;height:100%;object-fit:contain;object-position:left center}.core-photo-no-image{width:100%;height:100%;background:repeating-linear-gradient(-45deg,#fff,#fff 6px,#f1f5f9 6px,#f1f5f9 12px)}.core-photo-item-label{position:absolute;bottom:2px;left:2px;font-size:9px;background:#0000008c;color:#f8fafc;padding:1px 4px;border-radius:2px;pointer-events:none;white-space:nowrap;line-height:1.4}.core-photo-empty{flex:1;display:flex;align-items:center;justify-content:center;color:#94a3b8;font-size:14px}
1
+ .plot-card{display:flex;flex-direction:column}.plot-card__controls{flex-shrink:0;display:flex;gap:6px;flex-wrap:wrap}.plot-card__body{flex:1;min-height:0;display:flex}.plot-card.empty .plot-card__body{align-items:center;justify-content:center}.baselode-3d-controls{position:absolute;bottom:20px;left:20px;display:flex;gap:10px;flex-wrap:wrap;background:#ffffffe6;border:1px solid #e0e0e0;border-radius:10px;padding:10px;box-shadow:0 8px 24px #0000001a}.baselode-3d-controls .ghost-button,.baselode-3d-controls button{border:1px solid #d0d0d0;background:#fff;color:#333;cursor:pointer;transition:background .15s,border-color .15s}.baselode-3d-controls button:hover{background:#f2f2f2;border-color:silver}.baselode-3d-controls .ghost-button{padding:8px 12px;border-radius:8px}.baselode-3d-controls-checkbox{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:#333;cursor:pointer;-webkit-user-select:none;user-select:none;padding:0 4px}.bm-widget{display:flex;flex-direction:column;gap:8px;background:#fffffff2;border:1px solid #e0e0e0;border-radius:10px;padding:12px 14px;box-shadow:0 4px 16px #0000001a;min-width:200px;font-size:13px;color:#333}.bm-widget__label{font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:#666;margin-bottom:2px}.bm-widget__select{width:100%;padding:5px 8px;border:1px solid #d0d0d0;border-radius:6px;background:#fff;color:#333;font-size:13px;cursor:pointer}.bm-widget__select:focus{outline:none;border-color:#888}.bm-widget__scale{display:flex;align-items:center;gap:6px;margin:2px 0 4px}.bm-widget__scale-bar{flex:1;height:10px;border-radius:4px;background:linear-gradient(to right,#1919e6,#19e619,#e61919)}.bm-widget__scale-label{font-size:11px;color:#555;white-space:nowrap}.bm-widget__categories{display:flex;flex-wrap:wrap;gap:4px;margin:2px 0 4px}.bm-widget__category-chip{display:inline-block;padding:2px 8px;border-radius:10px;font-size:11px;color:#fff}.bm-widget__slider{width:100%;cursor:pointer;accent-color:#555}.bm-widget__popup{margin-top:4px;border:1px solid #ddd;border-radius:8px;overflow:hidden;background:#fff}.bm-widget__popup-header{display:flex;justify-content:space-between;align-items:center;padding:6px 10px;background:#f5f5f5;border-bottom:1px solid #e0e0e0;font-weight:600;font-size:12px}.bm-widget__popup-close{border:none;background:transparent;cursor:pointer;font-size:16px;line-height:1;color:#666;padding:0 4px}.bm-widget__popup-close:hover{color:#111}.bm-widget__popup-table{width:100%;border-collapse:collapse;font-size:12px}.bm-widget__popup-table th,.bm-widget__popup-table td{padding:4px 10px;border-bottom:1px solid #f0f0f0;text-align:left}.bm-widget__popup-table th{color:#555;font-weight:600;width:40%}.bm-widget__popup-table tr:last-child th,.bm-widget__popup-table tr:last-child td{border-bottom:none}.core-photo-table{display:flex;flex-direction:column;height:100%;overflow:hidden;background:#fff;font-family:inherit;font-size:12px;color:#1e293b}.core-photo-controls{display:flex;align-items:center;gap:8px;padding:6px 12px;background:#fff;border-bottom:1px solid #cbd5e1;flex-shrink:0;flex-wrap:wrap}.core-photo-hole-id{font-weight:600;letter-spacing:.04em;color:#0f172a;margin-right:4px}.core-photo-zoom-btn{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border:1px solid #94a3b8;border-radius:4px;background:#fff;color:#0f172a;font-size:16px;line-height:1;cursor:pointer;padding:0;transition:background .15s}.core-photo-zoom-btn:hover:not(:disabled){background:#e2e8f0}.core-photo-zoom-btn:disabled{opacity:.4;cursor:default}.core-photo-zoom-label{min-width:52px;text-align:center;color:#475569}.core-photo-col-headers{display:flex;flex-direction:row;flex-shrink:0;border-bottom:1px solid #cbd5e1;background:#fff}.core-photo-ruler-spacer{flex-shrink:0;width:64px;border-right:2px solid #334155}.core-photo-set-header{flex-shrink:0;padding:4px 8px;text-align:center;font-weight:600;color:#334155;letter-spacing:.05em;border-right:1px solid #cbd5e1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;box-sizing:border-box}.core-photo-scroll{flex:1;overflow:hidden;cursor:grab;-webkit-user-select:none;user-select:none}.core-photo-scroll.is-dragging{cursor:grabbing}.core-photo-inner{display:flex;flex-direction:row;position:relative;min-width:min-content}.core-photo-depth-ruler{position:relative;flex-shrink:0;width:64px;border-right:2px solid #334155;background:#fff}.core-photo-depth-marker{position:absolute;left:0;width:60px;padding-right:6px;font-size:10px;text-align:right;color:#475569;transform:translateY(-50%);white-space:nowrap;pointer-events:none;line-height:1}.core-photo-depth-marker:after{content:"";position:absolute;right:-4px;top:50%;width:4px;height:1px;background:#94a3b8}.core-photo-col-body{position:relative;flex-shrink:0;border-right:1px solid #e2e8f0}.core-photo-item{position:absolute;box-sizing:border-box;border:1px solid rgba(0,0,0,.15);overflow:hidden;background:#fff}.core-photo-item img{display:block;width:100%;height:100%;object-fit:contain;object-position:left center}.core-photo-no-image{width:100%;height:100%;background:repeating-linear-gradient(-45deg,#fff,#fff 6px,#f1f5f9 6px,#f1f5f9 12px)}.core-photo-item-label{position:absolute;bottom:2px;left:2px;font-size:9px;background:#0000008c;color:#f8fafc;padding:1px 4px;border-radius:2px;pointer-events:none;white-space:nowrap;line-height:1.4}.core-photo-empty{flex:1;display:flex;align-items:center;justify-content:center;color:#94a3b8;font-size:14px}
package/dist/tool-ui.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { z as t } from "zod";
2
2
  import { jsxs as w, jsx as c } from "react/jsx-runtime";
3
- import { useMemo as x, useState as J, useEffect as F, useRef as K } from "react";
4
- import H from "plotly.js-dist-min";
5
- import { r as ee, C as oe, c as te, i as R, k as q, an as W, o as le, l as ne, s as re, g as ie, Q as se, am as ae } from "./baselode3dScene-DbELmWnr.js";
6
- const pe = t.union([t.string(), t.number(), t.boolean(), t.null()]), v = t.record(t.string(), t.unknown()), Q = t.tuple([t.number(), t.number()]), de = t.object({
3
+ import { useMemo as x, useState as F, useEffect as V, useRef as H } from "react";
4
+ import Y from "plotly.js-dist-min";
5
+ import { s as ee, J as oe, c as te, j as R, l as Q, aH as W, o as le, m as ne, t as re, g as ie, U as se, aG as ae } from "./baselode3dScene-CLEvddGM.js";
6
+ const pe = t.union([t.string(), t.number(), t.boolean(), t.null()]), v = t.record(t.string(), t.unknown()), q = t.tuple([t.number(), t.number()]), de = t.object({
7
7
  id: t.string().optional(),
8
8
  property: t.string().min(1),
9
9
  label: t.string().optional(),
@@ -31,8 +31,8 @@ const pe = t.union([t.string(), t.number(), t.boolean(), t.null()]), v = t.recor
31
31
  allowPropertySelection: t.boolean().optional(),
32
32
  allowChartTypeSelection: t.boolean().optional(),
33
33
  showLegend: t.boolean().optional(),
34
- depthRange: Q.optional(),
35
- defaultDepthRange: Q.optional()
34
+ depthRange: q.optional(),
35
+ defaultDepthRange: q.optional()
36
36
  });
37
37
  function Le(o) {
38
38
  const e = ue.safeParse(o);
@@ -99,18 +99,18 @@ function ce(o) {
99
99
  "--baselode-tool-primary": o.primary || o.accent
100
100
  };
101
101
  }
102
- function C(o) {
102
+ function K(o) {
103
103
  return o === "baselode-dark" || o === "black" ? "baselode-dark" : "baselode";
104
104
  }
105
105
  function X(o) {
106
106
  return ce(
107
- C(o) === "baselode-dark" ? ee : oe
107
+ K(o) === "baselode-dark" ? ee : oe
108
108
  );
109
109
  }
110
110
  function be(o) {
111
111
  return o === "baselode-dark" ? re : o === "plotly-default" ? null : ie;
112
112
  }
113
- function G(o) {
113
+ function $(o) {
114
114
  if (!Array.isArray(o) || o.length !== 2) return null;
115
115
  const e = Number(o[0]), n = Number(o[1]);
116
116
  return !Number.isFinite(e) || !Number.isFinite(n) || e === n ? null : e < n ? [e, n] : [n, e];
@@ -123,9 +123,9 @@ function fe(o) {
123
123
  if (!o || typeof o != "object") return null;
124
124
  const e = o["yaxis.range"];
125
125
  if (Array.isArray(e) && e.length === 2)
126
- return G(e);
126
+ return $(e);
127
127
  const n = o["yaxis.range[0]"], i = o["yaxis.range[1]"];
128
- return n !== void 0 && i !== void 0 ? G([n, i]) : null;
128
+ return n !== void 0 && i !== void 0 ? $([n, i]) : null;
129
129
  }
130
130
  function Z(o, e) {
131
131
  return !!(o && o !== e);
@@ -136,7 +136,7 @@ function k(o, e) {
136
136
  const i = new Set(n);
137
137
  return e.filter((b) => i.has(b));
138
138
  }
139
- function Y(o, {
139
+ function C(o, {
140
140
  trackIndex: e = 0,
141
141
  selectableProperties: n,
142
142
  classified: i,
@@ -144,7 +144,7 @@ function Y(o, {
144
144
  allowChartTypeSelection: B,
145
145
  showLegend: p
146
146
  }) {
147
- const S = k(i, o.propertyOptions ?? n), d = S.includes(o.property) ? o.property : S[0] ?? o.property, m = i.byType[d] === R ? R : "numeric", a = o.chartType === "categorical" || o.displayType === R ? R : m, g = q(a).some((P) => P.value === o.chartType) ? o.chartType : W(a);
147
+ const S = k(i, o.propertyOptions ?? n), d = S.includes(o.property) ? o.property : S[0] ?? o.property, m = i.byType[d] === R ? R : "numeric", a = o.chartType === "categorical" || o.displayType === R ? R : m, g = Q(a).some((P) => P.value === o.chartType) ? o.chartType : W(a);
148
148
  return {
149
149
  ...o,
150
150
  id: o.id || `${d}-${e + 1}`,
@@ -186,7 +186,7 @@ function Se({
186
186
  onIntervalClick: S,
187
187
  onDepthRangeChange: d
188
188
  }) {
189
- const m = K(null), a = e.displayType === R || e.chartType === "categorical", u = x(
189
+ const m = H(null), a = e.displayType === R || e.chartType === "categorical", u = x(
190
190
  () => le(o, e.property, a),
191
191
  [o, a, e.property]
192
192
  ), g = x(() => {
@@ -206,10 +206,10 @@ function Se({
206
206
  () => e.showLegend && a ? ge(g.data) : [],
207
207
  [a, g.data, e.showLegend]
208
208
  ), N = x(
209
- () => q(e.displayType),
209
+ () => Q(e.displayType),
210
210
  [e.displayType]
211
211
  );
212
- return F(() => {
212
+ return V(() => {
213
213
  var r, j, _, f;
214
214
  const l = m.current;
215
215
  if (!l) return;
@@ -237,7 +237,7 @@ function Se({
237
237
  depthRange: h
238
238
  });
239
239
  };
240
- return (r = l.removeAllListeners) == null || r.call(l, "plotly_click"), (j = l.removeAllListeners) == null || j.call(l, "plotly_relayout"), H.react(
240
+ return (r = l.removeAllListeners) == null || r.call(l, "plotly_click"), (j = l.removeAllListeners) == null || j.call(l, "plotly_relayout"), Y.react(
241
241
  l,
242
242
  g.data,
243
243
  {
@@ -251,7 +251,7 @@ function Se({
251
251
  responsive: !0
252
252
  }
253
253
  ), S && ((_ = l.on) == null || _.call(l, "plotly_click", I)), d && ((f = l.on) == null || f.call(l, "plotly_relayout", E)), () => {
254
- H.purge(l);
254
+ Y.purge(l);
255
255
  };
256
256
  }, [
257
257
  n,
@@ -339,7 +339,7 @@ function Be({
339
339
  () => k(r, d),
340
340
  [r, d]
341
341
  ), _ = x(
342
- () => b.map((y, T) => Y(y, {
342
+ () => b.map((y, T) => C(y, {
343
343
  trackIndex: T,
344
344
  selectableProperties: j,
345
345
  classified: r,
@@ -348,21 +348,21 @@ function Be({
348
348
  showLegend: u
349
349
  })),
350
350
  [a, m, r, j, u, b]
351
- ), f = G(g), L = f ?? G(P), [h, A] = J(_), [z, O] = J(L);
352
- F(() => {
351
+ ), f = $(g), L = f ?? $(P), [h, A] = F(_), [z, O] = F(L);
352
+ V(() => {
353
353
  A(_);
354
- }, [_]), F(() => {
354
+ }, [_]), V(() => {
355
355
  f && O(f);
356
356
  }, [f == null ? void 0 : f[0], f == null ? void 0 : f[1]]);
357
357
  const U = f ?? z;
358
- function $(y) {
358
+ function J(y) {
359
359
  const T = h.map((s) => {
360
360
  if ((s.id || s.property) !== (y.id || y.property))
361
361
  return s;
362
- const V = y.property ?? s.property, D = r.byType[V] === R ? R : "numeric", M = Y({
362
+ const G = y.property ?? s.property, D = r.byType[G] === R ? R : "numeric", M = C({
363
363
  ...s,
364
364
  ...y,
365
- property: V,
365
+ property: G,
366
366
  displayType: y.chartType === "categorical" ? R : D,
367
367
  chartType: y.property && y.property !== s.property ? W(D) : y.chartType ?? s.chartType,
368
368
  label: Z(s.label, s.property) ? s.label : void 0
@@ -373,7 +373,7 @@ function Be({
373
373
  allowChartTypeSelection: a,
374
374
  showLegend: u
375
375
  });
376
- return l == null || l(M), V !== s.property && (N == null || N({
376
+ return l == null || l(M), G !== s.property && (N == null || N({
377
377
  trackId: M.id || M.property,
378
378
  property: M.property,
379
379
  displayType: M.displayType,
@@ -387,7 +387,7 @@ function Be({
387
387
  {
388
388
  className: "baselode-tool-strip-log",
389
389
  "data-tool-ui-id": o,
390
- "data-baselode-theme": C(p),
390
+ "data-baselode-theme": K(p),
391
391
  style: X(p),
392
392
  children: [
393
393
  /* @__PURE__ */ w("header", { className: "baselode-tool-strip-log__header", children: [
@@ -406,7 +406,7 @@ function Be({
406
406
  template: p,
407
407
  showModeBar: S,
408
408
  depthRange: U,
409
- onTrackChange: $,
409
+ onTrackChange: J,
410
410
  onIntervalClick: I,
411
411
  onDepthRangeChange: (T) => {
412
412
  !f && (T != null && T.depthRange) && O(T.depthRange), E == null || E(T);
@@ -432,15 +432,15 @@ function Pe({
432
432
  rasterOverlays: a = [],
433
433
  camera: u
434
434
  }) {
435
- const g = K(null), P = K(null), [N, l] = J("");
436
- return F(() => {
435
+ const g = H(null), P = H(null), [N, l] = F("");
436
+ return V(() => {
437
437
  const I = g.current;
438
438
  if (!I) return;
439
439
  let E = !1;
440
440
  const r = new se();
441
441
  P.current = r;
442
442
  async function j() {
443
- var f, L, h, A, z, O, U, $, y, T;
443
+ var f, L, h, A, z, O, U, J, y, T;
444
444
  try {
445
445
  l(""), r.init(I), r.setBackground(b), r.setControlMode(B);
446
446
  const s = (p == null ? void 0 : p.holes) || [];
@@ -454,10 +454,10 @@ function Pe({
454
454
  m.stats || {},
455
455
  m.options || {}
456
456
  );
457
- for (const V of a) {
458
- const D = await ae(V);
457
+ for (const G of a) {
458
+ const D = await ae(G);
459
459
  if (E) {
460
- (z = (A = (h = D.mesh) == null ? void 0 : h.geometry) == null ? void 0 : A.dispose) == null || z.call(A), ($ = (U = (O = D.mesh) == null ? void 0 : O.material) == null ? void 0 : U.dispose) == null || $.call(U), (T = (y = D.texture) == null ? void 0 : y.dispose) == null || T.call(y);
460
+ (z = (A = (h = D.mesh) == null ? void 0 : h.geometry) == null ? void 0 : A.dispose) == null || z.call(A), (J = (U = (O = D.mesh) == null ? void 0 : O.material) == null ? void 0 : U.dispose) == null || J.call(U), (T = (y = D.texture) == null ? void 0 : y.dispose) == null || T.call(y);
461
461
  return;
462
462
  }
463
463
  r.addRasterOverlay(D);
@@ -486,7 +486,7 @@ function Pe({
486
486
  {
487
487
  className: "baselode-tool-3d-scene",
488
488
  "data-tool-ui-id": o,
489
- "data-baselode-theme": C(b),
489
+ "data-baselode-theme": K(b),
490
490
  style: X(b),
491
491
  children: [
492
492
  (e || n) && /* @__PURE__ */ w("header", { className: "baselode-tool-3d-scene__header", children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baselode",
3
- "version": "0.1.19",
3
+ "version": "0.1.21",
4
4
  "description": "Geoscience drillhole data processing and visualization toolkit",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "repository": {