efficient-shell 12.40.1 → 12.43.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 +80 -24
- package/dist/{Browser-2KAKTRNM.js → Browser-NZTDWV5B.js} +16 -16
- package/dist/{Files-TDFKJDFL.js → Files-EWEQJLO4.js} +130 -130
- package/dist/{Notepad-AP35IJOS.js → Notepad-3UID4FA5.js} +9 -9
- package/dist/{Preview-MWTFD5UE.js → Preview-XZYKED2Z.js} +13 -13
- package/dist/ai/index.d.ts +1 -1
- package/dist/apps/index.js +1 -1
- package/dist/bin/media-host-check.js +1 -1
- package/dist/bin/ui-check.js +1 -1
- package/dist/chunk-2HCV3KM3.js +2 -0
- package/dist/{chunk-VNROPHRY.js → chunk-53GA6ZWG.js} +2 -2
- package/dist/{chunk-JTMR3EH3.js → chunk-JZY2RBPX.js} +6 -6
- package/dist/chunk-KHVMKTOL.js +2 -0
- package/dist/{chunk-GFM6O57V.js → chunk-KY4YVFL5.js} +1 -1
- package/dist/{chunk-HNBMBC77.js → chunk-L2OPI4MY.js} +1 -1
- package/dist/chunk-NKDDKXJF.js +2 -0
- package/dist/{chunk-E6PDAYBR.js → chunk-O5UD3ZWM.js} +4 -4
- package/dist/chunk-OB2ZVMGR.js +1 -0
- package/dist/chunk-RHI37D5L.js +1 -0
- package/dist/{chunk-DSOV33XA.js → chunk-S7CWKKNP.js} +1 -1
- package/dist/{chunk-EUKTGRUD.js → chunk-SAYI67HY.js} +1 -1
- package/dist/data/Gantt.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/Select.d.ts +1 -1
- package/dist/forms/TextToolbar.d.ts +1 -1
- package/dist/forms/textAlign.d.ts +1 -1
- package/dist/icons/efficient-glyphs.d.ts +1 -0
- package/dist/icons/efficient-glyphs.js +1 -1
- package/dist/icons/efficient-looks.d.ts +2 -0
- package/dist/icons/efficient-looks.js +1 -1
- package/dist/icons/efficient-meanings.d.ts +1 -0
- package/dist/icons/efficient-meanings.js +1 -1
- package/dist/icons/efficient.d.ts +1 -0
- package/dist/icons/efficient.js +1 -1
- package/dist/icons/glyphs/IconAboveTextIcon.d.ts +8 -0
- package/dist/icons/glyphs/IconAboveTextIcon.js +1 -0
- package/dist/icons/index.d.ts +2 -2
- package/dist/icons/index.js +1 -1
- package/dist/icons/looks/IconAboveTextMiniIcon.d.ts +8 -0
- package/dist/icons/looks/IconAboveTextMiniIcon.js +1 -0
- package/dist/icons/looks/IconAboveTextSolidIcon.d.ts +8 -0
- package/dist/icons/looks/IconAboveTextSolidIcon.js +1 -0
- package/dist/icons/looks/map.js +1 -1
- package/dist/icons/sets.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +142 -142
- package/dist/{names-BNKpHeTy.d.ts → names-F-LVocCZ.d.ts} +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.d.ts +1 -1
- package/dist/shell/SettingRow.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/tokens/colour.d.ts +2 -2
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-IESNUXYH.js +0 -1
- package/dist/chunk-YGWFOKBT.js +0 -1
- /package/dist/{chunk-VT7QZPIO.js → chunk-S7PTLTWK.js} +0 -0
package/README.md
CHANGED
|
@@ -5296,31 +5296,74 @@ and reviewed:
|
|
|
5296
5296
|
this branch does not (dropped from `kinds` or from the baseline, `--update`
|
|
5297
5297
|
included), and a file the base branch counted that is a symbolic link now,
|
|
5298
5298
|
or sits under one, and that the walk no longer reads for a kind counted in
|
|
5299
|
-
it
|
|
5300
|
-
|
|
5301
|
-
|
|
5299
|
+
it. Not yet seen by this check: a file the base branch held only in
|
|
5300
|
+
`allow`, with no baseline line, that is a symbolic link now (a dated
|
|
5301
|
+
follow-up, due 2026-11-25). A linked folder is followed only when it is the start of every glob
|
|
5302
|
+
that reads it; a file that only `includeCopies` reads now is read for the
|
|
5303
|
+
copied-value kinds alone.
|
|
5304
|
+
For each counted file that is gone or now counts less for a counted kind,
|
|
5305
|
+
the lock reads
|
|
5306
|
+
`git diff -M30% -C30% --find-copies-harder -l0 --no-relative --name-status -z`
|
|
5307
|
+
against the base, from the repository root under any `diff.relative`
|
|
5308
|
+
setting, with no rename limit. A rename or a copy of that file fails when
|
|
5309
|
+
the check does not read the new path for a kind that left the file (every
|
|
5310
|
+
kind of a file that is gone; the kinds that count less in a file that is
|
|
5311
|
+
still here, its baseline line and its `allow` entries together), or when
|
|
5312
|
+
the new path is outside the folder the check runs in;
|
|
5313
|
+
a move inside the scope, a delete, and a burn-down with no copy pass. A
|
|
5314
|
+
copy catches a file moved with
|
|
5315
|
+
a new file put at its old path. git pairs at 30% similarity, not its
|
|
5316
|
+
default 50%, so code moved and changed a lot is still paired with where it
|
|
5317
|
+
came from. git pairs on shared lines (imports, boilerplate), so a pair fails
|
|
5318
|
+
only for a kind that left the file and that the new file still holds: a
|
|
5319
|
+
story or a test that shares a burned-down file's imports passes unless it
|
|
5320
|
+
holds a kind that was burned down (padding in the test of a file whose
|
|
5321
|
+
buttons were burned down passes). The new file is read in the working tree,
|
|
5322
|
+
by its own rules and by the rules of the file it came from (`hex` counts
|
|
5323
|
+
only in JSX files, so a `.tsx` renamed to `.ts` still holds its hex, and a
|
|
5324
|
+
raw `<button>` in it still counts). A stylesheet paired with a stylesheet is
|
|
5325
|
+
read by the stylesheet rules. A file the check cannot scan (`.mdx`, `.d.ts`,
|
|
5326
|
+
a stylesheet paired with a script, anything else not a script) or cannot
|
|
5327
|
+
read is taken to hold every kind.
|
|
5328
|
+
If git cannot list the renames, the check fails.
|
|
5329
|
+
A file new to a scope (a widened `include`, `includeImporting` or
|
|
5330
|
+
`includeCopies`, or an `exclude` line taken out) may hold what it held for
|
|
5331
|
+
those kinds on the base, in the baseline or in `allow`: no more than it held
|
|
5332
|
+
there, and no more than it holds now, so an emptied file gives no room to
|
|
5333
|
+
another.
|
|
5334
|
+
When the base has no baseline in this folder, the lock lists the base's
|
|
5335
|
+
files (`git ls-tree`). A baseline there in a folder that is gone here means
|
|
5336
|
+
the check moved, and it fails; a baseline in a folder that is still here (a
|
|
5337
|
+
second app adopting) is an adoption.
|
|
5338
|
+
A base config or baseline that does not parse is repaired by this change:
|
|
5339
|
+
a run that reaches the comparison has read its own copies, so they parse.
|
|
5340
|
+
The comparison (for the baseline) or the shrink check (for the config) is
|
|
5341
|
+
skipped, and a GitHub Actions warning names the file. The next change is
|
|
5342
|
+
compared against the repaired file as usual.
|
|
5302
5343
|
Not seen by the lock, each with its reason:
|
|
5303
|
-
- A file moved
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
- The check pinned back to a release without this lock (the checker alias,
|
|
5317
|
-
or efficient-shell itself). The lock is code in the version the repository
|
|
5318
|
-
installs, so an older version runs the older check. Only a check outside
|
|
5319
|
-
the package can see it.
|
|
5344
|
+
- A file moved and changed so much that git finds under 30% of it in the
|
|
5345
|
+
new file. It counts as deleted.
|
|
5346
|
+
- A push of several commits at once, or a rebase merge: the lock compares
|
|
5347
|
+
the last commit with the one before it, not with the commit before the
|
|
5348
|
+
push. A pull request is compared as a whole.
|
|
5349
|
+
- No baseline anywhere on the base branch. The change is taken as the one
|
|
5350
|
+
adopting the check, and passes with a note.
|
|
5351
|
+
- A local run (no `GITHUB_BASE_REF`, and `GITHUB_EVENT_NAME` is not
|
|
5352
|
+
`push`). There is no base to compare. An empty `GITHUB_BASE_REF` counts
|
|
5353
|
+
as not set.
|
|
5354
|
+
- The check pinned back to a release without this lock, in a repository
|
|
5355
|
+
that does not run it with `--base-lock`, or in a change that also removes
|
|
5356
|
+
the flag from the script (the reviewer sees that line).
|
|
5320
5357
|
- Copies are counted only in a repository that sets `includeCopies`. Without
|
|
5321
5358
|
it, the copied-value kinds read the operator UI alone.
|
|
5322
5359
|
- `allow` is a count that is meant to stay, with its reason. It is exact too:
|
|
5323
|
-
when the element goes, the entry goes.
|
|
5360
|
+
when the element goes, the entry goes. The lock adds `allow` to the
|
|
5361
|
+
baseline: per kind, the two together may not rise against the base. So a
|
|
5362
|
+
count moved from the baseline into `allow` passes, and a new count that must
|
|
5363
|
+
stay goes in `allow` with its reason while the same count of that kind is
|
|
5364
|
+
burned down in the same change. Each `allow` entry that is new or raised
|
|
5365
|
+
against the base config prints a GitHub Actions warning with its file,
|
|
5366
|
+
kind, count and reason, so the reviewer reads it.
|
|
5324
5367
|
- A glob that matches no file fails. A line that outlived its files is deleted.
|
|
5325
5368
|
|
|
5326
5369
|
`ui-kit.baseline.json` is written only by the command: one sorted line per
|
|
@@ -5336,9 +5379,22 @@ repository would rise. `--init` writes the first baseline and refuses to
|
|
|
5336
5379
|
overwrite one; `--init --kind <kind>` takes the baseline for a kind just added
|
|
5337
5380
|
to `kinds`.
|
|
5338
5381
|
|
|
5339
|
-
On a pull request (`GITHUB_BASE_REF` set) it also compares with
|
|
5340
|
-
branch's baseline: no kind's total may be higher there.
|
|
5341
|
-
|
|
5382
|
+
On a pull request (`GITHUB_BASE_REF` set and not empty) it also compares with
|
|
5383
|
+
the base branch's baseline: no kind's total may be higher there. It fetches
|
|
5384
|
+
`origin/<base>` when the checkout lacks it; when that fails, the check fails.
|
|
5385
|
+
When git cannot read the checkout (no git, not a checkout, or a folder git
|
|
5386
|
+
does not trust), the check fails too.
|
|
5387
|
+
On a push (`GITHUB_EVENT_NAME` is `push`, no `GITHUB_BASE_REF`: main after a
|
|
5388
|
+
merge) it compares with the commit before this one (`HEAD^1`), and deepens a
|
|
5389
|
+
shallow checkout by one commit to read it; when that fails, the check fails.
|
|
5390
|
+
Give that job `fetch-depth: 2` in `actions/checkout`, so the commit is there
|
|
5391
|
+
without a fetch.
|
|
5392
|
+
`--no-base` skips the comparison where `GITHUB_BASE_REF` is not set; on a pull
|
|
5393
|
+
request it is refused.
|
|
5394
|
+
`--base-lock` changes nothing. Every release before the one that adds it
|
|
5395
|
+
stops on it as an unknown argument, so a repository that runs
|
|
5396
|
+
`efficient-shell-ui-check --base-lock` fails in its own CI when the shell or the
|
|
5397
|
+
checker alias is pinned back to such a release.
|
|
5342
5398
|
|
|
5343
5399
|
Wire it into the job that already gates a merge, for example at the front of
|
|
5344
5400
|
the `test` script: `"test": "efficient-shell-ui-check && vitest run"`.
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import{InputEndActionButton as e}from"./chunk-PT4GMPUB.js";import"./chunk-3DSGJIC7.js";import"./chunk-UZFFSZFI.js";import"./chunk-SV5RRBVA.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-PT4GMPUB.js";import"./chunk-3DSGJIC7.js";import"./chunk-UZFFSZFI.js";import"./chunk-SV5RRBVA.js";import"./chunk-AYZY3YNC.js";import{peekBrowserStartUrl as t,claimBrowserStartUrl as o}from"./chunk-LWLCNQY7.js";import{AboutApp as r}from"./chunk-SAYI67HY.js";import{WindowTitle as n}from"./chunk-PDOPU3KN.js";import"./chunk-4LXCCZDM.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-DASRJ26L.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-GHLXZDLU.js";import{confirm as s}from"./chunk-KV6XCHAG.js";import"./chunk-B447IHIL.js";import"./chunk-EIFNESXS.js";import"./chunk-PR6FNBKR.js";import"./chunk-RIG5FEVS.js";import"./chunk-NDWX5Z4D.js";import"./chunk-VWGWZY7A.js";import"./chunk-7QSDPSXP.js";import"./chunk-ZGIAMYTI.js";import"./chunk-5LHEPE4B.js";import"./chunk-F3ZOO23R.js";import"./chunk-2QY5BJLA.js";import"./chunk-UGTRSRIW.js";import"./chunk-KC3EX26K.js";import"./chunk-OB2ZVMGR.js";import"./chunk-DWGYC7OD.js";import"./chunk-JMGDGNM7.js";import"./chunk-GOAFMGUI.js";import"./chunk-URHGHXDN.js";import"./chunk-5QFPTDQF.js";import"./chunk-EVYD6UFQ.js";import"./chunk-M5K4AX4E.js";import{Icon as a}from"./chunk-ISVODSRP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-R2VKEMZH.js";import"./chunk-G67CJAQ2.js";import"./chunk-SOZCWT6I.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-STKJA4PV.js";import"./chunk-UQYNPYF4.js";import"./chunk-MRJKZWWV.js";import"./chunk-TWVUQUUD.js";import"./chunk-5FYDNH4Y.js";import"./chunk-LNXBTK7Q.js";import"./chunk-DEJIH3ZQ.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,S]=l(w),[D,R]=l([w]),[W,z]=l(0),[G,E]=l(0),[L,H]=l(x),[U,I]=l(!1),[M,P]=l(null),T=i(null),A=i(null);c(()=>{try{localStorage.setItem(d,JSON.stringify(L))}catch{}},[L]);const F=e=>{const t=f(e);t&&(v(t),S(t),R(e=>{const o=e.slice(0,W+1);return o.push(t),o}),z(e=>e+1),I(!1))},Z=()=>{"undefined"!=typeof window&&window.open(w,"_blank","noopener,noreferrer")},J=()=>{const e=M?.trim();e?(H(t=>[...t,{label:e,url:w}]),P(null)):P(null)};c(()=>{if(null===M)return;T.current?.focus(),T.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||P(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==M]);const O=e=>{H(t=>t.filter((t,o)=>o!==e))},Y=W>0,B=W<D.length-1,K=L.some(e=>e.url===w),X="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 - ${N(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(W>0){const e=W-1;z(e),v(
|
|
7
|
-
/* @__PURE__ */u("button",{onClick:()=>{if(W<
|
|
8
|
-
/* @__PURE__ */u("button",{onClick:()=>E(e=>e+1),className:
|
|
9
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
10
|
-
/* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),
|
|
6
|
+
/* @__PURE__ */u("button",{onClick:()=>{if(W>0){const e=W-1;z(e),v(D[e]),S(D[e]),I(!1)}},disabled:!Y,className:X,title:"Back",children:/* @__PURE__ */u(a,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
|
|
7
|
+
/* @__PURE__ */u("button",{onClick:()=>{if(W<D.length-1){const e=W+1;z(e),v(D[e]),S(D[e]),I(!1)}},disabled:!B,className:X,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:X,title:"Refresh",children:/* @__PURE__ */u(a,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
|
|
9
|
+
/* @__PURE__ */u("button",{onClick:()=>F(b),className:X,title:"Home",children:/* @__PURE__ */u(a,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
|
|
10
|
+
/* @__PURE__ */u("form",{onSubmit:e=>{e.preventDefault(),F(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
|
-
/* @__PURE__ */u("input",{type:"text",value:C,onChange:e=>
|
|
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:()=>
|
|
14
|
-
/* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>
|
|
15
|
-
/* @__PURE__ */u("button",{onClick:
|
|
16
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
12
|
+
/* @__PURE__ */u("input",{type:"text",value:C,onChange:e=>S(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
|
+
/* @__PURE__ */u("span",{className:"flex pr-1",children:/* @__PURE__ */u(e,{action:{label:"Reset to current URL",icon:/* @__PURE__ */u(a,{name:"close"}),onClick:()=>S(w)}})})]})}),
|
|
14
|
+
/* @__PURE__ */u("button",{"data-bookmark-popover":!0,onClick:()=>K?O(L.findIndex(e=>e.url===w)):void P(N(w)),className:X+" "+(K?"text-yellow-500":""),title:K?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */u(a,{name:"star",className:"h-4 w-4",fill:K?"currentColor":"none",strokeWidth:1.5})}),
|
|
15
|
+
/* @__PURE__ */u("button",{onClick:Z,className:X,title:"Open in new tab",children:/* @__PURE__ */u(a,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
|
|
16
|
+
/* @__PURE__ */u("button",{onClick:()=>I(e=>!e),className:X,title:"Embedding help",children:/* @__PURE__ */u(a,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==M&&/* @__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:T,type:"text",value:M,onChange:e=>P(e.target.value),onKeyDown:e=>{"Enter"===e.key?J():"Escape"===e.key&&P(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
|
-
/* @__PURE__ */u("button",{onClick:()=>
|
|
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===
|
|
21
|
+
/* @__PURE__ */u("button",{onClick:()=>P(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
|
|
22
|
+
/* @__PURE__ */u("button",{onClick:J,disabled:!M.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===L.length&&/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),L.map((e,t)=>/* @__PURE__ */m("button",{onClick:()=>F(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(j,{url:w,iframeKey:G,iframeRef:
|
|
27
|
+
/* @__PURE__ */u("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */u(j,{url:w,iframeKey:G,iframeRef:A,openExternal:Z,showHelp:U,dismissHelp:()=>I(!1)})})]})}function N(e){try{return new URL(e).hostname.replace(/^www\./,"")}catch{return e}}function j({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:[N(e)," can't be embedded"]}),
|
|
30
30
|
/* @__PURE__ */m("p",{className:"text-sm text-gray-500 mb-4",children:["This site sends an ",
|