@elmethis/qwik 0.0.30 → 0.0.32

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.
@@ -2200,24 +2200,30 @@ const ElmSquareLoadingIcon = qwik.component$(({ size = "3rem", dimensions = 4 })
2200
2200
  }, `${rowIndex}-${columnIndex}`)))
2201
2201
  });
2202
2202
  });
2203
- const image$1 = "_image_sf1wj_12";
2204
- const fallback = "_fallback_sf1wj_34";
2203
+ const image$1 = "_image_9cxd1_12";
2204
+ const fallback = "_fallback_9cxd1_36";
2205
2205
  const styles$h = {
2206
- "block-image": "_block-image_sf1wj_1",
2207
- "image-container": "_image-container_sf1wj_12",
2206
+ "block-image": "_block-image_9cxd1_1",
2207
+ "image-container": "_image-container_9cxd1_12",
2208
2208
  image: image$1,
2209
2209
  fallback,
2210
- "caption-box": "_caption-box_sf1wj_44",
2211
- "modal-container": "_modal-container_sf1wj_56"
2210
+ "caption-box": "_caption-box_9cxd1_46",
2211
+ "modal-container": "_modal-container_9cxd1_58"
2212
2212
  };
2213
2213
  const ElmBlockImage = qwik.component$(({ src, alt, caption: caption2, width, height, enableModal = true, srcset, sizes, style }) => {
2214
2214
  const isLoading = qwik.useSignal(true);
2215
2215
  const isShowModal = qwik.useSignal(false);
2216
+ const modalRef = qwik.useSignal();
2216
2217
  const handleImageLoad = qwik.$(() => {
2217
2218
  isLoading.value = false;
2218
2219
  });
2219
2220
  const handleToggleModal = qwik.$(() => {
2220
2221
  if (enableModal && !isLoading.value) {
2222
+ if (isShowModal.value) {
2223
+ modalRef.value?.hidePopover();
2224
+ } else {
2225
+ modalRef.value?.showPopover();
2226
+ }
2221
2227
  isShowModal.value = !isShowModal.value;
2222
2228
  }
2223
2229
  });
@@ -2237,12 +2243,10 @@ const ElmBlockImage = qwik.component$(({ src, alt, caption: caption2, width, hei
2237
2243
  }
2238
2244
  });
2239
2245
  const Modal = /* @__PURE__ */ jsxRuntime.jsx("div", {
2246
+ ref: modalRef,
2240
2247
  class: styles$h["modal-container"],
2241
- style: {
2242
- pointerEvents: isShowModal.value ? "auto" : "none",
2243
- "--opacity": isShowModal.value ? 1 : 0
2244
- },
2245
2248
  onClick$: handleToggleModal,
2249
+ popover: "manual",
2246
2250
  children: ImageComponent
2247
2251
  });
2248
2252
  return /* @__PURE__ */ jsxRuntime.jsxs("figure", {
@@ -3224,13 +3228,14 @@ const renderByToken = (tokens) => {
3224
3228
  }
3225
3229
  return results;
3226
3230
  };
3227
- const ElmMarkdown = qwik.component$(({ markdown }) => {
3231
+ const ElmMarkdown = qwik.component$(({ markdown, style }) => {
3228
3232
  const tokens = marked.marked.setOptions({
3229
3233
  gfm: true
3230
3234
  }).lexer(markdown);
3231
3235
  const elements = renderByToken(tokens);
3232
3236
  return /* @__PURE__ */ jsxRuntime.jsx("div", {
3233
3237
  class: styles["markdown-body"],
3238
+ style,
3234
3239
  children: elements
3235
3240
  });
3236
3241
  });
@@ -2198,24 +2198,30 @@ const ElmSquareLoadingIcon = component$(({ size = "3rem", dimensions = 4 }) => {
2198
2198
  }, `${rowIndex}-${columnIndex}`)))
2199
2199
  });
2200
2200
  });
2201
- const image$1 = "_image_sf1wj_12";
2202
- const fallback = "_fallback_sf1wj_34";
2201
+ const image$1 = "_image_9cxd1_12";
2202
+ const fallback = "_fallback_9cxd1_36";
2203
2203
  const styles$h = {
2204
- "block-image": "_block-image_sf1wj_1",
2205
- "image-container": "_image-container_sf1wj_12",
2204
+ "block-image": "_block-image_9cxd1_1",
2205
+ "image-container": "_image-container_9cxd1_12",
2206
2206
  image: image$1,
2207
2207
  fallback,
2208
- "caption-box": "_caption-box_sf1wj_44",
2209
- "modal-container": "_modal-container_sf1wj_56"
2208
+ "caption-box": "_caption-box_9cxd1_46",
2209
+ "modal-container": "_modal-container_9cxd1_58"
2210
2210
  };
2211
2211
  const ElmBlockImage = component$(({ src, alt, caption: caption2, width, height, enableModal = true, srcset, sizes, style }) => {
2212
2212
  const isLoading = useSignal(true);
2213
2213
  const isShowModal = useSignal(false);
2214
+ const modalRef = useSignal();
2214
2215
  const handleImageLoad = $(() => {
2215
2216
  isLoading.value = false;
2216
2217
  });
2217
2218
  const handleToggleModal = $(() => {
2218
2219
  if (enableModal && !isLoading.value) {
2220
+ if (isShowModal.value) {
2221
+ modalRef.value?.hidePopover();
2222
+ } else {
2223
+ modalRef.value?.showPopover();
2224
+ }
2219
2225
  isShowModal.value = !isShowModal.value;
2220
2226
  }
2221
2227
  });
@@ -2235,12 +2241,10 @@ const ElmBlockImage = component$(({ src, alt, caption: caption2, width, height,
2235
2241
  }
2236
2242
  });
2237
2243
  const Modal = /* @__PURE__ */ jsx("div", {
2244
+ ref: modalRef,
2238
2245
  class: styles$h["modal-container"],
2239
- style: {
2240
- pointerEvents: isShowModal.value ? "auto" : "none",
2241
- "--opacity": isShowModal.value ? 1 : 0
2242
- },
2243
2246
  onClick$: handleToggleModal,
2247
+ popover: "manual",
2244
2248
  children: ImageComponent
2245
2249
  });
2246
2250
  return /* @__PURE__ */ jsxs("figure", {
@@ -3222,13 +3226,14 @@ const renderByToken = (tokens) => {
3222
3226
  }
3223
3227
  return results;
3224
3228
  };
3225
- const ElmMarkdown = component$(({ markdown }) => {
3229
+ const ElmMarkdown = component$(({ markdown, style }) => {
3226
3230
  const tokens = marked.setOptions({
3227
3231
  gfm: true
3228
3232
  }).lexer(markdown);
3229
3233
  const elements = renderByToken(tokens);
3230
3234
  return /* @__PURE__ */ jsx("div", {
3231
3235
  class: styles["markdown-body"],
3236
+ style,
3232
3237
  children: elements
3233
3238
  });
3234
3239
  });
package/lib/style.css CHANGED
@@ -995,7 +995,7 @@
995
995
  }
996
996
  [data-theme=dark] ._square_13xd3_24 {
997
997
  background-color: #b0b5be;
998
- }._block-image_sf1wj_1 {
998
+ }._block-image_9cxd1_1 {
999
999
  margin-block: var(--margin-block, 0);
1000
1000
  margin-inline: 0;
1001
1001
  display: flex;
@@ -1006,29 +1006,31 @@
1006
1006
  width: 100%;
1007
1007
  }
1008
1008
 
1009
- ._image-container_sf1wj_12 {
1009
+ ._image-container_9cxd1_12 {
1010
1010
  width: 100%;
1011
1011
  height: 100%;
1012
1012
  position: relative;
1013
+
1013
1014
  display: flex;
1014
1015
  justify-content: center;
1015
1016
  align-items: center;
1016
1017
  }
1017
1018
 
1018
- ._image_sf1wj_12 {
1019
+ ._image_9cxd1_12 {
1019
1020
  max-width: 100%;
1020
1021
  max-height: min(100%, 100vh);
1021
1022
  height: auto;
1022
1023
  border-radius: 0.25rem;
1023
- box-shadow: 0 0 0.125rem rgba(0, 0, 0, 0.1);
1024
+ box-shadow: 0 0 0.125rem oklch(from black l c h / 0.1);
1024
1025
  transition: opacity 400ms;
1025
1026
  opacity: var(--opacity, 1);
1026
1027
  user-select: none;
1027
1028
  aspect-ratio: var(--aspect-ratio, auto);
1029
+
1028
1030
  cursor: var(--cursor);
1029
1031
  }
1030
1032
 
1031
- ._fallback_sf1wj_34 {
1033
+ ._fallback_9cxd1_36 {
1032
1034
  width: 100%;
1033
1035
  height: 100%;
1034
1036
  inset: 0 0 auto auto;
@@ -1038,7 +1040,7 @@
1038
1040
  pointer-events: none;
1039
1041
  }
1040
1042
 
1041
- ._caption-box_sf1wj_44 {
1043
+ ._caption-box_9cxd1_46 {
1042
1044
  box-sizing: border-box;
1043
1045
  padding: 0rem 1rem;
1044
1046
  display: flex;
@@ -1050,20 +1052,53 @@
1050
1052
  transition: opacity 400ms;
1051
1053
  }
1052
1054
 
1053
- ._modal-container_sf1wj_56 {
1054
- width: 100vw;
1055
- height: 100vh;
1056
- display: flex;
1057
- justify-content: center;
1058
- align-items: center;
1059
- position: fixed;
1060
- inset: 0 0 auto auto;
1061
- z-index: 100;
1062
- background-color: rgba(35, 38, 42, 0.8);
1063
- cursor: zoom-out;
1064
- opacity: var(--opacity, 1);
1065
- transition: opacity 200ms;
1066
- }._file_eqa3m_1 {
1055
+ ._modal-container_9cxd1_58 {
1056
+ opacity: 0;
1057
+ transform: scale(0.95);
1058
+ background-color: transparent;
1059
+ border: none;
1060
+ padding: 0;
1061
+ margin: auto;
1062
+ pointer-events: none;
1063
+ transition:
1064
+ opacity 200ms,
1065
+ transform 200ms,
1066
+ display 200ms allow-discrete,
1067
+ overlay 200ms allow-discrete;
1068
+
1069
+ &::backdrop {
1070
+ background-color: oklch(from #23262a l c h / 0.8);
1071
+ opacity: 0;
1072
+
1073
+ transition:
1074
+ background-color 200ms,
1075
+ opacity 200ms,
1076
+ display 200ms allow-discrete,
1077
+ overlay 200ms allow-discrete;
1078
+ }
1079
+
1080
+ &:popover-open {
1081
+ opacity: 1;
1082
+ transform: scale(1);
1083
+ pointer-events: auto;
1084
+
1085
+ &::backdrop {
1086
+ opacity: 1;
1087
+ }
1088
+ }
1089
+ }
1090
+
1091
+ @starting-style {
1092
+ ._modal-container_9cxd1_58:popover-open {
1093
+ opacity: 0;
1094
+ transform: scale(0.95);
1095
+
1096
+ &::backdrop {
1097
+ opacity: 0;
1098
+ }
1099
+ }
1100
+ }
1101
+ ._file_eqa3m_1 {
1067
1102
  margin-block: var(--margin-block, 0);
1068
1103
  padding: 1rem;
1069
1104
  display: grid;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elmethis/qwik",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },