efficient-shell 9.14.0 → 10.1.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 +16 -20
- package/dist/{Browser-42NYVAPR.js → Browser-2S5V2RRU.js} +14 -14
- package/dist/Calculator-N2NLSDTW.js +29 -0
- package/dist/{CurrencyConverter-OIXAMDP7.js → CurrencyConverter-HW5HW3RH.js} +8 -8
- package/dist/{Documents-V2OKP6JZ.js → Documents-JTURYN4D.js} +19 -19
- package/dist/{Files-OAMTKHYK.js → Files-GP2LAGME.js} +88 -88
- package/dist/Notepad-OV66ANUO.js +24 -0
- package/dist/PdfViewer-WNKGFJD6.js +1 -0
- package/dist/{PomodoroTimer-AYGPGA6Q.js → PomodoroTimer-TGUTV47T.js} +25 -25
- package/dist/{Preview-BBQWQ4DG.js → Preview-76A4GKGI.js} +45 -45
- package/dist/{Sidebar-RHGWTAPS.js → Sidebar-4OI4LP6G.js} +36 -36
- package/dist/{Spreadsheet-MS5FU7ET.js → Spreadsheet-FU5QIZA3.js} +14 -14
- package/dist/{Stock-GSQNTV7E.js → Stock-FEVMKWMS.js} +3 -3
- package/dist/{Weather-5XLO2GLO.js → Weather-2EGADOTH.js} +14 -14
- package/dist/{WorldClock-CG3NF4GA.js → WorldClock-U5DIGLOY.js} +6 -6
- package/dist/ai/index.js +33 -33
- 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/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/ChordChart.js +1 -1
- package/dist/charts/ColumnChart.js +1 -1
- package/dist/charts/HeatmapChart.js +1 -1
- package/dist/charts/HistogramChart.js +1 -1
- package/dist/charts/RadarChart.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/SunburstChart.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-2NMW66P5.js +1 -0
- package/dist/{chunk-PUIQFTCO.js → chunk-2OJ3HGFY.js} +5 -5
- package/dist/{chunk-PKIDVVAE.js → chunk-2SLQD57V.js} +5 -5
- package/dist/{chunk-NDEIZUMG.js → chunk-3V6ZERBS.js} +1 -1
- package/dist/{chunk-QO35WRYA.js → chunk-3V74SUZO.js} +17 -17
- package/dist/{chunk-DL6QIWVR.js → chunk-42XMT5JN.js} +1 -1
- package/dist/{chunk-VG5NGCMQ.js → chunk-44PGFMSX.js} +6 -6
- package/dist/{chunk-NU2YQSOP.js → chunk-45XXERGA.js} +2 -2
- package/dist/{chunk-A4HA7EXR.js → chunk-4UX6ET7G.js} +1 -1
- package/dist/{chunk-GXGBBMGV.js → chunk-4VDGVF5T.js} +1 -1
- package/dist/{chunk-VXP5L6DI.js → chunk-5EX6XXUX.js} +1 -1
- package/dist/chunk-5VDT4762.js +3 -0
- package/dist/{chunk-O25B75XX.js → chunk-5VSP3TYU.js} +1 -1
- package/dist/{chunk-R2QDO7NY.js → chunk-6B4F5DWV.js} +3 -3
- package/dist/{chunk-66JYKX4T.js → chunk-6FPDOEOX.js} +1 -1
- package/dist/{chunk-3AZBI76O.js → chunk-7ILNRFEV.js} +1 -1
- package/dist/{chunk-GQK3U2IO.js → chunk-7TONF2PM.js} +1 -1
- package/dist/{chunk-LKW3YAZN.js → chunk-A3VJ4PRU.js} +6 -6
- package/dist/chunk-ACVKU6YW.js +7 -0
- package/dist/{chunk-ELUTQZGP.js → chunk-AEQFFD5I.js} +1 -1
- package/dist/{chunk-QRJRGP2K.js → chunk-AGLBDT7X.js} +8 -8
- package/dist/chunk-AKVB5TQD.js +29 -0
- package/dist/{chunk-M7H3OCIL.js → chunk-ANTH2FBS.js} +57 -57
- package/dist/chunk-AXL7VTNM.js +11 -0
- package/dist/{chunk-7BDZZANS.js → chunk-B7HW6XZD.js} +1 -1
- package/dist/{chunk-XILZGSMX.js → chunk-BDFZNLFQ.js} +1 -1
- package/dist/{chunk-C6MV6IAX.js → chunk-BMXMSAQE.js} +8 -8
- package/dist/{chunk-PUCPFBYO.js → chunk-BNQRPLBW.js} +1 -1
- package/dist/{chunk-JWX7QRGE.js → chunk-BZPPDYEE.js} +1 -1
- package/dist/{chunk-DPDRFLBY.js → chunk-CLQFP42I.js} +3 -3
- package/dist/{chunk-C45OKLRM.js → chunk-CUA6CREW.js} +8 -8
- package/dist/{chunk-RYS3URDC.js → chunk-DY2M6BIG.js} +10 -10
- package/dist/{chunk-EGEWU776.js → chunk-E3RHEEA6.js} +1 -1
- package/dist/{chunk-WFANOFHG.js → chunk-F7A6K3D5.js} +5 -5
- package/dist/{chunk-IKQVK3I3.js → chunk-FFASZGNZ.js} +2 -2
- package/dist/{chunk-MPALY3CL.js → chunk-FMC2XNSP.js} +6 -6
- package/dist/{chunk-D7X2HMMA.js → chunk-FS2KWQJW.js} +10 -10
- package/dist/{chunk-MRUJRFIX.js → chunk-GGIFS34Z.js} +1 -1
- package/dist/chunk-GY67Y5SN.js +10 -0
- package/dist/{chunk-HJPCHES5.js → chunk-GZYTCHPX.js} +4 -4
- package/dist/{chunk-ZREDCRTL.js → chunk-J7CIBRDS.js} +1 -1
- package/dist/{chunk-ZOBLEXIU.js → chunk-JJYAYMY7.js} +1 -1
- package/dist/{chunk-ZPCADTM5.js → chunk-JRBQLRAZ.js} +1 -1
- package/dist/{chunk-YFUMK2E7.js → chunk-JZK3UDOT.js} +1 -1
- package/dist/{chunk-SVQJZF66.js → chunk-K64JRGNE.js} +5 -5
- package/dist/{chunk-2TQ6BLSN.js → chunk-K7PCBUDC.js} +6 -6
- package/dist/{chunk-FSPFV4MI.js → chunk-KKSVRIMP.js} +2 -4
- package/dist/{chunk-D46AP6U5.js → chunk-KZQAGXME.js} +1 -1
- package/dist/{chunk-KTKMM2XW.js → chunk-LFVUDFVU.js} +1 -1
- package/dist/{chunk-FTWWJHFX.js → chunk-LOYCPZUB.js} +1 -1
- package/dist/chunk-LPDI5NL6.js +5 -0
- package/dist/{chunk-BWIX3YIH.js → chunk-M3R4C3A6.js} +2 -2
- package/dist/{chunk-HAFB45DT.js → chunk-MH6DI6YY.js} +11 -11
- package/dist/{chunk-VVVWVOG7.js → chunk-MLKY5ESV.js} +1 -1
- package/dist/{chunk-TGLHJS3M.js → chunk-MUMQ6PW7.js} +1 -1
- package/dist/chunk-N6VP75F5.js +3 -0
- package/dist/{chunk-KAVFW5CU.js → chunk-NNOA7AVG.js} +5 -5
- package/dist/{chunk-6YQPLI5M.js → chunk-NQJKANUP.js} +11 -11
- package/dist/chunk-NW7Z3G7P.js +15 -0
- package/dist/chunk-O6ABVKHU.js +15 -0
- package/dist/{chunk-25STFYV3.js → chunk-OPB3I4JH.js} +4 -4
- package/dist/{chunk-RBD7SB6M.js → chunk-P5YFQ4IQ.js} +1 -1
- package/dist/chunk-PYQ6DD3F.js +1 -0
- package/dist/{chunk-NDKQDIWN.js → chunk-Q4LBBFLO.js} +5 -5
- package/dist/{chunk-X6TJR6M2.js → chunk-Q5YM65DZ.js} +8 -8
- package/dist/{chunk-XOKANFQD.js → chunk-QASKQDUR.js} +16 -16
- package/dist/{chunk-5F7HMNCX.js → chunk-QODTON7V.js} +1 -1
- package/dist/{chunk-7KDGW6BR.js → chunk-QXRRAADR.js} +1 -1
- package/dist/{chunk-VSAI5TH7.js → chunk-R4Q5653D.js} +20 -20
- package/dist/{chunk-DXHLUB36.js → chunk-RKFEJ5CX.js} +1 -1
- package/dist/{chunk-GKZUAT3K.js → chunk-RSIGTZMU.js} +1 -1
- package/dist/{chunk-GNU3U2TP.js → chunk-RZR3OAKV.js} +1 -1
- package/dist/chunk-SKY2NBTQ.js +6 -0
- package/dist/chunk-TDLU6GF5.js +4 -0
- package/dist/{chunk-4E4GWE4L.js → chunk-TYK7VN73.js} +15 -15
- package/dist/{chunk-PKHZTFBK.js → chunk-UDKOJB2B.js} +2 -2
- package/dist/chunk-UP442DPT.js +9 -0
- package/dist/{chunk-OUKDGO4N.js → chunk-V4RYE6KA.js} +8 -8
- package/dist/{chunk-E7WY4GZ3.js → chunk-VMDBVXDJ.js} +1 -1
- package/dist/{chunk-F24QTMTY.js → chunk-VP63OOO4.js} +3 -3
- package/dist/{chunk-GRBBQ3VF.js → chunk-WKSNTMEJ.js} +1 -1
- package/dist/{chunk-M5YG57UP.js → chunk-X6YT3I5F.js} +1 -1
- package/dist/{chunk-76IDLFXI.js → chunk-XABYSSXW.js} +1 -1
- package/dist/{chunk-GSBIJLTD.js → chunk-XAROKI7X.js} +1 -1
- package/dist/{chunk-ZMVCN4OA.js → chunk-XHMIJ7S3.js} +7 -7
- package/dist/{chunk-Q7HN6T3H.js → chunk-XNKIDGZW.js} +1 -1
- package/dist/{chunk-B4DR72FR.js → chunk-XQQNA246.js} +1 -1
- package/dist/{chunk-M33225G6.js → chunk-XZBQ3XXD.js} +1 -1
- package/dist/{chunk-UX5L3MOB.js → chunk-Y23TGQFN.js} +4 -4
- package/dist/chunk-ZLHPCPXS.js +19 -0
- package/dist/{chunk-LPUGK2MC.js → chunk-ZN2BFSQR.js} +2 -2
- package/dist/{chunk-TXMAWCR7.js → chunk-ZRZ5LOW3.js} +1 -1
- package/dist/data/ListLoadError.js +1 -1
- package/dist/forms/BorderInput.js +1 -1
- package/dist/forms/BrandAssetEditor.js +1 -1
- package/dist/forms/Calendar.js +1 -1
- package/dist/forms/ColorPicker.js +1 -1
- package/dist/forms/ComposerAttachments.js +1 -1
- package/dist/forms/CornersInput.js +1 -1
- package/dist/forms/DatePicker.js +1 -1
- package/dist/forms/DateRangePicker.js +1 -1
- package/dist/forms/DisplayChips.js +1 -1
- package/dist/forms/FilePicker.js +1 -1
- package/dist/forms/IconPicker.js +1 -1
- package/dist/forms/InputNumber.js +1 -1
- package/dist/forms/LinkPicker.js +1 -1
- package/dist/forms/MediaLibrary.js +1 -1
- package/dist/forms/MediaUploadField.js +1 -1
- package/dist/forms/MediaUploadGrid.js +1 -1
- package/dist/forms/MediaUsedInList.js +1 -1
- package/dist/forms/PositionInput.js +1 -1
- package/dist/forms/Select.d.ts +0 -6
- package/dist/forms/Select.js +1 -1
- package/dist/forms/SidesInput.js +1 -1
- package/dist/forms/Slider.js +1 -1
- package/dist/forms/Snippet.js +1 -1
- package/dist/forms/SplitButton.js +1 -1
- package/dist/forms/Switch.js +1 -1
- package/dist/forms/TagInput.js +1 -1
- package/dist/forms/TextToolbar.js +1 -1
- package/dist/forms/WidthsBar.js +1 -1
- package/dist/forms/mediaLibraryMenu.js +1 -1
- package/dist/forms/settingRowContext.d.ts +1 -3
- package/dist/forms/settingRowContext.js +1 -1
- package/dist/forms/textAlign.js +1 -1
- package/dist/icons/index.js +1 -1
- package/dist/index.d.ts +9 -2
- package/dist/index.js +90 -91
- package/dist/map/index.js +3 -3
- package/dist/markdown/index.js +1 -1
- package/dist/page-tabs/index.js +5 -5
- package/dist/pdf/index.js +1 -1
- package/dist/shell/Accordion.d.ts +22 -12
- package/dist/shell/Accordion.js +1 -1
- package/dist/shell/AppUpdateBanner.js +1 -1
- package/dist/shell/Banner.js +1 -1
- package/dist/shell/Breadcrumbs.js +1 -1
- package/dist/shell/ColoredBadge.js +1 -1
- package/dist/shell/ConfirmDialog.js +1 -1
- package/dist/shell/ContextMenu.js +1 -1
- package/dist/shell/Dialog.js +1 -1
- package/dist/shell/Drawer.js +1 -1
- package/dist/shell/DropdownMenu.js +1 -1
- package/dist/shell/EmptyState.js +1 -1
- package/dist/shell/HelpCenter.js +1 -1
- package/dist/shell/ImageLightbox.js +1 -1
- package/dist/shell/LanguageSelect.js +1 -1
- package/dist/shell/Markdown.js +1 -1
- package/dist/shell/PageHeader.js +1 -1
- package/dist/shell/PopupMenu.js +1 -1
- package/dist/shell/ProductionTimeline.js +1 -1
- package/dist/shell/Result.js +1 -1
- package/dist/shell/SearchableSelect.js +1 -1
- package/dist/shell/SettingReset.d.ts +23 -5
- package/dist/shell/SettingReset.js +1 -1
- package/dist/shell/SettingRow.d.ts +9 -14
- package/dist/shell/SettingRow.js +1 -1
- package/dist/shell/SidebarLayout.js +1 -1
- package/dist/shell/SidebarNav.js +1 -1
- package/dist/shell/SortableList.js +1 -1
- package/dist/shell/StepChain.js +1 -1
- package/dist/shell/Stepper.js +1 -1
- package/dist/shell/TopNav.js +1 -1
- package/dist/shell/Tree.js +1 -1
- package/dist/telemetry/index.js +1 -1
- package/dist/templates/ChatTemplate.js +1 -1
- package/dist/templates/CheckoutTemplate.js +1 -1
- package/dist/templates/DashboardTemplate.js +1 -1
- package/dist/templates/DataTablePage.js +1 -1
- package/dist/templates/EmailTemplate.js +1 -1
- package/dist/templates/FormLayoutPage.js +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/ui.css +247 -32
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/Calculator-PCTFUS5O.js +0 -29
- package/dist/Notepad-3LG227K2.js +0 -25
- package/dist/PdfViewer-DFBPEUY5.js +0 -1
- package/dist/chunk-6TCJOVFX.js +0 -3
- package/dist/chunk-A7CCSRPB.js +0 -12
- package/dist/chunk-AEJNFA2K.js +0 -6
- package/dist/chunk-AVAYZK3Z.js +0 -3
- package/dist/chunk-BGNJQMAZ.js +0 -1
- package/dist/chunk-EXJZUNNW.js +0 -29
- package/dist/chunk-KJXF5WAJ.js +0 -5
- package/dist/chunk-L65BESIE.js +0 -1
- package/dist/chunk-ME4VRJMK.js +0 -16
- package/dist/chunk-MNIULUQY.js +0 -14
- package/dist/chunk-NFJDLIRM.js +0 -5
- package/dist/chunk-TIUFFVP5.js +0 -9
- package/dist/chunk-UXPZQID4.js +0 -20
- package/dist/chunk-VVZE27M4.js +0 -7
- package/dist/chunk-XSJJPACH.js +0 -11
package/README.md
CHANGED
|
@@ -960,10 +960,9 @@ and an exact half step goes away from zero: 1.15 at step 0.1 is 1.2, and
|
|
|
960
960
|
value from before the box was entered, including numbers written live while
|
|
961
961
|
typing. These are `InputNumber`'s keys (`snap`, `allowEmpty`), not a copy.
|
|
962
962
|
|
|
963
|
-
The slider fills the width it is given
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
track if the row is narrower still.
|
|
963
|
+
The slider fills the width it is given, and its track never goes under 96px.
|
|
964
|
+
In a compact `SettingRow` it is the row's control, on its own line under the
|
|
965
|
+
name, at the panel's full width.
|
|
967
966
|
|
|
968
967
|
The number box (`InputNumber`, here and everywhere) steps with the mouse wheel
|
|
969
968
|
only while it has the focus: up adds `step`, down takes it, Shift uses the big
|
|
@@ -1030,14 +1029,13 @@ and it is exactly as wide as `#RRGGBB`, so it is never cut.
|
|
|
1030
1029
|
|
|
1031
1030
|
Opacity is its own number, 0-100, next to the colour, which stays `#rrggbb`.
|
|
1032
1031
|
Pass `opacity` and `onOpacityChange` and the row adds a `%` box after the hex
|
|
1033
|
-
(the
|
|
1032
|
+
(the kit's number box), the
|
|
1034
1033
|
picker adds an opacity strip and a `%` box, and the swatch shows the colour at
|
|
1035
1034
|
that opacity over the checkerboard (`colorFill(color, opacity)`). Leave
|
|
1036
1035
|
`onOpacityChange` out and none of it is drawn. When swatch, hex and `%` box
|
|
1037
1036
|
do not fit the width they are given, the `%` box goes under them at the right;
|
|
1038
|
-
it never shrinks. In a compact `SettingRow` the
|
|
1039
|
-
|
|
1040
|
-
controls drop under the name.
|
|
1037
|
+
it never shrinks. In a compact `SettingRow` the controls have their own line,
|
|
1038
|
+
under the name.
|
|
1041
1039
|
|
|
1042
1040
|
```tsx
|
|
1043
1041
|
<SettingRow size="compact" icon={<Icon name="swatch" />} label="Fill color"
|
|
@@ -1393,12 +1391,10 @@ deleted once this ships.
|
|
|
1393
1391
|
<SettingRow
|
|
1394
1392
|
size="compact"
|
|
1395
1393
|
label="Widths"
|
|
1396
|
-
action={resolveColumnShares(row.columnShares, count)
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
<WidthsBar label="Widths" count={count} value={row.columnShares} onChange={shares => save({ columnShares: shares })} />
|
|
1401
|
-
</SettingRow>
|
|
1394
|
+
action={<SettingReset label="Widths" changed={resolveColumnShares(row.columnShares, count) != null}
|
|
1395
|
+
detail={strings.widths.equal} onReset={() => save({ columnShares: undefined })} />}
|
|
1396
|
+
value={<WidthsBar label="Widths" count={count} value={row.columnShares} onChange={shares => save({ columnShares: shares })} />}
|
|
1397
|
+
/>
|
|
1402
1398
|
```
|
|
1403
1399
|
|
|
1404
1400
|
The value is `ColumnShares`: the first `count - 1` shares, whole percentages.
|
|
@@ -1428,7 +1424,7 @@ field are described by; no hint line is drawn (Lewis, 2026-10-13).
|
|
|
1428
1424
|
|
|
1429
1425
|
The bar draws no ↺ and nothing but itself. Its reset goes BY THE ROW TITLE,
|
|
1430
1426
|
like every other panel row's (2026-10-23): the host's `SettingRow` takes
|
|
1431
|
-
`SettingReset` as its `action
|
|
1427
|
+
`SettingReset` as its `action`, changed while the widths are set (above), so the ↺ is
|
|
1432
1428
|
"Reset Widths", "back to equal widths" (`strings.widths.equal`), at the end of
|
|
1433
1429
|
the title line, and the bar keeps its whole width for the numbers in a narrow
|
|
1434
1430
|
segment. The reset CLEARS the value (`undefined`): no stored value is what
|
|
@@ -1662,9 +1658,9 @@ All exports are named — `import { Modal, ... } from 'efficient-shell'`.
|
|
|
1662
1658
|
| `TimelineTrack` | The time axis both timelines are drawn on, and the reason they look and move alike rather than merely similar. A 6 px rail with a fill, a **date ruler** (month ticks always, week ticks where they clear 14 px, a month label only where it clears 72 px of the last one), dots whose shape and glyph say what kind of event they are — every one of them in the theme accent at its 600 step, the colour a primary `Button` wears, so a shape survives the greyscale print and the colour-blind reader that a hue never did, and one of two label strategies: `labels="lanes"` packs them into two rows and folds runs of the same kind into `×N` pills, `labels="active"` draws the one label a scrubber needs, `labels="none"` draws none — the bare rail, where an item's `caption` is the only text near its mark, the edge captions flank the rail on its own row, and the `pending` things are one dashed cap past a dashed tail rather than a column. `axis="compressed"` CUTS any stretch holding more than 30% of the window's time down to a fixed notch with a break glyph saying how many days it hides, and shares the rest of the track proportionally; `axis="linear"` keeps time proportional throughout; `axis="spread"` cuts nothing and keeps the 48 px floor, the idle stretches paying for it in proportion. `highlightKeys` lights one band from the leftmost named mark to the rightmost and every mark inside it; `onHoverChange` reports the mark under the pointer or the focus. A `provisional` item is hollow, never current, and outside the fill. `endMark` puts a hollow, dashed mark ON a bare rail's right edge for a day the window already runs to — an estimate, a contractual date — with the label and the date in its popover. An optional `thumb` turns it into a scrubber: give it `stops` and it becomes discrete — a drag follows the pointer but snaps to the nearest stop as it goes, arrows step stop to stop, and `valueText` says which one for a screen reader. An optional `playback` then drives that thumb along the rail by itself: the caller owns the button and the `playing` flag, the track owns the travel, because the distance between two stops is a distance in **pixels of its axis** and nobody outside knows how wide the track is. It is paced by that distance — 350 ms per 100 px, clamped to 450–1400 ms, eased in and out — so a compressed `//` notch costs 48 px of travel like any other 48 px instead of swallowing the glide, and the date chip, read back through the axis's inverse mapping, skips exactly the days the notch hides. `onArrive(key, ms)` fires on arrival and never mid-travel; the thumb then rests 700 ms before setting off again. The timing is the **wall clock**, not the frame rate: the rest is waited out on a timer and the travel is measured against the high-resolution timestamp each animation frame carries, so 700 ms is 700 ms on a throttled or occluded surface that hands out one frame a second instead of sixty — and a page that comes back after an idle stretch walks its backlog forward at one report per frame rather than announcing four at once. `onProgress({ fromKey, toKey, t, ms } | null)` hands out the in-flight position on every frame of a glide and `null` the moment there is none (arrival, pause, cancel, end, and a released drag), so a consumer can interpolate a table under the bar on the same eased `t` that places the disc; a drag reports the pointer's linear fraction between its two neighbouring stops. Flipping `playing` off freezes it where it is — keeping what is left of the rest rather than spending it — and flipping it back on carries on from there; taking hold of the thumb — a drag, a click, an arrow key — ends the playback through `onStop`. Under `prefers-reduced-motion` the walk stays, the travel goes, and `onProgress` only ever says `null`. Hovering a `×N` pill **magnifies** its stretch so the members can carry their own labels (or do it from code with `zoomRange`), and an item's `preview` fills the hover/focus popover with the document in miniature, with an "Open" footer that fires its `onOpen` — the popover has already drawn the mark's label and its date above the preview, so a consumer leaves both out of it. Also `markers` — each one free to name its own `glyph` where its kind's is not specific enough — `phases`, `edgeCaptions`, and a `pending` list for the things that have no date. Every mark takes its own pointer, including on a scrubber: the 24 px hit strip that makes a 6 px rail pressable runs UNDER the dots rather than over them, so hover, focus and click reach a report, an inspection or a shipment, while a press on the bare rail between two of them still starts a drag and a drag crossing a mark is not interrupted by it. No two marks are ever drawn on top of each other: a run whose centres are closer than one mark's width — of any kinds, folded or not — becomes ONE mark carrying `×N`, its kind's own shape and glyph where the run shares a kind and a neutral `×N` pill where it does not, named after every member it stands for. A pointer opens it: the axis magnifies around the run and each member is a mark again with its own popover, the same magnification a `×N` label pill asks for. A run that is all one DATE can never be opened — no magnification separates a coordinate from itself — so its popover lists every member with its date and its own preview instead. Folding is a drawing decision only: the thumb's stops, `onActivate` and playback all still see every mark. The marks are an `<ol>` with exactly one `aria-current="step"` and ONE tab stop — arrows traverse, Home/End jump, Enter/Space activates — and every tooltip and pill popover is hoverable, persistent and Escape-dismissible (WCAG 1.4.13). A popover is kept inside the track and inside the shell window that owns it (UI-11), the first day's mark included, and a mark carries no native `title` — its popover is the tooltip, on hover and on focus alike. Under a 320 px track it stops squeezing the axis and switches to a vertical variant. Motion is `rosh-tl-*` classes in `ui.css` behind one `prefers-reduced-motion` rule, replayed on every mount, total budget 600 ms. |
|
|
1663
1659
|
| `ProductionTimeline` | The scrubbable production bar, drawn on `TimelineTrack` inside the shared timeline card: a sentence-case heading with the PO as its subject, the window and the lead time as meta, a Play **pill** on the right whose glyph follows its state, and a footer carrying the status line and legend chips drawn with the track's own glyphs — a shipment is a diamond with a truck in it and an inspection a disc with a flask, on the rail and in the chip alike, because every kind is painted in the one accent and the glyph is the only thing left to tell them apart. The thumb only ever rests on a date a report was filed on — drag it and it snaps report to report, arrow it and it steps one report at a time — so the bar never shows an estimate dressed as a fact. Press Play and it **travels** between them: a fresh press rewinds to the first report, the thumb reads each snapshot for 700 ms and then glides to the next with the date chip counting the days it crosses, and the status line under the bar changes on arrival rather than while it is on its way. Pausing freezes it mid-glide and pressing Play again carries on from exactly there; touching the thumb ends the playback and hands it back. The walk keeps time by the clock rather than by the frame rate, so an idle or throttled pane does not stretch it. `onScrubProgress` forwards the track's in-flight fraction — `{ fromKey, toKey, t, ms }` keyed by report id, `null` at a stop — which is how a consumer's items table moves WITH the thumb instead of jumping a whole report's worth of quantities when it lands; it is optional and undefined by default, so a caller that only reads the snapshot needs no change. `onPickReport` selects a report; the optional `onOpenReport` / `onOpenMarker` make the label above the thumb a real button that opens the document behind it. `reportLabel` names a report wherever the bar states its identity — the caption over the thumb, the popover header, each dot's accessible name, the slider's value text and the status line — and defaults to its own `progress_number`, while `resetLabel` replaces the whole of the `Back to …` button: together they are what lets a portal that must not print an internal document number run the same card. A report carries an optional `preview` for its hover/focus popover — the stage row it filed, the note attached to it — and `renderReportPreview` builds one for the reports that carry none, the convenience for a caller whose list arrives straight off an API; the report's own preview wins where both exist, and the popover prints the report number and the date itself. `useProductionTimeline(opts)` owns the slider state and the derived snapshot so the caller's items table and the bar read the same state; `STAGES` / `calcOverall` / `calcReportOverall` are the stage maths it shares with that table. **`variant="rail"`** is the bar alone, for a window whose own header already says what the order is: no card, no heading, no lead-time line, no label under the active report — every report, shipment, inspection and **invoice** (kind `invoice`, a disc with a receipt) is a dot with a popover — the thumb with its date chip, `Start` and `Est. done` flanking the rail, the estimated completion as a hollow mark on the right edge while it is still ahead, and under the rail one row: Play, the return button when the thumb has been moved, and the `<report> · date · N% overall · N pc in stock` line. The rail spreads the reports (the track's `spread` axis) rather than folding two a week apart into a `×2`. `onPlayStart` fires before the thumb moves, on a fresh run and on a resume, so a window that keeps the bar in view while its table shows something else can switch the table first. |
|
|
1664
1660
|
| `MilestoneTimeline` | The static sibling, on the same `TimelineTrack` and in the same card: one dot per milestone on a date axis, no scrubber. `heading` and `subject` split the title from the record it is about (`Mould development` · **001F/1813**), and the meta line states when it started, how long it has run and how many milestones are dated. The axis **cuts** rather than squeezes: a stretch holding more than 30% of the window's time becomes a fixed notch with a break glyph saying how many days it hides, and every stretch that still keeps time gets at least 48 px. Labels are packed into **two lanes** by their **measured** width, and a run of same-kind revisions folds into one `DFM ×4` pill whose members keep their dots on the rail: hovering it magnifies that stretch until each member can carry its own label, a click pins the popover listing them, Escape closes it. A milestone carries an optional `glyph` (a `default` one that names `doc` is drawn as the signed drawing it is), a `preview` for the popover, and an `onOpen` that the popover's "Open" button fires — `onClick` selects the dot on the bar, `onOpen` opens the drawing behind it, and a card that declares only the first keeps its Open button because the footer falls back to it. Label and date are printed by the popover above the preview, so a consumer supplies neither. A milestone with **no date gets no position**, because the only position available would be a date the record does not have: it is listed beside the bar under "Not yet reached" (two rows, then a real `+N more` button) and takes no part in the range, the fill or a phase bracket. `phase` groups of 2+ get a bracket marking parallel work, the fill never runs past today, and today gets its dashed rule and tag even when it IS the right edge — the commonest case, because a programme with no finish date ends at today. **`variant="rail"`** is the bar alone, for a window whose stepper already names the stages: no card, no heading, no label under any dot — every milestone is a dot with a popover, a revision carries a two-character `caption` over its dot (`v3`; captions that would overprint collapse to `v1–v4`), `edgeCaptions` flank the rail on its own row (`{ start: 'Start', end: 'Ready' }`), nothing is cut (the `spread` axis: every stretch at least 48 px, the idle ones drawn short rather than notched), and what has not happened is one dashed **cap** at the end of a dashed tail — a real button announced as the last undated milestone, naming the rest in its popover. The stepper and the rail then point at each other: `highlightKeys` lights one soft band from the leftmost named milestone to the rightmost and every dot inside it (a single key rings one dot; the cap answers to the pending milestone's key), and `onHoverChange` reports the milestone under the pointer or the focus, `null` on leave. A `provisional` milestone — a sample ORDERED, drawn where the shipment will be — is hollow, never "where we are", and outside the fill. |
|
|
1665
|
-
| `SettingRow` | One setting in a settings card: the name with its explanation stacked under it on the left, the control or value on the right (it never shrinks), and an optional body (`children`) that opens beneath behind its own line. Each row draws its own top line (`divider`) and padding, so rows stack in a card. One prop per slot: `label` (the name) and `value` (a control or a read-only fact).
|
|
1666
|
-
| `SettingReset` | The ↺
|
|
1667
|
-
| `Accordion` | Folds with a heading button each (`h3` by default, `level`)
|
|
1661
|
+
| `SettingRow` | One setting in a settings card: the name with its explanation stacked under it on the left, the control or value on the right (it never shrinks), and an optional body (`children`) that opens beneath behind its own line. Each row draws its own top line (`divider`) and padding, so rows stack in a card. One prop per slot: `label` (the name) and `value` (a control or a read-only fact). Handles a value that is a control (`controlId` labels it; `labelId` puts an id on the name), a read-only fact, a value nobody knows (an em dash in the faint ink, never an empty cell), and a `quiet` row nothing can write yet. A name over a field (children, no value) draws nothing on the right. `DescriptionList` is the record-detail neighbour and stays that. `showWhen` (with `values`, and `context` for where the row is) hides the row while the rule is false — see `ShowWhen` below. **`size="compact"` is the editor-panel row, in the editor's look** (B2 plan C, Lewis 2026-10-26: efficient-easel's `SettingsField`, moved here whole, with its `es-field…` classes, which hosts style and select against): a name line — `icon`, the name (11px, grey; the accent's words while `changed`), the value's word (`readout`) at the right, then `action` (the `SettingReset` ↺, or a switch) — and the control (`value`) on its own line under it at full width, then the hint (`description`) flush left. A row whose only control is its `action` is one line; a row with neither draws nothing. The panel spaces its rows (efficient-easel's panel rhythm: 32px between two settings, 12px between a name and its control). A `Switch` in a compact row with no name of its own takes the row's name (`labelId`) by `aria-labelledby`. **The per-view state** (S7: V2 2026-10-09, D3 2026-10-12): `viewState="auto"` is a value never edited in the view on screen, worked out from the view above — an "auto" tag after the name, and every `InputNumber`, `Select` and `Slider` in the value wears the auto look (dashed edge, sunken ground, grey value) and is described as "auto" to a screen reader, from this one prop (a control's own `auto` wins; `useSettingAuto()` lets a host's own control follow it). `viewState="edited"` is a value set in this view: the kit's blue changed dot (`CountBadge dot tone="accent"`) after the name, heard as "Changed in this view". `readout` in a card row is the value's word ("1600px") with the control in `value` beneath it. |
|
|
1662
|
+
| `SettingReset` | The ↺ at the end of a compact `SettingRow`'s name line (`action`), in the editor's look (B2 plan C: efficient-easel's `SettingsDefaultReset`, moved here whole, with its `es-default-reset` classes): while `changed` (default) the 15px ↺ in a 22px button, in the accent's words; while not, the empty 22px slot, so every row's end lines up; `defaultAction` is the one press a row offers while unchanged, in the same slot. `view="desktop"` (default): "Reset Padding", back to the site default. `view="tablet"` / `"phone"`: "Inherit parent layout for Padding", back to auto. `detail` says what it goes back to ("auto, 40px"), in its tooltip and description; `name` and `tip` take a host's own words. A press calls `onReset` and moves focus to the row's own control. A host's right-click item on Tablet and Phone uses the same words: `strings.settingView.inheritParentLayout`, with a `PopupMenuItem` `description` second line. The three views' names are `strings.settingView.viewDesktop`, `viewTablet` and `viewPhone` — Desktop, Tablet, Phone (never "Mobile") — for a host's view switch and notes. |
|
|
1663
|
+
| `Accordion` | Folds with a heading button each (`h3` by default, `level`), in the editor's look, ONE group band for the editors and the portals (B2 plan C, option 1, Lewis 2026-10-26: efficient-easel's `SettingsGroup`, moved here whole, with its `es-group…` classes): `tier="band"` (default) is a square grey band 32 tall, title 12 / 600, a − / + sign at its right end, one grey step darker on hover; `tier="row"` is the quiet tier under it (11 / 600, uppercase, grey). A band item can carry a `count` of changed settings (a small accent pill after the title, read as "2 changed") and an `icon`. **The gap under a band is the band's:** its body keeps 32px above and below whatever it holds (setting rows, a chart, a list), as margins, so a setting row's own top margin and the air above the next band fold into it. The band's side inset is 16px; an editor's panel sets its own, and the air above a band is its host's. `keepMounted` keeps a folded body mounted and `hidden`; an item's `headId` names its button (its body is then `<headId>-body`). |
|
|
1668
1664
|
| `ShowWhen` / `isShown` / `ShowWhenRule` | The ONE rule for "show this settings row only when another setting has a value" (owner ruling 2026-10-17). The rule is data, never a function: `{ field: 'country_selector_enabled', is: true }`, `{ field, in: [...] }` (is one of), `{ field, set: true }` (holds anything: not `undefined`/`null`/`false`/blank/empty list; `0` counts), `default` for an unset field, a dotted `field` (`'source.slug'`), `{ context: 'parentType', in: ['Flex'] }` (where the row is, not what it stores), and `{ not }` / `{ all: [] }` / `{ any: [] }`. `isShown(rule, values, context)` is the only reader; `SettingRow`'s `showWhen` and the `<ShowWhen rule values>` wrapper both use it. A hidden row keeps its stored value — nothing here writes — and a rule it cannot read shows the row. |
|
|
1669
1665
|
| `withShowWhen` / `withRowRules` / `truthy` / `showWhenFactsContext` | Put the rule on field definitions, as data, from `efficient-shell/format` (no React, no UI kit), for every editor. `withShowWhen(field, rule)` puts it on one row and `showWhenOf(field)` reads it back. `withRowsShownWhen(fields, keys, rule)` and `withRowRules(fields, [[keys, rule], …])` do it for rows of a panel: a row's own rule is kept (`all`), and the same input hands back the same object. `truthy(field)` reads a value as `if (value)` does. `shownForOption(field, known, fallback, shownFor)` reads an unknown option as its fallback. A block's facts (`showWhenFacts`: name → `(data, params) => answer`) are what its `{ context }` rules read: `showWhenFactsContext(facts, data, params)` reads each one only when a rule asks, and `withShowWhenFacts` / `addShowWhenFacts` attach them to a block. |
|
|
1670
1666
|
| `Button`, `Input`, `Textarea`, `Select`, `Checkbox`, `Radio`, `Switch`, `FormField`, `Label` | Form controls — controlled (`value`/`onChange`); `Button`'s `variant` is `primary` (the default), `secondary` (outlined), `secondary-danger` (outlined in red: a destructive action in a footer of outlined buttons, e.g. Delete beside Archive — the same size and shape as `secondary`, red border and text, a light red wash on hover), `ghost`, `ghost-danger` (red text, no box: a destructive action among quiet `ghost` buttons), `danger` (solid red: the one action a confirm dialog asks for) or `link`; `Button` takes `pressed` (or follows `aria-pressed`) for a toggle that is on, with `IconButton`'s accent wash and ink on `ghost` and `secondary` (`secondary` keeps its border, tinted, so it does not move; `buttonClasses({ pressed })` gives a link the same); `Input`/`Textarea` forward native props for react-hook-form. `Button` and `Switch` take `disabledReason`: persistent text beside the control wired with `aria-describedby`, never a `title` — a tooltip needs a hover a disabled control does not reliably get. `Switch` also takes `disabledReasonId`, so a panel whose controls are all dead for one reason states it once and points every control at it. A `Select` option carries an optional `description`, rendered as a second muted line **in the open list only** — the closed trigger stays one line, so one explained option cannot change the height of every field in the row. `NativeSelect` (and so `Select` on touch) ignores it: an `<option>` holds text and nothing else. An option also takes `lang` (a BCP 47 tag) when its label is written in another language than the page's — a language picker naming each language in its own words: it goes on the option in the open list, on the native `<option>` and on the closed trigger's label while chosen, so a screen reader and the font fallback treat each name as its own language (WCAG 3.1.2). On the desktop listbox, `title` joins `aria-label` / `aria-labelledby` / `aria-describedby` on the VISIBLE trigger button — it used to ride the native spread onto the `sr-only` `<select>`, where a tooltip has no pointer that can reach it and a fallback name sits on an `aria-hidden` element. `name`, `required` and the forwarded ref stay on the native control, which is what it is for. A `Checkbox` or `Radio` with both a `label` and a `description` is NAMED by the label and DESCRIBED by the description (`aria-labelledby` / `aria-describedby`); the whole row is still its `<label>`, so its words still tick it. `FormField` points its one child at the hint or error on screen with `aria-describedby`, and marks it `aria-invalid` while `error` is set. A child that already has its own `aria-describedby` (a react-hook-form binding often does) keeps it: the ids are merged, the child's own first, and each id is said once — a repeated id is a message a screen reader reads twice. |
|
|
@@ -1682,7 +1678,7 @@ All exports are named — `import { Modal, ... } from 'efficient-shell'`.
|
|
|
1682
1678
|
| `Card`, `StatCard` | Surface panel (optional header/footer; `description` puts one sentence under the title, outside the heading; `headingLevel` makes the title a heading and the card a region named by it, and an `aria-label` names the region instead when the title is not the name, such as a count; `tone="warning"` draws the border amber for a card that needs attention, and the card's words still say why; `tone="current"` marks the current card in a list with a light-blue header band, a blue title and `aria-current`) + dashboard metric tile. |
|
|
1683
1679
|
| `Avatar`, `AvatarGroup` | User avatar with initials fallback + status dot; overlapping stack with +N overflow. |
|
|
1684
1680
|
| `Banner` | Static in-flow alert (`tone`: info / success / warning / danger / neutral). `neutral` is a note that is none of the other four ("Prices exclude GST"): grey in the kit's neutral, the same wash and ink as a neutral `StatusBadge` (`--status-neutral-soft` / `--status-neutral-soft-ink`, `--status-neutral-solid` when `emphasis="solid"`), with the info glyph. `action` renders a control at the right edge — after the text, so a screen reader reaches the problem before the remedy, and before the dismiss ×, so "Update card" is never past "close this". Vertically centred against the words and `shrink-0`, so a message that wraps does not drag the button down or squeeze it — and on a narrow banner (a phone, a narrow column: the words keep at least 12rem) it drops UNDER the words rather than leave them a column one word wide. A banner that names a condition and leaves the fix three menus away is the usual shape of a notice nobody acts on. |
|
|
1685
|
-
| `Tabs`, `Accordion`, `Tooltip` | Controlled tab strip, collapsible sections, solid hover/focus tooltip. `Tabs variant="pill"` draws the same strip as `Segmented` (the active tab solid blue on the grey track); use it when each choice shows its own panel, and `Segmented` when the choice is a value. `block` gives every tab an equal share of the strip's width, in either look (the same word as `Segmented`'s `block`): the editors' settings panel uses it for its two icon-only tabs, Design (`adjust`) and Animation (`animation`), with the `underline` look, so the chosen tab is a blue icon over a blue underline. `labelsFit` shows an icon tab's word beside its icon only while the words fit the strip's parent, measured in the three steps `IconRail`'s `labelsFit` takes (every word, then only the chosen tab's, then icons only); a hidden word still names the tab, and the tab's Tooltip says it. Items with an `href` make the strip in-page links for one scrolling page: the same underline drawn as a `<nav>` of `<a>`, `aria-current="location"` on the section in view, the current item following the scroll through `onChange`, and a click scrolling its `#section` into view and focusing it. A tab's `tone="warning"` inks it amber while it is not the chosen one, in either mode's underline look. Each `Accordion` title is a heading holding its button, `<h3><button aria-expanded aria-controls>`, the WAI-ARIA accordion pattern; `level` (2–6, default 3) sets the heading under the host's own, and the heading draws nothing of its own. An open item's panel is a region named by its button. `AccordionHeading` is a title in a tier's look that folds nothing (
|
|
1681
|
+
| `Tabs`, `Accordion`, `Tooltip` | Controlled tab strip, collapsible sections, solid hover/focus tooltip. `Tabs variant="pill"` draws the same strip as `Segmented` (the active tab solid blue on the grey track); use it when each choice shows its own panel, and `Segmented` when the choice is a value. `block` gives every tab an equal share of the strip's width, in either look (the same word as `Segmented`'s `block`): the editors' settings panel uses it for its two icon-only tabs, Design (`adjust`) and Animation (`animation`), with the `underline` look, so the chosen tab is a blue icon over a blue underline. `labelsFit` shows an icon tab's word beside its icon only while the words fit the strip's parent, measured in the three steps `IconRail`'s `labelsFit` takes (every word, then only the chosen tab's, then icons only); a hidden word still names the tab, and the tab's Tooltip says it. Items with an `href` make the strip in-page links for one scrolling page: the same underline drawn as a `<nav>` of `<a>`, `aria-current="location"` on the section in view, the current item following the scroll through `onChange`, and a click scrolling its `#section` into view and focusing it. A tab's `tone="warning"` inks it amber while it is not the chosen one, in either mode's underline look. Each `Accordion` title is a heading holding its button, `<h3><button aria-expanded aria-controls>`, the WAI-ARIA accordion pattern; `level` (2–6, default 3) sets the heading under the host's own, and the heading draws nothing of its own. An open item's panel is a region named by its button. `AccordionHeading` is a title in a tier's look that folds nothing (the heading element itself, no button, no box round it), and `AccordionBody` is the band body's side inset with no band above it. A tooltip's `side` is a preference: near an edge the bubble slides along that side to stay 8 px clear of it, and flips to the opposite side when its own has no room, keeping inside the screen and inside the shell window that owns its trigger (UI-11). It never leaves that box: a bubble wider than the room wraps, and one taller than the room is cut off at it. The bubble is drawn on `<body>`, in a `fixed` layer laid over its trigger, so a scrolling pane or an `overflow-hidden` box around the trigger cannot cut it off; it follows the trigger when that moves and closes once the trigger has scrolled out of sight. A small arrow on the edge facing the trigger points at the trigger's centre wherever the bubble ended up, kept clear of the bubble's corners; it is the bubble's own surface (`.rosh-tooltip-arrow` in `ui.css`), seamless, and hidden from assistive technology. The bubble is SOLID, not glass, in every setting: the kit's solid popup surface (`--rosh-glass-surface`, `--rosh-glass-solid-border`, `--rosh-glass-solid-shadow`), so words behind a small bubble never mix with its own. `open` holds a tooltip open (or shut) whatever the pointer does: for a drag over a place that refuses the drop, when the browser sends no hover. |
|
|
1686
1682
|
| `StepChain`, `StepChainItem` | A chain of steps for work in progress — a one-line summary that opens to steps, each with a status glyph (`pending`, `active`, `complete`, `failed`, `stopped`, `waiting`, `skipped`), a label, a one-line `description` and folded detail. Open while `busy`, folded to its summary when the work is done, and a click always wins; `aria-expanded` on the toggle, the summary is a polite live region, the spinner and chevron respect reduced motion. Modelled on the "Chain of Thought" shape of Vercel AI Elements (no code copied). The assistant chat's tool calls and a plan checklist draw with it. |
|
|
1687
1683
|
| `Stepper` | A linear wizard's progress strip — numbered circles, connectors, `aria-current="step"`. Controlled like Tabs; completed steps are clickable to go back (when `onChange` is wired), upcoming steps never are — moving forward belongs to the wizard's own Continue button, behind its validation. |
|
|
1688
1684
|
| `DataTable` | Read-only table for server-driven lists: it renders and reports, and never sorts or pages its own `data`. Controlled sort and pager, row selection, column groups, pinned columns, windowed rendering. `onRow` gives a row `onClick`, a `className`, any `data-*` attributes for its `<tr>` — a test's or a stylesheet's hook (`data-testid`, `data-state`) — the pointer and the keyboard coming in and out (`onMouseEnter` … `onBlur`) and `current`. `rowHref` makes each row one real link (`onRowPress` a button) with its controls still pressable — see [DataTable rows that are links](#datatable-rows-that-are-links). `stackOnNarrow` turns each row into a labelled card on a narrow container — see [DataTable on a narrow screen](#datatable-on-a-narrow-screen). |
|
|
@@ -1705,7 +1701,7 @@ All exports are named — `import { Modal, ... } from 'efficient-shell'`.
|
|
|
1705
1701
|
| `<ShellLanguageProvider languages language strings? onChange? reload?>` | Which interface language is in force. Takes the tag `resolveShellLanguage` chose before mount and that language's shell catalog, mounts `ShellStringsProvider` with both, stamps `<html lang>`, and gives `useShellLanguage()` its `setLanguage`, which saves the choice and reloads. See [Choosing the language](#choosing-the-language--shelllanguageprovider). |
|
|
1706
1702
|
| `<ShellEntityFetcherProvider value={(endpoint, id) => …}>` | How the modal stack fetches entity data. |
|
|
1707
1703
|
| `<BugReportConfigProvider value={{ submit, list?, resolve? }}>` | Wire the bug-report flow to your backend. |
|
|
1708
|
-
| `<DesktopHostProvider value={{ stickyResolver?, saveShortcuts?, … }}>` | Sticky-note ref resolver + persistence callbacks. `onOpenWhatsNew` hands the desktop version watermark to the host's own What's New window: set, the click calls it and the shell draws no What's New dialog; unset, the built-in dialog shows `productChangelog`. |
|
|
1704
|
+
| `<DesktopHostProvider value={{ stickyResolver?, saveShortcuts?, … }}>` | Sticky-note ref resolver + persistence callbacks. `onOpenWhatsNew` hands the desktop version watermark to the host's own What's New window: set, the click calls it and the shell draws no What's New dialog; unset, the built-in dialog shows `productChangelog`. Desktop sticky notes are their own notes under `desktop_stickies` (saved through `saveStickies`, else the prefs adapter), never Notepad notes; `saveNotes` is deprecated and no longer called. |
|
|
1709
1705
|
| `<StatusBadgeProvider groups={{ status: 'success' \| ... }} labelFor?>` | Status string → semantic group. `labelFor(status)` gives every badge under it the host's words for a status (an interface in another language passes it once); a status it returns `undefined` for keeps the derived label, and a badge's own `label` still wins. `useStatusLabel()` says a status the same way outside a badge: a filter option, a search result's second line. |
|
|
1710
1706
|
| `<PortalBrandingProvider load={...} fallback={...}>` | Loads public hostname-scoped Company Profile identity before authentication, applies its favicon and optional derived document title, and exposes it through `usePortalBranding()`. |
|
|
1711
1707
|
| `setShellApiClient(axios)` | Module-level: register your axios instance once. |
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import{peekBrowserStartUrl as e,claimBrowserStartUrl as t}from"./chunk-LWLCNQY7.js";import{AboutApp as o}from"./chunk-
|
|
1
|
+
import{peekBrowserStartUrl as e,claimBrowserStartUrl as t}from"./chunk-LWLCNQY7.js";import{AboutApp as o}from"./chunk-UDKOJB2B.js";import{WindowTitle as r}from"./chunk-ANTH2FBS.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-E3RHEEA6.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-3V6ZERBS.js";import{confirm as n}from"./chunk-TYK7VN73.js";import"./chunk-6B4F5DWV.js";import"./chunk-GMRZX2ET.js";import"./chunk-4AJRHTTB.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-RKFEJ5CX.js";import"./chunk-UGTRSRIW.js";import"./chunk-CDAJKLGL.js";import"./chunk-KC3EX26K.js";import"./chunk-PYQ6DD3F.js";import"./chunk-MH6DI6YY.js";import"./chunk-5QFPTDQF.js";import"./chunk-URHGHXDN.js";import"./chunk-LNARMEEZ.js";import"./chunk-NHH2MXFU.js";import"./chunk-UQYNPYF4.js";import{Icon as s}from"./chunk-KKSVRIMP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-HL6JSDN3.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-OZAAIE4E.js";import"./chunk-BCDG4N6L.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-X2PZMXDP.js";import"./chunk-C3QOHMR6.js";import{useRef as a,useEffect as i,useState as l}from"react";import{jsxs as c,jsx as m,Fragment as u}from"react/jsx-runtime";var d="react-os-shell:browser-bookmarks",h="react-os-shell:browser-homepage",p="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"}],k=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 g(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&&k.has(t[2].toLowerCase())}(t)?"https://"+t:"https://duckduckgo.com/?q="+encodeURIComponent(t):""}var f=["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 w(){return"undefined"==typeof window?p:localStorage.getItem(h)||p}function y(){const u=a(void 0);void 0===u.current&&(u.current=e()),i(()=>{null!=u.current&&t(u.current)},[]);const p=u.current?g(u.current.url):"",[b,k]=l(w),[f,y]=l(p||b),[j,C]=l(f),[R,W]=l([f]),[D,z]=l(0),[E,H]=l(0),[S,L]=l(x),[T,M]=l(!1),[U,J]=l(null),K=a(null),A=a(null);i(()=>{try{localStorage.setItem(d,JSON.stringify(S))}catch{}},[S]);const B=e=>{const t=g(e);t&&(y(t),C(t),W(e=>{const o=e.slice(0,D+1);return o.push(t),o}),z(e=>e+1),M(!1))},F=()=>{"undefined"!=typeof window&&window.open(f,"_blank","noopener,noreferrer")},G=()=>{const e=U?.trim();e?(L(t=>[...t,{label:e,url:f}]),J(null)):J(null)};i(()=>{if(null===U)return;K.current?.focus(),K.current?.select();const e=e=>{const t=e.target;t?.closest("[data-bookmark-popover]")||J(null)},t=setTimeout(()=>document.addEventListener("mousedown",e),0);return()=>{clearTimeout(t),document.removeEventListener("mousedown",e)}},[null!==U]);const P=e=>{L(t=>t.filter((t,o)=>o!==e))},X=D>0,I=D<R.length-1,O=S.some(e=>e.url===f),Z="p-2 rounded hover:bg-gray-200 transition-colors text-gray-600 disabled:opacity-30";/* @__PURE__ */
|
|
2
2
|
return c("div",{className:"relative flex flex-col h-full bg-white",children:[
|
|
3
3
|
/* @__PURE__ */m(r,{title:`Browser - ${v(f)}`}),
|
|
4
4
|
/* @__PURE__ */m(o,{app:"browser"}),
|
|
5
5
|
/* @__PURE__ */c("div",{className:"flex items-center gap-1 px-2 py-2 border-b border-line bg-surface-sunken shrink-0",children:[
|
|
6
|
-
/* @__PURE__ */m("button",{onClick:()=>{if(
|
|
7
|
-
/* @__PURE__ */m("button",{onClick:()=>{if(
|
|
8
|
-
/* @__PURE__ */m("button",{onClick:()=>H(e=>e+1),className:
|
|
9
|
-
/* @__PURE__ */m("button",{onClick:()=>
|
|
10
|
-
/* @__PURE__ */m("form",{onSubmit:e=>{e.preventDefault(),
|
|
6
|
+
/* @__PURE__ */m("button",{onClick:()=>{if(D>0){const e=D-1;z(e),y(R[e]),C(R[e]),M(!1)}},disabled:!X,className:Z,title:"Back",children:/* @__PURE__ */m(s,{name:"chevron-left",className:"h-4 w-4",strokeWidth:2})}),
|
|
7
|
+
/* @__PURE__ */m("button",{onClick:()=>{if(D<R.length-1){const e=D+1;z(e),y(R[e]),C(R[e]),M(!1)}},disabled:!I,className:Z,title:"Forward",children:/* @__PURE__ */m(s,{name:"chevron-right",className:"h-4 w-4",strokeWidth:2})}),
|
|
8
|
+
/* @__PURE__ */m("button",{onClick:()=>H(e=>e+1),className:Z,title:"Refresh",children:/* @__PURE__ */m(s,{name:"refresh",className:"h-4 w-4",strokeWidth:1.8})}),
|
|
9
|
+
/* @__PURE__ */m("button",{onClick:()=>B(b),className:Z,title:"Home",children:/* @__PURE__ */m(s,{name:"home",className:"h-4 w-4",strokeWidth:1.8})}),
|
|
10
|
+
/* @__PURE__ */m("form",{onSubmit:e=>{e.preventDefault(),B(j)},className:"flex-1 flex items-center mx-1",children:/* @__PURE__ */c("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__ */m("span",{className:"px-2 text-gray-400 text-xs",children:f.startsWith("https://")?"🔒":"⚠️"}),
|
|
12
12
|
/* @__PURE__ */m("input",{type:"text",value:j,onChange:e=>C(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…"}),f!==j&&/* @__PURE__ */m("button",{type:"button",onClick:()=>C(f),className:"px-2 text-2xs text-ink-faintest hover:text-ink",title:"Reset to current URL",children:"×"})]})}),
|
|
13
|
-
/* @__PURE__ */m("button",{"data-bookmark-popover":!0,onClick:()=>O?
|
|
14
|
-
/* @__PURE__ */m("button",{onClick:
|
|
15
|
-
/* @__PURE__ */m("button",{onClick:()=>
|
|
13
|
+
/* @__PURE__ */m("button",{"data-bookmark-popover":!0,onClick:()=>O?P(S.findIndex(e=>e.url===f)):void J(v(f)),className:Z+" "+(O?"text-yellow-500":""),title:O?"Remove bookmark":"Add bookmark",children:/* @__PURE__ */m(s,{name:"star",className:"h-4 w-4",fill:O?"currentColor":"none",strokeWidth:1.5})}),
|
|
14
|
+
/* @__PURE__ */m("button",{onClick:F,className:Z,title:"Open in new tab",children:/* @__PURE__ */m(s,{name:"external",className:"h-4 w-4",strokeWidth:1.5})}),
|
|
15
|
+
/* @__PURE__ */m("button",{onClick:()=>M(e=>!e),className:Z,title:"Embedding help",children:/* @__PURE__ */m(s,{name:"help",className:"h-4 w-4",strokeWidth:1.5})})]}),null!==U&&/* @__PURE__ */c("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:[
|
|
16
16
|
/* @__PURE__ */m("div",{className:"text-2xs font-semibold uppercase tracking-wide text-ink-faint mb-1",children:"Bookmark this page"}),
|
|
17
17
|
/* @__PURE__ */m("div",{className:"text-2xs text-ink-faintest truncate mb-2 font-mono",title:f,children:f}),
|
|
18
|
-
/* @__PURE__ */m("input",{ref:
|
|
18
|
+
/* @__PURE__ */m("input",{ref:K,type:"text",value:U,onChange:e=>J(e.target.value),onKeyDown:e=>{"Enter"===e.key?G():"Escape"===e.key&&J(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
19
|
/* @__PURE__ */c("div",{className:"flex justify-end gap-1 mt-2",children:[
|
|
20
|
-
/* @__PURE__ */m("button",{onClick:()=>
|
|
21
|
-
/* @__PURE__ */m("button",{onClick:
|
|
22
|
-
/* @__PURE__ */c("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===
|
|
20
|
+
/* @__PURE__ */m("button",{onClick:()=>J(null),className:"px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 rounded",children:"Cancel"}),
|
|
21
|
+
/* @__PURE__ */m("button",{onClick:G,disabled:!U.trim(),className:"px-2 py-1 text-xs bg-blue-500 text-white rounded hover:bg-blue-600 disabled:opacity-40",children:"Save"})]})]}),
|
|
22
|
+
/* @__PURE__ */c("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===S.length&&/* @__PURE__ */m("span",{className:"text-2xs text-ink-faintest italic px-2",children:"No bookmarks yet — star the address bar to add one."}),S.map((e,t)=>/* @__PURE__ */c("button",{onClick:()=>B(e.url),onContextMenu:async o=>{o.preventDefault();await n({title:"Remove bookmark",message:`"${e.label}" will be removed from your bookmarks.`,confirmLabel:"Remove",variant:"danger"})&&P(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:[
|
|
23
23
|
/* @__PURE__ */m("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)),
|
|
24
24
|
/* @__PURE__ */m("div",{className:"flex-1"}),
|
|
25
25
|
/* @__PURE__ */m("button",{onClick:()=>{k(f);try{localStorage.setItem(h,f)}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"})]}),
|
|
26
|
-
/* @__PURE__ */m("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */m(N,{url:f,iframeKey:E,iframeRef:
|
|
26
|
+
/* @__PURE__ */m("div",{className:"flex-1 relative min-h-0 bg-gray-50",children:/* @__PURE__ */m(N,{url:f,iframeKey:E,iframeRef:A,openExternal:F,showHelp:T,dismissHelp:()=>M(!1)})})]})}function v(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:a}){const[d,h]=l(!1);i(()=>{h(!1)},[e]);return function(e){try{const t=new URL(e).hostname.toLowerCase();return f.some(e=>t===e||t.endsWith("."+e))}catch{return!1}}(e)&&!d?/* @__PURE__ */m("div",{className:"absolute inset-0 flex items-center justify-center bg-white p-8",children:/* @__PURE__ */c("div",{className:"max-w-md text-center",children:[
|
|
27
27
|
/* @__PURE__ */m(s,{name:"no-symbol",className:"h-14 w-14 mx-auto text-gray-300 mb-3",strokeWidth:1.2}),
|
|
28
28
|
/* @__PURE__ */c("h3",{className:"text-base font-semibold text-gray-800 mb-1",children:[v(e)," can't be embedded"]}),
|
|
29
29
|
/* @__PURE__ */c("p",{className:"text-sm text-gray-500 mb-4",children:["This site sends an ",
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import{loadAppearance as e,WidgetSettingsModal as t}from"./chunk-XZBQ3XXD.js";import{useWidgetSettings as n}from"./chunk-ANTH2FBS.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-E3RHEEA6.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-3V6ZERBS.js";import"./chunk-TYK7VN73.js";import"./chunk-6B4F5DWV.js";import"./chunk-GMRZX2ET.js";import"./chunk-4AJRHTTB.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-RKFEJ5CX.js";import"./chunk-UGTRSRIW.js";import"./chunk-CDAJKLGL.js";import"./chunk-KC3EX26K.js";import"./chunk-MH6DI6YY.js";import"./chunk-5QFPTDQF.js";import"./chunk-URHGHXDN.js";import"./chunk-LNARMEEZ.js";import"./chunk-NHH2MXFU.js";import"./chunk-UQYNPYF4.js";import{Icon as r}from"./chunk-KKSVRIMP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-HL6JSDN3.js";import"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-OZAAIE4E.js";import"./chunk-BCDG4N6L.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-X2PZMXDP.js";import"./chunk-C3QOHMR6.js";import{useState as c,useRef as i,useCallback as l,useEffect as o}from"react";import{jsxs as s,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),[N,j]=c(!1),[y,x]=c(""),[f,C]=c([]),[v,$]=c(!1),[E,T]=c(()=>e(h)),[D,R]=c(!1),[W,A]=c(E),M=i(null);n(l(()=>{A({...E}),R(!0)},[E]));const w=l(e=>{x(""),k(t=>N||"0"===t?(j(!1),"."===e?"0.":e):"."===e&&t.includes(".")?t:t+e)},[N]),H=l(()=>{k("0"),d(null),g(null),j(!1)},[]),S=l((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}},[]),X=l(e=>{const t=parseFloat(m);if(null!==p&&b&&!N){const e=S(p,t,b);k(String(e)),d(e),C(n=>[`${p} ${b} ${t} = ${e}`,...n].slice(0,20))}else d(t);g(e),j(!0)},[m,p,b,N,S]),F=l(()=>{if(null===p||!b)return;const e=parseFloat(m),t=S(p,e,b),n=`${p} ${b} ${e} =`;C(e=>[`${n} ${t}`,...e].slice(0,20)),x(n),k(String(t)),d(null),g(null),j(!0)},[m,p,b,S]),J=l(()=>{k(e=>String(parseFloat(e)/100))},[]),B=l(()=>{k(e=>e.startsWith("-")?e.slice(1):"0"===e?e:"-"+e)},[]);o(()=>{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?X("+"):"-"===e.key?X("-"):"*"===e.key?X("×"):"/"===e.key?(e.preventDefault(),X("÷")):"Enter"===e.key||"="===e.key?("Enter"===e.key&&e.target instanceof Node&&M.current?.contains(e.target)&&e.preventDefault(),F()):"Escape"===e.key?H():"Backspace"===e.key?k(e=>e.length>1?e.slice(0,-1):"0"):"%"===e.key&&J())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[w,X,F,H,J]);const Z="flex items-center justify-center rounded-lg text-sm font-medium transition-colors",K=`${Z} bg-white border border-gray-200 text-gray-900 hover:bg-gray-50 active:bg-gray-100`,U=`${Z} bg-blue-50 border border-blue-200 text-blue-700 hover:bg-blue-100 active:bg-blue-200`,G=`${Z} bg-gray-100 border border-gray-200 text-gray-600 hover:bg-gray-200 active:bg-gray-300`,L=`${Z} bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800`;/* @__PURE__ */
|
|
2
|
+
return s(a,{children:[
|
|
3
|
+
/* @__PURE__ */s("div",{ref:M,className:"flex flex-col h-full",style:{opacity:E.activeOpacity/100,backdropFilter:E.activeBlur>0?`blur(${E.activeBlur}px)`:void 0},children:[
|
|
4
|
+
/* @__PURE__ */s("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:f.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} ${N?"":m}`}),
|
|
6
|
+
/* @__PURE__ */s("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__ */s("div",{className:"grid grid-cols-4 grid-rows-5 gap-2 flex-1 min-h-0 p-2",children:[
|
|
10
|
+
/* @__PURE__ */u("button",{onClick:H,className:G,children:"AC"}),
|
|
11
|
+
/* @__PURE__ */u("button",{onClick:B,className:G,children:"+/−"}),
|
|
12
|
+
/* @__PURE__ */u("button",{onClick:J,className:G,children:"%"}),
|
|
13
|
+
/* @__PURE__ */u("button",{onClick:()=>X("÷"),className:`${U} ${"÷"===b?"ring-2 ring-blue-400":""}`,children:"÷"}),
|
|
14
|
+
/* @__PURE__ */u("button",{onClick:()=>w("7"),className:K,children:"7"}),
|
|
15
|
+
/* @__PURE__ */u("button",{onClick:()=>w("8"),className:K,children:"8"}),
|
|
16
|
+
/* @__PURE__ */u("button",{onClick:()=>w("9"),className:K,children:"9"}),
|
|
17
|
+
/* @__PURE__ */u("button",{onClick:()=>X("×"),className:`${U} ${"×"===b?"ring-2 ring-blue-400":""}`,children:"×"}),
|
|
18
|
+
/* @__PURE__ */u("button",{onClick:()=>w("4"),className:K,children:"4"}),
|
|
19
|
+
/* @__PURE__ */u("button",{onClick:()=>w("5"),className:K,children:"5"}),
|
|
20
|
+
/* @__PURE__ */u("button",{onClick:()=>w("6"),className:K,children:"6"}),
|
|
21
|
+
/* @__PURE__ */u("button",{onClick:()=>X("-"),className:`${U} ${"-"===b?"ring-2 ring-blue-400":""}`,children:"−"}),
|
|
22
|
+
/* @__PURE__ */u("button",{onClick:()=>w("1"),className:K,children:"1"}),
|
|
23
|
+
/* @__PURE__ */u("button",{onClick:()=>w("2"),className:K,children:"2"}),
|
|
24
|
+
/* @__PURE__ */u("button",{onClick:()=>w("3"),className:K,children:"3"}),
|
|
25
|
+
/* @__PURE__ */u("button",{onClick:()=>X("+"),className:`${U} ${"+"===b?"ring-2 ring-blue-400":""}`,children:"+"}),
|
|
26
|
+
/* @__PURE__ */u("button",{onClick:()=>w("0"),className:`${K} col-span-2`,children:"0"}),
|
|
27
|
+
/* @__PURE__ */u("button",{onClick:()=>w("."),className:K,children:"."}),
|
|
28
|
+
/* @__PURE__ */u("button",{onClick:F,className:L,children:"="})]})]}),
|
|
29
|
+
/* @__PURE__ */u(t,{open:D,onClose:()=>R(!1),title:"Calculator Settings",appearance:W,onAppearanceChange:A,onSave:()=>{T(W),localStorage.setItem(h,JSON.stringify(W)),R(!1)}})]})}export{m as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-
|
|
1
|
+
import{loadAppearance as t,WidgetSettingsModal as e}from"./chunk-XZBQ3XXD.js";import{useWidgetSettings as r}from"./chunk-ANTH2FBS.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-E3RHEEA6.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-3V6ZERBS.js";import"./chunk-TYK7VN73.js";import"./chunk-6B4F5DWV.js";import"./chunk-GMRZX2ET.js";import"./chunk-4AJRHTTB.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import"./chunk-RKFEJ5CX.js";import"./chunk-UGTRSRIW.js";import"./chunk-CDAJKLGL.js";import"./chunk-KC3EX26K.js";import"./chunk-MH6DI6YY.js";import"./chunk-5QFPTDQF.js";import"./chunk-URHGHXDN.js";import"./chunk-LNARMEEZ.js";import"./chunk-NHH2MXFU.js";import"./chunk-UQYNPYF4.js";import"./chunk-KKSVRIMP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-HL6JSDN3.js";import{LoadingSpinner as n}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-OZAAIE4E.js";import"./chunk-BCDG4N6L.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-X2PZMXDP.js";import"./chunk-C3QOHMR6.js";import{useState as s,useCallback as o,useEffect as a}from"react";import{jsxs as c,Fragment as i,jsx as l}from"react/jsx-runtime";var m=["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 g(t){try{const e=JSON.parse(localStorage.getItem(d)||"{}")[t];if(e&&Date.now()-e.timestamp<36e5)return e.rates}catch{}return null}function k(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 N(){try{const t=JSON.parse(localStorage.getItem(p)||"");if(Array.isArray(t)&&t.length)return t.slice(0,4)}catch{}return u}var f={USD:"🇺🇸",CNY:"🇨🇳",AUD:"🇦🇺",GBP:"🇬🇧",JPY:"🇯🇵",CAD:"🇨🇦",EUR:"🇪🇺",THB:"🇹🇭",NZD:"🇳🇿",SGD:"🇸🇬",HKD:"🇭🇰",CHF:"🇨🇭",KRW:"🇰🇷",INR:"🇮🇳",MXN:"🇲🇽",BRL:"🇧🇷"};function j(){const[u,d]=s(N),[j,x]=s(()=>t(h)),[y,b]=s({}),[D,S]=s(!1),[v,C]=s(!1),[R,J]=s([]),[U,A]=s(j),[H,B]=s("USD"),[M,E]=s("CNY");r(o(()=>{J([...u]),A({...j}),C(!0)},[u,j])),a(()=>{const t=[...new Set(u.map(([t])=>t))];let e=!0;return async function(){S(!0);const r={};for(const e of t){const t=g(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,k(e,n.rates))}catch{}}e&&(b(r),S(!1))}(),()=>{e=!1}},[u]);/* @__PURE__ */
|
|
2
2
|
return c(i,{children:[
|
|
3
3
|
/* @__PURE__ */l("div",{style:{backgroundColor:`rgb(var(--taskbar-bg-rgb, 243 244 246) / ${j.activeOpacity/100})`,backdropFilter:j.activeBlur>0?`blur(${j.activeBlur}px)`:void 0},children:/* @__PURE__ */c("div",{className:"px-4 py-3 space-y-1",children:[D&&/* @__PURE__ */l(n,{size:"sm",padding:"py-4",label:"Loading rates"}),u.map(([t,e],r)=>{const n=y[t]?.[e];/* @__PURE__ */
|
|
4
4
|
return c("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:[
|
|
@@ -9,13 +9,13 @@ return c("button",{onClick:()=>{const t=u.map((t,e)=>e===r?[t[1],t[0]]:t);d(t),l
|
|
|
9
9
|
/* @__PURE__ */l("span",{className:"text-base",children:f[e]||""}),
|
|
10
10
|
/* @__PURE__ */l("span",{className:"text-sm font-semibold text-gray-700",children:e})]}),
|
|
11
11
|
/* @__PURE__ */l("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__ */l(e,{open:v,onClose:()=>C(!1),title:"Currency Settings",appearance:
|
|
12
|
+
/* @__PURE__ */l(e,{open:v,onClose:()=>C(!1),title:"Currency Settings",appearance:U,onAppearanceChange:A,onSave:()=>{if(0===R.length)return;const t=R.slice(0,4);d(t),x(U),localStorage.setItem(p,JSON.stringify(t)),localStorage.setItem(h,JSON.stringify(U)),C(!1)},children:/* @__PURE__ */c("div",{children:[
|
|
13
13
|
/* @__PURE__ */c("h3",{className:"text-sm font-semibold text-ink mb-2",children:["Currency Pairs ",
|
|
14
|
-
/* @__PURE__ */c("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",
|
|
15
|
-
/* @__PURE__ */l("div",{className:"space-y-1 mb-2",children:
|
|
14
|
+
/* @__PURE__ */c("span",{className:"text-2xs font-normal text-ink-faintest",children:["(",R.length,"/",4,")"]})]}),
|
|
15
|
+
/* @__PURE__ */l("div",{className:"space-y-1 mb-2",children:R.map(([t,e],r)=>/* @__PURE__ */c("div",{className:"flex items-center justify-between py-1 px-2 bg-gray-50 rounded",children:[
|
|
16
16
|
/* @__PURE__ */c("span",{className:"text-sm",children:[f[t]||""," ",t," → ",f[e]||""," ",e]}),
|
|
17
|
-
/* @__PURE__ */l("button",{onClick:()=>
|
|
18
|
-
/* @__PURE__ */l("select",{value:
|
|
17
|
+
/* @__PURE__ */l("button",{onClick:()=>J(t=>t.filter((t,e)=>e!==r)),className:"text-red-400 hover:text-red-600",children:"×"})]},r))}),R.length<4?/* @__PURE__ */c("div",{className:"flex items-center gap-2",children:[
|
|
18
|
+
/* @__PURE__ */l("select",{value:H,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:m.map(t=>/* @__PURE__ */l("option",{children:t},t))}),
|
|
19
19
|
/* @__PURE__ */l("span",{className:"text-gray-400",children:"→"}),
|
|
20
|
-
/* @__PURE__ */l("select",{value:
|
|
21
|
-
/* @__PURE__ */l("button",{onClick:()=>{M
|
|
20
|
+
/* @__PURE__ */l("select",{value:M,onChange:t=>E(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:m.map(t=>/* @__PURE__ */l("option",{children:t},t))}),
|
|
21
|
+
/* @__PURE__ */l("button",{onClick:()=>{H!==M&&R.length<4&&J(t=>[...t,[H,M]])},className:"text-sm font-medium text-blue-600 hover:text-blue-800 px-2",children:"+ Add"})]}):/* @__PURE__ */c("p",{className:"text-2xs text-ink-faintest italic",children:["Max ",4," pairs — remove one to add another."]})]})})]})}export{j as default};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import{escapeHtml as e}from"./chunk-G6DKCCWH.js";import{AboutApp as t}from"./chunk-
|
|
1
|
+
import{escapeHtml as e}from"./chunk-G6DKCCWH.js";import{AboutApp as t}from"./chunk-UDKOJB2B.js";import{WindowTitle as n}from"./chunk-ANTH2FBS.js";import"./chunk-CY5N5OA3.js";import"./chunk-AW7TOB6N.js";import"./chunk-KNUR2UEG.js";import"./chunk-JDCM2VHG.js";import"./chunk-E3RHEEA6.js";import"./chunk-ZDMZM7HD.js";import"./chunk-5A7MWTXX.js";import"./chunk-3V6ZERBS.js";import"./chunk-TYK7VN73.js";import"./chunk-6B4F5DWV.js";import"./chunk-GMRZX2ET.js";import"./chunk-4AJRHTTB.js";import"./chunk-VWGWZY7A.js";import"./chunk-PKXQDCNR.js";import{toast_default as r}from"./chunk-OQW42DOR.js";import"./chunk-RKFEJ5CX.js";import"./chunk-UGTRSRIW.js";import"./chunk-CDAJKLGL.js";import"./chunk-KC3EX26K.js";import"./chunk-PYQ6DD3F.js";import{PopupMenu as o,PopupMenuLabel as i,PopupMenuItem as l,PopupMenuDivider as a}from"./chunk-MH6DI6YY.js";import"./chunk-5QFPTDQF.js";import"./chunk-URHGHXDN.js";import"./chunk-LNARMEEZ.js";import"./chunk-NHH2MXFU.js";import"./chunk-UQYNPYF4.js";import{Icon as s}from"./chunk-KKSVRIMP.js";import"./chunk-J75ZT2JQ.js";import"./chunk-HL6JSDN3.js";import{LoadingSpinner as c}from"./chunk-R2VKEMZH.js";import"./chunk-MRJKZWWV.js";import"./chunk-OZAAIE4E.js";import"./chunk-BCDG4N6L.js";import"./chunk-PGN5ME7B.js";import"./chunk-62LW225J.js";import"./chunk-GLUJS42B.js";import"./chunk-D65T4H6J.js";import"./chunk-DTJRIWFR.js";import"./chunk-TWVUQUUD.js";import"./chunk-X2PZMXDP.js";import"./chunk-C3QOHMR6.js";import{useState as m,useRef as d}from"react";import{jsxs as h,jsx as u}from"react/jsx-runtime";var p=/* @__PURE__ */new Set(["txt","md","markdown","csv","tsv","log","json","xml","html","htm","css","js","jsx","ts","tsx","py","rb","go","rs","java","c","h","cpp","hpp","sh","bash","yml","yaml","toml","ini","conf","env","sql"]),g=/* @__PURE__ */new Set(["docx"]),x={filename:"Untitled",kind:"docx",content:"",ext:"docx"};function f(){const[f,y]=m(x),[k,v]=m(!1),[b,j]=m(!1),[w,N]=m(!1),[D,C]=m(null),M=d(null),L=d(null),R=d(null),U=(e,t)=>{R.current?.focus(),document.execCommand(e,!1,t),N(!0)},W=e=>{for(const t of e){if(!t.type.startsWith("image/"))continue;const e=new FileReader;e.onload=()=>{R.current?.focus(),document.execCommand("insertImage",!1,String(e.result)),N(!0)},e.readAsDataURL(t)}},T=e=>{D&&(D.el.removeAttribute("width"),D.el.removeAttribute("height"),D.el.style.width=e??"",D.el.style.height=e?"auto":"",N(!0),C(null))},B=async t=>{const n=(t.name.split(".").pop()||"").toLowerCase();v(!0);try{if(p.has(n)||!g.has(n)&&t.type.startsWith("text/")){const r=await t.text(),o=e(r).replace(/\n/g,"<br>");y({filename:t.name,kind:"text",content:o,ext:n}),N(!1)}else if(g.has(n))try{const e=await(import(
|
|
2
2
|
/* @vite-ignore */
|
|
3
|
-
"mammoth")),r=await t.arrayBuffer(),o=await e.convertToHtml({arrayBuffer:r});y({filename:t.name,kind:"docx",content:o.value||"<p><em>(empty document)</em></p>",ext:n}),N(!1)}catch(e){r.error('Install the optional "mammoth" peer dep to read .docx files.')}else"doc"===n?r.error(".doc is the legacy Word binary format — convert to .docx first."):r.error(`Unsupported file type: .${n||"unknown"}`)}finally{v(!1)}},
|
|
4
|
-
return h("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preventDefault(),b||j(!0)},onDragLeave:e=>{e.currentTarget===e.target&&j(!1)},onDrop:e=>{e.preventDefault(),j(!1);const t=Array.from(e.dataTransfer.files??[]);0!==t.length&&(t.every(e=>e.type.startsWith("image/"))?W(t):
|
|
5
|
-
/* @__PURE__ */u(n,{title:`${
|
|
3
|
+
"mammoth")),r=await t.arrayBuffer(),o=await e.convertToHtml({arrayBuffer:r});y({filename:t.name,kind:"docx",content:o.value||"<p><em>(empty document)</em></p>",ext:n}),N(!1)}catch(e){r.error('Install the optional "mammoth" peer dep to read .docx files.')}else"doc"===n?r.error(".doc is the legacy Word binary format — convert to .docx first."):r.error(`Unsupported file type: .${n||"unknown"}`)}finally{v(!1)}},A=f?.filename?(E=f.filename).length>24?`${E.slice(0,23)}…`:E:"Untitled";var E;/* @__PURE__ */
|
|
4
|
+
return h("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preventDefault(),b||j(!0)},onDragLeave:e=>{e.currentTarget===e.target&&j(!1)},onDrop:e=>{e.preventDefault(),j(!1);const t=Array.from(e.dataTransfer.files??[]);0!==t.length&&(t.every(e=>e.type.startsWith("image/"))?W(t):B(t[0]))},children:[
|
|
5
|
+
/* @__PURE__ */u(n,{title:`${A}${w?" •":""} - Documents`}),
|
|
6
6
|
/* @__PURE__ */u(t,{app:"documents"}),
|
|
7
7
|
/* @__PURE__ */h("div",{className:"flex items-center flex-wrap gap-x-2 gap-y-1 px-3 py-2 border-b border-gray-200 bg-gray-50 shrink-0",children:[
|
|
8
|
-
/* @__PURE__ */u("input",{ref:M,type:"file",accept:".txt,.md,.csv,.tsv,.log,.json,.xml,.html,.htm,.css,.js,.jsx,.ts,.tsx,.py,.rb,.go,.rs,.java,.c,.h,.cpp,.hpp,.sh,.bash,.yml,.yaml,.toml,.ini,.conf,.env,.sql,.docx,text/*",onChange:e=>{const t=e.target.files?.[0];t&&
|
|
8
|
+
/* @__PURE__ */u("input",{ref:M,type:"file",accept:".txt,.md,.csv,.tsv,.log,.json,.xml,.html,.htm,.css,.js,.jsx,.ts,.tsx,.py,.rb,.go,.rs,.java,.c,.h,.cpp,.hpp,.sh,.bash,.yml,.yaml,.toml,.ini,.conf,.env,.sql,.docx,text/*",onChange:e=>{const t=e.target.files?.[0];t&&B(t),M.current&&(M.current.value="")},className:"hidden"}),
|
|
9
9
|
/* @__PURE__ */h("button",{onClick:()=>M.current?.click(),className:"text-xs text-gray-700 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors flex items-center gap-1",children:[
|
|
10
10
|
/* @__PURE__ */u(s,{name:"folder-open",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Open"]}),
|
|
11
|
-
/* @__PURE__ */u("button",{onClick:()=>{if(!f)return;const t=
|
|
11
|
+
/* @__PURE__ */u("button",{onClick:()=>{if(!f)return;const t=R.current?.innerHTML??"";if("text"===f.kind){if(/<(b|strong|i|em|u|font|span style|ul|ol|img)|style="[^"]*text-align/i.test(t)){const n=new Blob([`<!doctype html><meta charset="utf-8"><title>${e(f.filename)}</title><body style="font-family:ui-monospace,monospace;white-space:pre-wrap">${t}`],{type:"text/html"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=`${f.filename.replace(/\.[^.]+$/,"")}.html`,o.click(),URL.revokeObjectURL(r)}else{const e=R.current?.innerText??"",t=new Blob([e],{type:"text/plain"}),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=f.filename,r.click(),URL.revokeObjectURL(n)}}else{const n=new Blob([`<!doctype html><meta charset="utf-8"><title>${e(f.filename)}</title>${t}`],{type:"text/html"}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r,o.download=`${f.filename.replace(/\.docx$/i,"")}.html`,o.click(),URL.revokeObjectURL(r)}},className:"text-xs text-gray-700 hover:text-gray-900 px-2 py-1 rounded hover:bg-gray-200 transition-colors",children:"Save"}),
|
|
12
12
|
/* @__PURE__ */u("span",{className:"text-2xs text-ink-faintest ml-1",children:"TXT · DOCX · Code"}),
|
|
13
13
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
14
14
|
/* @__PURE__ */h("span",{className:"text-xs font-medium text-gray-700 truncate max-w-[200px]",title:f.filename,children:[f.filename,w?" •":""]}),
|
|
15
15
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
16
16
|
/* @__PURE__ */h("div",{className:"flex items-center gap-0.5",children:[
|
|
17
|
-
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
18
|
-
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
19
|
-
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
20
|
-
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
17
|
+
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("bold"),className:"px-2 py-1 text-xs rounded font-bold text-gray-700 hover:bg-gray-200 transition-colors",title:"Bold",children:"B"}),
|
|
18
|
+
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("italic"),className:"px-2 py-1 text-xs rounded italic text-gray-700 hover:bg-gray-200 transition-colors",title:"Italic",children:"I"}),
|
|
19
|
+
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("underline"),className:"px-2 py-1 text-xs rounded underline text-gray-700 hover:bg-gray-200 transition-colors",title:"Underline",children:"U"}),
|
|
20
|
+
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("strikeThrough"),className:"px-2 py-1 text-xs rounded line-through text-gray-700 hover:bg-gray-200 transition-colors",title:"Strikethrough",children:"S"})]}),
|
|
21
21
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
22
|
-
/* @__PURE__ */h("select",{onMouseDown:e=>e.preventDefault(),onChange:e=>{
|
|
22
|
+
/* @__PURE__ */h("select",{onMouseDown:e=>e.preventDefault(),onChange:e=>{U("fontSize",e.target.value),e.currentTarget.value=""},defaultValue:"",className:"text-xs border border-gray-300 rounded px-1 py-0.5 bg-white",children:[
|
|
23
23
|
/* @__PURE__ */u("option",{value:"",disabled:!0,children:"Size"}),
|
|
24
24
|
/* @__PURE__ */u("option",{value:"1",children:"XS"}),
|
|
25
25
|
/* @__PURE__ */u("option",{value:"2",children:"S"}),
|
|
@@ -27,21 +27,21 @@ return h("div",{className:"relative flex flex-col h-full",onDragOver:e=>{e.preve
|
|
|
27
27
|
/* @__PURE__ */u("option",{value:"4",children:"L"}),
|
|
28
28
|
/* @__PURE__ */u("option",{value:"5",children:"XL"}),
|
|
29
29
|
/* @__PURE__ */u("option",{value:"6",children:"2XL"})]}),
|
|
30
|
-
/* @__PURE__ */u("input",{type:"color",defaultValue:"#000000",onChange:e=>
|
|
30
|
+
/* @__PURE__ */u("input",{type:"color",defaultValue:"#000000",onChange:e=>U("foreColor",e.target.value),className:"w-7 h-6 border border-gray-300 rounded cursor-pointer",title:"Text color"}),
|
|
31
31
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
32
|
-
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
33
|
-
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
32
|
+
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("insertUnorderedList"),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Bulleted list",children:"• List"}),
|
|
33
|
+
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("insertOrderedList"),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Numbered list",children:"1."}),
|
|
34
34
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
35
35
|
/* @__PURE__ */h("div",{className:"flex items-center gap-0.5",children:[
|
|
36
|
-
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
37
|
-
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
38
|
-
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
39
|
-
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>
|
|
36
|
+
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("justifyLeft"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align left",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h9.75M3.75 18h14.25"})})}),
|
|
37
|
+
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("justifyCenter"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align center",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M7.125 12h9.75M4.875 18h14.25"})})}),
|
|
38
|
+
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("justifyRight"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Align right",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M10.5 12h9.75M6 18h14.25"})})}),
|
|
39
|
+
/* @__PURE__ */u("button",{onMouseDown:e=>e.preventDefault(),onClick:()=>U("justifyFull"),className:"px-2 py-1 rounded text-gray-700 hover:bg-gray-200 transition-colors",title:"Justify",children:/* @__PURE__ */u("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:/* @__PURE__ */u("path",{strokeLinecap:"round",d:"M3.75 6h16.5M3.75 12h16.5M3.75 18h16.5"})})})]}),
|
|
40
40
|
/* @__PURE__ */u("div",{className:"h-4 w-px bg-gray-300 mx-1"}),
|
|
41
41
|
/* @__PURE__ */u("input",{ref:L,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:e=>{e.target.files?.length&&W(Array.from(e.target.files)),L.current&&(L.current.value="")}}),
|
|
42
42
|
/* @__PURE__ */h("button",{onClick:()=>L.current?.click(),className:"px-2 py-1 text-xs rounded text-gray-700 hover:bg-gray-200 transition-colors flex items-center gap-1",title:"Insert image (or paste / drop one)",children:[
|
|
43
43
|
/* @__PURE__ */u(s,{name:"image",className:"h-3.5 w-3.5",strokeWidth:1.5}),"Image"]})]}),
|
|
44
|
-
/* @__PURE__ */u("div",{className:"flex-1 min-h-0 overflow-hidden",children:k?/* @__PURE__ */u(c,{size:"sm",padding:"",className:"h-full",label:"Loading"}):/* @__PURE__ */u("div",{className:"h-full overflow-auto "+("docx"===f.kind?"bg-gray-100 px-6 py-8":"bg-white"),children:/* @__PURE__ */u("div",{ref:
|
|
44
|
+
/* @__PURE__ */u("div",{className:"flex-1 min-h-0 overflow-hidden",children:k?/* @__PURE__ */u(c,{size:"sm",padding:"",className:"h-full",label:"Loading"}):/* @__PURE__ */u("div",{className:"h-full overflow-auto "+("docx"===f.kind?"bg-gray-100 px-6 py-8":"bg-white"),children:/* @__PURE__ */u("div",{ref:R,contentEditable:!0,suppressContentEditableWarning:!0,spellCheck:!1,onInput:()=>N(!0),onPaste:e=>{const t=Array.from(e.clipboardData?.items??[]).filter(e=>"file"===e.kind&&e.type.startsWith("image/")).map(e=>e.getAsFile()).filter(e=>!!e);t.length&&(e.preventDefault(),W(t))},onClick:e=>{const t=e.target;"IMG"===t.tagName&&(e.preventDefault(),C({x:e.clientX,y:e.clientY,el:t}))},dangerouslySetInnerHTML:{__html:f.content},className:"docx"===f.kind?"docs-editor mx-auto w-[8.5in] min-h-[11in] bg-surface p-[1in] shadow text-sm leading-relaxed text-ink-strong outline-none focus:ring-2 focus:ring-blue-400/40":"docs-editor block w-full min-h-full p-4 font-mono text-sm leading-relaxed text-ink-strong bg-surface outline-none whitespace-pre-wrap"})})}),b&&/* @__PURE__ */u("div",{className:"absolute inset-0 bg-blue-500/15 border-4 border-dashed border-blue-500 pointer-events-none flex items-center justify-center z-20",children:/* @__PURE__ */u("div",{className:"px-4 py-2 rounded-md bg-blue-600 text-white text-sm font-medium shadow-lg",children:"Drop a document to open · images insert into the page"})}),D&&/* @__PURE__ */h(o,{minWidth:150,style:{left:D.x,top:D.y},onClose:()=>C(null),children:[
|
|
45
45
|
/* @__PURE__ */u(i,{children:"Image width"}),
|
|
46
46
|
/* @__PURE__ */u(l,{onClick:()=>T("25%"),children:"25%"}),
|
|
47
47
|
/* @__PURE__ */u(l,{onClick:()=>T("50%"),children:"50%"}),
|