rme 0.2.3-alpha.8 → 0.2.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.mjs CHANGED
@@ -6829,6 +6829,9 @@ var MarkdownParser = class {
6829
6829
  }
6830
6830
  return MarkdownIt().validateLink(url);
6831
6831
  };
6832
+ this.tokenizer.normalizeLink = (url) => {
6833
+ return url;
6834
+ };
6832
6835
  this.tokenHandlers = buildTokenHandlers(schema, parserRules);
6833
6836
  }
6834
6837
  parse(text) {
@@ -7894,6 +7897,7 @@ var ClipboardExtension = class extends PlainExtension2 {
7894
7897
  return {
7895
7898
  props: {
7896
7899
  handlePaste: (view, event) => {
7900
+ console.log("handlePaste event", event);
7897
7901
  const transformer = getTransformerByView(view);
7898
7902
  const parser4 = transformer.stringToDoc;
7899
7903
  const schema = view.state.schema;
@@ -7905,6 +7909,8 @@ var ClipboardExtension = class extends PlainExtension2 {
7905
7909
  const text = clipboardData.getData("text/plain");
7906
7910
  const html2 = clipboardData.getData("text/html");
7907
7911
  if (html2.length === 0 && text.length === 0) return false;
7912
+ console.log("html", html2);
7913
+ console.log("text", text);
7908
7914
  const domParser = DOMParser2.fromSchema(schema);
7909
7915
  let dom;
7910
7916
  if (html2.length === 0) {
@@ -7936,6 +7942,7 @@ var ClipboardExtension = class extends PlainExtension2 {
7936
7942
  }
7937
7943
  const slice = domParser.parseSlice(dom);
7938
7944
  const node = isTextOnlySlice(slice);
7945
+ console.log("slice", slice, node);
7939
7946
  if (node) {
7940
7947
  if ((node.type.name === "html_image" || node.type.name === "md_image") && node.attrs.src) {
7941
7948
  this.processImageNode(node, view);
@@ -8005,6 +8012,10 @@ var ClipboardExtension = class extends PlainExtension2 {
8005
8012
  imageCopyHandler(node.attrs.src).then((newSrc) => {
8006
8013
  if (newSrc && newSrc !== node.attrs.src) {
8007
8014
  this.updateImageNodeSrc(view, node, newSrc);
8015
+ } else {
8016
+ const { state, dispatch } = view;
8017
+ node.attrs["data-rme-loading"] = null;
8018
+ dispatch(state.tr);
8008
8019
  }
8009
8020
  }).catch((error) => {
8010
8021
  console.warn("imageCopyHandler failed:", error);
@@ -16137,6 +16148,7 @@ var Resizable = memo2((props) => {
16137
16148
  );
16138
16149
  const handleResizing = useCallback(
16139
16150
  (e, handleType) => {
16151
+ setHasChanged(true);
16140
16152
  startResizing(e, handleType);
16141
16153
  },
16142
16154
  [startResizing]
@@ -16149,7 +16161,6 @@ var Resizable = memo2((props) => {
16149
16161
  startHeightRef.current = height;
16150
16162
  currentWidthRef.current = width;
16151
16163
  currentHeightRef.current = height;
16152
- setHasChanged(true);
16153
16164
  setSize({ width, height });
16154
16165
  }
16155
16166
  };
@@ -17421,7 +17432,7 @@ function ImageNodeView(props) {
17421
17432
  }
17422
17433
  )
17423
17434
  },
17424
- `${node.attrs.src}`
17435
+ `${node.attrs.src}_${node.attrs["data-rme-loading"]}`
17425
17436
  );
17426
17437
  return /* @__PURE__ */ jsx13("div", { ref: popoverRef, style: { position: "relative", zIndex: selected ? 10 : "auto" }, children: /* @__PURE__ */ jsx13(
17427
17438
  Popover2,