@funnest/charts-ui 0.11.59 → 0.11.61

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 (2) hide show
  1. package/dist/index.js +612 -372
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -2966,6 +2966,34 @@ var CSS = (
2966
2966
  .fnc-sheet .fnc-sheet-body .fnc-tool-fav { opacity: 1; }
2967
2967
  .fnc-sheet .fnc-sheet-body .fnc-tool-tiles { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); }
2968
2968
  .fnc-sheet .fnc-sheet-body .fnc-tool-tile { width: 100%; height: 44px; }
2969
+ /* A phone's drawing style sheet (drawing-toolbar StyleSheet): title and \uAE30\uBCF8\uAC12\uC73C\uB85C at the top, sections
2970
+ (\uC120 \xB7 \uD14D\uC2A4\uD2B8 \xB7 \uC635\uC158 \xB7 \uB808\uBCA8 \xB7 \uBA54\uBAA8 \xB7 \uC88C\uD45C \xB7 \uBCF4\uC774\uB294 \uC8FC\uAE30 \xB7 \uC21C\uC11C \xB7 \uD15C\uD50C\uB9BF) under it. */
2971
+ .fnc-sheet.fnc-style-sheet { max-height: min(82dvh, 720px); }
2972
+ .fnc-sheet .fnc-ss-head { position: relative; display: flex; align-items: center; justify-content: space-between; height: auto; padding: 20px 16px 6px; }
2973
+ .fnc-ss-head > span { position: absolute; top: 8px; left: 50%; margin-left: -20px; }
2974
+ .fnc-ss-head h2 { margin: 0; color: var(--fnc-text); font-size: 18px; font-weight: 700; }
2975
+ .fnc-ss-reset { padding: 6px 4px; border: 0; background: none; color: var(--fnc-text-2); font: inherit; font-size: 14px; cursor: pointer; }
2976
+ .fnc-ss-body { flex: 1; min-height: 0; padding: 0 16px 16px; overflow-y: auto; overscroll-behavior: contain; }
2977
+ .fnc-ss-section { padding: 8px 0; border-top: 1px solid var(--fnc-border); }
2978
+ .fnc-ss-section:first-child { border-top: 0; }
2979
+ .fnc-ss-section h3 { margin: 6px 0 6px; color: var(--fnc-text-2); font-size: 13px; font-weight: 600; }
2980
+ .fnc-ss-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; color: var(--fnc-text); font-size: 15px; }
2981
+ .fnc-sheet .fnc-ss-color { width: 32px; height: 32px; border-radius: 50%; }
2982
+ .fnc-ss-seg { display: inline-flex; gap: 4px; padding: 3px; border-radius: 10px; background: var(--fnc-surface); }
2983
+ .fnc-ss-seg button { display: grid; place-items: center; width: 46px; height: 32px; border-radius: 8px; color: var(--fnc-text-2); }
2984
+ .fnc-ss-seg button[aria-checked='true'] { background: var(--fnc-bg); color: var(--fnc-text); box-shadow: 0 0 0 1px var(--fnc-border); }
2985
+ .fnc-ss-step { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--fnc-surface); }
2986
+ .fnc-ss-step button { width: 38px; height: 32px; border-radius: 999px; color: var(--fnc-text); font-size: 18px; }
2987
+ .fnc-ss-step button:disabled { opacity: 0.35; }
2988
+ .fnc-ss-step b { min-width: 30px; text-align: center; font-variant-numeric: tabular-nums; }
2989
+ .fnc-ss-text { box-sizing: border-box; width: 100%; height: 42px; font-size: 15px; }
2990
+ .fnc-ss-body .fnc-menu-item { min-height: 44px; font-size: 15px; }
2991
+ .fnc-ss-body .fnc-levels-list { max-height: none; }
2992
+ /* \u{1F58C}'s colors: one row of swatches over the bar. */
2993
+ .fnc-menu.fnc-brush-pop { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; }
2994
+ .fnc-brush-pop .fnc-swatch { width: 24px; height: 24px; }
2995
+ .fnc-selbar-pop.fnc-note-menu { width: auto; }
2996
+ .fnc-note-menu .fnc-ss-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--fnc-text-2); }
2969
2997
  .fnc-tool-row .fnc-menu-item { flex: 1; padding-right: 36px; }
2970
2998
  .fnc-tool-fav { position: absolute; right: 6px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; color: var(--fnc-text-2); opacity: 0; cursor: pointer; }
2971
2999
  .fnc-tool-row:hover .fnc-tool-fav, .fnc-tool-fav:focus-visible, .fnc-tool-fav[aria-pressed='true'] { opacity: 1; }
