@solutions2share/s2s-email-builder 0.0.1 → 0.0.3

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.es.js CHANGED
@@ -16198,10 +16198,6 @@ function f4({ data: e, setData: t }) {
16198
16198
  }
16199
16199
  }
16200
16200
  ),
16201
- /* @__PURE__ */ G.jsx("input", { type: "file", onChange: (_) => {
16202
- const g = URL.createObjectURL(_.target.files[0]);
16203
- n({ ...e, props: { ...e.props, url: g } });
16204
- } }),
16205
16201
  /* @__PURE__ */ G.jsx(
16206
16202
  as,
16207
16203
  {
@@ -28887,7 +28883,9 @@ function Ka({ children: e }) {
28887
28883
  const t = KT(), [r, n] = nr(!1), i = Vf();
28888
28884
  let a;
28889
28885
  t === i ? a = "2px solid rgba(0,121,204, 1)" : r && (a = "2px solid rgba(0,121,204, 0.3)");
28890
- const o = () => t !== i ? null : /* @__PURE__ */ G.jsx(G6, { blockId: i });
28886
+ let o;
28887
+ Object.keys(e.props.props).length === 1 && Object.keys(e.props.props)[0] === "text" && (o = "break-all");
28888
+ const u = () => t !== i ? null : /* @__PURE__ */ G.jsx(G6, { blockId: i });
28891
28889
  return /* @__PURE__ */ G.jsxs(
28892
28890
  On,
28893
28891
  {
@@ -28895,19 +28893,22 @@ function Ka({ children: e }) {
28895
28893
  position: "relative",
28896
28894
  maxWidth: "100%",
28897
28895
  outlineOffset: "-1px",
28898
- outline: a
28896
+ outline: a,
28897
+ // backgroundColor,
28898
+ // color,
28899
+ wordBreak: o
28899
28900
  },
28900
- onMouseEnter: (u) => {
28901
- n(!0), u.stopPropagation();
28901
+ onMouseEnter: (d) => {
28902
+ n(!0), d.stopPropagation();
28902
28903
  },
28903
28904
  onMouseLeave: () => {
28904
28905
  n(!1);
28905
28906
  },
28906
- onClick: (u) => {
28907
- uu(i), u.stopPropagation(), u.preventDefault();
28907
+ onClick: (d) => {
28908
+ uu(i), d.stopPropagation(), d.preventDefault();
28908
28909
  },
28909
28910
  children: [
28910
- o(),
28911
+ u(),
28911
28912
  e
28912
28913
  ]
28913
28914
  }
@@ -28970,12 +28971,17 @@ const Ww = {
28970
28971
  }
28971
28972
  }, $6 = Bw(Ww), Y6 = Uw(Ww);
28972
28973
  oe.record(oe.string(), Y6);
28973
- const jw = BI(null), Vf = () => WT(jw);
28974
- function Kw({ id: e }) {
28975
- const r = la()[e];
28976
- if (!r)
28974
+ const jw = BI(null), Vf = () => {
28975
+ const e = WT(jw);
28976
+ if (!e)
28977
+ throw new Error("useTheme must be used within an EditorBlockContext.Provider");
28978
+ return e.id;
28979
+ };
28980
+ function Kw({ id: e, theme: t }) {
28981
+ const n = la()[e];
28982
+ if (!n)
28977
28983
  throw new Error("Could not find block");
28978
- return /* @__PURE__ */ G.jsx(jw.Provider, { value: e, children: /* @__PURE__ */ G.jsx($6, { ...r }) });
28984
+ return /* @__PURE__ */ G.jsx(jw.Provider, { value: { id: e, theme: t }, children: /* @__PURE__ */ G.jsx($6, { ...n }) });
28979
28985
  }
28980
28986
  function Qw(e) {
28981
28987
  return e instanceof Map ? e.clear = e.delete = e.set = function() {
@@ -94091,33 +94097,43 @@ function Ane() {
94091
94097
  )
94092
94098
  ] });
94093
94099
  }
94094
- function xne() {
94095
- const e = la(), t = zI(), r = tF();
94096
- let n = {
94100
+ function xne({ style: e, children: t, theme: r }) {
94101
+ const { padding: n, borderColor: i, ...a } = e, o = {
94102
+ ...a
94103
+ };
94104
+ if (n) {
94105
+ const { top: u, bottom: d, left: p, right: _ } = n;
94106
+ o.padding = `${u}px ${_}px ${d}px ${p}px`;
94107
+ }
94108
+ return i && (o.border = `1px solid ${i}`), /* @__PURE__ */ G.jsx("div", { style: { maxWidth: "100%", ...o }, children: t });
94109
+ }
94110
+ function Rne({ theme: e }) {
94111
+ const t = la(), r = zI(), n = tF();
94112
+ let i = {
94097
94113
  height: "100%"
94098
94114
  };
94099
- r === "mobile" && (n = {
94100
- ...n,
94115
+ n === "mobile" && (i = {
94116
+ ...i,
94101
94117
  margin: "32px auto",
94102
94118
  width: 370,
94103
94119
  height: 800,
94104
94120
  boxShadow: "rgba(33, 36, 67, 0.04) 0px 10px 20px, rgba(33, 36, 67, 0.04) 0px 2px 6px, rgba(33, 36, 67, 0.04) 0px 0px 1px"
94105
94121
  });
94106
- const i = (o, u) => {
94107
- switch (u) {
94122
+ const a = (u, d) => {
94123
+ switch (d) {
94108
94124
  case "mobile":
94109
94125
  case "desktop":
94110
- Zv(u);
94126
+ Zv(d);
94111
94127
  return;
94112
94128
  default:
94113
94129
  Zv("desktop");
94114
94130
  }
94115
- }, a = () => {
94116
- switch (t) {
94131
+ }, o = () => {
94132
+ switch (r) {
94117
94133
  case "editor":
94118
- return /* @__PURE__ */ G.jsx(On, { sx: n, children: /* @__PURE__ */ G.jsx(Kw, { id: "root" }) });
94134
+ return /* @__PURE__ */ G.jsx(On, { sx: i, children: /* @__PURE__ */ G.jsx(Kw, { id: "root", theme: e }) });
94119
94135
  case "preview":
94120
- return /* @__PURE__ */ G.jsx(On, { sx: n, children: /* @__PURE__ */ G.jsx(qw, { document: e, rootBlockId: "root" }) });
94136
+ return /* @__PURE__ */ G.jsx(On, { sx: i, children: /* @__PURE__ */ G.jsx(xne, { style: i, theme: e, children: /* @__PURE__ */ G.jsx(qw, { document: t, rootBlockId: "root" }) }) });
94121
94137
  case "html":
94122
94138
  return /* @__PURE__ */ G.jsx(vne, {});
94123
94139
  case "json":
@@ -94143,14 +94159,14 @@ function xne() {
94143
94159
  alignItems: "center",
94144
94160
  children: /* @__PURE__ */ G.jsxs(Nn, { px: 2, direction: "row", gap: 2, width: "100%", justifyContent: "space-between", alignItems: "center", children: [
94145
94161
  /* @__PURE__ */ G.jsx(Nn, { direction: "row", spacing: 2, children: /* @__PURE__ */ G.jsx(Ane, {}) }),
94146
- /* @__PURE__ */ G.jsx(Nn, { direction: "row", spacing: 2, children: /* @__PURE__ */ G.jsxs(UI, { value: r, exclusive: !0, size: "small", onChange: i, children: [
94162
+ /* @__PURE__ */ G.jsx(Nn, { direction: "row", spacing: 2, children: /* @__PURE__ */ G.jsxs(UI, { value: n, exclusive: !0, size: "small", onChange: a, children: [
94147
94163
  /* @__PURE__ */ G.jsx(hr, { value: "desktop", children: /* @__PURE__ */ G.jsx(To, { title: "Desktop view", children: /* @__PURE__ */ G.jsx(q3, { fontSize: "small" }) }) }),
94148
94164
  /* @__PURE__ */ G.jsx(hr, { value: "mobile", children: /* @__PURE__ */ G.jsx(To, { title: "Mobile view", children: /* @__PURE__ */ G.jsx(W3, { fontSize: "small" }) }) })
94149
94165
  ] }) })
94150
94166
  ] })
94151
94167
  }
94152
94168
  ),
94153
- /* @__PURE__ */ G.jsx(On, { sx: { height: "calc(100vh - 49px)", overflow: "auto", minWidth: 370 }, children: a() })
94169
+ /* @__PURE__ */ G.jsx(On, { sx: { height: "calc(100vh - 49px)", overflow: "auto", minWidth: 370 }, children: o() })
94154
94170
  ] });
94155
94171
  }
94156
94172
  function LI(e, t) {
@@ -94160,7 +94176,7 @@ function LI(e, t) {
94160
94176
  duration: t ? r.duration.enteringScreen : r.duration.leavingScreen
94161
94177
  });
94162
94178
  }
94163
- const aie = ({ value: e, exportJson: t, variables: r, intl: n, theme: i }) => {
94179
+ const sie = ({ value: e, exportJson: t, variables: r, intl: n, theme: i }) => {
94164
94180
  const a = WI(), o = nF(), u = la(), d = zw(u, { rootBlockId: "root" }), p = LI("margin-left", o), _ = LI("margin-right", a);
94165
94181
  return Ps(() => {
94166
94182
  e && Wb(e);
@@ -94176,11 +94192,11 @@ const aie = ({ value: e, exportJson: t, variables: r, intl: n, theme: i }) => {
94176
94192
  // marginLeft: samplesDrawerOpen ? `${SAMPLES_DRAWER_WIDTH}px` : 0,
94177
94193
  transition: [p, _].join(", ")
94178
94194
  },
94179
- children: /* @__PURE__ */ G.jsx(xne, {})
94195
+ children: /* @__PURE__ */ G.jsx(Rne, { theme: i })
94180
94196
  }
94181
94197
  )
94182
94198
  ] });
94183
94199
  };
94184
94200
  export {
94185
- aie as default
94201
+ sie as default
94186
94202
  };
package/dist/style.css ADDED
@@ -0,0 +1 @@
1
+ .darkEmailStyle>div table,.darkEmailStyle>div{background-color:#292929!important;color:#fff!important}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solutions2share/s2s-email-builder",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",