@goodhood-web/nebenan-base 4.11.0-development.3 → 4.11.0-development.5

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.
Files changed (3) hide show
  1. package/index.js +3 -1
  2. package/index.mjs +34 -26
  3. package/package.json +1 -1
package/index.mjs CHANGED
@@ -75795,7 +75795,7 @@ function Zre(t) {
75795
75795
  url: h.cta_url
75796
75796
  });
75797
75797
  const g = Kre({ extendedEmbed: h });
75798
- console.log("Created node:", g.getType(), "isUnlinked:", g.__isUnlinked), r.append(g), l += h.title, i.set(h.cta_url, h), a.add(h.cta_url);
75798
+ r.append(g), l += h.title, i.set(h.cta_url, h), a.add(h.cta_url);
75799
75799
  } else
75800
75800
  Bd(r, d), l += d;
75801
75801
  s = f;
@@ -75863,50 +75863,58 @@ function Jre({ onChange: t, value: e }) {
75863
75863
  let c = !1;
75864
75864
  return n.registerUpdateListener(({ editorState: f }) => {
75865
75865
  c || f.read(() => {
75866
- const d = Ve(), h = d.getTextContent();
75867
- if (h === i.current) return;
75868
- const { embeds: m, linkUrls: g } = U5(
75866
+ const d = Ve();
75867
+ let h = "";
75868
+ const m = d.getChildren();
75869
+ if (m.forEach((k, y) => {
75870
+ "getChildren" in k && (k.getChildren().forEach((T) => {
75871
+ T.getType() === "linebreak" ? h += `
75872
+ ` : h += T.getTextContent();
75873
+ }), y < m.length - 1 && (h += `
75874
+ `));
75875
+ }), h === i.current) return;
75876
+ const { embeds: g, linkUrls: v } = U5(
75869
75877
  d,
75870
75878
  l.current
75871
75879
  );
75872
- g.forEach((b) => {
75873
- s.current.has(b) || (s.current.add(b), o(b).then((k) => {
75874
- if ((k == null ? void 0 : k.status) === "success" && k.data) {
75875
- const y = {
75876
- associated_gid: k.data.gid,
75877
- cta_url: k.data.cta_url,
75878
- description: k.data.description,
75879
- image_url: k.data.image_url,
75880
+ v.forEach((k) => {
75881
+ s.current.has(k) || (s.current.add(k), o(k).then((y) => {
75882
+ if ((y == null ? void 0 : y.status) === "success" && y.data) {
75883
+ const S = {
75884
+ associated_gid: y.data.gid,
75885
+ cta_url: y.data.cta_url,
75886
+ description: y.data.description,
75887
+ image_url: y.data.image_url,
75880
75888
  indices: null,
75881
- recommendations_count: k.data.recommendations_count,
75882
- role: k.data.role,
75883
- title: k.data.title
75889
+ recommendations_count: y.data.recommendations_count,
75890
+ role: y.data.role,
75891
+ title: y.data.title
75884
75892
  };
75885
- l.current.set(b, y), n.getEditorState().read(() => {
75886
- const { embeds: S } = U5(
75893
+ l.current.set(k, S), n.getEditorState().read(() => {
75894
+ const { embeds: C } = U5(
75887
75895
  Ve(),
75888
75896
  l.current
75889
- ), C = e.embeddables.filter(
75890
- (T) => T.role === "profile"
75897
+ ), T = e.embeddables.filter(
75898
+ (A) => A.role === "profile"
75891
75899
  );
75892
75900
  a.current = !0, t({
75893
75901
  ...e,
75894
75902
  body: h,
75895
- embeddables: [...S, ...C]
75903
+ embeddables: [...C, ...T]
75896
75904
  });
75897
75905
  });
75898
75906
  }
75899
- }).catch((k) => {
75900
- console.error("Failed to fetch link metadata:", k);
75907
+ }).catch((y) => {
75908
+ console.error("Failed to fetch link metadata:", y);
75901
75909
  }));
75902
- }), s.current.forEach((b) => {
75903
- g.has(b) || (s.current.delete(b), l.current.delete(b));
75910
+ }), s.current.forEach((k) => {
75911
+ v.has(k) || (s.current.delete(k), l.current.delete(k));
75904
75912
  });
75905
- const v = e.embeddables.filter((b) => b.role === "profile");
75913
+ const b = e.embeddables.filter((k) => k.role === "profile");
75906
75914
  i.current = h, a.current = !0, c = !0, t({
75907
75915
  ...e,
75908
75916
  body: h,
75909
- embeddables: [...m, ...v]
75917
+ embeddables: [...g, ...b]
75910
75918
  }), setTimeout(() => {
75911
75919
  c = !1;
75912
75920
  }, 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodhood-web/nebenan-base",
3
- "version": "4.11.0-development.3",
3
+ "version": "4.11.0-development.5",
4
4
  "main": "./index.js",
5
5
  "types": "./index.d.ts",
6
6
  "repository": "https://github.com/good-hood-gmbh/goodhood-web",