@funnest/charts-ui 0.11.66 → 0.11.67

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/i18n.d.ts CHANGED
@@ -233,6 +233,8 @@ export declare const STRINGS: {
233
233
  lock: string;
234
234
  unlock: string;
235
235
  duplicate: string;
236
+ copyDrawing: string;
237
+ pasteDrawing: string;
236
238
  moreActions: string;
237
239
  moveBar: string;
238
240
  indicators: string;
@@ -640,6 +642,8 @@ export declare const STRINGS: {
640
642
  lock: string;
641
643
  unlock: string;
642
644
  duplicate: string;
645
+ copyDrawing: string;
646
+ pasteDrawing: string;
643
647
  moreActions: string;
644
648
  moveBar: string;
645
649
  indicators: string;
package/dist/index.js CHANGED
@@ -668,6 +668,8 @@ var STRINGS = {
668
668
  lock: "\uC7A0\uADF8\uAE30",
669
669
  unlock: "\uC7A0\uAE08 \uD480\uAE30",
670
670
  duplicate: "\uBCF5\uC81C",
671
+ copyDrawing: "\uBCF5\uC0AC",
672
+ pasteDrawing: "\uBD99\uC5EC\uB123\uAE30",
671
673
  moreActions: "\uB354\uBCF4\uAE30",
672
674
  moveBar: "\uB04C\uC5B4\uC11C \uC62E\uAE30\uAE30 (\uB450 \uBC88 \uB204\uB974\uBA74 \uC81C\uC790\uB9AC)",
673
675
  indicators: "\uC9C0\uD45C",
@@ -751,7 +753,7 @@ var STRINGS = {
751
753
  moreToolsDown: "\uC544\uB798 \uB3C4\uAD6C \uB354 \uBCF4\uAE30",
752
754
  lockView: "\uCC28\uD2B8 \uACE0\uC815",
753
755
  unlockView: "\uCC28\uD2B8 \uACE0\uC815 \uD480\uAE30",
754
- hideNavButtons: "\uD655\uB300\xB7\uC774\uB3D9 \uBC84\uD2BC \uC228\uAE30\uAE30 (\uCC28\uD2B8 \uC124\uC815\uC5D0\uC11C \uB2E4\uC2DC \uCF1C\uC694)",
756
+ hideNavButtons: "\uD655\uB300\xB7\uC774\uB3D9 \uBC84\uD2BC \uC228\uAE30\uAE30",
755
757
  lockRatio: "\uAC00\uACA9 \uCD95 \uBE44\uC728 \uACE0\uC815",
756
758
  settingAutoScale: "\uC790\uB3D9 \uB9DE\uCDA4",
757
759
  hintAutoScale: "\uD654\uBA74\uC5D0 \uBCF4\uC774\uB294 \uCE94\uB4E4\uC5D0 \uB9DE\uCDB0 \uAC00\uACA9 \uCD95\uC744 \uB298\uC774\uACE0 \uC904\uC5EC\uC694. \uAC00\uACA9 \uCD95\uC744 \uB04C\uC5B4 \uC9C1\uC811 \uB9DE\uCD94\uBA74 \uAEBC\uC9C0\uACE0, \uAC00\uACA9 \uCD95\uC744 \uB354\uBE14\uD074\uB9AD\uD558\uBA74 \uB2E4\uC2DC \uCF1C\uC838\uC694.",
@@ -1077,6 +1079,8 @@ var STRINGS = {
1077
1079
  lock: "Lock",
1078
1080
  unlock: "Unlock",
1079
1081
  duplicate: "Duplicate",
1082
+ copyDrawing: "Copy",
1083
+ pasteDrawing: "Paste",
1080
1084
  moreActions: "More",
1081
1085
  moveBar: "Drag to move (double-click to reset)",
1082
1086
  indicators: "Indicators",
@@ -1160,7 +1164,7 @@ var STRINGS = {
1160
1164
  moreToolsDown: "More tools below",
1161
1165
  lockView: "Lock chart",
1162
1166
  unlockView: "Unlock chart",
1163
- hideNavButtons: "Hide zoom & scroll buttons (turn them back on in chart settings)",
1167
+ hideNavButtons: "Hide zoom & scroll buttons",
1164
1168
  lockRatio: "Lock price to bar ratio",
1165
1169
  settingAutoScale: "Auto (fit to screen)",
1166
1170
  hintAutoScale: "The price axis stretches to fit the candles on screen. Dragging the axis turns it off; double-click the axis to turn it back on.",
@@ -2620,6 +2624,11 @@ var CSS = (
2620
2624
  .fnc-levels-menu { min-width: 340px; }
2621
2625
  .fnc-level-text { flex: 1; min-width: 0; width: 110px; height: 28px; padding: 0 8px; font-size: 13px; }
2622
2626
  .fnc-options-menu { min-width: 280px; max-height: min(70vh, 560px); overflow-y: auto; }
2627
+ /* \u2699 on a computer: \uC635\uC158 \xB7 \uC88C\uD45C \xB7 \uBCF4\uC784 as tabs over one body. */
2628
+ .fnc-menu.fnc-settings-pop { width: 340px; padding: 0; }
2629
+ .fnc-settings-pop .fnc-tabs { position: sticky; top: 0; z-index: 1; padding: 8px 10px; background: var(--fnc-bg); }
2630
+ .fnc-settings-pop-body { display: flex; flex-direction: column; padding: 6px; }
2631
+ .fnc-settings-pop-body > .fnc-coords, .fnc-settings-pop-body > .fnc-hint { padding: 4px 6px; }
2623
2632
  .fnc-option-row { display: flex; align-items: center; gap: 8px; }
2624
2633
  .fnc-option-row input[type='checkbox'] { width: 15px; height: 15px; margin: 0; accent-color: var(--fnc-accent, #3182f6); }
2625
2634
  .fnc-option-field { justify-content: space-between; padding: 4px 10px; font-size: 13px; color: var(--fnc-text); }
@@ -2639,6 +2648,10 @@ var CSS = (
2639
2648
  .fnc-template-name { width: calc(100% - 8px); margin: 4px; }
2640
2649
  .fnc-menu-note { padding: 8px 10px; color: var(--fnc-text-2); font-size: 12px; }
2641
2650
  .fnc-menu-sep { height: 1px; margin: 4px 6px; background: var(--fnc-border); }
2651
+ /* \u22EF on the drawing bar: \uBCF5\uC81C \xB7 \uBCF5\uC0AC \xB7 \uBD99\uC5EC\uB123\uAE30, then \uC21C\uC11C. */
2652
+ .fnc-more-menu { min-width: 180px; }
2653
+ .fnc-more-menu .fnc-menu-item kbd { margin-left: auto; font: inherit; font-size: 12px; color: var(--fnc-text-3); }
2654
+ .fnc-more-title { padding: 6px 10px 2px; font-size: 11px; font-weight: 700; color: var(--fnc-text-2); }
2642
2655
  .fnc-tools-layouts { display: flex; flex-direction: column; gap: 2px; padding: 0 2px 4px; }
2643
2656
  .fnc-tools-sep { height: 1px; margin: 6px 4px; background: var(--fnc-border); }
2644
2657
  .fnc-tools-icon { display: inline-flex; width: 20px; height: 20px; flex: none; }
@@ -3926,10 +3939,6 @@ var GearIcon = () => /* @__PURE__ */ a3(Icon, { size: 14, children: [
3926
3939
  /* @__PURE__ */ a3("circle", { cx: "10", cy: "10", r: "2.4" }),
3927
3940
  /* @__PURE__ */ a3("path", { d: "M10 3v2M10 15v2M3 10h2M15 10h2M5 5l1.4 1.4M13.6 13.6L15 15M5 15l1.4-1.4M13.6 6.4L15 5" })
3928
3941
  ] });
3929
- var LayersIcon = () => /* @__PURE__ */ a3(Icon, { children: [
3930
- /* @__PURE__ */ a3("path", { d: "M10 4 3 7.5 10 11l7-3.5z", fill: "currentColor", "fill-opacity": "0.25" }),
3931
- /* @__PURE__ */ a3("path", { d: "M3 11l7 3.5 7-3.5" })
3932
- ] });
3933
3942
  var LevelsIcon = () => /* @__PURE__ */ a3(Icon, { children: [
3934
3943
  /* @__PURE__ */ a3("path", { d: "M3 5h9M3 10h14M3 15h11" }),
3935
3944
  /* @__PURE__ */ a3("circle", { cx: "15", cy: "5", r: "1.4" }),
@@ -3970,10 +3979,6 @@ var DiceIcon = () => /* @__PURE__ */ a3(Icon, { size: 16, children: [
3970
3979
  /* @__PURE__ */ a3("circle", { cx: "12.8", cy: "12.8", r: "1.1", fill: "currentColor", stroke: "none" }),
3971
3980
  /* @__PURE__ */ a3("circle", { cx: "10", cy: "10", r: "1.1", fill: "currentColor", stroke: "none" })
3972
3981
  ] });
3973
- var ClockIcon = () => /* @__PURE__ */ a3(Icon, { size: 13, children: [
3974
- /* @__PURE__ */ a3("circle", { cx: "10", cy: "10", r: "7" }),
3975
- /* @__PURE__ */ a3("path", { d: "M10 6v4l2.5 1.5" })
3976
- ] });
3977
3982
  var SettingsIcon = () => /* @__PURE__ */ a3(Icon, { children: [
3978
3983
  /* @__PURE__ */ a3("path", { d: "M10 12.6a2.6 2.6 0 1 0 0-5.2 2.6 2.6 0 0 0 0 5.2z" }),
3979
3984
  /* @__PURE__ */ a3("path", { d: "M16.2 12a1.3 1.3 0 0 0 .26 1.43l.05.05a1.6 1.6 0 1 1-2.26 2.26l-.05-.05a1.3 1.3 0 0 0-1.43-.26 1.3 1.3 0 0 0-.79 1.19v.14a1.6 1.6 0 0 1-3.2 0v-.07a1.3 1.3 0 0 0-.85-1.19 1.3 1.3 0 0 0-1.43.26l-.05.05a1.6 1.6 0 1 1-2.26-2.26l.05-.05A1.3 1.3 0 0 0 4.5 12a1.3 1.3 0 0 0-1.19-.79h-.14a1.6 1.6 0 0 1 0-3.2h.07a1.3 1.3 0 0 0 1.19-.85 1.3 1.3 0 0 0-.26-1.43l-.05-.05a1.6 1.6 0 1 1 2.26-2.26l.05.05a1.3 1.3 0 0 0 1.43.26h.06a1.3 1.3 0 0 0 .79-1.19v-.14a1.6 1.6 0 0 1 3.2 0v.07a1.3 1.3 0 0 0 .79 1.19 1.3 1.3 0 0 0 1.43-.26l.05-.05a1.6 1.6 0 1 1 2.26 2.26l-.05.05a1.3 1.3 0 0 0-.26 1.43v.06a1.3 1.3 0 0 0 1.19.79h.14a1.6 1.6 0 0 1 0 3.2h-.07a1.3 1.3 0 0 0-1.19.79z" })
@@ -4048,10 +4053,6 @@ var DrawingsEyeIcon = ({ off = false }) => /* @__PURE__ */ a3(Icon, { children:
4048
4053
  /* @__PURE__ */ a3("circle", { cx: "10", cy: "10", r: "2.3" }),
4049
4054
  off && /* @__PURE__ */ a3("path", { d: "M3.5 3.5l13 13" })
4050
4055
  ] });
4051
- var CopyIcon = () => /* @__PURE__ */ a3(Icon, { children: [
4052
- /* @__PURE__ */ a3("rect", { x: "7", y: "7", width: "9.5", height: "9.5", rx: "1.8" }),
4053
- /* @__PURE__ */ a3("path", { d: "M13 7V5a1.5 1.5 0 0 0-1.5-1.5h-6A1.5 1.5 0 0 0 4 5v6a1.5 1.5 0 0 0 1.5 1.5H7" })
4054
- ] });
4055
4056
  var TextIcon = () => /* @__PURE__ */ a3(Icon, { children: /* @__PURE__ */ a3("path", { d: "M4.5 5V3.8h11V5M10 3.8v12.5M7.5 16.3h5" }) });
4056
4057
 
4057
4058
  // src/store.ts
@@ -4512,6 +4513,7 @@ function DrawingToolbar({ ctx }) {
4512
4513
  ] });
4513
4514
  }
4514
4515
  var SWATCHES = ["#3182F6", "#F04452", "#12B886", "#FF9F0A", "#7048E8"];
4516
+ var MOD = typeof navigator !== "undefined" && /Mac|iPhone|iPad/.test(navigator.platform) ? "\u2318" : "Ctrl+";
4515
4517
  var WIDTHS = [1, 2, 3, 4];
4516
4518
  var FONT_SIZES = [10, 12, 14, 16, 20, 24, 32];
4517
4519
  var DASH_ORDER = ["solid", "dashed", "dotted"];
@@ -4604,6 +4606,7 @@ function SelectionBar({ ctx }) {
4604
4606
  const [lift, setLift] = d2(() => readJson(LIFT_KEY, 0));
4605
4607
  const [menu, setMenu] = d2(null);
4606
4608
  const [sheet, setSheet] = d2(false);
4609
+ const [settingsTab, setSettingsTab] = d2("options");
4607
4610
  const [templates, setTemplates] = d2(() => readJson(TEMPLATES_KEY, {}));
4608
4611
  const [naming, setNaming] = d2(null);
4609
4612
  const bar = T2(null);
@@ -4642,7 +4645,10 @@ function SelectionBar({ ctx }) {
4642
4645
  const setStyleRaw = (next) => ctx.chart.updateDrawing(d3.id, { style: next });
4643
4646
  const current = d3.color ?? SWATCHES[0];
4644
4647
  const pickColor = (color) => {
4645
- if (style.colors || style.levels?.some((l3) => l3.color)) {
4648
+ if (def?.levels) {
4649
+ const { colors: _drop, ...rest } = style;
4650
+ ctx.chart.updateDrawing(d3.id, { color, style: { ...rest, levels: drawingLevels(def, d3).map((l3) => ({ ...l3, color })) } });
4651
+ } else if (style.colors || style.levels?.some((l3) => l3.color)) {
4646
4652
  const { colors: _drop, ...rest } = style;
4647
4653
  const levels = rest.levels?.map(({ color: _c, ...l3 }) => l3);
4648
4654
  ctx.chart.updateDrawing(d3.id, { color, style: { ...rest, ...levels ? { levels } : {} } });
@@ -4728,6 +4734,12 @@ function SelectionBar({ ctx }) {
4728
4734
  document.addEventListener("pointerup", up);
4729
4735
  };
4730
4736
  const phone = touchDevice();
4737
+ const hasOptions = !!def?.options && def.options.length > 0;
4738
+ const settingsTabs = [
4739
+ ...hasOptions ? [["options", t3.drawingOptions]] : [],
4740
+ ["coords", t3.coordinates],
4741
+ ["visibility", t3.tabVisibility]
4742
+ ];
4731
4743
  const widthIndex = Math.max(0, WIDTHS.indexOf(style.width ?? 2));
4732
4744
  const fontIndex = Math.max(0, FONT_SIZES.indexOf(style.fontSize ?? 14));
4733
4745
  const colorsBody = () => /* @__PURE__ */ a3($, { children: [
@@ -5018,7 +5030,21 @@ function SelectionBar({ ctx }) {
5018
5030
  children: /* @__PURE__ */ a3(GripIcon, {})
5019
5031
  }
5020
5032
  ),
5021
- !def?.levels && !def?.plain && /* @__PURE__ */ a3(ColorPicker, { class: "fnc-btn fnc-selbar-brush", boardClass: "fnc-palette-big", value: current, label: t3.color, tip: t3.color, t: t3, onPick: pickColor, onOpen: () => setMenu(null), children: /* @__PURE__ */ a3(BrushIcon, { color: current }) }),
5033
+ !def?.plain && /* @__PURE__ */ a3(ColorPicker, { class: "fnc-btn fnc-selbar-brush", boardClass: "fnc-palette-big", value: current, label: t3.color, tip: t3.color, t: t3, onPick: pickColor, onOpen: () => setMenu(null), children: /* @__PURE__ */ a3(BrushIcon, { color: current }) }),
5034
+ !phone && def && !def.text && !def.plain && /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5035
+ /* @__PURE__ */ a3(
5036
+ "button",
5037
+ {
5038
+ class: style.text ? "fnc-btn fnc-btn-on" : "fnc-btn",
5039
+ "data-tip": t3.note,
5040
+ "aria-label": t3.note,
5041
+ "aria-expanded": menu === "note",
5042
+ onClick: () => setMenu(menu === "note" ? null : "note"),
5043
+ children: /* @__PURE__ */ a3(TextIcon, {})
5044
+ }
5045
+ ),
5046
+ menu === "note" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop fnc-note-menu", role: "menu", onKeyDown: (e3) => e3.key !== "Escape" && e3.stopPropagation(), children: noteBody() })
5047
+ ] }),
5022
5048
  phone && def && (def.text || !def.plain) && /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5023
5049
  /* @__PURE__ */ a3(
5024
5050
  "button",
@@ -5083,9 +5109,29 @@ function SelectionBar({ ctx }) {
5083
5109
  /* @__PURE__ */ a3("button", { class: "fnc-btn", "data-tip": t3.partColors, "aria-label": t3.partColors, "aria-expanded": menu === "colors", onClick: () => setMenu(menu === "colors" ? null : "colors"), children: /* @__PURE__ */ a3(PaletteIcon, {}) }),
5084
5110
  menu === "colors" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop fnc-part-menu", role: "menu", children: colorsBody() })
5085
5111
  ] }),
5086
- def?.options && def.options.length > 0 && /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5087
- /* @__PURE__ */ a3("button", { class: "fnc-btn", "data-tip": t3.drawingOptions, "aria-label": t3.drawingOptions, "aria-expanded": menu === "options", onClick: () => setMenu(menu === "options" ? null : "options"), children: /* @__PURE__ */ a3(SettingsIcon, {}) }),
5088
- menu === "options" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop fnc-options-menu", role: "menu", onKeyDown: (e3) => e3.key !== "Escape" && e3.stopPropagation(), children: optionsBody() })
5112
+ def && /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5113
+ /* @__PURE__ */ a3(
5114
+ "button",
5115
+ {
5116
+ class: style.intervals ? "fnc-btn fnc-btn-on" : "fnc-btn",
5117
+ "data-tip": t3.drawingOptions,
5118
+ "aria-label": t3.drawingOptions,
5119
+ "aria-expanded": menu === "options",
5120
+ onClick: () => {
5121
+ setSettingsTab(hasOptions ? "options" : "coords");
5122
+ setMenu(menu === "options" ? null : "options");
5123
+ },
5124
+ children: /* @__PURE__ */ a3(SettingsIcon, {})
5125
+ }
5126
+ ),
5127
+ menu === "options" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop fnc-options-menu fnc-settings-pop", role: "menu", onKeyDown: (e3) => e3.key !== "Escape" && e3.stopPropagation(), children: [
5128
+ /* @__PURE__ */ a3("div", { class: "fnc-tabs", role: "tablist", "aria-label": t3.drawingOptions, children: settingsTabs.map(([k2, label]) => /* @__PURE__ */ a3("button", { type: "button", class: "fnc-tab", role: "tab", "aria-selected": settingsTab === k2, onClick: () => setSettingsTab(k2), children: label })) }),
5129
+ /* @__PURE__ */ a3("div", { class: "fnc-settings-pop-body", children: [
5130
+ settingsTab === "options" && hasOptions && optionsBody(),
5131
+ settingsTab === "coords" && coordsBody(),
5132
+ settingsTab === "visibility" && visibilityBody()
5133
+ ] })
5134
+ ] })
5089
5135
  ] }),
5090
5136
  def?.levels && /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5091
5137
  /* @__PURE__ */ a3("button", { class: "fnc-btn", "data-tip": t3.levels, "aria-label": t3.levels, "aria-expanded": menu === "levels", onClick: () => setMenu(menu === "levels" ? null : "levels"), children: /* @__PURE__ */ a3(LevelsIcon, {}) }),
@@ -5191,78 +5237,71 @@ function SelectionBar({ ctx }) {
5191
5237
  }
5192
5238
  )),
5193
5239
  /* @__PURE__ */ a3("div", { class: "fnc-sep" }),
5194
- !phone && /* @__PURE__ */ a3($, { children: [
5195
- /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5196
- /* @__PURE__ */ a3("button", { class: "fnc-btn", "data-tip": t3.drawingOrder, "aria-label": t3.drawingOrder, "aria-expanded": menu === "order", onClick: () => setMenu(menu === "order" ? null : "order"), children: /* @__PURE__ */ a3(LayersIcon, {}) }),
5197
- menu === "order" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop", role: "menu", children: orderBody() })
5198
- ] }),
5199
- def && !def.text && /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5240
+ !phone && /* @__PURE__ */ a3($, {}),
5241
+ /* @__PURE__ */ a3("button", { class: "fnc-btn", "data-tip": locked ? t3.unlock : t3.lock, "aria-label": locked ? t3.unlock : t3.lock, "aria-pressed": locked, onClick: () => setStyle({ locked: !locked }), children: /* @__PURE__ */ a3(LockIcon, { open: !locked }) }),
5242
+ /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5243
+ /* @__PURE__ */ a3("button", { class: "fnc-btn", "data-tip": t3.moreActions, "aria-label": t3.moreActions, "aria-expanded": menu === "more", onClick: () => setMenu(menu === "more" ? null : "more"), children: /* @__PURE__ */ a3(MoreIcon, {}) }),
5244
+ menu === "more" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop fnc-more-menu", role: "menu", children: [
5200
5245
  /* @__PURE__ */ a3(
5201
5246
  "button",
5202
5247
  {
5203
- class: style.text ? "fnc-btn fnc-btn-on" : "fnc-btn",
5204
- "data-tip": t3.note,
5205
- "aria-label": t3.note,
5206
- "aria-expanded": menu === "note",
5207
- onClick: () => setMenu(menu === "note" ? null : "note"),
5208
- children: /* @__PURE__ */ a3(TextIcon, {})
5248
+ class: "fnc-menu-item",
5249
+ role: "menuitem",
5250
+ onClick: () => {
5251
+ setMenu(null);
5252
+ const id = ctx.chart.addDrawing({ type: d3.type, points: d3.points.map((p3) => ({ ...p3 })), ...d3.color ? { color: d3.color } : {}, style: { ...style, locked: false } });
5253
+ ctx.chart.selectDrawing(id);
5254
+ },
5255
+ children: /* @__PURE__ */ a3("span", { children: t3.duplicate })
5209
5256
  }
5210
5257
  ),
5211
- menu === "note" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop fnc-note-menu", role: "menu", onKeyDown: (e3) => e3.key !== "Escape" && e3.stopPropagation(), children: noteBody() })
5212
- ] }),
5213
- /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5214
- /* @__PURE__ */ a3("button", { class: "fnc-btn", "data-tip": t3.coordinates, "aria-label": t3.coordinates, "aria-expanded": menu === "coords", onClick: () => setMenu(menu === "coords" ? null : "coords"), children: /* @__PURE__ */ a3(CrossCursorIcon, {}) }),
5215
- menu === "coords" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop fnc-coords-menu", role: "menu", onKeyDown: (e3) => e3.key !== "Escape" && e3.stopPropagation(), children: coordsBody() })
5216
- ] }),
5217
- /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5218
5258
  /* @__PURE__ */ a3(
5219
5259
  "button",
5220
5260
  {
5221
- class: style.intervals ? "fnc-btn fnc-btn-on" : "fnc-btn",
5222
- "data-tip": t3.tabVisibility,
5223
- "aria-label": t3.tabVisibility,
5224
- "aria-expanded": menu === "visibility",
5225
- onClick: () => setMenu(menu === "visibility" ? null : "visibility"),
5226
- children: /* @__PURE__ */ a3(ClockIcon, {})
5261
+ class: "fnc-menu-item",
5262
+ role: "menuitem",
5263
+ onClick: () => {
5264
+ ctx.chart.copyDrawing(d3.id);
5265
+ setMenu(null);
5266
+ },
5267
+ children: [
5268
+ /* @__PURE__ */ a3("span", { children: t3.copyDrawing }),
5269
+ !phone && /* @__PURE__ */ a3("kbd", { children: [
5270
+ MOD,
5271
+ "C"
5272
+ ] })
5273
+ ]
5274
+ }
5275
+ ),
5276
+ ctx.chart.canPasteDrawing() && /* @__PURE__ */ a3(
5277
+ "button",
5278
+ {
5279
+ class: "fnc-menu-item",
5280
+ role: "menuitem",
5281
+ onClick: () => {
5282
+ setMenu(null);
5283
+ ctx.chart.pasteDrawing();
5284
+ },
5285
+ children: [
5286
+ /* @__PURE__ */ a3("span", { children: t3.pasteDrawing }),
5287
+ !phone && /* @__PURE__ */ a3("kbd", { children: [
5288
+ MOD,
5289
+ "V"
5290
+ ] })
5291
+ ]
5227
5292
  }
5228
5293
  ),
5229
- menu === "visibility" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop fnc-visibility-menu", role: "menu", onKeyDown: (e3) => e3.key !== "Escape" && e3.stopPropagation(), children: visibilityBody() })
5294
+ /* @__PURE__ */ a3("div", { class: "fnc-menu-sep", role: "separator" }),
5295
+ /* @__PURE__ */ a3("div", { class: "fnc-more-title", children: t3.drawingOrder }),
5296
+ orderBody()
5230
5297
  ] })
