ywana-core8 0.2.14 → 0.2.15

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/index.css CHANGED
@@ -15079,19 +15079,36 @@ li.selected,
15079
15079
  justify-content: space-between;
15080
15080
  margin-top: 20px;
15081
15081
  display: none !important;
15082
- }.image-viewer {
15082
+ }.image-viewer {
15083
15083
  display: flex;
15084
15084
  justify-content: center;
15085
15085
  align-items: center;
15086
+ width: 100%;
15087
+ height: 100%;
15088
+ overflow: hidden;
15089
+ }
15090
+
15091
+ .image-viewer canvas {
15092
+ cursor: grab;
15093
+ max-width: 100%;
15094
+ max-height: 100%;
15095
+ }
15096
+
15097
+ .image-viewer canvas:active {
15098
+ cursor: grabbing;
15086
15099
  }.viewer {
15100
+ position: fixed;
15101
+ top: 0;
15102
+ left: 0;
15087
15103
  width: 100vw;
15088
15104
  height: 100vh;
15089
- background-color: rgba(0, 0, 0, .75);
15105
+ background-color: rgba(0, 0, 0, .85);
15090
15106
  display: grid;
15091
15107
  grid-template-columns: 1fr auto;
15092
15108
  grid-template-rows: 4rem 1fr;
15093
15109
  grid-template-areas: "header aside" "main aside";
15094
15110
  color: #FFF;
15111
+ z-index: 1000;
15095
15112
  }
15096
15113
 
