@savvycal/mjml-editor 0.9.0 → 0.9.1
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.
|
@@ -3,7 +3,7 @@ import { useState as f, useRef as g, useEffect as p, useCallback as v, useMemo a
|
|
|
3
3
|
import k from "@uiw/react-codemirror";
|
|
4
4
|
import { EditorState as N } from "@codemirror/state";
|
|
5
5
|
import { indentUnit as M, bracketMatching as E, syntaxHighlighting as j, HighlightStyle as C } from "@codemirror/language";
|
|
6
|
-
import {
|
|
6
|
+
import { EditorView as w, lineNumbers as L, highlightActiveLineGutter as D, highlightActiveLine as W, keymap as R } from "@codemirror/view";
|
|
7
7
|
import { history as z, indentWithTab as A, defaultKeymap as H, historyKeymap as K } from "@codemirror/commands";
|
|
8
8
|
import { highlightSelectionMatches as T, searchKeymap as U } from "@codemirror/search";
|
|
9
9
|
import { xml as _ } from "@codemirror/lang-xml";
|
|
@@ -63,16 +63,16 @@ function ae() {
|
|
|
63
63
|
[u]
|
|
64
64
|
), x = y(
|
|
65
65
|
() => [
|
|
66
|
-
w(),
|
|
67
66
|
L(),
|
|
68
67
|
D(),
|
|
68
|
+
W(),
|
|
69
69
|
z(),
|
|
70
70
|
N.tabSize.of(2),
|
|
71
71
|
M.of(" "),
|
|
72
72
|
E(),
|
|
73
73
|
T(),
|
|
74
74
|
j(V),
|
|
75
|
-
|
|
75
|
+
w.lineWrapping,
|
|
76
76
|
R.of([
|
|
77
77
|
A,
|
|
78
78
|
...H,
|
|
@@ -2,7 +2,7 @@ import { jsx as J } from "react/jsx-runtime";
|
|
|
2
2
|
import { useReducer as W, useCallback as h, useMemo as D, createContext as $, useContext as q } from "react";
|
|
3
3
|
import { v4 as N } from "uuid";
|
|
4
4
|
import { cloneNode as m, addIds as j, findNodeById as U, moveNode as z, deleteNode as G, insertNode as Q, updateNode as F } from "../lib/mjml/parser.js";
|
|
5
|
-
import {
|
|
5
|
+
import { getSchemaForTag as X, getDefaultBlock as Y } from "../lib/mjml/schema.js";
|
|
6
6
|
import { extractMjmlAttributes as Z, getDefinedClasses as ee, resolveNodeAttributes as te, getInheritedValue as ne, extractFonts as oe } from "../lib/mjml/attributes.js";
|
|
7
7
|
function de(e) {
|
|
8
8
|
let d = e.children?.find((o) => o.tagName === "mj-head"), t = !1;
|
|
@@ -409,7 +409,7 @@ function Ne({
|
|
|
409
409
|
n({ type: "UPDATE_CONTENT", payload: { id: c, content: u } });
|
|
410
410
|
}, []), i = h(
|
|
411
411
|
(c, u, p) => {
|
|
412
|
-
const x =
|
|
412
|
+
const x = Y(p), V = {
|
|
413
413
|
tagName: p,
|
|
414
414
|
attributes: x.attributes,
|
|
415
415
|
content: x.content,
|
|
@@ -478,7 +478,7 @@ function Ne({
|
|
|
478
478
|
[g]
|
|
479
479
|
), T = h(
|
|
480
480
|
(c, u) => {
|
|
481
|
-
const p =
|
|
481
|
+
const p = X(c.tagName);
|
|
482
482
|
return ne(c, u, g, p);
|
|
483
483
|
},
|
|
484
484
|
[g]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as y } from "react/jsx-runtime";
|
|
2
|
-
import { useState as d, useEffect as h, useCallback as a, useMemo as S,
|
|
3
|
-
const u =
|
|
2
|
+
import { useState as d, useEffect as h, useCallback as a, useMemo as S, useContext as E, createContext as x } from "react";
|
|
3
|
+
const u = x(null), l = "mjml-editor-theme";
|
|
4
4
|
function p() {
|
|
5
5
|
return typeof window > "u" ? "light" : window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
6
6
|
}
|
|
@@ -44,7 +44,7 @@ function P({
|
|
|
44
44
|
return /* @__PURE__ */ y(u.Provider, { value: v, children: e });
|
|
45
45
|
}
|
|
46
46
|
function b() {
|
|
47
|
-
const e =
|
|
47
|
+
const e = E(u);
|
|
48
48
|
if (!e)
|
|
49
49
|
throw new Error("useTheme must be used within a ThemeProvider");
|
|
50
50
|
return e;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@savvycal/mjml-editor",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"lucide-react": "^0.562.0",
|
|
65
65
|
"react-arborist": "^3.4.3",
|
|
66
66
|
"tailwind-merge": "^3.4.0",
|
|
67
|
-
"uuid": "^13.0.
|
|
67
|
+
"uuid": "^13.0.1"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@tailwindcss/vite": "^4.1.18",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"tailwindcss": "^4.1.18",
|
|
78
78
|
"tw-animate-css": "^1.4.0",
|
|
79
79
|
"typescript": "~5.9.3",
|
|
80
|
-
"vite": "^7.2
|
|
80
|
+
"vite": "^7.3.2",
|
|
81
81
|
"vite-plugin-dts": "^4.5.0",
|
|
82
82
|
"vitest": "^4.0.16"
|
|
83
83
|
},
|