@@ -4525,6 +4553,7 @@ function SelectionBar({ ctx }) {
4525
4553
  const [offset, setOffset] = d2(() => readJson(POS_KEY, [0, 0]));
4526
4554
  const [recent, setRecent] = d2(() => recentColors().slice(0, 3));
4527
4555
  const [menu, setMenu] = d2(null);
4556
+ const [sheet, setSheet] = d2(false);
4528
4557
  const [templates, setTemplates] = d2(() => readJson(TEMPLATES_KEY, {}));
4529
4558
  const [naming, setNaming] = d2(null);
4530
4559
  const bar = T2(null);
@@ -4613,6 +4642,280 @@ function SelectionBar({ ctx }) {
4613
4642
  document.addEventListener("pointermove", move);
4614
4643
  document.addEventListener("pointerup", up);
4615
4644
  };
4645
+ const phone = touchDevice();
4646
+ const widthIndex = Math.max(0, WIDTHS.indexOf(style.width ?? 2));
4647
+ const fontIndex = Math.max(0, FONT_SIZES.indexOf(style.fontSize ?? 14));
4648
+ const colorsBody = () => /* @__PURE__ */ a3($, { children: [
4649
+ slots.map((slot) => {
4650
+ const c3 = slotColor(slot.key, slot.color);
4651
+ return /* @__PURE__ */ a3("div", { class: "fnc-menu-item fnc-part", children: [
4652
+ /* @__PURE__ */ a3(ColorPicker, { class: "fnc-swatch", style: { background: c3 }, value: c3, label: `${slot.name[s3.locale]} ${t3.color}`, t: t3, onPick: (color) => setStyle({ colors: { ...style.colors, [slot.key]: color } }) }),
4653
+ /* @__PURE__ */ a3("span", { children: slot.name[s3.locale] })
4654
+ ] });
4655
+ }),
4656
+ /* @__PURE__ */ a3(
4657
+ "button",
4658
+ {
4659
+ class: "fnc-menu-item fnc-part-reset",
4660
+ role: "menuitem",
4661
+ onClick: () => {
4662
+ const { colors: _drop, ...rest } = style;
4663
+ ctx.chart.updateDrawing(d3.id, { style: rest });
4664
+ setMenu(null);
4665
+ },
4666
+ children: t3.resetColors
4667
+ }
4668
+ )
4669
+ ] });
4670
+ const optionsBody = () => /* @__PURE__ */ a3($, { children: [
4671
+ (def?.options ?? []).map((o4) => {
4672
+ const value = drawingOption(def, d3, o4.key);
4673
+ const set = (v3) => setStyle({ options: { ...style.options, [o4.key]: v3 } });
4674
+ if (o4.kind === "toggle")
4675
+ return /* @__PURE__ */ a3("label", { class: "fnc-menu-item fnc-option-row", children: [
4676
+ /* @__PURE__ */ a3("input", { type: "checkbox", checked: value === true, onChange: (e3) => set(e3.target.checked) }),
4677
+ /* @__PURE__ */ a3("span", { children: o4.label[s3.locale] })
4678
+ ] });
4679
+ if (o4.kind === "choice")
4680
+ return /* @__PURE__ */ a3("label", { class: "fnc-option-row fnc-option-field", children: [
4681
+ /* @__PURE__ */ a3("span", { children: o4.label[s3.locale] }),
4682
+ /* @__PURE__ */ a3("select", { class: "fnc-select", value: String(value), onChange: (e3) => set(e3.target.value), children: o4.choices?.map((c3) => /* @__PURE__ */ a3("option", { value: c3.value, children: c3.label[s3.locale] })) })
4683
+ ] });
4684
+ return /* @__PURE__ */ a3("label", { class: "fnc-option-row fnc-option-field", children: [
4685
+ /* @__PURE__ */ a3("span", { children: o4.label[s3.locale] }),
4686
+ /* @__PURE__ */ a3(
4687
+ "input",
4688
+ {
4689
+ class: "fnc-input fnc-option-number",
4690
+ type: "number",
4691
+ step: o4.step ?? "any",
4692
+ min: o4.min,
4693
+ max: o4.max,
4694
+ defaultValue: String(value),
4695
+ onChange: (e3) => {
4696
+ const v3 = Number(e3.target.value);
4697
+ if (Number.isFinite(v3)) set(v3);
4698
+ }
4699
+ }
4700
+ ),
4701
+ o4.unit && /* @__PURE__ */ a3("span", { class: "fnc-option-unit", children: o4.unit })
4702
+ ] }, `${o4.key}:${String(value)}`);
4703
+ }),
4704
+ /* @__PURE__ */ a3("div", { class: "fnc-menu-sep" }),
4705
+ /* @__PURE__ */ a3(
4706
+ "button",
4707
+ {
4708
+ class: "fnc-menu-item",
4709
+ role: "menuitem",
4710
+ onClick: () => {
4711
+ const { options: _drop, ...rest } = style;
4712
+ setStyleRaw(rest);
4713
+ },
4714
+ children: t3.resetOptions
4715
+ }
4716
+ )
4717
+ ] });
4718
+ const levelsBody = () => /* @__PURE__ */ a3($, { children: [
4719
+ /* @__PURE__ */ a3("div", { class: "fnc-levels-list fnc-scroll", children: levelRows.map((l3, i3) => /* @__PURE__ */ a3("div", { class: "fnc-level-row", children: [
4720
+ /* @__PURE__ */ a3(
4721
+ "input",
4722
+ {
4723
+ type: "checkbox",
4724
+ checked: l3.on !== false,
4725
+ "aria-label": `${t3.levelShown} ${l3.value}`,
4726
+ onChange: (e3) => setLevels(levelRows.map((x2, j2) => j2 === i3 ? { ...x2, on: e3.target.checked } : x2))
4727
+ }
4728
+ ),
4729
+ /* @__PURE__ */ a3(
4730
+ "input",
4731
+ {
4732
+ class: "fnc-input fnc-level-value",
4733
+ type: "number",
4734
+ step: "any",
4735
+ defaultValue: String(l3.value),
4736
+ "aria-label": t3.levelValue,
4737
+ onChange: (e3) => {
4738
+ const v3 = Number(e3.target.value);
4739
+ if (Number.isFinite(v3) && Math.abs(v3) <= 1e3) setLevels(levelRows.map((x2, j2) => j2 === i3 ? { ...x2, value: v3 } : x2));
4740
+ }
4741
+ }
4742
+ ),
4743
+ /* @__PURE__ */ a3(
4744
+ ColorPicker,
4745
+ {
4746
+ class: "fnc-swatch fnc-level-color",
4747
+ style: { background: l3.color ?? "#3182F6" },
4748
+ tip: t3.levelColor,
4749
+ value: l3.color ?? "",
4750
+ label: `${t3.levelColor} ${l3.value}`,
4751
+ t: t3,
4752
+ onPick: (color) => setLevels(levelRows.map((x2, j2) => j2 === i3 ? { ...x2, color } : x2))
4753
+ }
4754
+ ),
4755
+ /* @__PURE__ */ a3(
4756
+ "input",
4757
+ {
4758
+ class: "fnc-input fnc-level-text",
4759
+ type: "text",
4760
+ maxLength: 40,
4761
+ defaultValue: l3.text ?? "",
4762
+ placeholder: t3.levelText,
4763
+ "aria-label": `${l3.value} ${t3.levelText}`,
4764
+ onChange: (e3) => setLevels(levelRows.map((x2, j2) => j2 === i3 ? { ...x2, text: e3.target.value.trim() } : x2))
4765
+ }
4766
+ ),
4767
+ /* @__PURE__ */ a3("button", { class: "fnc-ind-btn", "data-tip": t3.removeLevel, "aria-label": `${l3.value} ${t3.removeLevel}`, onClick: () => setLevels(levelRows.filter((_3, j2) => j2 !== i3)), children: /* @__PURE__ */ a3(SmallCloseIcon, {}) })
4768
+ ] }, `${i3}:${l3.value}`)) }),
4769
+ /* @__PURE__ */ a3("div", { class: "fnc-menu-sep" }),
4770
+ /* @__PURE__ */ a3(
4771
+ "button",
4772
+ {
4773
+ class: "fnc-menu-item",
4774
+ role: "menuitem",
4775
+ onClick: () => {
4776
+ const values = levelRows.map((x2) => x2.value);
4777
+ const top = values.length ? Math.max(...values) : 0;
4778
+ const gap = values.length > 1 ? Math.abs(values[values.length - 1] - values[values.length - 2]) || 1 : 1;
4779
+ setLevels([...levelRows, { value: Number((top + gap).toFixed(4)), on: true, color: current }]);
4780
+ },
4781
+ children: [
4782
+ "+ ",
4783
+ t3.addLevel
4784
+ ]
4785
+ }
4786
+ ),
4787
+ /* @__PURE__ */ a3("button", { class: "fnc-menu-item", role: "menuitem", onClick: resetLevels, children: t3.resetLevels })
4788
+ ] });
4789
+ const templateBody = () => /* @__PURE__ */ a3($, { children: [
4790
+ mine.length === 0 && /* @__PURE__ */ a3("div", { class: "fnc-menu-note", children: t3.noTemplates }),
4791
+ mine.map((tpl) => /* @__PURE__ */ a3("div", { class: "fnc-template-row", children: [
4792
+ /* @__PURE__ */ a3("button", { class: "fnc-menu-item", role: "menuitem", onClick: () => applyTemplate(tpl), children: [
4793
+ /* @__PURE__ */ a3("span", { class: "fnc-swatch", style: { background: tpl.color ?? current } }),
4794
+ /* @__PURE__ */ a3("svg", { width: "28", height: "12", viewBox: "0 0 28 12", "aria-hidden": "true", children: /* @__PURE__ */ a3(
4795
+ "path",
4796
+ {
4797
+ d: "M2 6h24",
4798
+ stroke: tpl.color ?? current,
4799
+ "stroke-width": tpl.style.width ?? 2,
4800
+ "stroke-linecap": "round",
4801
+ "stroke-dasharray": tpl.style.dash === "dashed" ? "4 3" : tpl.style.dash === "dotted" ? "1 3" : void 0
4802
+ }
4803
+ ) }),
4804
+ /* @__PURE__ */ a3("span", { children: tpl.name })
4805
+ ] }),
4806
+ /* @__PURE__ */ a3(
4807
+ "button",
4808
+ {
4809
+ class: "fnc-ind-btn",
4810
+ "data-tip": t3.deleteTemplate,
4811
+ "aria-label": `${tpl.name} ${t3.deleteTemplate}`,
4812
+ onClick: () => keepTemplates(mine.filter((x2) => x2 !== tpl)),
4813
+ children: /* @__PURE__ */ a3(SmallCloseIcon, {})
4814
+ }
4815
+ )
4816
+ ] })),
4817
+ /* @__PURE__ */ a3("div", { class: "fnc-menu-sep" }),
4818
+ naming === null ? /* @__PURE__ */ a3($, { children: [
4819
+ /* @__PURE__ */ a3("button", { class: "fnc-menu-item", role: "menuitem", onClick: () => setNaming(""), children: t3.saveTemplate }),
4820
+ /* @__PURE__ */ a3("button", { class: "fnc-menu-item", role: "menuitem", onClick: resetLook, children: t3.resetDrawingLook })
4821
+ ] }) : /* @__PURE__ */ a3(
4822
+ "input",
4823
+ {
4824
+ class: "fnc-selbar-text fnc-template-name",
4825
+ value: naming,
4826
+ placeholder: t3.templateName,
4827
+ "aria-label": t3.templateName,
4828
+ maxLength: 30,
4829
+ autoFocus: true,
4830
+ onInput: (e3) => setNaming(e3.target.value),
4831
+ onKeyDown: (e3) => {
4832
+ e3.stopPropagation();
4833
+ if (e3.key === "Enter") saveTemplate();
4834
+ if (e3.key === "Escape") setNaming(null);
4835
+ }
4836
+ }
4837
+ )
4838
+ ] });
4839
+ const orderBody = () => /* @__PURE__ */ a3($, { children: [
4840
+ ["front", t3.bringToFront],
4841
+ ["forward", t3.bringForward],
4842
+ ["backward", t3.sendBackward],
4843
+ ["back", t3.sendToBack]
4844
+ ].map(([where, label]) => /* @__PURE__ */ a3("button", { class: "fnc-menu-item", role: "menuitem", disabled: !ctx.chart.canMoveDrawing(d3.id, where), onClick: () => ctx.chart.moveDrawing(d3.id, where), children: label })) });
4845
+ const noteBody = () => /* @__PURE__ */ a3($, { children: [
4846
+ /* @__PURE__ */ a3(
4847
+ "textarea",
4848
+ {
4849
+ defaultValue: style.text ?? "",
4850
+ placeholder: t3.noteText,
4851
+ "aria-label": t3.noteText,
4852
+ onInput: (e3) => {
4853
+ const text = e3.target.value;
4854
+ const { text: _drop, ...rest } = style;
4855
+ setStyleRaw(text.trim() ? { ...rest, text } : rest);
4856
+ }
4857
+ },
4858
+ d3.id
4859
+ ),
4860
+ /* @__PURE__ */ a3("div", { class: "fnc-note-row", children: [
4861
+ /* @__PURE__ */ a3(
4862
+ ColorPicker,
4863
+ {
4864
+ class: "fnc-color fnc-color-btn",
4865
+ style: { background: style.textColor ?? d3.color ?? "#3182F6" },
4866
+ value: style.textColor ?? d3.color ?? "",
4867
+ label: t3.textColor,
4868
+ t: t3,
4869
+ onPick: (textColor) => setStyle({ textColor })
4870
+ }
4871
+ ),
4872
+ /* @__PURE__ */ a3("select", { class: "fnc-select", "aria-label": t3.fontSize, value: String(style.fontSize ?? 14), onChange: (e3) => setStyle({ fontSize: Number(e3.target.value) }), children: [10, 11, 12, 14, 16, 20, 24, 28, 32, 40].map((n2) => /* @__PURE__ */ a3("option", { value: String(n2), children: [
4873
+ n2,
4874
+ "px"
4875
+ ] })) }),
4876
+ /* @__PURE__ */ a3("button", { type: "button", class: "fnc-note-toggle", "aria-pressed": !!style.bold, "aria-label": t3.bold, onClick: () => setStyle({ bold: !style.bold }), children: /* @__PURE__ */ a3("b", { children: "B" }) }),
4877
+ /* @__PURE__ */ a3("button", { type: "button", class: "fnc-note-toggle", "aria-pressed": !!style.italic, "aria-label": t3.italic, onClick: () => setStyle({ italic: !style.italic }), children: /* @__PURE__ */ a3("i", { children: "I" }) })
4878
+ ] }),
4879
+ /* @__PURE__ */ a3("div", { class: "fnc-note-row", children: [
4880
+ /* @__PURE__ */ a3("span", { children: t3.noteH }),
4881
+ /* @__PURE__ */ a3("select", { class: "fnc-select", "aria-label": t3.noteH, value: style.textH ?? "center", onChange: (e3) => setStyle({ textH: e3.target.value }), children: [
4882
+ /* @__PURE__ */ a3("option", { value: "left", children: t3.alignLeft }),
4883
+ /* @__PURE__ */ a3("option", { value: "center", children: t3.alignCenter }),
4884
+ /* @__PURE__ */ a3("option", { value: "right", children: t3.alignRight })
4885
+ ] }),
4886
+ /* @__PURE__ */ a3("span", { children: t3.noteV }),
4887
+ /* @__PURE__ */ a3(
4888
+ "select",
4889
+ {
4890
+ class: "fnc-select",
4891
+ "aria-label": t3.noteV,
4892
+ value: style.textV ?? (def?.note === "line" ? "top" : "middle"),
4893
+ onChange: (e3) => setStyle({ textV: e3.target.value }),
4894
+ children: [
4895
+ /* @__PURE__ */ a3("option", { value: "top", children: t3.alignTop }),
4896
+ /* @__PURE__ */ a3("option", { value: "middle", children: t3.alignMiddle }),
4897
+ /* @__PURE__ */ a3("option", { value: "bottom", children: t3.alignBottom })
4898
+ ]
4899
+ }
4900
+ )
4901
+ ] })
4902
+ ] });
4903
+ const coordsBody = () => /* @__PURE__ */ a3($, { children: /* @__PURE__ */ a3(DrawingCoords, { ctx, drawing: d3, t: t3 }) });
4904
+ const visibilityBody = () => /* @__PURE__ */ a3($, { children: [
4905
+ /* @__PURE__ */ a3("p", { class: "fnc-hint", children: t3.visibilityHint }),
4906
+ /* @__PURE__ */ a3(
4907
+ IntervalVisibilityEditor,
4908
+ {
4909
+ t: t3,
4910
+ value: style.intervals,
4911
+ onChange: (v3) => {
4912
+ const intervals = cleanIntervals(v3);
4913
+ const { intervals: _drop, ...rest } = style;
4914
+ setStyleRaw(intervals ? { ...rest, intervals } : rest);
4915
+ }
4916
+ }
4917
+ )
4918
+ ] });
4616
4919
  return /* @__PURE__ */ a3("div", { ref: bar, class: "fnc-selbar", role: "toolbar", style: { left: `${s3.layout.plotWidth / 2 + offset[0]}px`, top: `${8 + offset[1]}px` }, children: [
4617
4920
  /* @__PURE__ */ a3(
4618
4921
  "button",
@@ -4628,302 +4931,183 @@ function SelectionBar({ ctx }) {
4628
4931
  children: /* @__PURE__ */ a3(GripIcon, {})
4629
4932
  }
4630
4933
  ),
4631
- !def?.levels && !def?.plain && [...SWATCHES, ...recent.filter((c3) => !SWATCHES.includes(c3))].map((color) => /* @__PURE__ */ a3("button", { class: "fnc-swatch", style: { background: color }, "data-tip": t3.color, "aria-label": `${t3.color} ${color}`, "aria-pressed": current === color, onClick: () => pickColor(color) })),
4632
- !def?.levels && !def?.plain && /* @__PURE__ */ a3(
4633
- ColorPicker,
4634
- {
4635
- class: "fnc-swatch fnc-swatch-add",
4636
- value: current,
4637
- label: t3.palette,
4638
- tip: t3.palette,
4639
- t: t3,
4640
- onPick: (color) => {
4641
- pickColor(color);
4642
- setRecent(recentColors().slice(0, 3));
4643
- },
4644
- children: /* @__PURE__ */ a3("svg", { width: "10", height: "10", viewBox: "0 0 10 10", "aria-hidden": "true", children: /* @__PURE__ */ a3("path", { d: "M5 1.5v7M1.5 5h7", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round" }) })
4645
- }
4646
- ),
4647
- slots.length > 0 && /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
4648
- /* @__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, {}) }),
4649
- menu === "colors" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop fnc-part-menu", role: "menu", children: [
4650
- slots.map((slot) => {
4651
- const c3 = slotColor(slot.key, slot.color);
4652
- return /* @__PURE__ */ a3("div", { class: "fnc-menu-item fnc-part", children: [
4653
- /* @__PURE__ */ a3(ColorPicker, { class: "fnc-swatch", style: { background: c3 }, value: c3, label: `${slot.name[s3.locale]} ${t3.color}`, t: t3, onPick: (color) => setStyle({ colors: { ...style.colors, [slot.key]: color } }) }),
4654
- /* @__PURE__ */ a3("span", { children: slot.name[s3.locale] })
4655
- ] });
4656
- }),
4934
+ phone && !def?.levels && !def?.plain && /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
4935
+ /* @__PURE__ */ a3("button", { class: "fnc-btn fnc-selbar-brush", "aria-label": t3.color, "aria-expanded": menu === "brush", onClick: () => setMenu(menu === "brush" ? null : "brush"), children: /* @__PURE__ */ a3(BrushIcon, { color: current }) }),
4936
+ menu === "brush" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop fnc-brush-pop", role: "menu", children: [
4937
+ [...SWATCHES, ...recent.filter((c3) => !SWATCHES.includes(c3))].map((color) => /* @__PURE__ */ a3("button", { class: "fnc-swatch", style: { background: color }, "aria-label": `${t3.color} ${color}`, "aria-pressed": current === color, onClick: () => pickColor(color) })),
4657
4938
  /* @__PURE__ */ a3(
4658
- "button",
4939
+ ColorPicker,
4659
4940
  {
4660
- class: "fnc-menu-item fnc-part-reset",
4661
- role: "menuitem",
4662
- onClick: () => {
4663
- const { colors: _drop, ...rest } = style;
4664
- ctx.chart.updateDrawing(d3.id, { style: rest });
4665
- setMenu(null);
4941
+ class: "fnc-swatch fnc-swatch-add",
4942
+ value: current,
4943
+ label: t3.palette,
4944
+ t: t3,
4945
+ onPick: (color) => {
4946
+ pickColor(color);
4947
+ setRecent(recentColors().slice(0, 3));
4666
4948
  },
4667
- children: t3.resetColors
4949
+ children: /* @__PURE__ */ a3("svg", { width: "10", height: "10", viewBox: "0 0 10 10", "aria-hidden": "true", children: /* @__PURE__ */ a3("path", { d: "M5 1.5v7M1.5 5h7", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round" }) })
4668
4950
  }
4669
4951
  )
4670
4952
  ] })
4671
4953
  ] }),
4672
- def?.options && def.options.length > 0 && /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
4673
- /* @__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, {}) }),
4674
- menu === "options" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop fnc-options-menu", role: "menu", onKeyDown: (e3) => e3.key !== "Escape" && e3.stopPropagation(), children: [
4675
- def.options.map((o4) => {
4676
- const value = drawingOption(def, d3, o4.key);
4677
- const set = (v3) => setStyle({ options: { ...style.options, [o4.key]: v3 } });
4678
- if (o4.kind === "toggle")
4679
- return /* @__PURE__ */ a3("label", { class: "fnc-menu-item fnc-option-row", children: [
4680
- /* @__PURE__ */ a3("input", { type: "checkbox", checked: value === true, onChange: (e3) => set(e3.target.checked) }),
4681
- /* @__PURE__ */ a3("span", { children: o4.label[s3.locale] })
4682
- ] });
4683
- if (o4.kind === "choice")
4684
- return /* @__PURE__ */ a3("label", { class: "fnc-option-row fnc-option-field", children: [
4685
- /* @__PURE__ */ a3("span", { children: o4.label[s3.locale] }),
4686
- /* @__PURE__ */ a3("select", { class: "fnc-select", value: String(value), onChange: (e3) => set(e3.target.value), children: o4.choices?.map((c3) => /* @__PURE__ */ a3("option", { value: c3.value, children: c3.label[s3.locale] })) })
4687
- ] });
4688
- return /* @__PURE__ */ a3("label", { class: "fnc-option-row fnc-option-field", children: [
4689
- /* @__PURE__ */ a3("span", { children: o4.label[s3.locale] }),
4690
- /* @__PURE__ */ a3(
4691
- "input",
4692
- {
4693
- class: "fnc-input fnc-option-number",
4694
- type: "number",
4695
- step: o4.step ?? "any",
4696
- min: o4.min,
4697
- max: o4.max,
4698
- defaultValue: String(value),
4699
- onChange: (e3) => {
4700
- const v3 = Number(e3.target.value);
4701
- if (Number.isFinite(v3)) set(v3);
4702
- }
4703
- }
4704
- ),
4705
- o4.unit && /* @__PURE__ */ a3("span", { class: "fnc-option-unit", children: o4.unit })
4706
- ] }, `${o4.key}:${String(value)}`);
4707
- }),
4708
- /* @__PURE__ */ a3("div", { class: "fnc-menu-sep" }),
4954
+ phone && def && (def.text || !def.plain) && /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
4955
+ /* @__PURE__ */ a3(
4956
+ "button",
4957
+ {
4958
+ class: style.text ? "fnc-btn fnc-btn-on" : "fnc-btn",
4959
+ "aria-label": def.text ? t3.drawingText : t3.note,
4960
+ "aria-expanded": menu === "note",
4961
+ onClick: () => setMenu(menu === "note" ? null : "note"),
4962
+ children: /* @__PURE__ */ a3(TextIcon, {})
4963
+ }
4964
+ ),
4965
+ menu === "note" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop fnc-note-menu", role: "menu", onKeyDown: (e3) => e3.key !== "Escape" && e3.stopPropagation(), children: def.text ? /* @__PURE__ */ a3($, { children: [
4709
4966
  /* @__PURE__ */ a3(
4710
- "button",
4967
+ "input",
4711
4968
  {
4712
- class: "fnc-menu-item",
4713
- role: "menuitem",
4714
- onClick: () => {
4715
- const { options: _drop, ...rest } = style;
4716
- setStyleRaw(rest);
4717
- },
4718
- children: t3.resetOptions
4969
+ class: "fnc-input fnc-ss-text",
4970
+ value: style.text ?? "",
4971
+ placeholder: t3.textPlaceholder,
4972
+ "aria-label": t3.drawingText,
4973
+ maxLength: 200,
4974
+ onInput: (e3) => setStyle({ text: e3.target.value })
4719
4975
  }
4720
- )
4721
- ] })
4976
+ ),
4977
+ /* @__PURE__ */ a3("div", { class: "fnc-ss-row", children: [
4978
+ /* @__PURE__ */ a3("span", { children: t3.fontSize }),
4979
+ /* @__PURE__ */ a3("div", { class: "fnc-ss-step", children: [
4980
+ /* @__PURE__ */ a3("button", { "aria-label": `${t3.fontSize} \u2212`, disabled: fontIndex === 0, onClick: () => setStyle({ fontSize: FONT_SIZES[fontIndex - 1] }), children: "\u2212" }),
4981
+ /* @__PURE__ */ a3("b", { children: style.fontSize ?? 14 }),
4982
+ /* @__PURE__ */ a3("button", { "aria-label": `${t3.fontSize} +`, disabled: fontIndex >= FONT_SIZES.length - 1, onClick: () => setStyle({ fontSize: FONT_SIZES[fontIndex + 1] }), children: "+" })
4983
+ ] })
4984
+ ] })
4985
+ ] }) : noteBody() })
4722
4986
  ] }),
