@funnest/charts-ui 0.11.43 → 0.11.44
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.js +9 -6
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -7578,10 +7578,10 @@ function TextEditor({ ctx }) {
|
|
|
7578
7578
|
window.addEventListener("pointerdown", down, true);
|
|
7579
7579
|
window.addEventListener("pointerup", up, true);
|
|
7580
7580
|
window.addEventListener("pointercancel", up, true);
|
|
7581
|
-
const off = ctx.chart.on("drawingTextEdit", ({ id, x: x2, y: y3 }) => {
|
|
7581
|
+
const off = ctx.chart.on("drawingTextEdit", ({ id, x: x2, y: y3, field }) => {
|
|
7582
7582
|
const open = () => {
|
|
7583
7583
|
const d3 = ctx.chart.getDrawings().find((x3) => x3.id === id);
|
|
7584
|
-
if (d3) setEdit({ id, x: x2, y: y3, before: d3.style?.text ?? "" });
|
|
7584
|
+
if (d3) setEdit({ id, x: x2, y: y3, field, before: d3.style?.text ?? "" });
|
|
7585
7585
|
};
|
|
7586
7586
|
if (pressed) pending = open;
|
|
7587
7587
|
else open();
|
|
@@ -7610,9 +7610,12 @@ function TextEditor({ ctx }) {
|
|
|
7610
7610
|
if (!keep) write(edit.before);
|
|
7611
7611
|
setEdit(null);
|
|
7612
7612
|
};
|
|
7613
|
-
const
|
|
7614
|
-
const
|
|
7615
|
-
|
|
7613
|
+
const plot = ctx.chart.layout.plotWidth;
|
|
7614
|
+
const f4 = edit.field;
|
|
7615
|
+
const width = f4 ? Math.max(160, Math.min(f4.width, plot - 8)) : 220;
|
|
7616
|
+
const left = Math.max(4, Math.min(f4 ? f4.x : edit.x - 8, plot - width - 4));
|
|
7617
|
+
const top = Math.max(4, f4 ? f4.y : edit.y - 18);
|
|
7618
|
+
return /* @__PURE__ */ a3("div", { class: "fnc-text-edit", style: { left: `${left}px`, top: `${top}px`, width: `${width}px` }, children: [
|
|
7616
7619
|
/* @__PURE__ */ a3(
|
|
7617
7620
|
"textarea",
|
|
7618
7621
|
{
|
|
@@ -7620,7 +7623,7 @@ function TextEditor({ ctx }) {
|
|
|
7620
7623
|
rows: 1,
|
|
7621
7624
|
maxLength: TEXT_MAX,
|
|
7622
7625
|
"aria-label": t3.drawingText,
|
|
7623
|
-
placeholder: t3.textPlaceholder,
|
|
7626
|
+
placeholder: f4?.placeholder ?? t3.textPlaceholder,
|
|
7624
7627
|
onInput: (e3) => {
|
|
7625
7628
|
const el = e3.target;
|
|
7626
7629
|
fit(el);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@funnest/charts-ui",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.44",
|
|
4
4
|
"description": "Pro trading UI (toolbar, drawing tools, sheets) for Funnest Charts. Framework-agnostic.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chart",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"NOTICE"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@funnest/charts": "0.11.
|
|
45
|
+
"@funnest/charts": "0.11.44"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"preact": "^11.2.0"
|