@fibery/custom-app-text-editor 1.4.0 → 1.5.0
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/lib/custom-app-text-editor.js +42 -35
- package/package.json +1 -1
|
@@ -83508,7 +83508,7 @@ var pce = Object.freeze({}), mce = "#4978D4", hce = class {
|
|
|
83508
83508
|
type: e,
|
|
83509
83509
|
publicId: t
|
|
83510
83510
|
}),
|
|
83511
|
-
openView: (
|
|
83511
|
+
openView: (e) => _("open-view", e),
|
|
83512
83512
|
hasHostBridge: g,
|
|
83513
83513
|
makeFileUrl: (e) => i(`/api/files/${encodeURIComponent(e)}`),
|
|
83514
83514
|
makeEntityUrl: (n, i) => {
|
|
@@ -83617,32 +83617,35 @@ var pce = Object.freeze({}), mce = "#4978D4", hce = class {
|
|
|
83617
83617
|
}, X9 = ({ children: e }) => /* @__PURE__ */ F("span", {
|
|
83618
83618
|
className: c(G9, xce),
|
|
83619
83619
|
children: e
|
|
83620
|
-
}),
|
|
83621
|
-
|
|
83620
|
+
}), Tce = (e) => e?.contextEntityTypeId && e.contextEntityPublicId ? {
|
|
83621
|
+
typeId: e.contextEntityTypeId,
|
|
83622
|
+
publicId: e.contextEntityPublicId
|
|
83623
|
+
} : void 0, Z9 = (e) => e.status === "type-deleted" ? "Deleted database" : `${e.typeTitle} not found`, Q9 = ({ data: e, context: t, onOpen: n, className: r, children: i }) => {
|
|
83624
|
+
let a = c(r, G9, e.url && q9, e.isFinalState && Sce, e.isDeactivated && Cce);
|
|
83622
83625
|
return e.url ? /* @__PURE__ */ F("a", {
|
|
83623
|
-
className:
|
|
83626
|
+
className: a,
|
|
83624
83627
|
href: e.url,
|
|
83625
83628
|
target: "_blank",
|
|
83626
83629
|
rel: "noopener noreferrer",
|
|
83627
83630
|
title: e.title,
|
|
83628
|
-
onClick: (
|
|
83629
|
-
!(
|
|
83631
|
+
onClick: (r) => {
|
|
83632
|
+
!(r.metaKey || r.ctrlKey || r.shiftKey || r.altKey) && n?.(e, t) && r.preventDefault();
|
|
83630
83633
|
},
|
|
83631
|
-
children:
|
|
83634
|
+
children: i
|
|
83632
83635
|
}) : e.opensInHost ? /* @__PURE__ */ F("span", {
|
|
83633
|
-
className: c(
|
|
83636
|
+
className: c(a, q9),
|
|
83634
83637
|
title: e.title,
|
|
83635
|
-
onClick: () =>
|
|
83636
|
-
children:
|
|
83638
|
+
onClick: () => n?.(e, t),
|
|
83639
|
+
children: i
|
|
83637
83640
|
}) : /* @__PURE__ */ F("span", {
|
|
83638
|
-
className:
|
|
83641
|
+
className: a,
|
|
83639
83642
|
title: e.title,
|
|
83640
|
-
children:
|
|
83643
|
+
children: i
|
|
83641
83644
|
});
|
|
83642
|
-
},
|
|
83643
|
-
className:
|
|
83645
|
+
}, Ece = "eu9zgnk", Dce = ({ children: e }) => /* @__PURE__ */ F("span", {
|
|
83646
|
+
className: Ece,
|
|
83644
83647
|
children: e
|
|
83645
|
-
}),
|
|
83648
|
+
}), Oce = ({ data: { icon: e, type: t, hasAccess: n, view: r }, size: i = 16 }) => n ? r ? /* @__PURE__ */ F("span", {
|
|
83646
83649
|
className: K9,
|
|
83647
83650
|
children: F(u9, {
|
|
83648
83651
|
view: r,
|
|
@@ -83677,14 +83680,15 @@ var pce = Object.freeze({}), mce = "#4978D4", hce = class {
|
|
|
83677
83680
|
iconSize: i,
|
|
83678
83681
|
containerSize: i
|
|
83679
83682
|
})
|
|
83680
|
-
}),
|
|
83681
|
-
let { id: r, typeId: i, text: a } = n.attrs,
|
|
83682
|
-
return !
|
|
83683
|
-
data:
|
|
83683
|
+
}), kce = (e, t) => function({ node: n }) {
|
|
83684
|
+
let { id: r, typeId: i, text: a, meta: o } = n.attrs, s = Y9(e, r, i), c = Tce(o);
|
|
83685
|
+
return !s || s.status === "pending" ? /* @__PURE__ */ F("span", { className: J9 }) : s.status === "failed" ? /* @__PURE__ */ F(X9, { children: a || "Unavailable" }) : s.status === "resolved" ? /* @__PURE__ */ I(Q9, {
|
|
83686
|
+
data: s.data,
|
|
83687
|
+
context: c,
|
|
83684
83688
|
onOpen: t,
|
|
83685
|
-
children: [/* @__PURE__ */ F(
|
|
83686
|
-
}) : /* @__PURE__ */ F(X9, { children: Z9(
|
|
83687
|
-
},
|
|
83689
|
+
children: [/* @__PURE__ */ F(Oce, { data: s.data }), /* @__PURE__ */ F(Dce, { children: s.data.title })]
|
|
83690
|
+
}) : /* @__PURE__ */ F(X9, { children: Z9(s) });
|
|
83691
|
+
}, Ace = "m17wbl80", jce = (e, t) => function({ node: n }) {
|
|
83688
83692
|
let { id: r, typeId: i, name: a } = n.attrs, o = Y9(e, r, i);
|
|
83689
83693
|
if (!o || o.status === "pending") return /* @__PURE__ */ F("span", { className: J9 });
|
|
83690
83694
|
if (o.status === "failed") return /* @__PURE__ */ F(X9, { children: a || "Unavailable" });
|
|
@@ -83692,7 +83696,7 @@ var pce = Object.freeze({}), mce = "#4978D4", hce = class {
|
|
|
83692
83696
|
let { data: s } = o;
|
|
83693
83697
|
return /* @__PURE__ */ I(Q9, {
|
|
83694
83698
|
data: s,
|
|
83695
|
-
className:
|
|
83699
|
+
className: Ace,
|
|
83696
83700
|
onOpen: t,
|
|
83697
83701
|
children: [/* @__PURE__ */ F("span", {
|
|
83698
83702
|
className: K9,
|
|
@@ -83705,8 +83709,8 @@ var pce = Object.freeze({}), mce = "#4978D4", hce = class {
|
|
|
83705
83709
|
})
|
|
83706
83710
|
}), s.title]
|
|
83707
83711
|
});
|
|
83708
|
-
},
|
|
83709
|
-
let n =
|
|
83712
|
+
}, Mce = (e, t) => {
|
|
83713
|
+
let n = kce(e, t);
|
|
83710
83714
|
return {
|
|
83711
83715
|
getNodeComponent: () => n,
|
|
83712
83716
|
getItemTitle: ({ id: t, typeId: n, defaultTitle: r }) => {
|
|
@@ -83718,13 +83722,13 @@ var pce = Object.freeze({}), mce = "#4978D4", hce = class {
|
|
|
83718
83722
|
},
|
|
83719
83723
|
getActualSchema: () => null
|
|
83720
83724
|
};
|
|
83721
|
-
},
|
|
83722
|
-
let r =
|
|
83725
|
+
}, Nce = (e, t, n) => {
|
|
83726
|
+
let r = jce(e, n);
|
|
83723
83727
|
return {
|
|
83724
83728
|
getNodeComponent: () => r,
|
|
83725
83729
|
getItems: t
|
|
83726
83730
|
};
|
|
83727
|
-
},
|
|
83731
|
+
}, Pce = (e, t) => e.request(Jz(t)), $9 = ({ id: e, typeId: t }) => `${t}:${e}`, Fce = ({ resolveEntities: e }) => {
|
|
83728
83732
|
let t = /* @__PURE__ */ new Map(), { subscribe: n, publish: r } = lD();
|
|
83729
83733
|
return {
|
|
83730
83734
|
request: (n) => {
|
|
@@ -83754,7 +83758,7 @@ var pce = Object.freeze({}), mce = "#4978D4", hce = class {
|
|
|
83754
83758
|
};
|
|
83755
83759
|
//#endregion
|
|
83756
83760
|
//#region src/custom-app-text-editor.tsx
|
|
83757
|
-
function
|
|
83761
|
+
function Ice({ defaultValue: e, readOnly: t = !1, placeholder: n = "", onChange: r }) {
|
|
83758
83762
|
let { mode: i, warm: a, arch: o } = ei(), s = k(!1), c = D(() => $r({
|
|
83759
83763
|
warmLook: a,
|
|
83760
83764
|
isArchitect: o
|
|
@@ -83765,8 +83769,8 @@ function Fce({ defaultValue: e, readOnly: t = !1, placeholder: n = "", onChange:
|
|
|
83765
83769
|
emojiDataStore: t
|
|
83766
83770
|
};
|
|
83767
83771
|
}), f = D(() => xse({ emojiOptions: { getEmoji: u.get } }), [u]), [p] = A(() => ti()), [m] = A(() => {
|
|
83768
|
-
let r = B9(), i =
|
|
83769
|
-
|
|
83772
|
+
let r = B9(), i = Fce({ resolveEntities: bce(r) });
|
|
83773
|
+
Pce(i, GF(e).doc);
|
|
83770
83774
|
let a = async (e, t, n) => {
|
|
83771
83775
|
let { name: i, secret: a } = await r.uploadFile({
|
|
83772
83776
|
file: e,
|
|
@@ -83778,15 +83782,18 @@ function Fce({ defaultValue: e, readOnly: t = !1, placeholder: n = "", onChange:
|
|
|
83778
83782
|
alt: i,
|
|
83779
83783
|
title: i
|
|
83780
83784
|
};
|
|
83781
|
-
}, o = ({ id: e, typeName: t, publicId: n, view: i }) => i ? r.openView({
|
|
83785
|
+
}, o = ({ id: e, typeName: t, publicId: n, view: i }, a) => i ? r.openView({
|
|
83786
|
+
id: e,
|
|
83787
|
+
context: a
|
|
83788
|
+
}) : t && n ? r.openEntity({
|
|
83782
83789
|
type: t,
|
|
83783
83790
|
publicId: n
|
|
83784
83791
|
}) : !1;
|
|
83785
83792
|
return new yse({
|
|
83786
83793
|
onUploadFile: a,
|
|
83787
83794
|
theme: l,
|
|
83788
|
-
entityDataProvider:
|
|
83789
|
-
mentionDataProvider:
|
|
83795
|
+
entityDataProvider: Mce(i, o),
|
|
83796
|
+
mentionDataProvider: Nce(i, Nse(r), o),
|
|
83790
83797
|
createEntitiesMenuComponent: kse(jse(r)),
|
|
83791
83798
|
entitiesMenuWidth: 300,
|
|
83792
83799
|
isImageBlockEnabled: !0,
|
|
@@ -83827,4 +83834,4 @@ function Fce({ defaultValue: e, readOnly: t = !1, placeholder: n = "", onChange:
|
|
|
83827
83834
|
});
|
|
83828
83835
|
}
|
|
83829
83836
|
//#endregion
|
|
83830
|
-
export {
|
|
83837
|
+
export { Ice as TextEditor, gp as t };
|