efficient-shell 14.0.0 → 14.1.1

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 CHANGED
@@ -5417,6 +5417,8 @@ itself where the kit has an answer:
5417
5417
  | `own-text` | text drawn with its own type: a raw `<h1>`…`<h6>`; a raw `<p>` or `<span>` with a type class (a size step `text-xs` … or an arbitrary size, a weight `font-medium` … or `font-[600]`, also through `clsx()`) or an inline `fontSize` / `fontWeight`; in a stylesheet, a rule that sets its own `font-size` or `font` (not a reset to `inherit`), once per rule, on its selector line. A pill's type is the pill's (`own-badge`) | `Title` (with `as=` for the heading level), `Paragraph`, `Text` |
5418
5418
  | `own-badge` | a pill drawn by hand: a raw `span`, `div`, `small`, `strong`, `b`, `em`, `i`, `p`, `mark`, `label` or `li` whose classes (a string, a template, the strings of a ternary or a `clsx()`) give it a round corner, a background colour, a text colour, side padding and a pill's height (a vertical padding of 0 to 3px, or a full round with small type and no vertical padding). Not counted: a box with a box's padding, a `<button>` (the `button` kind) | `ColoredBadge` (a tone), `StatusBadge` |
5419
5419
  | `shell-part-copy` | a component defined under the name of a shell part: a function with a body, a class, or a `const` set to an arrow, a function, or `forwardRef` / `memo` of one, named like a PascalCase value the shell exports (`Title`, `Card`, `ColoredBadge` …). The names are read when the check runs, from the installed shell's own `dist/index.js` and `dist/ui/index.js` (through `export *`), never from a hand list: a part a release adds is covered by that release. A run that cannot read them fails | import the part from `efficient-shell` (`efficient-shell/ui`) |
5420
+ | `copied-value` | a top-level `const` whose literal value is the same as a `const` a package exports (its copy index, below): a string of 8 or more characters with a character other than a letter (a slug, a key, an attribute), an array of 3 or more items one of which is a string of 8 or more or an object, an object of 3 or more keys. Key order and casts are no difference. Not counted: a number, a boolean, a one-word label, a hex colour (the `colour` kind), a short list of short words | the export named after each line (`` `PAGE_ORDER` from efficient-storefront-blocks/render/lib/storefront-page-order``), imported |
5421
+ | `copied-routine` | a function (any depth: a declaration, an arrow, a method) whose parameters and body are the same as a function a package exports, with local names, types, casts and parentheses aside and literals kept; 25 or more syntax nodes. Not counted: a function that reads module state of its own file (a top-level `let` / `var`, or a `const` made by `new` or a call: a Map, a cache), since the export reads its own module's state | the export named after each line, imported |
5420
5422
  | `hand-motion` | a typed time, weight or length where the shell has a token: a time in a `transition` / `animation`, a `duration-150` / `delay-[40ms]` class, a numeric or bold `font-weight` / `fontWeight` / `font-[600]`, a literal border width (`border-[1px]`, `borderWidth: 1`, `border: 1px solid …`); in a stylesheet also a literal `padding`, `margin` or `gap`, and a custom property set to one literal length or time (an own token: `--rail-w: 44px`). Not counted: a token, a zero, `none` | `--motion-fast` / `--motion-base`, `--weight-*`, `--border-hairline` / `-strong` / `-accent`, `--space-*`, `--row-height-*`, `--control-height-*` |
5421
5423
 
5422
5424
  Known gaps: `rgb()` / `hsl()` colours, colours in `.ts` maps, and
@@ -5458,6 +5460,31 @@ and reviewed:
5458
5460
  again in the same change: take them out of `kinds` and run `--update` (it
5459
5461
  drops their lines), put them back with the key, and run
5460
5462
  `--init --kind <kind>` for each.
5463
+ - **The copy index.** `copied-value` and `copied-routine` read the values and
5464
+ routines a package exports, by fingerprint (a hash: no source ships). The
5465
+ shell writes one; efficient-easel, efficient-web-builder and
5466
+ efficient-storefront-blocks write theirs from their next release. Each
5467
+ package writes its own at build time, from its own source and
5468
+ its own `exports` map, into `dist/value-index.json` and
5469
+ `dist/routine-index.json`:
5470
+ `efficient-shell-ui-check --write-index dist [--src src] [--entry <subpath>=<file>]`.
5471
+ A script export with no source at `<src>/<path>.ts(x)` fails the build until
5472
+ `--entry` names it: a file, a pattern (`./render/*=src/sides/*.tsx`), or a
5473
+ folder and every module under it (`./render/*=src/render/**`). A pattern
5474
+ keeps only the sources whose built file the export's target holds, so a
5475
+ package that builds one source folder into several sides (`./render/*=src/**`
5476
+ and `./editor/*=src/**`) lists each module under its own side; run it after
5477
+ the build. The check
5478
+ reads the index of each declared package installed under `node_modules` (the
5479
+ version the repository installs; no list of names), and the shell's beside the
5480
+ command only when the repository does not install the shell itself. Only a
5481
+ package the repository declares counts (`dependencies`, `peerDependencies`,
5482
+ `optionalDependencies`, and in an app, `"private": true`, `devDependencies`
5483
+ too): a package that does not depend on another cannot import from it, so the
5484
+ copy is counted where the import can be written. A package never counts its
5485
+ own exports. A run that reads no index at all fails. A generated file (the
5486
+ upload limits a repository generates from the backend's export) goes in
5487
+ `exclude`.
5461
5488
  - `includeValues` (globs) does the same for the design-value kinds
5462
5489
  (`VALUE_KINDS`: `hex`, `colour`, `radius`, `spacing`, `font-size`, `shadow`,
5463
5490
  `hand-motion`): they also read every file these globs match, `output`
@@ -1,30 +1,30 @@
1
- import{InputEndActionButton as e}from"./chunk-W6REY3SV.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-7KNVO46D.js";import{WindowTitle as n}from"./chunk-6IP4Q3AT.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-YI4T5I5D.js";import"./chunk-PSVGB7KT.js";import"./chunk-TTD2M6RF.js";import"./chunk-5A7MWTXX.js";import"./chunk-TJ5YMXVB.js";import{confirm as s}from"./chunk-2XDO7FZC.js";import"./chunk-ZSVU44OB.js";import"./chunk-EIFNESXS.js";import"./chunk-7WF6LFOJ.js";import"./chunk-CJ4OEY3T.js";import"./chunk-AH5MLH54.js";import"./chunk-5YTZBYG4.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-6X32SWQI.js";import"./chunk-4PJFL26P.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-POBVGDZP.js";import"./chunk-AW7TOB6N.js";import"./chunk-UZESZ3EB.js";import"./chunk-M5IZ7QLQ.js";import"./chunk-XNKNX5L3.js";import"./chunk-DWGYC7OD.js";import"./chunk-MYH5H43C.js";import"./chunk-RTK77DMP.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EDRELF6L.js";import"./chunk-MEP6CZJ3.js";import"./chunk-IVEM2BPC.js";import{Icon as a}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-G3TC2GIA.js";import"./chunk-AJPQJ7TC.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.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-NRHG4R2Q.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),[W,T]=l([w]),[E,S]=l(0),[z,D]=l(0),[H,L]=l(x),[M,P]=l(!1),[Z,G]=l(null),J=i(null),U=i(null);c(()=>{try{localStorage.setItem(d,JSON.stringify(H))}catch{}},[H]);const Y=e=>{const t=f(e);t&&(v(t),R(t),T(e=>{const o=e.slice(0,E+1);return o.push(t),o}),S(e=>e+1),P(!1))},F=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},O=()=>{const e=Z?.trim();e?(L(t=>[...t,{label:e,url:w}]),G(null)):G(null)};c(()=>{if(null===Z)return;J.current?.focus(),J.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||G(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==Z]);const Q=e=>{L(t=>t.filter((t,o)=>o!==e))},B=E>0,I=E<W.length-1,A=H.some(e=>e.url===w),V="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
1
+ import{InputEndActionButton as e}from"./chunk-W6REY3SV.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-K3LSKG6L.js";import{WindowTitle as n}from"./chunk-6IP4Q3AT.js";import"./chunk-4LXCCZDM.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-YI4T5I5D.js";import"./chunk-PSVGB7KT.js";import"./chunk-TTD2M6RF.js";import"./chunk-5A7MWTXX.js";import"./chunk-TJ5YMXVB.js";import{confirm as s}from"./chunk-2XDO7FZC.js";import"./chunk-ZSVU44OB.js";import"./chunk-EIFNESXS.js";import"./chunk-7WF6LFOJ.js";import"./chunk-CJ4OEY3T.js";import"./chunk-AH5MLH54.js";import"./chunk-5YTZBYG4.js";import"./chunk-VWGWZY7A.js";import"./chunk-DBQNYJZ6.js";import"./chunk-6X32SWQI.js";import"./chunk-4PJFL26P.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-POBVGDZP.js";import"./chunk-AW7TOB6N.js";import"./chunk-CSMFF6LM.js";import"./chunk-M5IZ7QLQ.js";import"./chunk-XNKNX5L3.js";import"./chunk-DWGYC7OD.js";import"./chunk-MYH5H43C.js";import"./chunk-RTK77DMP.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EDRELF6L.js";import"./chunk-MEP6CZJ3.js";import"./chunk-IVEM2BPC.js";import{Icon as a}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-BWJZTHZ6.js";import"./chunk-G3TC2GIA.js";import"./chunk-AJPQJ7TC.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-TAHHZGRH.js";import"./chunk-KEFNQEXZ.js";import"./chunk-PU2GJVMG.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-NRHG4R2Q.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),[W,T]=l([w]),[L,S]=l(0),[z,M]=l(0),[D,E]=l(x),[H,P]=l(!1),[F,G]=l(null),Z=i(null),J=i(null);c(()=>{try{localStorage.setItem(d,JSON.stringify(D))}catch{}},[D]);const Y=e=>{const t=f(e);t&&(v(t),R(t),T(e=>{const o=e.slice(0,L+1);return o.push(t),o}),S(e=>e+1),P(!1))},U=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},O=()=>{const e=F?.trim();e?(E(t=>[...t,{label:e,url:w}]),G(null)):G(null)};c(()=>{if(null===F)return;Z.current?.focus(),Z.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||G(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==F]);const Q=e=>{E(t=>t.filter((t,o)=>o!==e))},I=L>0,A=L<W.length-1,B=D.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
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(E>0){const e=E-1;S(e),v(W[e]),R(W[e]),P(!1)}},disabled:!B,className:V,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
- /* @__PURE__ */u("button",{onClick:()=>{if(E<W.length-1){const e=E+1;S(e),v(W[e]),R(W[e]),P(!1)}},disabled:!I,className:V,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
- /* @__PURE__ */u("button",{onClick:()=>D(e=>e+1),className:V,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
9
- /* @__PURE__ */u("button",{onClick:()=>Y(b),className:V,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
6
+ /* @__PURE__ */u("button",{onClick:()=>{if(L>0){const e=L-1;S(e),v(W[e]),R(W[e]),P(!1)}},disabled:!I,className:K,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
7
+ /* @__PURE__ */u("button",{onClick:()=>{if(L<W.length-1){const e=L+1;S(e),v(W[e]),R(W[e]),P(!1)}},disabled:!A,className:K,title:"Forward",children:/* @__PURE__ */u(a,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
8
+ /* @__PURE__ */u("button",{onClick:()=>M(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:()=>Y(b),className:K,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
10
10
  /* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),Y(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:()=>A?Q(H.findIndex(e=>e.url===w)):void G(j(w)),className:V+" "+(A?"text-yellow-500":""),title:A?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(a,{name:"star",className:"h-4 w-4",fill:A?"currentColor":"none",strokeWidth:1.5})}),
15
- /* @__PURE__ */u("button",{onClick:F,className:V,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
16
- /* @__PURE__ */u("button",{onClick:()=>P(e=>!e),className:V,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==Z&&/* @__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:[
14
+ /* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>B?Q(D.findIndex(e=>e.url===w)):void G(j(w)),className:K+" "+(B?"text-yellow-500":""),title:B?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(a,{name:"star",className:"h-4 w-4",fill:B?"currentColor":"none",strokeWidth:1.5})}),
15
+ /* @__PURE__ */u("button",{onClick:U,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:()=>P(e=>!e),className:K,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==F&&/* @__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:J,type:"text",value:Z,onChange:e=>G(e.target.value),onKeyDown:e=>{"Enter"===e.key?O():"Escape"===e.key&&G(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"}),
19
+ /* @__PURE__ */u("input",{ref:Z,type:"text",value:F,onChange:e=>G(e.target.value),onKeyDown:e=>{"Enter"===e.key?O():"Escape"===e.key&&G(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:()=>G(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
22
- /* @__PURE__ */u("button",{onClick:O,disabled:!Z.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===H.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),H.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>Y(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"})&&Q(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:[
22
+ /* @__PURE__ */u("button",{onClick:O,disabled:!F.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===D.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),D.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>Y(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"})&&Q(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(N,{url:w,iframeKey:z,iframeRef:U,openExternal:F,showHelp:M,dismissHelp:()=>P(!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:[
27
+ /* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(N,{url:w,iframeKey:z,iframeRef:J,openExternal:U,showHelp:H,dismissHelp:()=>P(!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
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 ",