5231
5298
  ] }),
5232
- phone && /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5233
- /* @__PURE__ */ a3("button", { class: "fnc-btn", "aria-label": t3.moreActions, "aria-expanded": menu === "more", onClick: () => setMenu(menu === "more" ? null : "more"), children: /* @__PURE__ */ a3(MoreIcon, {}) }),
5234
- menu === "more" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop", role: "menu", children: orderBody() })
5235
- ] }),
5236
- /* @__PURE__ */ a3("button", { class: "fnc-btn", "data-tip": locked ? t3.unlock : t3.lock, "aria-label": locked ? t3.unlock : t3.lock, "aria-pressed": locked, onClick: () => setStyle({ locked: !locked }), children: /* @__PURE__ */ a3(LockIcon, { open: !locked }) }),
5237
- /* @__PURE__ */ a3(
5238
- "button",
5239
- {
5240
- class: "fnc-btn",
5241
- "data-tip": t3.duplicate,
5242
- "aria-label": t3.duplicate,
5243
- onClick: () => {
5244
- const id = ctx.chart.addDrawing({ type: d3.type, points: d3.points.map((p3) => ({ ...p3 })), ...d3.color ? { color: d3.color } : {}, style: { ...style, locked: false } });
5245
- ctx.chart.selectDrawing(id);
5246
- },
5247
- children: /* @__PURE__ */ a3(CopyIcon, {})
5248
- }
5249
- ),
5250
5299
  /* @__PURE__ */ a3("button", { class: "fnc-btn", "data-tip": t3.remove, "aria-label": t3.remove, onClick: () => ctx.chart.removeDrawing(d3.id), children: /* @__PURE__ */ a3(TrashIcon, {}) }),