4723
- def?.levels && /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
4724
- /* @__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, {}) }),
4725
- menu === "levels" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop fnc-levels-menu", role: "menu", onKeyDown: (e3) => e3.key !== "Escape" && e3.stopPropagation(), children: [
4726
- /* @__PURE__ */ a3("div", { class: "fnc-levels-list fnc-scroll", children: levelRows.map((l3, i3) => /* @__PURE__ */ a3("div", { class: "fnc-level-row", children: [
4727
- /* @__PURE__ */ a3(
4728
- "input",
4729
- {
4730
- type: "checkbox",
4731
- checked: l3.on !== false,
4732
- "aria-label": `${t3.levelShown} ${l3.value}`,
4733
- onChange: (e3) => setLevels(levelRows.map((x2, j2) => j2 === i3 ? { ...x2, on: e3.target.checked } : x2))
4734
- }
4735
- ),
4736
- /* @__PURE__ */ a3(
4737
- "input",
4738
- {
4739
- class: "fnc-input fnc-level-value",
4740
- type: "number",
4741
- step: "any",
4742
- defaultValue: String(l3.value),
4743
- "aria-label": t3.levelValue,
4744
- onChange: (e3) => {
4745
- const v3 = Number(e3.target.value);
4746
- if (Number.isFinite(v3) && Math.abs(v3) <= 1e3) setLevels(levelRows.map((x2, j2) => j2 === i3 ? { ...x2, value: v3 } : x2));
4747
- }
4748
- }
4749
- ),
4750
- /* @__PURE__ */ a3(
4751
- ColorPicker,
4752
- {
4753
- class: "fnc-swatch fnc-level-color",
4754
- style: { background: l3.color ?? "#3182F6" },
4755
- tip: t3.levelColor,
4756
- value: l3.color ?? "",
4757
- label: `${t3.levelColor} ${l3.value}`,
4758
- t: t3,
4759
- onPick: (color) => setLevels(levelRows.map((x2, j2) => j2 === i3 ? { ...x2, color } : x2))
4760
- }
4761
- ),
4762
- /* @__PURE__ */ a3(
4763
- "input",
4987
+ phone && /* @__PURE__ */ a3(
4988
+ "button",
4989
+ {
4990
+ class: "fnc-btn",
4991
+ "aria-label": t3.style,
4992
+ "aria-expanded": sheet,
4993
+ onClick: () => {
4994
+ setMenu(null);
4995
+ setSheet(true);
4996
+ },
4997
+ children: /* @__PURE__ */ a3(SettingsIcon, {})
4998
+ }
4999
+ ),
5000
+ !phone && /* @__PURE__ */ a3($, { children: [
5001
+ !def?.levels && !def?.plain && [...SWATCHES, ...recent.filter((c3) => !SWATCHES.includes(c3))].map((color) => /* @__PURE__ */ a3("button", { class: "fnc-swatch", style: { background: color }, "data-tip": t3.color, "aria-label": `${t3.color} ${color}`, "aria-pressed": current === color, onClick: () => pickColor(color) })),
5002
+ !def?.levels && !def?.plain && /* @__PURE__ */ a3(
5003
+ ColorPicker,
5004
+ {
5005
+ class: "fnc-swatch fnc-swatch-add",
5006
+ value: current,
5007
+ label: t3.palette,
5008
+ tip: t3.palette,
5009
+ t: t3,
5010
+ onPick: (color) => {
5011
+ pickColor(color);
5012
+ setRecent(recentColors().slice(0, 3));
5013
+ },
5014
+ children: /* @__PURE__ */ a3("svg", { width: "10", height: "10", viewBox: "0 0 10 10", "aria-hidden": "true", children: /* @__PURE__ */ a3("path", { d: "M5 1.5v7M1.5 5h7", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round" }) })
5015
+ }
5016
+ ),
5017
+ slots.length > 0 && /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5018
+ /* @__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, {}) }),
5019
+ menu === "colors" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop fnc-part-menu", role: "menu", children: colorsBody() })
5020
+ ] }),
5021
+ def?.options && def.options.length > 0 && /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5022
+ /* @__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, {}) }),
5023
+ 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() })
5024
+ ] }),
5025
+ def?.levels && /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5026
+ /* @__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, {}) }),
5027
+ menu === "levels" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop fnc-levels-menu", role: "menu", onKeyDown: (e3) => e3.key !== "Escape" && e3.stopPropagation(), children: levelsBody() })
5028
+ ] }),
5029
+ !def?.plain && /* @__PURE__ */ a3($, { children: [
5030
+ /* @__PURE__ */ a3("div", { class: "fnc-sep" }),
5031
+ /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5032
+ /* @__PURE__ */ a3("button", { class: "fnc-btn fnc-selbar-width", "data-tip": t3.lineWidth, "aria-label": t3.lineWidth, "aria-expanded": menu === "width", onClick: () => setMenu(menu === "width" ? null : "width"), children: /* @__PURE__ */ a3("svg", { width: "20", height: "20", viewBox: "0 0 20 20", "aria-hidden": "true", children: /* @__PURE__ */ a3("path", { d: "M3 10h14", stroke: "currentColor", "stroke-width": style.width ?? 2, "stroke-linecap": "round" }) }) }),
5033
+ menu === "width" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop", role: "menu", children: WIDTHS.map((w3) => /* @__PURE__ */ a3(
5034
+ "button",
4764
5035
  {
4765
- class: "fnc-input fnc-level-text",
4766
- type: "text",
4767
- maxLength: 40,
4768
- defaultValue: l3.text ?? "",
4769
- placeholder: t3.levelText,
4770
- "aria-label": `${l3.value} ${t3.levelText}`,
4771
- onChange: (e3) => setLevels(levelRows.map((x2, j2) => j2 === i3 ? { ...x2, text: e3.target.value.trim() } : x2))
5036
+ class: "fnc-menu-item",
5037
+ role: "menuitemradio",
5038
+ "aria-checked": (style.width ?? 2) === w3,
5039
+ onClick: () => {
5040
+ setStyle({ width: w3 });
5041
+ setMenu(null);
5042
+ },
5043
+ children: [
5044
+ /* @__PURE__ */ a3("svg", { width: "40", height: "12", viewBox: "0 0 40 12", "aria-hidden": "true", children: /* @__PURE__ */ a3("path", { d: "M2 6h36", stroke: "currentColor", "stroke-width": w3, "stroke-linecap": "round" }) }),
5045
+ /* @__PURE__ */ a3("span", { children: [
5046
+ w3,
5047
+ "px"
5048
+ ] })
5049
+ ]
4772
5050
  }
4773
- ),
4774
- /* @__PURE__ */ a3("button", { class: "fnc-ind-btn", "data-tip": t3.removeLevel, "aria-label": `${l3.value} ${t3.removeLevel}`, onClick: () => setLevels(levelRows.filter((_3, j2) => j2 !== i3)), children: /* @__PURE__ */ a3(SmallCloseIcon, {}) })
4775
- ] }, `${i3}:${l3.value}`)) }),
4776
- /* @__PURE__ */ a3("div", { class: "fnc-menu-sep" }),
5051
+ )) })
5052
+ ] }),
4777
5053
  /* @__PURE__ */ a3(
4778
5054
  "button",
4779
5055
  {
4780
- class: "fnc-menu-item",
4781
- role: "menuitem",
4782
- onClick: () => {
4783
- const values = levelRows.map((x2) => x2.value);
4784
- const top = values.length ? Math.max(...values) : 0;
4785
- const gap = values.length > 1 ? Math.abs(values[values.length - 1] - values[values.length - 2]) || 1 : 1;
4786
- setLevels([...levelRows, { value: Number((top + gap).toFixed(4)), on: true, color: current }]);
4787
- },
4788
- children: [
4789
- "+ ",
4790
- t3.addLevel
4791
- ]
5056
+ class: "fnc-btn",
5057
+ "data-tip": `${t3.lineStyle}: ${dash === "solid" ? t3.lineSolid : dash === "dashed" ? t3.lineDashed : t3.lineDotted}`,
5058
+ "aria-label": t3.lineStyle,
5059
+ onClick: () => setStyle({ dash: DASH_ORDER[(DASH_ORDER.indexOf(dash) + 1) % DASH_ORDER.length] }),
5060
+ children: /* @__PURE__ */ a3(DashGlyph, { dash })
4792
5061
  }
4793
- ),
4794
- /* @__PURE__ */ a3("button", { class: "fnc-menu-item", role: "menuitem", onClick: resetLevels, children: t3.resetLevels })
4795
- ] })
4796
- ] }),
4797
- !def?.plain && /* @__PURE__ */ a3($, { children: [
4798
- /* @__PURE__ */ a3("div", { class: "fnc-sep" }),
4799
- /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
4800
- /* @__PURE__ */ a3("button", { class: "fnc-btn fnc-selbar-width", "data-tip": t3.lineWidth, "aria-label": t3.lineWidth, "aria-expanded": menu === "width", onClick: () => setMenu(menu === "width" ? null : "width"), children: /* @__PURE__ */ a3("svg", { width: "20", height: "20", viewBox: "0 0 20 20", "aria-hidden": "true", children: /* @__PURE__ */ a3("path", { d: "M3 10h14", stroke: "currentColor", "stroke-width": style.width ?? 2, "stroke-linecap": "round" }) }) }),
4801
- menu === "width" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop", role: "menu", children: WIDTHS.map((w3) => /* @__PURE__ */ a3(
5062
+ )
5063
+ ] }),
5064
+ def?.text && /* @__PURE__ */ a3(
5065
+ "input",
5066
+ {
5067
+ class: "fnc-selbar-text",
5068
+ value: style.text ?? "",
5069
+ placeholder: t3.textPlaceholder,
5070
+ "aria-label": t3.drawingText,
5071
+ maxLength: 200,
5072
+ onInput: (e3) => setStyle({ text: e3.target.value }),
5073
+ onKeyDown: (e3) => e3.stopPropagation()
5074
+ }
5075
+ ),
5076
+ def?.text && /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5077
+ /* @__PURE__ */ a3("button", { class: "fnc-btn fnc-selbar-font", "data-tip": t3.fontSize, "aria-label": t3.fontSize, "aria-expanded": menu === "font", onClick: () => setMenu(menu === "font" ? null : "font"), children: style.fontSize ?? 14 }),
5078
+ menu === "font" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop", role: "menu", children: FONT_SIZES.map((size) => /* @__PURE__ */ a3(
4802
5079
  "button",
4803
5080
  {
4804
5081
  class: "fnc-menu-item",
4805
5082
  role: "menuitemradio",
4806
- "aria-checked": (style.width ?? 2) === w3,
5083
+ "aria-checked": (style.fontSize ?? 14) === size,
4807
5084
  onClick: () => {
4808
- setStyle({ width: w3 });
5085
+ setStyle({ fontSize: size });
4809
5086
  setMenu(null);
4810
5087
  },
4811
- children: [
4812
- /* @__PURE__ */ a3("svg", { width: "40", height: "12", viewBox: "0 0 40 12", "aria-hidden": "true", children: /* @__PURE__ */ a3("path", { d: "M2 6h36", stroke: "currentColor", "stroke-width": w3, "stroke-linecap": "round" }) }),
4813
- /* @__PURE__ */ a3("span", { children: [
4814
- w3,
4815
- "px"
4816
- ] })
4817
- ]
5088
+ children: /* @__PURE__ */ a3("span", { children: [
5089
+ size,
5090
+ "px"
5091
+ ] })
4818
5092
  }
4819
5093
  )) })
4820
5094
  ] }),
4821
- /* @__PURE__ */ a3(
4822
- "button",
4823
- {
4824
- class: "fnc-btn",
4825
- "data-tip": `${t3.lineStyle}: ${dash === "solid" ? t3.lineSolid : dash === "dashed" ? t3.lineDashed : t3.lineDotted}`,
4826
- "aria-label": t3.lineStyle,
4827
- onClick: () => setStyle({ dash: DASH_ORDER[(DASH_ORDER.indexOf(dash) + 1) % DASH_ORDER.length] }),
4828
- children: /* @__PURE__ */ a3(DashGlyph, { dash })
4829
- }
4830
- )
4831
- ] }),
4832
- def?.text && /* @__PURE__ */ a3(
4833
- "input",
4834
- {
4835
- class: "fnc-selbar-text",
4836
- value: style.text ?? "",
4837
- placeholder: t3.textPlaceholder,
4838
- "aria-label": t3.drawingText,
4839
- maxLength: 200,
4840
- onInput: (e3) => setStyle({ text: e3.target.value }),
4841
- onKeyDown: (e3) => e3.stopPropagation()
4842
- }
4843
- ),
4844
- def?.text && /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
4845
- /* @__PURE__ */ a3("button", { class: "fnc-btn fnc-selbar-font", "data-tip": t3.fontSize, "aria-label": t3.fontSize, "aria-expanded": menu === "font", onClick: () => setMenu(menu === "font" ? null : "font"), children: style.fontSize ?? 14 }),
4846
- menu === "font" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop", role: "menu", children: FONT_SIZES.map((size) => /* @__PURE__ */ a3(
4847
- "button",
4848
- {
4849
- class: "fnc-menu-item",
4850
- role: "menuitemradio",
4851
- "aria-checked": (style.fontSize ?? 14) === size,
4852
- onClick: () => {
4853
- setStyle({ fontSize: size });
4854
- setMenu(null);
4855
- },
4856
- children: /* @__PURE__ */ a3("span", { children: [
4857
- size,
4858
- "px"
4859
- ] })
4860
- }
4861
- )) })
4862
- ] }),
4863
- /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
4864
- /* @__PURE__ */ a3(
4865
- "button",
4866
- {
4867
- class: "fnc-btn",
4868
- "data-tip": t3.templates,
4869
- "aria-label": t3.templates,
4870
- "aria-expanded": menu === "template",
4871
- onClick: () => {
4872
- setNaming(null);
4873
- setMenu(menu === "template" ? null : "template");
4874
- },
4875
- children: /* @__PURE__ */ a3(TemplateIcon, {})
4876
- }
4877
- ),
4878
- menu === "template" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop fnc-template-menu", role: "menu", children: [
4879
- mine.length === 0 && /* @__PURE__ */ a3("div", { class: "fnc-menu-note", children: t3.noTemplates }),
4880
- mine.map((tpl) => /* @__PURE__ */ a3("div", { class: "fnc-template-row", children: [
4881
- /* @__PURE__ */ a3("button", { class: "fnc-menu-item", role: "menuitem", onClick: () => applyTemplate(tpl), children: [
4882
- /* @__PURE__ */ a3("span", { class: "fnc-swatch", style: { background: tpl.color ?? current } }),
4883
- /* @__PURE__ */ a3("svg", { width: "28", height: "12", viewBox: "0 0 28 12", "aria-hidden": "true", children: /* @__PURE__ */ a3(
4884
- "path",
4885
- {
4886
- d: "M2 6h24",
4887
- stroke: tpl.color ?? current,
4888
- "stroke-width": tpl.style.width ?? 2,
4889
- "stroke-linecap": "round",
4890
- "stroke-dasharray": tpl.style.dash === "dashed" ? "4 3" : tpl.style.dash === "dotted" ? "1 3" : void 0
4891
- }
4892
- ) }),
4893
- /* @__PURE__ */ a3("span", { children: tpl.name })
4894
- ] }),
4895
- /* @__PURE__ */ a3(
4896
- "button",
4897
- {
4898
- class: "fnc-ind-btn",
4899
- "data-tip": t3.deleteTemplate,
4900
- "aria-label": `${tpl.name} ${t3.deleteTemplate}`,
4901
- onClick: () => keepTemplates(mine.filter((x2) => x2 !== tpl)),
4902
- children: /* @__PURE__ */ a3(SmallCloseIcon, {})
4903
- }
4904
- )
4905
- ] })),
4906
- /* @__PURE__ */ a3("div", { class: "fnc-menu-sep" }),
4907
- naming === null ? /* @__PURE__ */ a3($, { children: [
4908
- /* @__PURE__ */ a3("button", { class: "fnc-menu-item", role: "menuitem", onClick: () => setNaming(""), children: t3.saveTemplate }),
4909
- /* @__PURE__ */ a3("button", { class: "fnc-menu-item", role: "menuitem", onClick: resetLook, children: t3.resetDrawingLook })
4910
- ] }) : /* @__PURE__ */ a3(
4911
- "input",
5095
+ /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5096
+ /* @__PURE__ */ a3(
5097
+ "button",
4912
5098
  {
4913
- class: "fnc-selbar-text fnc-template-name",
4914
- value: naming,
4915
- placeholder: t3.templateName,
4916
- "aria-label": t3.templateName,
4917
- maxLength: 30,
4918
- autoFocus: true,
4919
- onInput: (e3) => setNaming(e3.target.value),
4920
- onKeyDown: (e3) => {
4921
- e3.stopPropagation();
4922
- if (e3.key === "Enter") saveTemplate();
4923
- if (e3.key === "Escape") setNaming(null);
4924
- }
5099
+ class: "fnc-btn",
5100
+ "data-tip": t3.templates,
5101
+ "aria-label": t3.templates,
5102
+ "aria-expanded": menu === "template",
5103
+ onClick: () => {
5104
+ setNaming(null);
5105
+ setMenu(menu === "template" ? null : "template");
5106
+ },
5107
+ children: /* @__PURE__ */ a3(TemplateIcon, {})
4925
5108
  }
4926
- )
5109
+ ),
5110
+ menu === "template" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop fnc-template-menu", role: "menu", children: templateBody() })
4927
5111
  ] })
4928
5112
  ] }),
4929
5113
  actions.length > 0 && /* @__PURE__ */ a3("div", { class: "fnc-sep" }),
@@ -4942,116 +5126,42 @@ function SelectionBar({ ctx }) {
4942
5126
  }
4943
5127
  )),
4944
5128
  /* @__PURE__ */ a3("div", { class: "fnc-sep" }),
4945
- /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
4946
- /* @__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, {}) }),
4947
- menu === "order" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop", role: "menu", children: [
4948
- ["front", t3.bringToFront],
4949
- ["forward", t3.bringForward],
4950
- ["backward", t3.sendBackward],
4951
- ["back", t3.sendToBack]
4952
- ].map(([where, label]) => /* @__PURE__ */ a3("button", { class: "fnc-menu-item", role: "menuitem", disabled: !ctx.chart.canMoveDrawing(d3.id, where), onClick: () => ctx.chart.moveDrawing(d3.id, where), children: label })) })
4953
- ] }),
4954
- def && !def.text && /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
4955
- /* @__PURE__ */ a3(
4956
- "button",
4957
- {
4958
- class: style.text ? "fnc-btn fnc-btn-on" : "fnc-btn",
4959
- "data-tip": t3.note,
4960
- "aria-label": t3.note,
4961
- "aria-expanded": menu === "note",
4962
- onClick: () => setMenu(menu === "note" ? null : "note"),
4963
- children: /* @__PURE__ */ a3(TextIcon, {})
4964
- }
4965
- ),
4966
- menu === "note" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop fnc-note-menu", role: "menu", onKeyDown: (e3) => e3.key !== "Escape" && e3.stopPropagation(), children: [
5129
+ !phone && /* @__PURE__ */ a3($, { children: [
5130
+ /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5131
+ /* @__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, {}) }),
5132
+ menu === "order" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop", role: "menu", children: orderBody() })
5133
+ ] }),
5134
+ def && !def.text && /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
4967
5135
  /* @__PURE__ */ a3(
4968
- "textarea",
5136
+ "button",
4969
5137
  {
4970
- defaultValue: style.text ?? "",
4971
- placeholder: t3.noteText,
4972
- "aria-label": t3.noteText,
4973
- onInput: (e3) => {
4974
- const text = e3.target.value;
4975
- const { text: _drop, ...rest } = style;
4976
- setStyleRaw(text.trim() ? { ...rest, text } : rest);
4977
- }
4978
- },
4979
- d3.id
5138
+ class: style.text ? "fnc-btn fnc-btn-on" : "fnc-btn",
5139
+ "data-tip": t3.note,
5140
+ "aria-label": t3.note,
5141
+ "aria-expanded": menu === "note",
5142
+ onClick: () => setMenu(menu === "note" ? null : "note"),
5143
+ children: /* @__PURE__ */ a3(TextIcon, {})
5144
+ }
4980
5145
  ),
4981
- /* @__PURE__ */ a3("div", { class: "fnc-note-row", children: [
4982
- /* @__PURE__ */ a3(
4983
- ColorPicker,
4984
- {
4985
- class: "fnc-color fnc-color-btn",
4986
- style: { background: style.textColor ?? d3.color ?? "#3182F6" },
4987
- value: style.textColor ?? d3.color ?? "",
4988
- label: t3.textColor,
4989
- t: t3,
4990
- onPick: (textColor) => setStyle({ textColor })
4991
- }
4992
- ),
4993
- /* @__PURE__ */ a3("select", { class: "fnc-select", "aria-label": t3.fontSize, value: String(style.fontSize ?? 14), onChange: (e3) => setStyle({ fontSize: Number(e3.target.value) }), children: [10, 11, 12, 14, 16, 20, 24, 28, 32, 40].map((n2) => /* @__PURE__ */ a3("option", { value: String(n2), children: [
4994
- n2,
4995
- "px"
4996
- ] })) }),
4997
- /* @__PURE__ */ a3("button", { type: "button", class: "fnc-note-toggle", "aria-pressed": !!style.bold, "aria-label": t3.bold, onClick: () => setStyle({ bold: !style.bold }), children: /* @__PURE__ */ a3("b", { children: "B" }) }),
4998
- /* @__PURE__ */ a3("button", { type: "button", class: "fnc-note-toggle", "aria-pressed": !!style.italic, "aria-label": t3.italic, onClick: () => setStyle({ italic: !style.italic }), children: /* @__PURE__ */ a3("i", { children: "I" }) })
4999
- ] }),
5000
- /* @__PURE__ */ a3("div", { class: "fnc-note-row", children: [
5001
- /* @__PURE__ */ a3("span", { children: t3.noteH }),
5002
- /* @__PURE__ */ a3("select", { class: "fnc-select", "aria-label": t3.noteH, value: style.textH ?? "center", onChange: (e3) => setStyle({ textH: e3.target.value }), children: [
5003
- /* @__PURE__ */ a3("option", { value: "left", children: t3.alignLeft }),
5004
- /* @__PURE__ */ a3("option", { value: "center", children: t3.alignCenter }),
5005
- /* @__PURE__ */ a3("option", { value: "right", children: t3.alignRight })
5006
- ] }),
5007
- /* @__PURE__ */ a3("span", { children: t3.noteV }),
5008
- /* @__PURE__ */ a3(
5009
- "select",
5010
- {
5011
- class: "fnc-select",
5012
- "aria-label": t3.noteV,
5013
- value: style.textV ?? (def.note === "line" ? "top" : "middle"),
5014
- onChange: (e3) => setStyle({ textV: e3.target.value }),
5015
- children: [
5016
- /* @__PURE__ */ a3("option", { value: "top", children: t3.alignTop }),
5017
- /* @__PURE__ */ a3("option", { value: "middle", children: t3.alignMiddle }),
5018
- /* @__PURE__ */ a3("option", { value: "bottom", children: t3.alignBottom })
5019
- ]
5020
- }
5021
- )
5022
- ] })
5023
- ] })
5024
- ] }),
5025
- /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5026
- /* @__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, {}) }),
5027
- menu === "coords" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop fnc-coords-menu", role: "menu", onKeyDown: (e3) => e3.key !== "Escape" && e3.stopPropagation(), children: /* @__PURE__ */ a3(DrawingCoords, { ctx, drawing: d3, t: t3 }) })
5028
- ] }),
5029
- /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5030
- /* @__PURE__ */ a3(
5031
- "button",
5032
- {
5033
- class: style.intervals ? "fnc-btn fnc-btn-on" : "fnc-btn",
5034
- "data-tip": t3.tabVisibility,
5035
- "aria-label": t3.tabVisibility,
5036
- "aria-expanded": menu === "visibility",
5037
- onClick: () => setMenu(menu === "visibility" ? null : "visibility"),
5038
- children: /* @__PURE__ */ a3(ClockIcon, {})
5039
- }
5040
- ),
5041
- menu === "visibility" && /* @__PURE__ */ a3("div", { class: "fnc-menu fnc-selbar-pop fnc-visibility-menu", role: "menu", onKeyDown: (e3) => e3.key !== "Escape" && e3.stopPropagation(), children: [
5042
- /* @__PURE__ */ a3("p", { class: "fnc-hint", children: t3.visibilityHint }),
5146
+ 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() })
5147
+ ] }),
5148
+ /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5149
+ /* @__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, {}) }),
5150
+ 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() })
5151
+ ] }),
5152
+ /* @__PURE__ */ a3("div", { class: "fnc-selbar-menu", children: [
5043
5153
  /* @__PURE__ */ a3(
5044
- IntervalVisibilityEditor,
5154
+ "button",
5045
5155
  {
5046
- t: t3,
5047
- value: style.intervals,
5048
- onChange: (v3) => {
5049
- const intervals = cleanIntervals(v3);
5050
- const { intervals: _drop, ...rest } = style;
5051
- setStyleRaw(intervals ? { ...rest, intervals } : rest);
5052
- }
5156
+ class: style.intervals ? "fnc-btn fnc-btn-on" : "fnc-btn",
5157
+ "data-tip": t3.tabVisibility,
5158
+ "aria-label": t3.tabVisibility,
5159
+ "aria-expanded": menu === "visibility",
5160
+ onClick: () => setMenu(menu === "visibility" ? null : "visibility"),
5161
+ children: /* @__PURE__ */ a3(ClockIcon, {})
5053
5162
  }
5054
- )
5163
+ ),
5164
+ 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() })
5055
5165
  ] })
5056
5166
  ] }),
5057
5167
  /* @__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 }) }),
@@ -5068,7 +5178,137 @@ function SelectionBar({ ctx }) {
5068
5178
  children: /* @__PURE__ */ a3(CopyIcon, {})
5069
5179
  }
5070
5180
  ),
5071
- /* @__PURE__ */ a3("button", { class: "fnc-btn", "data-tip": t3.remove, "aria-label": t3.remove, onClick: () => ctx.chart.removeDrawing(d3.id), children: /* @__PURE__ */ a3(TrashIcon, {}) })
5181
+ /* @__PURE__ */ a3("button", { class: "fnc-btn", "data-tip": t3.remove, "aria-label": t3.remove, onClick: () => ctx.chart.removeDrawing(d3.id), children: /* @__PURE__ */ a3(TrashIcon, {}) }),
5182
+ phone && sheet && /* @__PURE__ */ a3(StyleSheet, { ctx, title: t3.style, resetLabel: t3.resetDefaults, onReset: resetLook, onClose: () => setSheet(false), children: [
5183
+ !def?.plain && /* @__PURE__ */ a3("section", { class: "fnc-ss-section", children: [
5184
+ !def?.levels && /* @__PURE__ */ a3("div", { class: "fnc-ss-row", children: [
5185
+ /* @__PURE__ */ a3("span", { children: t3.color }),
5186
+ /* @__PURE__ */ a3(
5187
+ ColorPicker,
5188
+ {
5189
+ class: "fnc-swatch fnc-ss-color",
5190
+ style: { background: current },
5191
+ value: current,
5192
+ label: t3.color,
5193
+ t: t3,
5194
+ onPick: (color) => {
5195
+ pickColor(color);
5196
+ setRecent(recentColors().slice(0, 3));
5197
+ }
5198
+ }
5199
+ )
5200
+ ] }),
5201
+ /* @__PURE__ */ a3("div", { class: "fnc-ss-row", children: [
5202
+ /* @__PURE__ */ a3("span", { children: t3.lineStyle }),
5203
+ /* @__PURE__ */ a3("div", { class: "fnc-ss-seg", role: "radiogroup", "aria-label": t3.lineStyle, children: DASH_ORDER.map((k2) => /* @__PURE__ */ a3("button", { role: "radio", "aria-checked": dash === k2, "aria-label": k2 === "solid" ? t3.lineSolid : k2 === "dashed" ? t3.lineDashed : t3.lineDotted, onClick: () => setStyle({ dash: k2 }), children: /* @__PURE__ */ a3(DashGlyph, { dash: k2 }) })) })
5204
+ ] }),
5205
+ /* @__PURE__ */ a3("div", { class: "fnc-ss-row", children: [
5206
+ /* @__PURE__ */ a3("span", { children: t3.lineWidth }),
5207
+ /* @__PURE__ */ a3("div", { class: "fnc-ss-step", children: [
5208
+ /* @__PURE__ */ a3("button", { "aria-label": `${t3.lineWidth} \u2212`, disabled: widthIndex === 0, onClick: () => setStyle({ width: WIDTHS[widthIndex - 1] }), children: "\u2212" }),
5209
+ /* @__PURE__ */ a3("b", { children: style.width ?? 2 }),
5210
+ /* @__PURE__ */ a3("button", { "aria-label": `${t3.lineWidth} +`, disabled: widthIndex >= WIDTHS.length - 1, onClick: () => setStyle({ width: WIDTHS[widthIndex + 1] }), children: "+" })
5211
+ ] })
5212
+ ] })
5213
+ ] }),
5214
+ slots.length > 0 && /* @__PURE__ */ a3("section", { class: "fnc-ss-section", children: [
5215
+ /* @__PURE__ */ a3("h3", { children: t3.partColors }),
5216
+ colorsBody()
5217
+ ] }),
5218
+ def?.options && def.options.length > 0 && /* @__PURE__ */ a3("section", { class: "fnc-ss-section", children: [
5219
+ /* @__PURE__ */ a3("h3", { children: t3.drawingOptions }),
5220
+ optionsBody()
5221
+ ] }),
5222
+ def?.levels && /* @__PURE__ */ a3("section", { class: "fnc-ss-section", children: [
5223
+ /* @__PURE__ */ a3("h3", { children: t3.levels }),
5224
+ levelsBody()
5225
+ ] }),
5226
+ /* @__PURE__ */ a3("section", { class: "fnc-ss-section", children: [
5227
+ /* @__PURE__ */ a3("h3", { children: t3.coordinates }),
5228
+ coordsBody()
5229
+ ] }),
5230
+ /* @__PURE__ */ a3("section", { class: "fnc-ss-section", children: [
5231
+ /* @__PURE__ */ a3("h3", { children: t3.tabVisibility }),
5232
+ visibilityBody()
5233
+ ] }),
5234
+ /* @__PURE__ */ a3("section", { class: "fnc-ss-section", children: [
5235
+ /* @__PURE__ */ a3("h3", { children: t3.drawingOrder }),
5236
+ orderBody()
5237
+ ] }),
5238
+ /* @__PURE__ */ a3("section", { class: "fnc-ss-section", children: [
5239
+ /* @__PURE__ */ a3("h3", { children: t3.templates }),
5240
+ templateBody()
5241
+ ] })
5242
+ ] })
5243
+ ] });
5244
+ }
5245
+ function BrushIcon({ color }) {
5246
+ return /* @__PURE__ */ a3("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", "stroke-width": "1.5", "stroke-linecap": "round", "stroke-linejoin": "round", "aria-hidden": "true", children: [
5247
+ /* @__PURE__ */ a3("path", { d: "M13.5 3.5 16.5 6.5 9 14 6 11Z" }),
5248
+ /* @__PURE__ */ a3("path", { d: "M6 11 4.5 12.5c-.8.8-.9 2-1 3 1 0 2.2-.2 3-1L8 13" }),
5249
+ /* @__PURE__ */ a3("rect", { x: "3", y: "17", width: "14", height: "2.2", rx: "1.1", fill: color, stroke: "none" })
5250
+ ] });
5251
+ }
5252
+ function StyleSheet({ ctx, title, resetLabel, onReset, onClose, children }) {
5253
+ const anchor = T2(null);
5254
+ const layer = usePageLayer(anchor, ctx.chart.settings);
5255
+ const panel = T2(null);
5256
+ const drag = T2(null);
5257
+ const [dy, setDy] = d2(0);
5258
+ const [shown, setShown] = d2(false);
5259
+ const [leaving, setLeaving] = d2(false);
5260
+ A2(() => {
5261
+ const frame = requestAnimationFrame(() => setShown(true));
5262
+ const esc = (e3) => e3.key === "Escape" && close();
5263
+ document.addEventListener("keydown", esc);
5264
+ return () => {
5265
+ cancelAnimationFrame(frame);
5266
+ document.removeEventListener("keydown", esc);
5267
+ };
5268
+ }, []);
5269
+ const close = () => {
5270
+ setLeaving(true);
5271
+ setTimeout(onClose, 180);
5272
+ };
5273
+ const move = (e3) => {
5274
+ const d3 = drag.current;
5275
+ if (!d3 || d3.id !== e3.pointerId) return;
5276
+ d3.dy = Math.max(0, e3.clientY - d3.y0);
5277
+ if (d3.dy > 4 && !panel.current?.hasPointerCapture(e3.pointerId)) panel.current?.setPointerCapture(e3.pointerId);
5278
+ setDy(d3.dy);
5279
+ };
5280
+ const end = (e3) => {
5281
+ const d3 = drag.current;
5282
+ if (!d3 || d3.id !== e3.pointerId) return;
5283
+ drag.current = null;
5284
+ const speed = d3.dy / Math.max(1, performance.now() - d3.t0);
5285
+ if (d3.dy > 90 || d3.dy > 24 && speed > 0.5) close();
5286
+ else setDy(0);
5287
+ };
5288
+ const sheet = /* @__PURE__ */ a3("div", { class: `fnc-sheet-backdrop${shown && !leaving ? " is-shown" : ""}`, onPointerDown: (e3) => e3.target === e3.currentTarget && close(), children: /* @__PURE__ */ a3(
5289
+ "div",
5290
+ {
5291
+ ref: panel,
5292
+ class: "fnc-sheet fnc-style-sheet",
5293
+ role: "dialog",
5294
+ "aria-label": title,
5295
+ style: { transform: shown && !leaving ? `translateY(${dy}px)` : "translateY(100%)", transition: drag.current ? "none" : void 0 },
5296
+ onPointerMove: move,
5297
+ onPointerUp: end,
5298
+ onPointerCancel: end,
5299
+ children: [
5300
+ /* @__PURE__ */ a3("div", { class: "fnc-sheet-grip fnc-ss-head", onPointerDown: (e3) => drag.current = { id: e3.pointerId, y0: e3.clientY, t0: performance.now(), dy: 0 }, children: [
5301
+ /* @__PURE__ */ a3("span", {}),
5302
+ /* @__PURE__ */ a3("h2", { children: title }),
5303
+ /* @__PURE__ */ a3("button", { class: "fnc-ss-reset", onPointerDown: (e3) => e3.stopPropagation(), onClick: onReset, children: resetLabel })
5304
+ ] }),
5305
+ /* @__PURE__ */ a3("div", { class: "fnc-ss-body", onKeyDown: (e3) => e3.key !== "Escape" && e3.stopPropagation(), children })
5306
+ ]
5307
+ }
5308
+ ) });
5309
+ return /* @__PURE__ */ a3($, { children: [
5310
+ /* @__PURE__ */ a3("span", { ref: anchor, hidden: true }),
5311
+ layer && X(sheet, layer)
5072
5312
  ] });
5073
5313
  }
5074
5314
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@funnest/charts-ui",
3
- "version": "0.11.59",
3
+ "version": "0.11.61",
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.59"
45
+ "@funnest/charts": "0.11.61"
46
46
  },
47
47
  "devDependencies": {
48
48
  "preact": "^11.2.0"