@elmethis/react 0.2.4 → 0.2.6

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.
@@ -1,15 +1,3 @@
1
- (function() {
2
- "use strict";
3
- try {
4
- if (typeof document != "undefined") {
5
- var elementStyle = document.createElement("style");
6
- elementStyle.appendChild(document.createTextNode("._icon_19g82_1{margin:0;padding:0;display:inline-block;vertical-align:middle;height:1em}._icon_19g82_1::-moz-selection{filter:brightness(1000%);background-color:#00000040;background-color:var(--color, rgba(0, 0, 0, .25))}._icon_19g82_1::selection{filter:brightness(1000%);background-color:#00000040;background-color:var(--color, rgba(0, 0, 0, .25))}[data-theme=dark] ._icon_19g82_1{color:#ffffffb3;color:var(--color, rgba(255, 255, 255, .7))}[data-theme=dark] ._icon_19g82_1::-moz-selection{color:#000000b3;background-color:#ffffff40;background-color:var(--color, rgba(255, 255, 255, .25))}[data-theme=dark] ._icon_19g82_1::selection{color:#000000b3;background-color:#ffffff40;background-color:var(--color, rgba(255, 255, 255, .25))}"));
7
- document.head.appendChild(elementStyle);
8
- }
9
- } catch (e) {
10
- console.error("vite-plugin-css-injected-by-js", e);
11
- }
12
- })();
13
1
  const icon = "_icon_19g82_1";
