@jvs-milkdown/crepe 1.2.40 → 1.2.41

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.
@@ -1054,7 +1054,7 @@ const splitCellIcon = `
1054
1054
  `;
1055
1055
 
1056
1056
  const formatPainterIcon = `
1057
- <svg viewBox="0 0 1024 1024" version="1.1" width="20" height="20">
1057
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" version="1.1" width="32" height="32">
1058
1058
  <path d="M454.698667 302.506667H323.84q-23.04 0-41.6 13.824-18.517333 13.824-25.130667 35.968l-31.36 104.704q-10.112 33.621333 10.794667 61.738666 11.52 15.445333 27.221333 22.442667 0.853333 46.165333-0.810666 105.6-1.408 51.84-58.368 138.496-23.338667 35.413333-3.413334 72.96 20.053333 37.76 62.677334 37.76h477.994666q39.509333 0 69.077334-26.325333 29.738667-26.453333 34.090666-65.962667 10.24-93.738667 10.24-155.946667 0-57.088-8.618666-103.68 20.949333-6.058667 35.285333-25.344 20.864-28.117333 10.837333-61.738666l-31.36-104.704q-6.656-22.144-25.173333-35.968-18.517333-13.781333-41.6-13.781334h-130.858667V197.802667q0-28.885333-20.437333-49.365334Q622.933333 128 594.090667 128H524.373333q-28.842667 0-49.237333 20.48-20.437333 20.437333-20.437333 49.322667v104.746666z m68.992 41.728q0.682667-3.370667 0.682666-6.784V197.802667h69.717334V337.493333q0 3.413333 0.64 6.826667 0.682667 3.370667 2.005333 6.528 1.28 3.2 3.2 6.058667 1.92 2.816 4.352 5.248 2.389333 2.474667 5.248 4.352 2.901333 1.92 6.058667 3.242666 3.157333 1.322667 6.528 1.962667 3.328 0.682667 6.826666 0.682667h165.674667l31.36 104.746666H292.48l31.36-104.746666h165.717333q3.413333 0 6.826667-0.64 3.328-0.682667 6.528-2.005334 3.157333-1.322667 5.973333-3.242666 2.858667-1.877333 5.290667-4.352 2.432-2.432 4.309333-5.248 1.92-2.901333 3.242667-6.058667 1.322667-3.157333 1.962667-6.570667z m252.501333 202.666666q9.429333 43.648 9.429333 100.864 0 58.368-9.813333 148.352-1.450667 12.757333-11.093333 21.376-9.813333 8.704-22.826667 8.704h-100.309333q22.058667-81.493333 22.058666-174.592h-69.674666q0 94.421333-24.96 174.592h-121.514667q41.941333-81.450667 41.941333-174.592H419.754667q0 94.378667-52.992 174.592H263.808q-0.725333 0-1.109333-0.725333-0.469333-0.981333 0.042666-1.749333 67.968-103.253333 69.888-175.018667 1.536-56.533333 0.938667-101.802667H776.106667z" fill="currentColor" p-id="11997"></path>
1059
1059
  </svg>
1060
1060
  `;
@@ -4403,19 +4403,24 @@ const Toolbar = vue.defineComponent({
4403
4403
  vue.watch(
4404
4404
  () => formatPainterState.value,
4405
4405
  (newVal) => {
4406
+ console.log("[FormatPainter] state changed:", newVal);
4406
4407
  if (newVal) {
4407
4408
  let cursorStyleEl = cursorStyleEls.get(ctx);
4409
+ console.log("[FormatPainter] existing style tag:", cursorStyleEl);
4408
4410
  if (!cursorStyleEl) {
4409
4411
  cursorStyleEl = document.createElement("style");
4410
- const encodedSvg = encodeURIComponent(
4411
- formatPainterIcon.replace(/currentColor/g, "#363B4C")
4412
- );
4413
- cursorStyleEl.innerHTML = `.milkdown .ProseMirror, .milkdown .ProseMirror * { cursor: url("data:image/svg+xml;utf8,${encodedSvg}") 0 16, auto !important; }`;
4412
+ let svgWithXmlns = formatPainterIcon.includes("xmlns=") ? formatPainterIcon : formatPainterIcon.replace("<svg ", '<svg xmlns="http://www.w3.org/2000/svg" ');
4413
+ svgWithXmlns = svgWithXmlns.replace(/\s+/g, " ").trim();
4414
+ const cleanSvg = svgWithXmlns.replace(/currentColor/g, "#363B4C");
4415
+ const base64Svg = window.btoa(cleanSvg);
4416
+ cursorStyleEl.innerHTML = `body, body *, .ProseMirror, .ProseMirror * { cursor: url("data:image/svg+xml;base64,${base64Svg}") 0 0, auto !important; }`;
4414
4417
  document.head.appendChild(cursorStyleEl);
4415
4418
  cursorStyleEls.set(ctx, cursorStyleEl);
4419
+ console.log("[FormatPainter] Style tag appended to head:", cursorStyleEl.outerHTML);
4416
4420
  }
4417
4421
  } else {
4418
4422
  const cursorStyleEl = cursorStyleEls.get(ctx);
4423
+ console.log("[FormatPainter] removing style tag:", cursorStyleEl);
4419
4424
  if (cursorStyleEl) {
4420
4425
  cursorStyleEl.remove();
4421
4426
  cursorStyleEls.delete(ctx);