15097
15114
  .viewer>header {
@@ -15119,6 +15136,7 @@ li.selected,
15119
15136
 
15120
15137
  .viewer>main>.resizer {
15121
15138
  width: 100%;
15139
+ height: 100%;
15122
15140
  overflow: hidden;
15123
15141
  position: relative;
15124
15142
  display: flex;
@@ -15127,9 +15145,18 @@ li.selected,
15127
15145
  padding: 1rem;
15128
15146
  }
15129
15147
 
15130
- .viewer>main>.resizer img {
15148
+ .viewer>main>.resizer picture {
15131
15149
  width: 100%;
15132
- object-fit: fill;
15150
+ height: 100%;
15151
+ display: flex;
15152
+ justify-content: center;
15153
+ align-items: center;
15154
+ }
15155
+
15156
+ .viewer>main>.resizer img {
15157
+ max-width: 100%;
15158
+ max-height: 100%;
15159
+ object-fit: contain;
15133
15160
  }
15134
15161
 
15135
15162
  @media (min-width: 800px) {
@@ -15141,9 +15168,12 @@ li.selected,
15141
15168
 
15142
15169
  .viewer>aside {
15143
15170
  min-width: 22rem;
15171
+ max-width: 25rem;
15144
15172
  grid-area: aside;
15145
15173
  display: none;
15146
- background-color: rgb(50, 50, 50);
15174
+ background-color: rgba(40, 40, 40, 0.95);
15175
+ backdrop-filter: blur(10px);
15176
+ border-left: 1px solid rgba(255, 255, 255, 0.1);
15147
15177
  }
15148
15178
 
15149
15179
  .viewer>aside.open {
@@ -15152,22 +15182,40 @@ li.selected,
15152
15182
  flex-direction: column;
15153
15183
  }
15154
15184
 
15185
+ .viewer>aside main {
15186
+ flex: 1;
15187
+ overflow-y: auto;
15188
+ padding: 0;
15189
+ }
15190
+
15155
15191
  .viewer>aside .property>label {
15156
15192
  color: #AAA;
15157
15193
  }
15158
15194
 
15159
15195
  .viewer>footer {
15160
- width: 15rem;
15196
+ width: 12rem;
15161
15197
  position: absolute;
15162
- bottom: 1rem;
15163
- left: calc(50vw - 4rem);
15164
- border-radius: 3px;
15198
+ bottom: 2rem;
15199
+ left: calc(50vw - 6rem);
15200
+ border-radius: 8px;
15165
15201
  z-index: 100;
15166
15202
  display: flex;
15167
15203
  justify-content: space-between;
15168
15204
  align-items: center;
15169
- padding: .5rem;
15170
- background-color: rgba(0, 0, 0, .75);
15205
+ padding: 0.75rem 1rem;
15206
+ background-color: rgba(0, 0, 0, 0.8);
15207
+ backdrop-filter: blur(10px);
15208
+ border: 1px solid rgba(255, 255, 255, 0.1);
15209
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
15210
+ }
15211
+
15212
+ .viewer>footer .icon {
15213
+ transition: all 0.2s ease;
15214
+ }
15215
+
15216
+ .viewer>footer .icon:hover {
15217
+ transform: scale(1.1);
15218
+ color: #fff;
15171
15219
  }.kanban {
15172
15220
  background-color: var(--background-color);
15173
15221
  overflow-x: auto;
package/dist/index.js CHANGED
@@ -22634,26 +22634,38 @@ const LOGIN_CONTEXT = {
22634
22634
  const SCROLL_SENSITIVITY = 5e-4;
22635
22635
  const MAX_ZOOM = 5;
22636
22636
  const MIN_ZOOM = 0.1;
22637
- const ImageViewer = ({ image }) => {
22637
+ const ImageViewer = React.forwardRef(({ image }, ref2) => {
22638
22638
  const [offset2, setOffset] = React.useState({ x: 0, y: 0 });
22639
22639
  const [zoom, setZoom] = React.useState(1);
22640
- const [draggind, setDragging] = React.useState(false);
22640
+ const [dragging, setDragging] = React.useState(false);
22641
22641
  const touch = React.useRef({ x: 0, y: 0 });
22642
22642
  const canvasRef = React.useRef(null);
22643
22643
  const containerRef = React.useRef(null);
22644
22644
  const observer = React.useRef(null);
22645
22645
  const background = React.useMemo(() => new Image(), [image]);
22646
22646
  const clamp = (num, min2, max2) => Math.min(Math.max(num, min2), max2);
22647
+ React.useImperativeHandle(ref2, () => ({
22648
+ zoomIn: () => {
22649
+ setZoom((prevZoom) => clamp(prevZoom + 0.2, MIN_ZOOM, MAX_ZOOM));
22650
+ },
22651
+ zoomOut: () => {
22652
+ setZoom((prevZoom) => clamp(prevZoom - 0.2, MIN_ZOOM, MAX_ZOOM));
22653
+ },
22654
+ resetZoom: () => {
22655
+ setZoom(1);
22656
+ setOffset({ x: 0, y: 0 });
22657
+ }
22658
+ }), []);
22647
22659
  const handleWheel = (event) => {
22648
22660
  const { deltaY } = event;
22649
- if (!draggind) {
22661
+ if (!dragging) {
22650
22662
  setZoom(
22651
22663
  (zoom2) => clamp(zoom2 + deltaY * SCROLL_SENSITIVITY * -1, MIN_ZOOM, MAX_ZOOM)
22652
22664
  );
22653
22665
  }
22654
22666
  };
22655
22667
  const handleMouseMove = (event) => {
22656
- if (draggind) {
22668
+ if (dragging) {
22657
22669
  const { x, y } = touch.current;
22658
22670
  const { clientX, clientY } = event;
22659
22671
  setOffset({
@@ -22722,14 +22734,55 @@ const ImageViewer = ({ image }) => {
22722
22734
  ref: canvasRef
22723
22735
  }
22724
22736
  ));
22737
+ });
22738
+ const ViewerTest = () => {
22739
+ const [showViewer, setShowViewer] = React.useState(false);
22740
+ const sampleInfo = /* @__PURE__ */ React.createElement("div", { style: { padding: "1rem" } }, /* @__PURE__ */ React.createElement("h3", null, "Sample Image"), /* @__PURE__ */ React.createElement("p", null, /* @__PURE__ */ React.createElement("strong", null, "Size:"), " 1920x1080"), /* @__PURE__ */ React.createElement("p", null, /* @__PURE__ */ React.createElement("strong", null, "Format:"), " PNG"), /* @__PURE__ */ React.createElement("p", null, /* @__PURE__ */ React.createElement("strong", null, "Created:"), " 2024-01-15"));
22741
+ const sampleActions = [
22742
+ /* @__PURE__ */ React.createElement(Icon, { key: "download", icon: "download", clickable: true, title: "Download" }),
22743
+ /* @__PURE__ */ React.createElement(Icon, { key: "share", icon: "share", clickable: true, title: "Share" })
22744
+ ];
22745
+ return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("button", { onClick: () => setShowViewer(true) }, "Open Viewer Test"), showViewer && /* @__PURE__ */ React.createElement(
22746
+ Viewer,
22747
+ {
22748
+ title: "Sample Image",
22749
+ src: "https://concepto.de/wp-content/uploads/2015/03/paisaje-800x409.jpg",
22750
+ info: sampleInfo,
22751
+ actions: sampleActions,
22752
+ tools: true,
22753
+ onClose: () => setShowViewer(false)
22754
+ }
22755
+ ));
22725
22756
  };
22726
22757
  const Viewer = ({ title, src, info, actions = [], tools = false, onClose }) => {
22727
22758
  const [showDetails, setShowDetails] = React.useState(false);
22759
+ const [imageViewerRef, setImageViewerRef] = React.useState(null);
22728
22760
  function toggleDetails() {
22729
22761
  setShowDetails(!showDetails);
22730
22762
  }
22763
+ function handleZoomIn() {
22764
+ if (imageViewerRef && imageViewerRef.zoomIn) {
22765
+ imageViewerRef.zoomIn();
22766
+ }
22767
+ }
22768
+ function handleZoomOut() {
22769
+ if (imageViewerRef && imageViewerRef.zoomOut) {
22770
+ imageViewerRef.zoomOut();
22771
+ }
22772
+ }
22773
+ function handleZoomReset() {
22774
+ if (imageViewerRef && imageViewerRef.resetZoom) {
22775
+ imageViewerRef.resetZoom();
22776
+ }
22777
+ }
22731
22778
  const headerTitle = /* @__PURE__ */ React.createElement(Text, { use: "headline6" }, title);
22732
- return /* @__PURE__ */ React.createElement("div", { className: "viewer" }, /* @__PURE__ */ React.createElement(Header, { icon: "view", title: headerTitle }, onClose ? /* @__PURE__ */ React.createElement(Icon, { icon: "close", clickable: true, action: onClose }) : null, showDetails ? "" : /* @__PURE__ */ React.createElement(Icon, { icon: "info", clickable: true, action: toggleDetails }), actions), /* @__PURE__ */ React.createElement("main", null, /* @__PURE__ */ React.createElement("div", { className: "resizer" }, /* @__PURE__ */ React.createElement("picture", null, /* @__PURE__ */ React.createElement(ImageViewer, { image: src })))), /* @__PURE__ */ React.createElement("aside", { className: `${showDetails ? "open" : ""}` }, /* @__PURE__ */ React.createElement(Header, { title: "Detalles" }, /* @__PURE__ */ React.createElement(Icon, { icon: "close", clickable: true, action: toggleDetails })), /* @__PURE__ */ React.createElement("main", null, info)), tools ? /* @__PURE__ */ React.createElement("footer", null, /* @__PURE__ */ React.createElement(Icon, { clickable: true, icon: "zoom_out" }), /* @__PURE__ */ React.createElement(Icon, { clickable: true, icon: "zoom_out_map" }), /* @__PURE__ */ React.createElement(Icon, { clickable: true, icon: "zoom_in" })) : null);
22779
+ return /* @__PURE__ */ React.createElement("div", { className: "viewer" }, /* @__PURE__ */ React.createElement(Header, { icon: "view", title: headerTitle }, actions, !showDetails && /* @__PURE__ */ React.createElement(Icon, { icon: "info", clickable: true, action: toggleDetails }), onClose && /* @__PURE__ */ React.createElement(Icon, { icon: "close", clickable: true, action: onClose })), /* @__PURE__ */ React.createElement("main", null, /* @__PURE__ */ React.createElement("div", { className: "resizer" }, /* @__PURE__ */ React.createElement("picture", null, /* @__PURE__ */ React.createElement(
22780
+ ImageViewer,
22781
+ {
22782
+ image: src,
22783
+ ref: setImageViewerRef
22784
+ }
22785
+ )))), /* @__PURE__ */ React.createElement("aside", { className: `${showDetails ? "open" : ""}` }, /* @__PURE__ */ React.createElement(Header, { title: "Detalles" }, /* @__PURE__ */ React.createElement(Icon, { icon: "close", clickable: true, action: toggleDetails })), /* @__PURE__ */ React.createElement("main", null, info)), tools && /* @__PURE__ */ React.createElement("footer", null, /* @__PURE__ */ React.createElement(Icon, { clickable: true, icon: "zoom_out", action: handleZoomOut }), /* @__PURE__ */ React.createElement(Icon, { clickable: true, icon: "zoom_out_map", action: handleZoomReset }), /* @__PURE__ */ React.createElement(Icon, { clickable: true, icon: "zoom_in", action: handleZoomIn })));
22733
22786
  };
22734
22787
  const Kanban = ({ children }) => {
22735
22788
  const hasSwimlanes = React.useMemo(() => {
@@ -43033,6 +43086,7 @@ exports.MenuIcon = MenuIcon;
43033
43086
  exports.MenuItem = MenuItem;
43034
43087
  exports.MenuSeparator = MenuSeparator;
43035
43088
  exports.MonthCalendar = MonthCalendar;
43089
+ exports.MultiProgress = MultiProgress;
43036
43090
  exports.MultiSelector = MultiSelector;
43037
43091
  exports.Page = Page;
43038
43092
  exports.PageContext = PageContext;
@@ -43046,6 +43100,7 @@ exports.Planner2 = Planner2;
43046
43100
  exports.ProgressExamples = ProgressExamples;
43047
43101
  exports.Property = Property;
43048
43102
  exports.PropertyExamples = PropertyExamples;
43103
+ exports.RadialProgress = RadialProgress;
43049
43104
  exports.RadioButton = RadioButton;
43050
43105
  exports.RadioExamples = RadioExamples;
43051
43106
  exports.RadioGroup = RadioGroup;
@@ -43057,6 +43112,7 @@ exports.Site = Site;
43057
43112
  exports.SiteContext = SiteContext;
43058
43113
  exports.SiteProvider = SiteProvider;
43059
43114
  exports.Stack = Stack;
43115
+ exports.StepProgress = StepProgress;
43060
43116
  exports.Switch = Switch;
43061
43117
  exports.SwitchExamples = SwitchExamples;
43062
43118
  exports.TASK_STATES = TASK_STATES;
@@ -43101,6 +43157,7 @@ exports.UploadIcon = UploadIcon;
43101
43157
  exports.Uploader = Uploader;
43102
43158
  exports.View = View;
43103
43159
  exports.Viewer = Viewer;
43160
+ exports.ViewerTest = ViewerTest;
43104
43161
  exports.WaitScreen = WaitScreen;
43105
43162
  exports.Window = Window;
43106
43163
  exports.WindowManager = WindowManager;