14
2
  const style = {
15
3
  icon
@@ -1,15 +1,3 @@
1
- (function() {
2
- "use strict";
3
- try {
4
- if (typeof document != "undefined") {
5
- var elementStyle = document.createElement("style");
6
- elementStyle.appendChild(document.createTextNode("._icon_67eyp_1{fill:#555b67;fill:var(--color, #555b67);transition:fill .2s;flex-shrink:0}[data-theme=dark] ._icon_67eyp_1{fill:#b0b5be;fill:var(--dark-color, #b0b5be)}"));
7
- document.head.appendChild(elementStyle);
8
- }
9
- } catch (e) {
10
- console.error("vite-plugin-css-injected-by-js", e);
11
- }
12
- })();
13
1
  const icon = "_icon_67eyp_1";
14
2
  const style = {
15
3
  icon
@@ -1,15 +1,3 @@
1
- (function() {
2
- "use strict";
3
- try {
4
- if (typeof document != "undefined") {
5
- var elementStyle = document.createElement("style");
6
- elementStyle.appendChild(document.createTextNode('@charset "UTF-8";.fade-enter{opacity:0}.fade-enter-active{opacity:1;transition:opacity .3s}.fade-exit{opacity:1}.fade-exit-active{opacity:0;transition:opacity .3s}'));
7
- document.head.appendChild(elementStyle);
8
- }
9
- } catch (e) {
10
- console.error("vite-plugin-css-injected-by-js", e);
11
- }
12
- })();
13
1
  "use client";
14
2
  import { j as jsxRuntimeExports } from "../../_virtual/jsx-runtime.mjs";
15
3
  import { c as compilerRuntimeExports } from "../../_virtual/compiler-runtime.mjs";
@@ -18,10 +6,13 @@ import style from "./ElmImage.module.scss.mjs";
18
6
  import { ElmInlineText } from "../typography/ElmInlineText.mjs";
19
7
  import { mdiTooltipImage } from "@mdi/js";
20
8
  import { ElmMdiIcon } from "../icon/ElmMdiIcon.mjs";
21
- import { CSSTransition } from "react-transition-group";
22
-
9
+ import { config, CSSTransition } from "react-transition-group";
10
+ /* empty css */
11
+ if (typeof window === "undefined") {
12
+ config.disabled = true;
13
+ }
23
14
  const ElmImage = (t0) => {
24
- const $ = compilerRuntimeExports.c(37);
15
+ const $ = compilerRuntimeExports.c(35);
25
16
  let alt;
26
17
  let args;
27
18
  let block;
@@ -55,111 +46,108 @@ const ElmImage = (t0) => {
55
46
  const enableModal = t1 === void 0 ? false : t1;
56
47
  const nodeRef = useRef(null);
57
48
  const [isShowModal, setIsShowModal] = useState(false);
58
- const [isMounted, setIsMounted] = useState(false);
59
49
  let t2;
60
- let t3;
61
50
  if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
62
- t2 = () => {
63
- setIsMounted(true);
64
- };
65
- t3 = [];
51
+ t2 = [];
66
52
  $[7] = t2;
67
- $[8] = t3;
68
53
  } else {
69
54
  t2 = $[7];
70
- t3 = $[8];
71
55
  }
72
- useEffect(t2, t3);
73
- let t4;
74
- if ($[9] !== enableModal || $[10] !== isShowModal) {
75
- t4 = () => {
56
+ useEffect(_temp, t2);
57
+ let t3;
58
+ if ($[8] !== enableModal || $[9] !== isShowModal) {
59
+ t3 = () => {
76
60
  if (enableModal) {
77
61
  setIsShowModal(!isShowModal);
78
62
  }
79
63
  };
80
- $[9] = enableModal;
81
- $[10] = isShowModal;
82
- $[11] = t4;
64
+ $[8] = enableModal;
65
+ $[9] = isShowModal;
66
+ $[10] = t3;
83
67
  } else {
84
- t4 = $[11];
68
+ t3 = $[10];
85
69
  }
86
- const handleClick = t4;
87
- const t5 = enableModal && !isShowModal ? "zoom-in" : "unset";
88
- let t6;
89
- if ($[12] !== t5) {
90
- t6 = {
91
- cursor: t5
70
+ const handleClick = t3;
71
+ const t4 = enableModal && !isShowModal ? "zoom-in" : "unset";
72
+ let t5;
73
+ if ($[11] !== t4) {
74
+ t5 = {
75
+ cursor: t4
92
76
  };
77
+ $[11] = t4;
93
78
  $[12] = t5;
94
- $[13] = t6;
95
79
  } else {
96
- t6 = $[13];
80
+ t5 = $[12];
97
81
  }
98
- let t7;
99
- if ($[14] !== alt || $[15] !== args || $[16] !== handleClick || $[17] !== src || $[18] !== t6) {
100
- t7 = /* @__PURE__ */ jsxRuntimeExports.jsx("img", { className: style.image, src, alt, style: t6, ...args, onClick: handleClick });
101
- $[14] = alt;
102
- $[15] = args;
103
- $[16] = handleClick;
104
- $[17] = src;
82
+ let t6;
83
+ if ($[13] !== alt || $[14] !== args || $[15] !== handleClick || $[16] !== src || $[17] !== t5) {
84
+ t6 = /* @__PURE__ */ jsxRuntimeExports.jsx("img", { className: style.image, src, alt, style: t5, ...args, onClick: handleClick });
85
+ $[13] = alt;
86
+ $[14] = args;
87
+ $[15] = handleClick;
88
+ $[16] = src;
89
+ $[17] = t5;
105
90
  $[18] = t6;
106
- $[19] = t7;
107
91
  } else {
108
- t7 = $[19];
92
+ t6 = $[18];
109
93
  }
110
- const image = t7;
111
- let t8;
112
- if ($[20] !== margin) {
113
- t8 = {
94
+ const image = t6;
95
+ let t7;
96
+ if ($[19] !== margin) {
97
+ t7 = {
114
98
  marginBlock: margin
115
99
  };
116
- $[20] = margin;
117
- $[21] = t8;
100
+ $[19] = margin;
101
+ $[20] = t7;
118
102
  } else {
119
- t8 = $[21];
103
+ t7 = $[20];
120
104
  }
121
- let t9;
122
- if ($[22] !== alt || $[23] !== block) {
123
- t9 = alt && block && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: style.caption, children: [
105
+ let t8;
106
+ if ($[21] !== alt || $[22] !== block) {
107
+ t8 = alt && block && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: style.caption, children: [
124
108
  /* @__PURE__ */ jsxRuntimeExports.jsx(ElmMdiIcon, { d: mdiTooltipImage, color: "#bfa056", size: "1.25rem" }),
125
109
  /* @__PURE__ */ jsxRuntimeExports.jsx(ElmInlineText, { text: alt })
126
110
  ] });
127
- $[22] = alt;
128
- $[23] = block;
129
- $[24] = t9;
111
+ $[21] = alt;
112
+ $[22] = block;
113
+ $[23] = t8;
130
114
  } else {
131
- t9 = $[24];
115
+ t8 = $[23];
132
116
  }
133
- let t10;
134
- if ($[25] !== enableModal || $[26] !== handleClick || $[27] !== image || $[28] !== isMounted || $[29] !== isShowModal) {
135
- t10 = isMounted && enableModal && /* @__PURE__ */ jsxRuntimeExports.jsx(CSSTransition, { classNames: "fade", in: isShowModal, timeout: 300, unmountOnExit: true, nodeRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: style.modal, onClick: handleClick, ref: nodeRef, children: image }) });
136
- $[25] = enableModal;
137
- $[26] = handleClick;
138
- $[27] = image;
139
- $[28] = isMounted;
140
- $[29] = isShowModal;
141
- $[30] = t10;
117
+ let t9;
118
+ if ($[24] !== enableModal || $[25] !== handleClick || $[26] !== image || $[27] !== isShowModal) {
119
+ t9 = enableModal && /* @__PURE__ */ jsxRuntimeExports.jsx(CSSTransition, { classNames: "fade", in: isShowModal, timeout: 300, unmountOnExit: true, nodeRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: style.modal, onClick: handleClick, ref: nodeRef, children: image }) });
120
+ $[24] = enableModal;
121
+ $[25] = handleClick;
122
+ $[26] = image;
123
+ $[27] = isShowModal;
124
+ $[28] = t9;
142
125
  } else {
143
- t10 = $[30];
126
+ t9 = $[28];
144
127
  }
145
- let t11;
146
- if ($[31] !== args || $[32] !== image || $[33] !== t10 || $[34] !== t8 || $[35] !== t9) {
147
- t11 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: t8, ...args, children: [
128
+ let t10;
129
+ if ($[29] !== args || $[30] !== image || $[31] !== t7 || $[32] !== t8 || $[33] !== t9) {
130
+ t10 = /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: t7, ...args, children: [
148
131
  image,
149
- t9,
150
- t10
132
+ t8,
133
+ t9
151
134
  ] });
152
- $[31] = args;
153
- $[32] = image;
154
- $[33] = t10;
155
- $[34] = t8;
156
- $[35] = t9;
157
- $[36] = t11;
135
+ $[29] = args;
136
+ $[30] = image;
137
+ $[31] = t7;
138
+ $[32] = t8;
139
+ $[33] = t9;
140
+ $[34] = t10;
158
141
  } else {
159
- t11 = $[36];
142
+ t10 = $[34];
160
143
  }
161
- return t11;
144
+ return t10;
162
145
  };
146
+ function _temp() {
147
+ if (typeof window === "undefined") {
148
+ config.disabled = false;
149
+ }
150
+ }
163
151
  export {
164
152
  ElmImage
165
153
  };
@@ -1,15 +1,3 @@
1
- (function() {
2
- "use strict";
3
- try {
4
- if (typeof document != "undefined") {
5
- var elementStyle = document.createElement("style");
6
- elementStyle.appendChild(document.createTextNode("._image_z5fgk_1{width:100%}._block-image_z5fgk_5{border-radius:.25rem;box-shadow:0 0 .125rem #000}._caption_z5fgk_10{margin-block:.5rem;display:flex;justify-content:center;align-items:center;gap:.5rem}._modal_z5fgk_18{position:fixed;z-index:10000;top:0;left:0;width:100%;height:100%;display:flex;justify-self:center;align-items:center;background-color:#3e434bcc;cursor:zoom-out}"));
7
- document.head.appendChild(elementStyle);
8
- }
9
- } catch (e) {
10
- console.error("vite-plugin-css-injected-by-js", e);
11
- }
12
- })();
13
1
  const image = "_image_z5fgk_1";
14
2
  const caption = "_caption_z5fgk_10";
15
3
  const modal = "_modal_z5fgk_18";
@@ -1,15 +1,3 @@
1
- (function() {
2
- "use strict";
3
- try {
4
- if (typeof document != "undefined") {
5
- var elementStyle = document.createElement("style");
6
- elementStyle.appendChild(document.createTextNode("._blockquote_1msat_1{box-sizing:border-box;padding:.5rem 2rem;background-color:#e3e5e7;border-left:4px solid #606875}[data-theme=dark] ._blockquote_1msat_1{background-color:#3e434b;border-color:#b0b5be}._blockquote_1msat_1 a{all:unset;cursor:pointer;transition:color .1s}._blockquote_1msat_1 a:hover{color:#5879b0}._blockquote_1msat_1 cite{display:block;margin-block:1rem;text-align:right}"));
7
- document.head.appendChild(elementStyle);
8
- }
9
- } catch (e) {
10
- console.error("vite-plugin-css-injected-by-js", e);
11
- }
12
- })();
13
1
  const blockquote = "_blockquote_1msat_1";
14
2
  const style = {
15
3
  blockquote
@@ -1,15 +1,3 @@
1
- (function() {
2
- "use strict";
3
- try {
4
- if (typeof document != "undefined") {
5
- var elementStyle = document.createElement("style");
6
- elementStyle.appendChild(document.createTextNode('._callout_pqkj1_1{box-sizing:border-box;padding:1rem 1rem 1rem 1.5rem;position:relative}._callout_pqkj1_1:after{position:absolute;content:"";top:0;left:0;width:4px;height:100%;background-color:var(--callout-color);z-index:-1}._callout_pqkj1_1:before{position:absolute;content:"";top:0;left:0;width:100%;height:100%;background-color:var(--callout-color);opacity:.15;z-index:-1}._header_pqkj1_28{display:flex;justify-content:flex-start;align-items:center;gap:.5rem;margin-block-end:.5rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}'));
7
- document.head.appendChild(elementStyle);
8
- }
9
- } catch (e) {
10
- console.error("vite-plugin-css-injected-by-js", e);
11
- }
12
- })();
13
1
  const callout = "_callout_pqkj1_1";
14
2
  const header = "_header_pqkj1_28";
15
3
  const style = {
@@ -1,15 +1,3 @@
1
- (function() {
2
- "use strict";
3
- try {
4
- if (typeof document != "undefined") {
5
- var elementStyle = document.createElement("style");
6
- elementStyle.appendChild(document.createTextNode('._base_ctq5w_1{background-color:var(--background-color)}._underline_ctq5w_5{text-decoration:underline}._link_ctq5w_9{all:unset;box-sizing:border-box;padding:0 .25rem;font-size:var(--font-size);display:inline-flex;align-items:center;gap:.25rem;cursor:pointer;color:#6987b8;border-radius:.125rem;transition:background-color .2s,color .2s,opacity .2s}._link_ctq5w_9:hover{background-color:#6987b833}._link_ctq5w_9:active{opacity:.5}._link_ctq5w_9:visited{color:#9771bd;border-bottom:dashed 1px #9771bd}._link_ctq5w_9:visited:hover{background-color:#9771bd33}._code_ctq5w_36{margin-inline:.25rem;padding:2px .5em;font-size:calc(1em - 2px);border-radius:.125rem;background-color:#00000013;font-family:"Source Code Pro" monospace}._kbd_ctq5w_45{padding:.125rem .25rem;position:relative;border-radius:.125rem;background-color:#e6e6e6}[data-theme=dark] ._kbd_ctq5w_45{background-color:#404040}._kbd_ctq5w_45:before{z-index:-1;position:absolute;content:"";bottom:-.25em;left:0;height:100%;width:100%;background-color:#ccc;border-radius:0 0 .125rem .125rem;box-shadow:0 0 .125em #00000080}[data-theme=dark] ._kbd_ctq5w_45:before{background-color:#595959;box-shadow:0 0 .125em #ffffff80}'));
7
- document.head.appendChild(elementStyle);
8
- }
9
- } catch (e) {
10
- console.error("vite-plugin-css-injected-by-js", e);
11
- }
12
- })();
13
1
  const base = "_base_ctq5w_1";
14
2
  const underline = "_underline_ctq5w_5";
15
3
  const link = "_link_ctq5w_9";
package/dist/index.mjs CHANGED
@@ -1,3 +1,15 @@
1
+ (function() {
2
+ "use strict";
3
+ try {
4
+ if (typeof document != "undefined") {
5
+ var elementStyle = document.createElement("style");
6
+ elementStyle.appendChild(document.createTextNode('._icon_67eyp_1{fill:#555b67;fill:var(--color, #555b67);transition:fill .2s;flex-shrink:0}[data-theme=dark] ._icon_67eyp_1{fill:#b0b5be;fill:var(--dark-color, #b0b5be)}\n._text_2fuj1_1{color:#606875;color:var(--color, #606875);font-size:normal;font-size:var(--font-size, normal)}._text_2fuj1_1::-moz-selection{color:#cccfd5;background-color:#3e434b;background-color:var(--color, #3e434b)}._text_2fuj1_1::selection{color:#cccfd5;background-color:#3e434b;background-color:var(--color, #3e434b)}[data-theme=dark] ._text_2fuj1_1{color:#b0b5be;color:var(--color, #b0b5be)}[data-theme=dark] ._text_2fuj1_1::-moz-selection{color:#3e434b;background-color:#cccfd5;background-color:var(--color, #cccfd5)}[data-theme=dark] ._text_2fuj1_1::selection{color:#3e434b;background-color:#cccfd5;background-color:var(--color, #cccfd5)}\n._icon_19g82_1{margin:0;padding:0;display:inline-block;vertical-align:middle;height:1em}._icon_19g82_1::-moz-selection{filter:brightness(1000%);background-color:#00000040;background-color:var(--color, rgba(0, 0, 0, .25))}._icon_19g82_1::selection{filter:brightness(1000%);background-color:#00000040;background-color:var(--color, rgba(0, 0, 0, .25))}[data-theme=dark] ._icon_19g82_1{color:#ffffffb3;color:var(--color, rgba(255, 255, 255, .7))}[data-theme=dark] ._icon_19g82_1::-moz-selection{color:#000000b3;background-color:#ffffff40;background-color:var(--color, rgba(255, 255, 255, .25))}[data-theme=dark] ._icon_19g82_1::selection{color:#000000b3;background-color:#ffffff40;background-color:var(--color, rgba(255, 255, 255, .25))}\n._blockquote_1msat_1{box-sizing:border-box;padding:.5rem 2rem;background-color:#e3e5e7;border-left:4px solid #606875}[data-theme=dark] ._blockquote_1msat_1{background-color:#3e434b;border-color:#b0b5be}._blockquote_1msat_1 a{all:unset;cursor:pointer;transition:color .1s}._blockquote_1msat_1 a:hover{color:#5879b0}._blockquote_1msat_1 cite{display:block;margin-block:1rem;text-align:right}\n._base_ctq5w_1{background-color:var(--background-color)}._underline_ctq5w_5{text-decoration:underline}._link_ctq5w_9{all:unset;box-sizing:border-box;padding:0 .25rem;font-size:var(--font-size);display:inline-flex;align-items:center;gap:.25rem;cursor:pointer;color:#6987b8;border-radius:.125rem;transition:background-color .2s,color .2s,opacity .2s}._link_ctq5w_9:hover{background-color:#6987b833}._link_ctq5w_9:active{opacity:.5}._link_ctq5w_9:visited{color:#9771bd;border-bottom:dashed 1px #9771bd}._link_ctq5w_9:visited:hover{background-color:#9771bd33}._code_ctq5w_36{margin-inline:.25rem;padding:2px .5em;font-size:calc(1em - 2px);border-radius:.125rem;background-color:#00000013;font-family:"Source Code Pro" monospace}._kbd_ctq5w_45{padding:.125rem .25rem;position:relative;border-radius:.125rem;background-color:#e6e6e6}[data-theme=dark] ._kbd_ctq5w_45{background-color:#404040}._kbd_ctq5w_45:before{z-index:-1;position:absolute;content:"";bottom:-.25em;left:0;height:100%;width:100%;background-color:#ccc;border-radius:0 0 .125rem .125rem;box-shadow:0 0 .125em #00000080}[data-theme=dark] ._kbd_ctq5w_45:before{background-color:#595959;box-shadow:0 0 .125em #ffffff80}\n._callout_pqkj1_1{box-sizing:border-box;padding:1rem 1rem 1rem 1.5rem;position:relative}._callout_pqkj1_1:after{position:absolute;content:"";top:0;left:0;width:4px;height:100%;background-color:var(--callout-color);z-index:-1}._callout_pqkj1_1:before{position:absolute;content:"";top:0;left:0;width:100%;height:100%;background-color:var(--callout-color);opacity:.15;z-index:-1}._header_pqkj1_28{display:flex;justify-content:flex-start;align-items:center;gap:.5rem;margin-block-end:.5rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}\n._image_z5fgk_1{width:100%}._block-image_z5fgk_5{border-radius:.25rem;box-shadow:0 0 .125rem #000}._caption_z5fgk_10{margin-block:.5rem;display:flex;justify-content:center;align-items:center;gap:.5rem}._modal_z5fgk_18{position:fixed;z-index:10000;top:0;left:0;width:100%;height:100%;display:flex;justify-self:center;align-items:center;background-color:#3e434bcc;cursor:zoom-out}\n@charset "UTF-8";.fade-enter{opacity:0}.fade-enter-active{opacity:1;transition:opacity .3s}.fade-exit{opacity:1}.fade-exit-active{opacity:0;transition:opacity .3s}'));
7
+ document.head.appendChild(elementStyle);
8
+ }
9
+ } catch (e) {
10
+ console.error("vite-plugin-css-injected-by-js", e);
11
+ }
12
+ })();
1
13
  import { ElmInlineIcon } from "./components/icon/ElmInlineIcon.mjs";
2
14
  import { ElmMdiIcon } from "./components/icon/ElmMdiIcon.mjs";
3
15
  import { ElmImage } from "./components/media/ElmImage.mjs";
@@ -1,15 +1,3 @@
1
- (function() {
2
- "use strict";
3
- try {
4
- if (typeof document != "undefined") {
5
- var elementStyle = document.createElement("style");
6
- elementStyle.appendChild(document.createTextNode("._text_2fuj1_1{color:#606875;color:var(--color, #606875);font-size:normal;font-size:var(--font-size, normal)}._text_2fuj1_1::-moz-selection{color:#cccfd5;background-color:#3e434b;background-color:var(--color, #3e434b)}._text_2fuj1_1::selection{color:#cccfd5;background-color:#3e434b;background-color:var(--color, #3e434b)}[data-theme=dark] ._text_2fuj1_1{color:#b0b5be;color:var(--color, #b0b5be)}[data-theme=dark] ._text_2fuj1_1::-moz-selection{color:#3e434b;background-color:#cccfd5;background-color:var(--color, #cccfd5)}[data-theme=dark] ._text_2fuj1_1::selection{color:#3e434b;background-color:#cccfd5;background-color:var(--color, #cccfd5)}"));
7
- document.head.appendChild(elementStyle);
8
- }
9
- } catch (e) {
10
- console.error("vite-plugin-css-injected-by-js", e);
11
- }
12
- })();
13
1
  const text = "_text_2fuj1_1";
14
2
  const textStyle = {
15
3
  text
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elmethis/react",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },