efficient-shell 13.16.0 → 13.18.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/README.md +7 -0
- package/dist/{Browser-4KWGT3FG.js → Browser-ORLSC6T4.js} +15 -15
- package/dist/Calculator-4UBMDAJO.js +29 -0
- package/dist/{CurrencyConverter-X5ENBDLK.js → CurrencyConverter-H3HHXXKT.js} +6 -6
- package/dist/{Files-NT76VUHQ.js → Files-PI3Z4TAO.js} +53 -53
- package/dist/Notepad-6FPZHJQ7.js +24 -0
- package/dist/PdfViewer-EELX35ZI.js +1 -0
- package/dist/{PomodoroTimer-KDXH5M3Q.js → PomodoroTimer-JVCYYGRD.js} +16 -16
- package/dist/{Preview-QNJD5PVD.js → Preview-4XSAIYMZ.js} +21 -21
- package/dist/{Stock-JR77FPOD.js → Stock-S266KGAF.js} +4 -4
- package/dist/{Weather-MGSDU3M5.js → Weather-TE4TTTQA.js} +19 -19
- package/dist/{WorldClock-GGAYPYIO.js → WorldClock-5TPBHBYA.js} +6 -6
- package/dist/ai/index.js +23 -23
- package/dist/apps/ImageAnnotator.js +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/bin/browser-check.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/brand.css +1 -1
- package/dist/charts/BoxPlotChart.js +1 -1
- package/dist/charts/CandlestickChart.js +1 -1
- package/dist/charts/CartesianPlot.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/FunnelChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/PieChart.js +1 -1
- package/dist/charts/RangeChart.js +1 -1
- package/dist/charts/SankeyChart.js +1 -1
- package/dist/charts/ScatterChart.js +1 -1
- package/dist/charts/SpecChart.js +1 -1
- package/dist/charts/TimeSeriesChart.js +1 -1
- package/dist/charts/TreemapChart.js +1 -1
- package/dist/charts/WaterfallChart.js +1 -1
- package/dist/chunk-2WBKQOLF.js +2 -0
- package/dist/{chunk-QE2JX7D4.js → chunk-34HRPEQD.js} +1 -1
- package/dist/{chunk-OWAYSIQH.js → chunk-42DF7CDB.js} +5 -5
- package/dist/chunk-43JCG6EB.js +1 -0
- package/dist/{chunk-J4CVYOY3.js → chunk-4SYPNE3P.js} +1 -1
- package/dist/{chunk-OEPQIIYL.js → chunk-63E4ZZYI.js} +1 -1
- package/dist/{chunk-CKTFXTJL.js → chunk-6OCA7RKQ.js} +1 -1
- package/dist/{chunk-NISLELJF.js → chunk-6UGMQZTF.js} +1 -1
- package/dist/{chunk-VYHVIKP6.js → chunk-7SVSHJOO.js} +10 -10
- package/dist/{chunk-W6NGPSMM.js → chunk-ABPVCVCT.js} +12 -12
- package/dist/{chunk-FKMARSJZ.js → chunk-BNI3N4TT.js} +2 -2
- package/dist/{chunk-IJNQ2BUY.js → chunk-CILE3ZCC.js} +2 -2
- package/dist/{chunk-XHD6Q6JV.js → chunk-EFO72DEI.js} +1 -1
- package/dist/{chunk-IJJNJJ6I.js → chunk-EG5MU7XL.js} +1 -1
- package/dist/{chunk-UC5IC3AM.js → chunk-EHM3ZVVT.js} +4 -4
- package/dist/{chunk-SHHRC5XK.js → chunk-ENVANMHI.js} +7 -7
- package/dist/{chunk-UFWBPTCM.js → chunk-F5F5RKB5.js} +5 -5
- package/dist/{chunk-OLSA36VX.js → chunk-FUPU7Z2G.js} +6 -6
- package/dist/{chunk-YDFDTRZF.js → chunk-G7SILKUY.js} +5 -5
- package/dist/{chunk-BVX7LUAW.js → chunk-GEQZUCEO.js} +6 -6
- package/dist/{chunk-J6QC45OS.js → chunk-HC5KQZFG.js} +5 -5
- package/dist/{chunk-GNXAVDZD.js → chunk-J5NBRYBF.js} +1 -1
- package/dist/chunk-KBQXXPFK.js +1 -0
- package/dist/{chunk-MHQW6NAE.js → chunk-KBZMOPPH.js} +10 -10
- package/dist/{chunk-N5KJLHYI.js → chunk-LADP6AJY.js} +5 -5
- package/dist/{chunk-IG3K6AGW.js → chunk-LUCO5PS6.js} +1 -1
- package/dist/chunk-M6UKCZHT.js +2 -0
- package/dist/{chunk-H5PSCQJ2.js → chunk-NVKRYUCM.js} +6 -6
- package/dist/{chunk-7IXU4YT4.js → chunk-OFFJHTNM.js} +4 -4
- package/dist/chunk-OTEAWX2C.js +1 -0
- package/dist/chunk-OUYGLDQN.js +24 -0
- package/dist/{chunk-7TJZ5AJE.js → chunk-QNXTVDIC.js} +6 -6
- package/dist/{chunk-PY4DTB6Y.js → chunk-QSJMLHBD.js} +1 -1
- package/dist/{chunk-IUQJGFEO.js → chunk-QTDR2CTB.js} +3 -3
- package/dist/{chunk-K2FVP22A.js → chunk-S43DEWMZ.js} +1 -1
- package/dist/{chunk-XXTAMF3O.js → chunk-S7YUQLBN.js} +6 -6
- package/dist/chunk-SHBZTW7P.js +5 -0
- package/dist/chunk-SM3N5UJ2.js +69 -0
- package/dist/{chunk-J4KPBR5B.js → chunk-TKCCJRPE.js} +1 -1
- package/dist/{chunk-YTDMCUL7.js → chunk-U5RG34NE.js} +10 -10
- package/dist/{chunk-NW5NSV7N.js → chunk-V6HKE4HV.js} +2 -2
- package/dist/{chunk-OIEFMLYI.js → chunk-VR6LMREE.js} +3 -3
- package/dist/{chunk-EJOKROMB.js → chunk-WHPYQOXA.js} +5 -5
- package/dist/{chunk-WLBWACKP.js → chunk-WJTNQ7YD.js} +1 -1
- package/dist/{chunk-P5C7DI5A.js → chunk-WPGSU4QG.js} +5 -5
- package/dist/{chunk-75R3EKWZ.js → chunk-XD3M5ZXM.js} +3 -3
- package/dist/chunk-ZI2FDUYJ.js +99 -0
- package/dist/data/EntityList.js +1 -1
- package/dist/data/ResizableTable.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/UnitMenu.js +1 -1
- package/dist/forms/WidestLabel.d.ts +26 -0
- package/dist/forms/WidestLabel.js +1 -0
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/icons/brands.node.js +1 -1
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/payment.js +3 -3
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +117 -117
- package/dist/pdf/index.js +1 -1
- package/dist/shell/FitFrame.d.ts +46 -0
- package/dist/shell/FitFrame.js +2 -0
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-VURS4NAT.js +0 -29
- package/dist/Notepad-6AMNAYQQ.js +0 -24
- package/dist/PdfViewer-PFQGQRQX.js +0 -1
- package/dist/chunk-6QKTQOEV.js +0 -69
- package/dist/chunk-74SCWPQF.js +0 -1
- package/dist/chunk-JFOMAXD2.js +0 -99
- package/dist/chunk-OMOAD5LL.js +0 -1
- package/dist/chunk-QAAHFU2I.js +0 -1
- package/dist/chunk-XQVGBVHC.js +0 -5
- package/dist/chunk-YGKLZBWC.js +0 -24
- /package/dist/{chunk-VG6BT2UG.js → chunk-7UCZAUAU.js} +0 -0
package/README.md
CHANGED
|
@@ -1620,6 +1620,12 @@ Round 4:
|
|
|
1620
1620
|
`SidesInput`, `CornersInput` (its unit in force is `radiusUnit`),
|
|
1621
1621
|
`BorderInput` and `PositionInput` pass their `units` there, so the menu is
|
|
1622
1622
|
drawn in one place. A choice of one unit, or none, is plain text.
|
|
1623
|
+
**`WidestLabel`** (`labels`, `shown`, `align`: `start` | `center` | `end`,
|
|
1624
|
+
default `start`) keeps a control as wide as the widest label it can change
|
|
1625
|
+
to: every label sits in one grid cell and only `shown` is visible, so a
|
|
1626
|
+
change of words moves nothing beside it. `UnitMenu`'s trigger draws with it;
|
|
1627
|
+
use it for a button whose words change (for example "Close Short" /
|
|
1628
|
+
"Complete Order").
|
|
1623
1629
|
- **`Slider`**: `shiftStep`, `placeholderValue` and `stepFrom` (see `Slider`
|
|
1624
1630
|
above). `onCommit(value)` reports the value once it is final: the range's
|
|
1625
1631
|
own `change` (let go, or a key that moved it), or the box left or given
|
|
@@ -5303,6 +5309,7 @@ itself where the kit has an answer:
|
|
|
5303
5309
|
| `ellipsis-label` | a button, link or menu label that ends in `…` or `...`: the text of `button`, `a`, `option`, `Button`, `IconButton`, `SplitButton`, `Link`, `NavLink`, `PopupMenuItem`, `PopupMenuLabel`, `DropdownMenuItem`, `MenuItem`, `ContextMenuItem` (through any spans inside), a `label` or `aria-label`, and a `label:` in an object. Each branch of a `?:` is read, and so is the English phrase handed to `say()` or `t()` (a key such as `team:menu.remove` has no dots of its own); no other call's result is. A `…` with no word of its own in the same string is a truncation's and is not counted. Not counted yet, by name in `ELLIPSIS_EXEMPT` until the sweep that clears each: `busy` (a listed first word such as Saving, Loading, and the Chinese busy forms), `placeholder` (`placeholder`, `searchPlaceholder`, `emptyOptionLabel`, `blankLabel`) and `prompt` (an `<option value="">` or `{ value: '', label }`) | the label without the dots, saying what it does ("Extend trial"). `…` means only "the words are cut" (owner ruling 2026-10-14) |
|
|
5304
5310
|
| `colour` | a literal colour, in a script string (`.ts` and `.tsx`) or a stylesheet declaration (`.css`, `.scss`, which this kind alone reads): a hex; an `rgb()` / `rgba()` / `hsl()` / `hsla()` / `hwb()` / `oklch()` / `oklab()` / `lab()` / `lch()` with a number in it; a Tailwind palette class (a colour utility with a hue and a step, or `white` / `black`, under any variant and alpha); a `--color-<hue>-<step>` variable; a named colour as the value of a colour property; and a palette class in `@apply`. A `var()` fallback counts (a fallback is a second palette). Not counted: a role or token, `transparent`, `currentColor`, `url(#…)`, a `#` in a link or id, a comment, a `mask` declaration (its black is alpha) | a colour role: its utility (`text-ink`, `bg-surface`, `border-line`, `bg-accent-fill` …) or `var(--role)`; `COLOUR_ROLES` lists them. A merchant site reads the site theme. A colour a frame needs because the shell's stylesheet cannot reach it is an `allow` entry with its reason (owner ruling 2026-10-23) |
|
|
5305
5311
|
| `dialog-frame` | a `className` on a shell `Dialog`, `PopupForm` or `ConfirmDialog` (bare or namespaced) that redraws its frame (a string or a template literal): a zero padding on any side, named or `[0]` / `[0px]`; a width or height cap taken off or set (`none`, `screen`, `full`, any arbitrary value); a height of `full`, `screen` or a viewport unit (`dvh`, `svh` …); an arbitrary width or height in viewport units, a percentage or a `calc()`; a minimum height of the screen. Not counted: a class held in a variable (`className={cls}`), and a `style` prop | a `Dialog` size: `size="full"` for a chooser laid out like a window, with `headerActions` beside the cross |
|
|
5312
|
+
| `scaled-frame` | a drawing scaled from the top left by hand: a top-left transform origin (`top left`, `left top`, `0 0`, `0% 0%`, `0px 0px`) as a style key or a DOM write, in CSS text inside a string, or as the Tailwind origin class for the top left (named or an arbitrary zero). Not counted: an origin held in a variable, a stylesheet file, and a scale from the centre moved back with a translate | `FitFrame` (a preview drawn at a logical size), or `fitScale` / `fitBoxScale` / `fitFrameStyle`, from `efficient-shell/ui` |
|
|
5306
5313
|
|
|
5307
5314
|
Known gaps: `rgb()` / `hsl()` colours, colours in `.ts` maps, and
|
|
5308
5315
|
`createElement('button')` are not counted.
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import{InputEndActionButton as e}from"./chunk-3SIRRK3F.js";import"./chunk-EX3DARI3.js";import"./chunk-VQBKRBBR.js";import"./chunk-NWS5G7FE.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-
|
|
1
|
+
import{InputEndActionButton as e}from"./chunk-3SIRRK3F.js";import"./chunk-EX3DARI3.js";import"./chunk-VQBKRBBR.js";import"./chunk-NWS5G7FE.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-V6HKE4HV.js";import{WindowTitle as n}from"./chunk-ZI2FDUYJ.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-M2TQOJ3G.js";import"./chunk-FBZUEZK7.js";import"./chunk-5A7MWTXX.js";import"./chunk-BG3C4ALM.js";import{confirm as s}from"./chunk-GMLOMLCS.js";import"./chunk-UTQN5AIO.js";import"./chunk-EIFNESXS.js";import"./chunk-SXHV5OLA.js";import"./chunk-SF4IIV5Z.js";import"./chunk-FRCTA5FS.js";import"./chunk-VWGWZY7A.js";import"./chunk-UVHXVSB2.js";import"./chunk-WRV6QKJN.js";import"./chunk-AW7TOB6N.js";import"./chunk-4U5M37SF.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-DPFEQQQU.js";import"./chunk-43JCG6EB.js";import"./chunk-DWGYC7OD.js";import"./chunk-YDJ5IZOU.js";import"./chunk-THAPVKEJ.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-UTISUEO4.js";import"./chunk-BUFAJJDZ.js";import{Icon as a}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-TD3ZQD5R.js";import"./chunk-F2RAIGCG.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-VY3UA6AR.js";import"./chunk-WCCS4VFE.js";import"./chunk-ZDXRSY2Y.js";import"./chunk-STKJA4PV.js";import"./chunk-M6UKCZHT.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-IUVGHHR3.js";import"./chunk-C3QOHMR6.js";import{useRef as i,useEffect as c,useState as l}from"react";import{jsxs as m,jsx as u,Fragment as h}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",p="react-os-shell:browser-homepage",k="https://en.wikipedia.org/wiki/Main_Page",b=[{label:"Wikipedia",url:"https://en.wikipedia.org/wiki/Main_Page"},{label:"DevDocs",url:"https://devdocs.io"},{label:"Example",url:"https://example.com"}],g=new Set(["ac ad ae af ag ai al am ao aq ar as at au aw ax az ba bb bd be bf bg bh bi","bj bm bn bo br bs bt bw by bz ca cc cd cf cg ch ci ck cl cm cn co cr cu cv","cw cx cy cz de dj dk dm do dz ec ee eg er es et eu fi fj fk fm fo fr ga gd","ge gf gg gh gi gl gm gn gp gq gr gs gt gu gw gy hk hm hn hr ht hu id ie il","im in io iq ir is it je jm jo jp ke kg kh ki km kn kp kr kw ky kz la lb lc","li lk lr ls lt lu lv ly ma mc md me mg mh mk ml mm mn mo mp mq mr ms mt mu","mv mw mx my mz na nc ne nf ng ni nl no np nr nu nz om pa pe pf pg ph pk pl","pm pn pr ps pt pw py qa re ro rs ru rw sa sb sc sd se sg sh si sk sl sm sn","so sr ss st su sv sx sy sz tc td tf tg th tj tk tl tm tn to tr tt tv tw tz","ua ug uk us uy uz va vc ve vg vi vn vu wf ws ye yt za zm zw","com net org edu gov mil int info biz name pro app dev xyz online site tech","store shop cloud design digital agency studio media news blog live life","world today email systems solutions services software page link space host","press wiki team group works careers finance capital energy academy"].join(" ").split(" "));function f(e){let t=e.trim();return t?/^[a-z][a-z0-9+.-]*:\/\//i.test(t)?t:function(e){const t=/^([\w-]+\.)+([a-z]{2,})(\/.*)?$/i.exec(e);return null!==t&&g.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var w=["duckduckgo.com","developer.mozilla.org","google.com","gmail.com","youtube.com","facebook.com","instagram.com","whatsapp.com","twitter.com","x.com","github.com","gitlab.com","linkedin.com","reddit.com","pinterest.com","amazon.com","amazon.ca","amazon.co.uk","apple.com","icloud.com","microsoft.com","outlook.com","live.com","office.com","netflix.com","spotify.com","paypal.com","stripe.com","chat.openai.com","chatgpt.com","claude.ai"];function x(){if("undefined"==typeof window)return b;try{const e=localStorage.getItem(d);if(!e)return b;const t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>"string"==typeof e?.url))return t}catch{}return b}function y(){return"undefined"==typeof window?k:localStorage.getItem(p)||k}function v(){const h=i(void 0);void 0===h.current&&(h.current=t()),c(()=>{null!=h.current&&o(h.current)},[]);const k=h.current?f(h.current.url):"",[b,g]=l(y),[w,v]=l(k||b),[C,R]=l(w),[S,W]=l([w]),[U,z]=l(0),[D,E]=l(0),[F,H]=l(x),[T,A]=l(!1),[L,I]=l(null),V=i(null),Z=i(null);c(()=>{try{localStorage.setItem(d,JSON.stringify(F))}catch{}},[F]);const G=e=>{const t=f(e);t&&(v(t),R(t),W(e=>{const o=e.slice(0,U+1);return o.push(t),o}),z(e=>e+1),A(!1))},J=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},M=()=>{const e=L?.trim();e?(H(t=>[...t,{label:e,url:w}]),I(null)):I(null)};c(()=>{if(null===L)return;V.current?.focus(),V.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||I(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==L]);const O=e=>{H(t=>t.filter((t,o)=>o!==e))},Q=U>0,B=U<S.length-1,Y=F.some(e=>e.url===w),K="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
|
|
2
2
|
return m("div",{className:"relative flex flex-col h-full bg-white",children:[
|
|
3
|
-
/* @__PURE__ */u(n,{title:`Browser - ${
|
|
3
|
+
/* @__PURE__ */u(n,{title:`Browser - ${j(w)}`}),
|
|
4
4
|
/* @__PURE__ */u(r,{app:"browser"}),
|
|
5
5
|
/* @__PURE__ */m("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-line bg-surface-sunken shrink-0",children:[
|
|
6
|
-
/* @__PURE__ */u("button",{onClick:()=>{if(U>0){const e=U-1;z(e),v(S[e]),R(S[e]),
|
|
7
|
-
/* @__PURE__ */u("button",{onClick:()=>{if(U<S.length-1){const e=U+1;z(e),v(S[e]),R(S[e]),
|
|
8
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
9
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
10
|
-
/* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),
|
|
6
|
+
/* @__PURE__ */u("button",{onClick:()=>{if(U>0){const e=U-1;z(e),v(S[e]),R(S[e]),A(!1)}},disabled:!Q,className:K,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
|
|
7
|
+
/* @__PURE__ */u("button",{onClick:()=>{if(U<S.length-1){const e=U+1;z(e),v(S[e]),R(S[e]),A(!1)}},disabled:!B,className:K,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
|
|
8
|
+
/* @__PURE__ */u("button",{onClick:()=>E(e=>e+1),className:K,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
|
|
9
|
+
/* @__PURE__ */u("button",{onClick:()=>G(b),className:K,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
|
|
10
|
+
/* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),G(C)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */m("div",{className:"flex items-center w-full bg-white border border-gray-300 rounded focus-within:border-blue-400 focus-within:ring-1 focus-within:ring-blue-200",children:[
|
|
11
11
|
/* @__PURE__ */u("span",{className:"px-2 text-gray-400 text-xs",children:w.startsWith("https://")?"🔒":"⚠️"}),
|
|
12
12
|
/* @__PURE__ */u("input",{type:"text",value:C,onChange:e=>R(e.target.value),onFocus:e=>e.target.select(),className:"flex-1 px-1 py-1 text-sm bg-transparent outline-none font-mono",spellCheck:!1,placeholder:"Enter URL or search…"}),w!==C&&
|
|
13
13
|
/* @__PURE__ */u("span",{className:"flex pr-1",children:/* @__PURE__ */u(e,{action:{label:"Reset to current URL",icon:/* @__PURE__ */u(a,{name:"close"}),onClick:()=>R(w)}})})]})}),
|
|
14
|
-
/* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>Y?
|
|
15
|
-
/* @__PURE__ */u("button",{onClick:
|
|
16
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
14
|
+
/* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>Y?O(F.findIndex(e=>e.url===w)):void I(j(w)),className:K+" "+(Y?"text-yellow-500":""),title:Y?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(a,{name:"star",className:"h-4 w-4",fill:Y?"currentColor":"none",strokeWidth:1.5})}),
|
|
15
|
+
/* @__PURE__ */u("button",{onClick:J,className:K,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
|
|
16
|
+
/* @__PURE__ */u("button",{onClick:()=>A(e=>!e),className:K,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==L&&/* @__PURE__ */m("div",{"data-bookmark-popover":!0,className:"absolute right-3 top-12 z-30 w-72 bg-white border border-gray-200 rounded-md shadow-lg p-3",children:[
|
|
17
17
|
/* @__PURE__ */u("div",{className:"text-2xs font-semibold uppercase tracking-wide text-ink-faint mb-1",children:"Bookmark this page"}),
|
|
18
18
|
/* @__PURE__ */u("div",{className:"text-2xs text-ink-faintest truncate mb-2 font-mono",title:w,children:w}),
|
|
19
|
-
/* @__PURE__ */u("input",{ref:
|
|
19
|
+
/* @__PURE__ */u("input",{ref:V,type:"text",value:L,onChange:e=>I(e.target.value),onKeyDown:e=>{"Enter"===e.key?M():"Escape"===e.key&&I(null)},placeholder:"Name",className:"w-full text-sm px-2 h-8 border border-line-strong rounded focus:outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-200"}),
|
|
20
20
|
/* @__PURE__ */m("div",{className:"flex justify-end gap-1 mt-2",children:[
|
|
21
21
|
/* @__PURE__ */u("button",{onClick:()=>I(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
|
|
22
|
-
/* @__PURE__ */u("button",{onClick:
|
|
23
|
-
/* @__PURE__ */m("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===
|
|
22
|
+
/* @__PURE__ */u("button",{onClick:M,disabled:!L.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
|
|
23
|
+
/* @__PURE__ */m("div",{className:"flex items-center gap-0.5 px-2 py-1 border-b border-gray-200 bg-white shrink-0 overflow-x-auto",children:[0===F.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),F.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>G(e.url),onContextMenu:async o=>{o.preventDefault();await s({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&O(t)},className:"flex items-center gap-2 px-2 py-0.5 rounded text-xs text-ink hover:bg-gray-100 whitespace-nowrap",title:`${e.url}\n(right-click to remove)`,children:[
|
|
24
24
|
/* @__PURE__ */u("img",{src:`https://icons.duckduckgo.com/ip3/${new URL(e.url).hostname}.ico`,alt:"",className:"h-3.5 w-3.5",onError:e=>{e.target.style.visibility="hidden"}}),e.label]},t)),
|
|
25
25
|
/* @__PURE__ */u("div",{className:"flex-1"}),
|
|
26
26
|
/* @__PURE__ */u("button",{onClick:()=>{g(w);try{localStorage.setItem(p,w)}catch{}},className:"px-2 py-0.5 text-2xs text-ink-faint hover:text-ink-strong",title:"Set current page as homepage",children:"Set as home"})]}),
|
|
27
|
-
/* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(
|
|
27
|
+
/* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(N,{url:w,iframeKey:D,iframeRef:Z,openExternal:J,showHelp:T,dismissHelp:()=>A(!1)})})]})}function j(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function N({url:e,iframeKey:t,iframeRef:o,openExternal:r,showHelp:n,dismissHelp:s}){const[i,d]=l(!1);c(()=>{d(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return w.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!i?/* @__PURE__ */u("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */m("div",{className:"max-w-md text-center",children:[
|
|
28
28
|
/* @__PURE__ */u(a,{name:"no-symbol",className:"h-14 w-14 mx-auto text-gray-300 mb-3",strokeWidth:1.2}),
|
|
29
|
-
/* @__PURE__ */m("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[
|
|
29
|
+
/* @__PURE__ */m("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[j(e)," can't be embedded"]}),
|
|
30
30
|
/* @__PURE__ */m("p",{className:"text-sm text-gray-500 mb-4",children:["This site sends an ",
|
|
31
31
|
/* @__PURE__ */u("span",{className:"font-mono text-xs",children:"X-Frame-Options"})," ","or ",
|
|
32
32
|
/* @__PURE__ */u("span",{className:"font-mono text-xs",children:"Content-Security-Policy"})," header that refuses iframe embedding. The browser blocks the load before our app can do anything about it."]}),
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-QSJMLHBD.js";import{useWidgetSettings as n}from"./chunk-ZI2FDUYJ.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-M2TQOJ3G.js";import"./chunk-FBZUEZK7.js";import"./chunk-5A7MWTXX.js";import"./chunk-BG3C4ALM.js";import"./chunk-GMLOMLCS.js";import"./chunk-UTQN5AIO.js";import"./chunk-EIFNESXS.js";import"./chunk-SXHV5OLA.js";import"./chunk-SF4IIV5Z.js";import"./chunk-FRCTA5FS.js";import"./chunk-VWGWZY7A.js";import"./chunk-UVHXVSB2.js";import"./chunk-WRV6QKJN.js";import"./chunk-AW7TOB6N.js";import"./chunk-4U5M37SF.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-DPFEQQQU.js";import"./chunk-DWGYC7OD.js";import"./chunk-YDJ5IZOU.js";import"./chunk-THAPVKEJ.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-UTISUEO4.js";import"./chunk-BUFAJJDZ.js";import{Icon as r}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-TD3ZQD5R.js";import"./chunk-F2RAIGCG.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-VY3UA6AR.js";import"./chunk-WCCS4VFE.js";import"./chunk-ZDXRSY2Y.js";import"./chunk-STKJA4PV.js";import"./chunk-M6UKCZHT.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-IUVGHHR3.js";import"./chunk-C3QOHMR6.js";import{useState as c,useRef as i,useCallback as o,useEffect as s}from"react";import{jsxs as l,Fragment as a,jsx as u}from"react/jsx-runtime";var h="calc_appearance";function m(){const[m,k]=c("0"),[p,d]=c(null),[b,g]=c(null),[j,N]=c(!1),[y,C]=c(""),[x,f]=c([]),[v,$]=c(!1),[S,U]=c(()=>e(h)),[F,T]=c(!1),[E,A]=c(S),D=i(null);n(o(()=>{A({...S}),T(!0)},[S]));const W=o(e=>{C(""),k(t=>j||"0"===t?(N(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[j]),Z=o(()=>{k("0"),d(null),g(null),N(!1)},[]),J=o((e,t,n)=>{switch(n){case"+":return e+t;case"-":return e-t;case"×":return e*t;case"÷":return 0===t?0:e/t;default:return t}},[]),R=o(e=>{const t=parseFloat(m);if(null!==p&&b&&!j){const e=J(p,t,b);k(String(e)),d(e),f(n=>[`${p} ${b} ${t} = ${e}`,...n].slice(0,20))}else d(t);g(e),N(!0)},[m,p,b,j,J]),M=o(()=>{if(null===p||!b)return;const e=parseFloat(m),t=J(p,e,b),n=`${p} ${b} ${e} =`;f(e=>[`${n} ${t}`,...e].slice(0,20)),C(n),k(String(t)),d(null),g(null),N(!0)},[m,p,b,J]),Q=o(()=>{k(e=>String(parseFloat(e)/100))},[]),V=o(()=>{k(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);s(()=>{const e=e=>{const t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t&&"SELECT"!==t&&(e.key>="0"&&e.key<="9"?W(e.key):"."===e.key?W("."):"+"===e.key?R("+"):"-"===e.key?R("-"):"*"===e.key?R("×"):"/"===e.key?(e.preventDefault(),R("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&D.current?.contains(e.target)&&e.preventDefault(),M()):"Escape"===e.key?Z():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&Q())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[W,R,M,Z,Q]);const w="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",H=`${w} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,O=`${w} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,B=`${w} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,G=`${w} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
|
|
2
|
+
return l(a,{children:[
|
|
3
|
+
/* @__PURE__ */l("div",{ref:D,className:"flex flex-col h-full",style:{opacity:S.activeOpacity/100,backdropFilter:S.activeBlur>0?`blur(${S.activeBlur}px)`:void 0},children:[
|
|
4
|
+
/* @__PURE__ */l("div",{className:"bg-slate-200 rounded-t-lg px-4 py-2 group/display relative flex flex-col justify-end min-h-[120px] border-b border-slate-300",children:[
|
|
5
|
+
/* @__PURE__ */u("div",{className:"flex flex-col justify-end flex-1 overflow-hidden",children:x.slice(0,3).reverse().map((e,t)=>/* @__PURE__ */u("div",{className:"text-2xs text-slate-400 text-right font-mono truncate",children:e},t))}),(y||b&&null!==p)&&/* @__PURE__ */u("div",{className:"text-base text-slate-600 text-right font-mono",children:y||`${p} ${b} ${j?"":m}`}),
|
|
6
|
+
/* @__PURE__ */l("div",{className:"flex items-center gap-2",children:[
|
|
7
|
+
/* @__PURE__ */u("button",{onClick:()=>{navigator.clipboard.writeText(m),$(!0),setTimeout(()=>$(!1),1200)},title:"Copy result",className:"shrink-0 text-slate-300 hover:text-slate-500 transition-colors opacity-0 group-hover/display:opacity-100",children:/* @__PURE__ */u(r,v?{name:"check",className:"h-5 w-5 text-green-500",strokeWidth:2}:{name:"copy",className:"h-5 w-5",strokeWidth:2})}),
|
|
8
|
+
/* @__PURE__ */u("div",{className:"text-right text-4xl font-mono font-bold text-slate-800 truncate flex-1",children:(e=>{const t=parseFloat(e);return isNaN(t)||e.endsWith(".")||e.endsWith(".0")||Math.abs(t)<1e15&&e.length<16?e:t.toExponential(6)})(m)})]})]}),
|
|
9
|
+
/* @__PURE__ */l("div",{className:"grid grid-cols-4 grid-rows-5 gap-2 flex-1 min-h-0 p-2",children:[
|
|
10
|
+
/* @__PURE__ */u("button",{onClick:Z,className:B,children:"AC"}),
|
|
11
|
+
/* @__PURE__ */u("button",{onClick:V,className:B,children:"+/−"}),
|
|
12
|
+
/* @__PURE__ */u("button",{onClick:Q,className:B,children:"%"}),
|
|
13
|
+
/* @__PURE__ */u("button",{onClick:()=>R("÷"),className:`${O} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
|
|
14
|
+
/* @__PURE__ */u("button",{onClick:()=>W("7"),className:H,children:"7"}),
|
|
15
|
+
/* @__PURE__ */u("button",{onClick:()=>W("8"),className:H,children:"8"}),
|
|
16
|
+
/* @__PURE__ */u("button",{onClick:()=>W("9"),className:H,children:"9"}),
|
|
17
|
+
/* @__PURE__ */u("button",{onClick:()=>R("×"),className:`${O} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
|
|
18
|
+
/* @__PURE__ */u("button",{onClick:()=>W("4"),className:H,children:"4"}),
|
|
19
|
+
/* @__PURE__ */u("button",{onClick:()=>W("5"),className:H,children:"5"}),
|
|
20
|
+
/* @__PURE__ */u("button",{onClick:()=>W("6"),className:H,children:"6"}),
|
|
21
|
+
/* @__PURE__ */u("button",{onClick:()=>R("-"),className:`${O} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
|
|
22
|
+
/* @__PURE__ */u("button",{onClick:()=>W("1"),className:H,children:"1"}),
|
|
23
|
+
/* @__PURE__ */u("button",{onClick:()=>W("2"),className:H,children:"2"}),
|
|
24
|
+
/* @__PURE__ */u("button",{onClick:()=>W("3"),className:H,children:"3"}),
|
|
25
|
+
/* @__PURE__ */u("button",{onClick:()=>R("+"),className:`${O} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
|
|
26
|
+
/* @__PURE__ */u("button",{onClick:()=>W("0"),className:`${H} col-span-2`,children:"0"}),
|
|
27
|
+
/* @__PURE__ */u("button",{onClick:()=>W("."),className:H,children:"."}),
|
|
28
|
+
/* @__PURE__ */u("button",{onClick:M,className:G,children:"="})]})]}),
|
|
29
|
+
/* @__PURE__ */u(t,{open:F,onClose:()=>T(!1),title:"Calculator Settings",appearance:E,onAppearanceChange:A,onSave:()=>{U(E),localStorage.setItem(h,JSON.stringify(E)),T(!1)}})]})}export{m as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-
|
|
1
|
+
import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-QSJMLHBD.js";import{useWidgetSettings as r}from"./chunk-ZI2FDUYJ.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-M2TQOJ3G.js";import"./chunk-FBZUEZK7.js";import"./chunk-5A7MWTXX.js";import"./chunk-BG3C4ALM.js";import"./chunk-GMLOMLCS.js";import"./chunk-UTQN5AIO.js";import"./chunk-EIFNESXS.js";import"./chunk-SXHV5OLA.js";import"./chunk-SF4IIV5Z.js";import"./chunk-FRCTA5FS.js";import"./chunk-VWGWZY7A.js";import"./chunk-UVHXVSB2.js";import"./chunk-WRV6QKJN.js";import"./chunk-AW7TOB6N.js";import"./chunk-4U5M37SF.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-DPFEQQQU.js";import"./chunk-DWGYC7OD.js";import"./chunk-YDJ5IZOU.js";import"./chunk-THAPVKEJ.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-UTISUEO4.js";import"./chunk-BUFAJJDZ.js";import"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-TD3ZQD5R.js";import"./chunk-F2RAIGCG.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-VY3UA6AR.js";import"./chunk-WCCS4VFE.js";import"./chunk-ZDXRSY2Y.js";import"./chunk-STKJA4PV.js";import"./chunk-M6UKCZHT.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-MAFUXCPZ.js";import"./chunk-IUVGHHR3.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as c}from"react";import{jsxs as i,Fragment as a,jsx as m}from"react/jsx-runtime";var l=["USD","CNY","AUD","GBP","EUR","JPY","CAD","THB","NZD","SGD","HKD","CHF","KRW","INR","MXN","BRL"],u=[["USD","CNY"],["USD","AUD"],["GBP","USD"],["USD","JPY"]],p="currency_pairs",h="currency_appearance",d="currency_rates_cache";function k(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function g(t,e){try{const r=JSON.parse(localStorage.getItem(d)||"{}");r[t]={rates:e,timestamp:Date.now()},localStorage.setItem(d,JSON.stringify(r))}catch{}}function j(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var N={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function f(){const[u,d]=s(j),[f,S]=s(()=>t(h)),[x,y]=s({}),[b,D]=s(!1),[U,C]=s(!1),[v,J]=s([]),[A,R]=s(f),[F,B]=s("USD"),[H,I]=s("CNY");r(o(()=>{J([...u]),R({...f}),C(!0)},[u,f])),c(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){D(!0);const r={};for(const e of t){const t=k(e);if(t)r[e]=t;else try{const t=await fetch(`https://open.er-api.com/v6/latest/${e}`),n=await t.json();n.rates&&(r[e]=n.rates,g(e,n.rates))}catch{}}e&&(y(r),D(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
|
|
2
2
|
return i(a,{children:[
|
|
3
|
-
/* @__PURE__ */m("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3 space-y-1",children:[b&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=
|
|
3
|
+
/* @__PURE__ */m("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${f.activeOpacity/100})`,backdropFilter:f.activeBlur>0?`blur(${f.activeBlur}px)`:void 0},children:/* @__PURE__ */i("div",{className:"px-4 py-3 space-y-1",children:[b&&/* @__PURE__ */m(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=x[t]?.[e];/* @__PURE__ */
|
|
4
4
|
return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),localStorage.setItem(p,JSON.stringify(t))},className:"flex items-center justify-between px-2 py-2 border-b border-gray-200 last:border-0 w-full hover:bg-gray-100 rounded transition-colors cursor-pointer",children:[
|
|
5
5
|
/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
|
|
6
6
|
/* @__PURE__ */m("span",{className:"text-base",children:N[t]||""}),
|
|
@@ -9,13 +9,13 @@ return i("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),l
|
|
|
9
9
|
/* @__PURE__ */m("span",{className:"text-base",children:N[e]||""}),
|
|
10
10
|
/* @__PURE__ */m("span",{className:"text-sm font-semibold text-gray-700",children:e})]}),
|
|
11
11
|
/* @__PURE__ */m("div",{className:"text-base font-mono font-semibold text-gray-900 tabular-nums",children:null!=n?n.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:4}):"—"})]},`${t}-${e}-${r}`)})]})}),
|
|
12
|
-
/* @__PURE__ */m(e,{open:U,onClose:()=>C(!1),title:"Currency Settings",appearance:A,onAppearanceChange:R,onSave:()=>{if(0===v.length)return;const t=v.slice(0,4);d(t),
|
|
12
|
+
/* @__PURE__ */m(e,{open:U,onClose:()=>C(!1),title:"Currency Settings",appearance:A,onAppearanceChange:R,onSave:()=>{if(0===v.length)return;const t=v.slice(0,4);d(t),S(A),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(A)),C(!1)},children:/* @__PURE__ */i("div",{children:[
|
|
13
13
|
/* @__PURE__ */i("h3",{className:"text-sm font-semibold text-ink mb-2",children:["Currency Pairs ",
|
|
14
14
|
/* @__PURE__ */i("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",v.length,"/",4,")"]})]}),
|
|
15
15
|
/* @__PURE__ */m("div",{className:"space-y-1 mb-2",children:v.map(([t,e],r)=>/* @__PURE__ */i("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
|
|
16
16
|
/* @__PURE__ */i("span",{className:"text-sm",children:[N[t]||""," ",t," → ",N[e]||""," ",e]}),
|
|
17
17
|
/* @__PURE__ */m("button",{onClick:()=>J(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),v.length<4?/* @__PURE__ */i("div",{className:"flex items-center gap-2",children:[
|
|
18
|
-
/* @__PURE__ */m("select",{value:F,onChange:t=>
|
|
18
|
+
/* @__PURE__ */m("select",{value:F,onChange:t=>B(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
|
|
19
19
|
/* @__PURE__ */m("span",{className:"text-gray-400",children:"→"}),
|
|
20
|
-
/* @__PURE__ */m("select",{value:
|
|
21
|
-
/* @__PURE__ */m("button",{onClick:()=>{F!==
|
|
20
|
+
/* @__PURE__ */m("select",{value:H,onChange:t=>I(t.target.value),className:"bg-gray-50 border border-gray-200 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500",children:l.map(t=>/* @__PURE__ */m("option",{children:t},t))}),
|
|
21
|
+
/* @__PURE__ */m("button",{onClick:()=>{F!==H&&v.length<4&&J(t=>[...t,[F,H]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */i("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{f as default};
|