5251
5300
  phone && sheet && /* @__PURE__ */ a3(StyleSheet, { ctx, title: t3.style, resetLabel: t3.resetDefaults, onReset: resetLook, onClose: () => setSheet(false), children: [
5252
5301
  !def?.plain && /* @__PURE__ */ a3("section", { class: "fnc-ss-section", children: [
5253
- !def?.levels && /* @__PURE__ */ a3("div", { class: "fnc-ss-row", children: [
5302
+ /* @__PURE__ */ a3("div", { class: "fnc-ss-row", children: [
5254
5303
  /* @__PURE__ */ a3("span", { children: t3.color }),
5255
- /* @__PURE__ */ a3(
5256
- ColorPicker,
5257
- {
5258
- class: "fnc-swatch fnc-ss-color",
5259
- style: { background: current },
5260
- value: current,
5261
- label: t3.color,
5262
- t: t3,
5263
- onPick: pickColor
5264
- }
5265
- )
5304
+ /* @__PURE__ */ a3(ColorPicker, { class: "fnc-swatch fnc-ss-color", style: { background: current }, value: current, label: t3.color, t: t3, onPick: pickColor })
5266
5305
  ] }),
5267
5306
  /* @__PURE__ */ a3("div", { class: "fnc-ss-row", children: [
5268
5307
  /* @__PURE__ */ a3("span", { children: t3.lineStyle }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnest/charts-ui",
3
- "version": "0.11.66",
3
+ "version": "0.11.67",
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.66"
45
+ "@funnest/charts": "0.11.67"
46
46
  },
47
47
  "devDependencies": {
48
48
  "preact": "^11.2.0"