@conboai/storybook.components 0.3.61 → 0.3.62

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.
@@ -14,6 +14,8 @@ export interface ImagePlayerProps {
14
14
  disabled?: boolean;
15
15
  sx?: SxProps;
16
16
  shapes: Shape[];
17
+ selectedShape?: Shape;
18
+ onShapeSelect?: (selectedShape: Shape | null, shapesList: Shape[]) => void;
17
19
  }
18
20
  declare const ImagePlayer: React.FC<ImagePlayerProps>;
19
21
  export default ImagePlayer;
@@ -97207,16 +97207,18 @@ const Dve = (e, t) => ({
97207
97207
  loading: o = !1,
97208
97208
  disabled: s = !1,
97209
97209
  shapes: a,
97210
- sx: l
97210
+ sx: l,
97211
+ selectedShape: c,
97212
+ onShapeSelect: u
97211
97213
  }) => {
97212
- const [c, u] = Ye(0), d = Ove(s), f = Lve(s), h = (p, w) => {
97213
- typeof w == "number" && u(w);
97214
+ const [d, f] = Ye(0), h = Ove(s), m = Lve(s), g = (C, y) => {
97215
+ typeof y == "number" && f(y);
97214
97216
  };
97215
97217
  Me(() => {
97216
- r && r(e[c]);
97217
- }, [c, r, e]);
97218
- const m = (p) => {
97219
- const w = {
97218
+ r && r(e[d]);
97219
+ }, [d, r, e]);
97220
+ const A = (C) => {
97221
+ const y = {
97220
97222
  year: "numeric",
97221
97223
  month: "long",
97222
97224
  day: "numeric",
@@ -97224,17 +97226,17 @@ const Dve = (e, t) => ({
97224
97226
  minute: "2-digit",
97225
97227
  second: "2-digit"
97226
97228
  };
97227
- return new Date(p).toLocaleDateString(void 0, w);
97228
- }, g = (p) => {
97229
- u((w) => {
97230
- const C = w + p;
97231
- return C < 0 ? 0 : C >= e.length ? e.length - 1 : C;
97229
+ return new Date(C).toLocaleDateString(void 0, y);
97230
+ }, p = (C) => {
97231
+ f((y) => {
97232
+ const D = y + C;
97233
+ return D < 0 ? 0 : D >= e.length ? e.length - 1 : D;
97232
97234
  });
97233
- }, A = {
97235
+ }, w = {
97234
97236
  ...Sve,
97235
97237
  ...l
97236
97238
  };
97237
- return /* @__PURE__ */ N.jsxs(Dt, { sx: A, children: [
97239
+ return /* @__PURE__ */ N.jsxs(Dt, { sx: w, children: [
97238
97240
  /* @__PURE__ */ N.jsxs(Dt, { sx: Fve, children: [
97239
97241
  /* @__PURE__ */ N.jsx(
97240
97242
  FO,
@@ -97244,13 +97246,15 @@ const Dve = (e, t) => ({
97244
97246
  menu: { show: !1 },
97245
97247
  showId: !1,
97246
97248
  showPoints: !1,
97249
+ selected: c,
97250
+ onShapeSelect: u,
97247
97251
  children: /* @__PURE__ */ N.jsx(
97248
97252
  Hh,
97249
97253
  {
97250
97254
  sx: { ...jve, objectFit: "contain" },
97251
97255
  component: "img",
97252
- image: e.length > 0 ? t(e[c]) : zve,
97253
- alt: e.length > 0 ? `Snapshot ${c}` : "No Data"
97256
+ image: e.length > 0 ? t(e[d]) : zve,
97257
+ alt: e.length > 0 ? `Snapshot ${d}` : "No Data"
97254
97258
  }
97255
97259
  )
97256
97260
  }
@@ -97259,21 +97263,21 @@ const Dve = (e, t) => ({
97259
97263
  ] }),
97260
97264
  /* @__PURE__ */ N.jsx(v1, { children: /* @__PURE__ */ N.jsxs(Dt, { sx: Tve, children: [
97261
97265
  /* @__PURE__ */ N.jsxs(Dt, { display: "flex", justifyContent: "space-between", children: [
97262
- /* @__PURE__ */ N.jsx(Xt, { variant: "body2", sx: f, children: e.length ? m(n(e[0])) : "Start time" }),
97263
- /* @__PURE__ */ N.jsx(Xt, { variant: "body2", sx: f, children: e.length ? m(n(e[c])) : "Current time" }),
97264
- /* @__PURE__ */ N.jsx(Xt, { variant: "body2", "aria-disabled": s, sx: f, children: e.length ? m(n(e[e.length - 1])) : "End time" })
97266
+ /* @__PURE__ */ N.jsx(Xt, { variant: "body2", sx: m, children: e.length ? A(n(e[0])) : "Start time" }),
97267
+ /* @__PURE__ */ N.jsx(Xt, { variant: "body2", sx: m, children: e.length ? A(n(e[d])) : "Current time" }),
97268
+ /* @__PURE__ */ N.jsx(Xt, { variant: "body2", "aria-disabled": s, sx: m, children: e.length ? A(n(e[e.length - 1])) : "End time" })
97265
97269
  ] }),
97266
97270
  /* @__PURE__ */ N.jsx(
97267
97271
  Tx,
97268
97272
  {
97269
97273
  disabled: s,
97270
- value: c,
97274
+ value: d,
97271
97275
  min: 0,
97272
97276
  max: e.length - 1,
97273
- onChange: h,
97277
+ onChange: g,
97274
97278
  "aria-labelledby": "image-slider",
97275
97279
  valueLabelDisplay: "auto",
97276
- valueLabelFormat: (p) => m(n(e[p]))
97280
+ valueLabelFormat: (C) => A(n(e[C]))
97277
97281
  }
97278
97282
  ),
97279
97283
  /* @__PURE__ */ N.jsxs(
@@ -97283,14 +97287,14 @@ const Dve = (e, t) => ({
97283
97287
  justifyContent: "center",
97284
97288
  alignItems: "center",
97285
97289
  mb: 2,
97286
- sx: d,
97290
+ sx: h,
97287
97291
  gap: "12px",
97288
97292
  children: [
97289
97293
  /* @__PURE__ */ N.jsxs(Dt, { display: "flex", gap: "12px", children: [
97290
97294
  /* @__PURE__ */ N.jsx(
97291
97295
  Mo,
97292
97296
  {
97293
- onClick: () => g(-10),
97297
+ onClick: () => p(-10),
97294
97298
  variant: "action",
97295
97299
  disabled: s || e.length === 0,
97296
97300
  children: /* @__PURE__ */ N.jsx(kve, {})
@@ -97299,7 +97303,7 @@ const Dve = (e, t) => ({
97299
97303
  /* @__PURE__ */ N.jsx(
97300
97304
  Mo,
97301
97305
  {
97302
- onClick: () => g(-1),
97306
+ onClick: () => p(-1),
97303
97307
  variant: "action",
97304
97308
  disabled: s || e.length === 0,
97305
97309
  children: /* @__PURE__ */ N.jsx(Mve, {})
@@ -97310,7 +97314,7 @@ const Dve = (e, t) => ({
97310
97314
  /* @__PURE__ */ N.jsx(
97311
97315
  Mo,
97312
97316
  {
97313
- onClick: () => g(1),
97317
+ onClick: () => p(1),
97314
97318
  variant: "action",
97315
97319
  disabled: s || e.length === 0,
97316
97320
  children: /* @__PURE__ */ N.jsx(Eve, {})
@@ -97319,7 +97323,7 @@ const Dve = (e, t) => ({
97319
97323
  /* @__PURE__ */ N.jsx(
97320
97324
  Mo,
97321
97325
  {
97322
- onClick: () => g(10),
97326
+ onClick: () => p(10),
97323
97327
  variant: "action",
97324
97328
  disabled: s || e.length === 0,
97325
97329
  children: /* @__PURE__ */ N.jsx(Ive, {})
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conboai/storybook.components",
3
- "version": "0.3.61",
3
+ "version": "0.3.62",
4
4
  "main": "dist/storybook.components.mjs",
5
5
  "types": "dist/build/index.d.ts",
6
6
  "files": [