feat: publish Regex Tools 0.1.0
This commit is contained in:
151
src/components/HelpDialog.tsx
Normal file
151
src/components/HelpDialog.tsx
Normal file
@@ -0,0 +1,151 @@
|
||||
import { useEffect, useRef } from "react";
|
||||
import { DEFAULT_REGEX_LIMITS } from "../regex/execution/request-limits";
|
||||
import { manifest } from "../toolbox/manifest";
|
||||
|
||||
const releaseSourceUrl = `https://git.add-ideas.de/zemion/regex-tools/src/tag/v${manifest.version}`;
|
||||
|
||||
export function HelpDialog({
|
||||
open,
|
||||
onClose,
|
||||
}: {
|
||||
readonly open: boolean;
|
||||
readonly onClose: () => void;
|
||||
}) {
|
||||
const dialog = useRef<HTMLDialogElement>(null);
|
||||
useEffect(() => {
|
||||
const element = dialog.current;
|
||||
if (!element) return;
|
||||
if (open && !element.open) element.showModal();
|
||||
if (!open && element.open) element.close();
|
||||
}, [open]);
|
||||
return (
|
||||
<dialog
|
||||
ref={dialog}
|
||||
className="app-dialog"
|
||||
aria-labelledby="help-title"
|
||||
onClose={onClose}
|
||||
>
|
||||
<header>
|
||||
<div>
|
||||
<p className="eyebrow">Regex Tools {manifest.version}</p>
|
||||
<h2 id="help-title">Local regex workbench</h2>
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
className="icon-button"
|
||||
aria-label="Close help"
|
||||
onClick={onClose}
|
||||
>
|
||||
×
|
||||
</button>
|
||||
</header>
|
||||
<div className="dialog-content">
|
||||
<section>
|
||||
<h3>What runs where</h3>
|
||||
<p>
|
||||
Syntax parsing and actual ECMAScript execution run in separate,
|
||||
killable browser workers. Patterns, subjects and projects are never
|
||||
uploaded. There is no backend, account, telemetry, CDN dependency,
|
||||
or executable replacement function.
|
||||
</p>
|
||||
</section>
|
||||
<section>
|
||||
<h3>Trees and replacement mapping</h3>
|
||||
<p>
|
||||
The explanation tree is deterministic structure derived from the
|
||||
syntax provider. The extraction tree contains actual browser-engine
|
||||
matches and captures. Replacement mode adds a typed token tree and
|
||||
bounded per-match contribution/range mapping over those actual
|
||||
matches. None is an internal V8, SpiderMonkey or JavaScriptCore
|
||||
execution trace.
|
||||
</p>
|
||||
</section>
|
||||
<section>
|
||||
<h3>Timeouts and limits</h3>
|
||||
<dl className="help-limits">
|
||||
<div>
|
||||
<dt>Live execution</dt>
|
||||
<dd>{DEFAULT_REGEX_LIMITS.liveExecutionTimeoutMs} ms</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Manual execution</dt>
|
||||
<dd>{DEFAULT_REGEX_LIMITS.manualExecutionTimeoutMs} ms</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Maximum matches</dt>
|
||||
<dd>{DEFAULT_REGEX_LIMITS.maximumMatches.toLocaleString()}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Maximum capture rows</dt>
|
||||
<dd>
|
||||
{DEFAULT_REGEX_LIMITS.maximumCaptureRows.toLocaleString()}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Maximum capture groups</dt>
|
||||
<dd>
|
||||
{DEFAULT_REGEX_LIMITS.maximumCaptureGroups.toLocaleString()}
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Replacement template</dt>
|
||||
<dd>
|
||||
{DEFAULT_REGEX_LIMITS.maximumReplacementTemplateUtf16.toLocaleString()}{" "}
|
||||
UTF-16 units
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>List template</dt>
|
||||
<dd>
|
||||
{DEFAULT_REGEX_LIMITS.maximumListTemplateUtf16.toLocaleString()}{" "}
|
||||
UTF-16 units
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt>Unit-test suite wall time</dt>
|
||||
<dd>60 seconds</dd>
|
||||
</div>
|
||||
</dl>
|
||||
<p>
|
||||
A timeout terminates the worker. It means “timed out”, never “no
|
||||
match”. The following run uses a fresh worker.
|
||||
</p>
|
||||
</section>
|
||||
<section>
|
||||
<h3>Persistence</h3>
|
||||
<p>
|
||||
Ad-hoc test text is excluded from local saves and exports by
|
||||
default. Test definitions are deliberate project data. Import is
|
||||
validated and paused until you review and run it.
|
||||
</p>
|
||||
</section>
|
||||
<section>
|
||||
<h3>Legal notice</h3>
|
||||
<p>
|
||||
Copyright © 2026 Albrecht Degering. Regex Tools is free software:
|
||||
you may redistribute it and/or modify it under the terms of the GNU
|
||||
General Public License, version 3 or (at your option) any later
|
||||
version. It comes without any warranty, to the extent permitted by
|
||||
law.
|
||||
</p>
|
||||
<p>
|
||||
Read the{" "}
|
||||
<a href="./LICENSE" target="_blank" rel="noreferrer">
|
||||
complete licence
|
||||
</a>{" "}
|
||||
or inspect and obtain the{" "}
|
||||
<a href={releaseSourceUrl} target="_blank" rel="noreferrer">
|
||||
corresponding source code
|
||||
</a>
|
||||
.
|
||||
</p>
|
||||
</section>
|
||||
</div>
|
||||
<footer>
|
||||
<button type="button" className="primary-button" onClick={onClose}>
|
||||
Close
|
||||
</button>
|
||||
</footer>
|
||||
</dialog>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user