mevebu 1.3.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/mevebu/app/mevebu.js +260 -208
- package/mevebu/app/tailwind.css +1658 -2079
- package/mevebu/app/tailwind.src.css +161 -1127
- package/mevebu/index.html +2 -2
- package/mevebu/libs/js/core.js +245 -96
- package/mevebu/libs/js/tools/abstract-checklist.js +5 -7
- package/mevebu/libs/js/tools/add-subtract-days.js +9 -11
- package/mevebu/libs/js/tools/age-calculator.js +7 -8
- package/mevebu/libs/js/tools/api-request-builder.js +3 -4
- package/mevebu/libs/js/tools/area-converter.js +7 -9
- package/mevebu/libs/js/tools/aspect-ratio.js +8 -9
- package/mevebu/libs/js/tools/average-calculator.js +4 -5
- package/mevebu/libs/js/tools/base64.js +2 -3
- package/mevebu/libs/js/tools/binary-calculator.js +6 -7
- package/mevebu/libs/js/tools/border-radius.js +7 -9
- package/mevebu/libs/js/tools/box-shadow.js +6 -7
- package/mevebu/libs/js/tools/break-even.js +4 -5
- package/mevebu/libs/js/tools/business-days.js +7 -8
- package/mevebu/libs/js/tools/canonical-tag.js +5 -6
- package/mevebu/libs/js/tools/caption-counter.js +5 -7
- package/mevebu/libs/js/tools/case-converter.js +10 -11
- package/mevebu/libs/js/tools/case-inspector.js +14 -16
- package/mevebu/libs/js/tools/cash-denomination.js +7 -8
- package/mevebu/libs/js/tools/cash-flow.js +7 -8
- package/mevebu/libs/js/tools/cert-expiry.js +5 -7
- package/mevebu/libs/js/tools/changelog-generator.js +4 -6
- package/mevebu/libs/js/tools/character-counter.js +10 -13
- package/mevebu/libs/js/tools/checklist.js +6 -7
- package/mevebu/libs/js/tools/citation-number-check.js +10 -13
- package/mevebu/libs/js/tools/coin-flip.js +9 -11
- package/mevebu/libs/js/tools/color-converter.js +6 -7
- package/mevebu/libs/js/tools/color-palette.js +6 -8
- package/mevebu/libs/js/tools/color-picker.js +4 -5
- package/mevebu/libs/js/tools/content-calendar.js +3 -4
- package/mevebu/libs/js/tools/contrast-checker.js +5 -6
- package/mevebu/libs/js/tools/cron-builder.js +4 -6
- package/mevebu/libs/js/tools/css-clamp.js +5 -6
- package/mevebu/libs/js/tools/css-formatter.js +4 -7
- package/mevebu/libs/js/tools/css-grid.js +6 -7
- package/mevebu/libs/js/tools/css-minifier.js +5 -8
- package/mevebu/libs/js/tools/csv-to-json.js +2 -3
- package/mevebu/libs/js/tools/csv-viewer.js +9 -11
- package/mevebu/libs/js/tools/currency-format.js +5 -7
- package/mevebu/libs/js/tools/daily-planner.js +9 -10
- package/mevebu/libs/js/tools/data-masker.js +6 -8
- package/mevebu/libs/js/tools/data-storage.js +7 -9
- package/mevebu/libs/js/tools/data-validator.js +9 -11
- package/mevebu/libs/js/tools/date-difference.js +6 -7
- package/mevebu/libs/js/tools/date-format.js +11 -13
- package/mevebu/libs/js/tools/delimiter-converter.js +3 -5
- package/mevebu/libs/js/tools/discount-calculator.js +4 -5
- package/mevebu/libs/js/tools/doi-resolver.js +4 -5
- package/mevebu/libs/js/tools/env-formatter.js +3 -6
- package/mevebu/libs/js/tools/equation-formatter.js +5 -9
- package/mevebu/libs/js/tools/expense-split.js +6 -7
- package/mevebu/libs/js/tools/fake-data.js +8 -13
- package/mevebu/libs/js/tools/find-replace.js +3 -5
- package/mevebu/libs/js/tools/flashcard-creator.js +9 -10
- package/mevebu/libs/js/tools/font-pairing.js +6 -8
- package/mevebu/libs/js/tools/fraction-calculator.js +10 -13
- package/mevebu/libs/js/tools/git-command-builder.js +11 -22
- package/mevebu/libs/js/tools/gpa-calculator.js +8 -10
- package/mevebu/libs/js/tools/grade-calculator.js +7 -8
- package/mevebu/libs/js/tools/gradient-generator.js +10 -12
- package/mevebu/libs/js/tools/habit-tracker.js +8 -9
- package/mevebu/libs/js/tools/hash-generator.js +3 -5
- package/mevebu/libs/js/tools/hashtag-formatter.js +6 -8
- package/mevebu/libs/js/tools/hmac-generator.js +3 -5
- package/mevebu/libs/js/tools/hpp-calculator.js +4 -5
- package/mevebu/libs/js/tools/html-entity.js +2 -3
- package/mevebu/libs/js/tools/html-formatter.js +3 -6
- package/mevebu/libs/js/tools/http-status.js +5 -7
- package/mevebu/libs/js/tools/inventory-quantity.js +7 -8
- package/mevebu/libs/js/tools/json-formatter.js +3 -6
- package/mevebu/libs/js/tools/json-minifier.js +5 -8
- package/mevebu/libs/js/tools/json-to-csv.js +3 -5
- package/mevebu/libs/js/tools/json-to-typescript.js +2 -5
- package/mevebu/libs/js/tools/json-validator.js +2 -3
- package/mevebu/libs/js/tools/jwt-decoder.js +6 -7
- package/mevebu/libs/js/tools/jwt-expiry.js +5 -6
- package/mevebu/libs/js/tools/jwt-generator.js +4 -6
- package/mevebu/libs/js/tools/length-converter.js +7 -9
- package/mevebu/libs/js/tools/license-reference.js +10 -13
- package/mevebu/libs/js/tools/line-counter.js +5 -7
- package/mevebu/libs/js/tools/list-difference.js +5 -7
- package/mevebu/libs/js/tools/list-merger.js +4 -5
- package/mevebu/libs/js/tools/locale-number.js +5 -8
- package/mevebu/libs/js/tools/markdown-preview.js +5 -8
- package/mevebu/libs/js/tools/markdown-table.js +5 -7
- package/mevebu/libs/js/tools/markup-calculator.js +4 -5
- package/mevebu/libs/js/tools/meeting-agenda.js +8 -9
- package/mevebu/libs/js/tools/meta-preview.js +12 -13
- package/mevebu/libs/js/tools/meta-tags.js +6 -7
- package/mevebu/libs/js/tools/mime-types.js +5 -7
- package/mevebu/libs/js/tools/name-picker.js +2 -3
- package/mevebu/libs/js/tools/number-base-converter.js +9 -12
- package/mevebu/libs/js/tools/password-generator.js +9 -12
- package/mevebu/libs/js/tools/password-strength.js +21 -25
- package/mevebu/libs/js/tools/percent-to-fraction.js +6 -7
- package/mevebu/libs/js/tools/percentage-calculator.js +6 -9
- package/mevebu/libs/js/tools/percentage-change.js +4 -5
- package/mevebu/libs/js/tools/permutation-combination.js +9 -12
- package/mevebu/libs/js/tools/prefix-suffix.js +2 -3
- package/mevebu/libs/js/tools/priority-matrix.js +6 -10
- package/mevebu/libs/js/tools/profit-margin.js +4 -5
- package/mevebu/libs/js/tools/qr-generator.js +3 -4
- package/mevebu/libs/js/tools/qr-scanner.js +11 -12
- package/mevebu/libs/js/tools/quadratic-solver.js +7 -8
- package/mevebu/libs/js/tools/query-builder.js +2 -3
- package/mevebu/libs/js/tools/quiz-formatter.js +4 -6
- package/mevebu/libs/js/tools/ratio-calculator.js +7 -8
- package/mevebu/libs/js/tools/readability.js +12 -15
- package/mevebu/libs/js/tools/reading-time.js +5 -7
- package/mevebu/libs/js/tools/reference-completeness.js +6 -8
- package/mevebu/libs/js/tools/regex-tester.js +7 -10
- package/mevebu/libs/js/tools/remove-duplicate-lines.js +2 -3
- package/mevebu/libs/js/tools/remove-extra-spaces.js +3 -5
- package/mevebu/libs/js/tools/robots-txt.js +3 -4
- package/mevebu/libs/js/tools/roman-numeral-converter.js +6 -8
- package/mevebu/libs/js/tools/sales-commission.js +8 -9
- package/mevebu/libs/js/tools/scientific-calculator.js +10 -14
- package/mevebu/libs/js/tools/scientific-notation.js +8 -9
- package/mevebu/libs/js/tools/script-planner.js +8 -10
- package/mevebu/libs/js/tools/selling-price.js +4 -5
- package/mevebu/libs/js/tools/semver-helper.js +3 -5
- package/mevebu/libs/js/tools/sentence-length.js +9 -10
- package/mevebu/libs/js/tools/sequence-analyzer.js +7 -8
- package/mevebu/libs/js/tools/sitemap-xml.js +4 -7
- package/mevebu/libs/js/tools/slug-converter.js +3 -5
- package/mevebu/libs/js/tools/slug-preview.js +6 -7
- package/mevebu/libs/js/tools/sort-lines.js +3 -5
- package/mevebu/libs/js/tools/speed-converter.js +7 -9
- package/mevebu/libs/js/tools/spin-wheel.js +19 -17
- package/mevebu/libs/js/tools/sql-formatter.js +5 -9
- package/mevebu/libs/js/tools/sql-minifier.js +5 -8
- package/mevebu/libs/js/tools/standard-deviation.js +6 -9
- package/mevebu/libs/js/tools/stopwatch.js +4 -6
- package/mevebu/libs/js/tools/study-schedule.js +8 -9
- package/mevebu/libs/js/tools/subtitle-formatter.js +10 -11
- package/mevebu/libs/js/tools/table-to-markdown.js +8 -12
- package/mevebu/libs/js/tools/tax-calculator.js +4 -5
- package/mevebu/libs/js/tools/temperature-converter.js +8 -11
- package/mevebu/libs/js/tools/text-diff.js +11 -7
- package/mevebu/libs/js/tools/text-direction.js +3 -5
- package/mevebu/libs/js/tools/text-reverser.js +3 -5
- package/mevebu/libs/js/tools/time-duration.js +8 -9
- package/mevebu/libs/js/tools/timestamp-converter.js +4 -6
- package/mevebu/libs/js/tools/timezone-converter.js +9 -13
- package/mevebu/libs/js/tools/title-length.js +6 -7
- package/mevebu/libs/js/tools/unicode-inspector.js +4 -5
- package/mevebu/libs/js/tools/url-inspector.js +8 -9
- package/mevebu/libs/js/tools/url-parser.js +12 -13
- package/mevebu/libs/js/tools/utf8-bytes.js +6 -9
- package/mevebu/libs/js/tools/uuid-generator.js +5 -9
- package/mevebu/libs/js/tools/version-compare.js +3 -4
- package/mevebu/libs/js/tools/video-duration.js +5 -7
- package/mevebu/libs/js/tools/volume-converter.js +7 -9
- package/mevebu/libs/js/tools/weekly-planner.js +8 -10
- package/mevebu/libs/js/tools/weight-converter.js +7 -9
- package/mevebu/libs/js/tools/weighted-average.js +4 -5
- package/mevebu/libs/js/tools/word-counter.js +10 -13
- package/mevebu/libs/js/tools/word-limit.js +4 -5
- package/mevebu/libs/js/tools/yaml-formatter.js +6 -7
- package/package.json +1 -1
|
@@ -8,12 +8,10 @@ export function mount(slot) {
|
|
|
8
8
|
const flagsInput = textInput({ value: "g", "aria-label": "Flags", spellcheck: "false", placeholder: "g i m s u y" });
|
|
9
9
|
const source = textArea({
|
|
10
10
|
rows: 8,
|
|
11
|
-
class: "mvb-in mvb-in--area mvb-in--mono",
|
|
12
11
|
"aria-label": "Text to test",
|
|
13
|
-
value: "Contact ada@example.com or grace@navy.com for details."
|
|
14
|
-
});
|
|
15
|
-
const
|
|
16
|
-
const listWrap = el("div", { class: "mvb-scroll" });
|
|
12
|
+
value: "Contact ada@example.com or grace@navy.com for details."});
|
|
13
|
+
const pane = el("div", { class: "min-h-[120px] max-h-[380px] overflow-auto wrap-anywhere rounded-r1 border border-orbit bg-deck-2 px-4 py-3.5 leading-normal [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&_h1]:my-4 [&_h2]:my-4 [&_h3]:my-4 [&_h1]:tracking-[-0.01em] [&_h2]:tracking-[-0.01em] [&_h3]:tracking-[-0.01em] [&_p]:mb-2.5 [&_ul]:mb-2.5 [&_ol]:mb-2.5 [&_pre]:mb-2.5 [&_ul]:ps-[22px] [&_ol]:ps-[22px] [&_code]:rounded-[5px] [&_code]:bg-deck [&_code]:px-[5px] [&_code]:py-px [&_code]:font-mono [&_code]:text-2xs [&_pre]:overflow-auto [&_pre]:rounded-r1 [&_pre]:bg-deck [&_pre]:px-3 [&_pre]:py-2.5 [&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_a]:text-jade [&_table]:border-collapse [&_th]:border [&_td]:border [&_th]:border-orbit [&_td]:border-orbit [&_th]:px-[9px] [&_td]:px-[9px] [&_th]:py-1.5 [&_td]:py-1.5" });
|
|
14
|
+
const listWrap = el("div", { class: "max-h-80 overflow-auto" });
|
|
17
15
|
const error = notice("error");
|
|
18
16
|
let lines = [];
|
|
19
17
|
|
|
@@ -42,7 +40,7 @@ export function mount(slot) {
|
|
|
42
40
|
while ((match = re.exec(text)) && count < MAX_MATCHES) {
|
|
43
41
|
if (match.index === re.lastIndex) re.lastIndex++;
|
|
44
42
|
nodes.push(document.createTextNode(text.slice(last, match.index)));
|
|
45
|
-
nodes.push(el("span", { class: "
|
|
43
|
+
nodes.push(el("span", { class: "rounded-[3px] bg-star/40" }, match[0] || "\u200b"));
|
|
46
44
|
last = match.index + match[0].length;
|
|
47
45
|
const groups = match.slice(1).map((group) => group ?? "").join(", ");
|
|
48
46
|
rows.push(el("tr", {},
|
|
@@ -56,10 +54,10 @@ export function mount(slot) {
|
|
|
56
54
|
nodes.push(document.createTextNode(text.slice(last)));
|
|
57
55
|
pane.append(...nodes);
|
|
58
56
|
if (!count) {
|
|
59
|
-
listWrap.append(el("p", { class: "
|
|
57
|
+
listWrap.append(el("p", { class: "border-s-[3px] border-transparent ps-2 text-sm text-ink-3" }, "No matches."));
|
|
60
58
|
return;
|
|
61
59
|
}
|
|
62
|
-
const table = el("table", { class: "
|
|
60
|
+
const table = el("table", { class: "w-full border-collapse font-mono text-sm [&_th]:wrap-anywhere [&_td]:wrap-anywhere [&_th]:border-b [&_td]:border-b [&_th]:border-orbit [&_td]:border-orbit [&_th]:px-2.5 [&_td]:px-2.5 [&_th]:py-2 [&_td]:py-2 [&_th]:text-start [&_td]:text-start [&_th]:font-sans [&_th]:text-2xs [&_th]:font-semibold [&_th]:text-ink-2 [&_tbody>tr:last-child>th]:border-b-0 [&_tbody>tr:last-child>td]:border-b-0" },
|
|
63
61
|
el("thead", {}, el("tr", {}, el("th", {}, "#"), el("th", {}, "Match"), el("th", {}, "Groups"))),
|
|
64
62
|
el("tbody", {}, ...rows)
|
|
65
63
|
);
|
|
@@ -75,8 +73,7 @@ export function mount(slot) {
|
|
|
75
73
|
stack(panel("Pattern", patternInput), panel("Flags", flagsInput), panel("Text", source), error),
|
|
76
74
|
stack(panel("Matches", pane), panel("Groups", listWrap))
|
|
77
75
|
),
|
|
78
|
-
foot: actions(copyButton(() => lines.join("\n"), "Copy matches", "fill"))
|
|
79
|
-
});
|
|
76
|
+
foot: actions(copyButton(() => lines.join("\n"), "Copy matches", "fill"))});
|
|
80
77
|
slot.append(card.node);
|
|
81
78
|
run();
|
|
82
79
|
|
|
@@ -4,7 +4,7 @@ import { bench, stack, panel, textArea, checkbox, notice, copyButton, actions, t
|
|
|
4
4
|
export function mount(slot) {
|
|
5
5
|
const source = textArea({ rows: 12, "aria-label": "Text", placeholder: "Paste your list, one entry per line" });
|
|
6
6
|
const ignoreCase = checkbox("Ignore case", { checked: false });
|
|
7
|
-
const result = textArea({ rows: 12, readonly: true,
|
|
7
|
+
const result = textArea({ rows: 12, readonly: true, "aria-label": "Result" });
|
|
8
8
|
const note = notice("note");
|
|
9
9
|
|
|
10
10
|
function run() {
|
|
@@ -35,8 +35,7 @@ export function mount(slot) {
|
|
|
35
35
|
stack(panel("Text", source), ignoreCase, note),
|
|
36
36
|
stack(panel("Result", result))
|
|
37
37
|
),
|
|
38
|
-
foot: actions(copyButton(() => result.value, "Copy result", "fill"))
|
|
39
|
-
});
|
|
38
|
+
foot: actions(copyButton(() => result.value, "Copy result", "fill"))});
|
|
40
39
|
slot.append(card.node);
|
|
41
40
|
run();
|
|
42
41
|
|
|
@@ -4,12 +4,11 @@ import { bench, stack, panel, textArea, toggleRow, copyButton, actions, toolcard
|
|
|
4
4
|
|
|
5
5
|
export function mount(slot) {
|
|
6
6
|
const source = textArea({ rows: 12, "aria-label": "Text", placeholder: "Paste your text" });
|
|
7
|
-
const result = textArea({ rows: 12, readonly: true,
|
|
7
|
+
const result = textArea({ rows: 12, readonly: true, "aria-label": "Result" });
|
|
8
8
|
const options = toggleRow([
|
|
9
9
|
{ value: "collapse", label: "Collapse spaces", checked: true },
|
|
10
10
|
{ value: "trim", label: "Trim lines", checked: true },
|
|
11
|
-
{ value: "blank", label: "Remove blank lines", checked: false }
|
|
12
|
-
]);
|
|
11
|
+
{ value: "blank", label: "Remove blank lines", checked: false }]);
|
|
13
12
|
|
|
14
13
|
function run() {
|
|
15
14
|
const text = source.value;
|
|
@@ -30,8 +29,7 @@ export function mount(slot) {
|
|
|
30
29
|
stack(panel("Text", source), options),
|
|
31
30
|
stack(panel("Result", result))
|
|
32
31
|
),
|
|
33
|
-
foot: actions(copyButton(() => result.value, "Copy result", "fill"))
|
|
34
|
-
});
|
|
32
|
+
foot: actions(copyButton(() => result.value, "Copy result", "fill"))});
|
|
35
33
|
slot.append(card.node);
|
|
36
34
|
run();
|
|
37
35
|
|
|
@@ -13,8 +13,8 @@ const isUrl = (value) => {
|
|
|
13
13
|
|
|
14
14
|
export function mount(slot) {
|
|
15
15
|
const agent = textInput({ value: "*", "aria-label": "User agent" });
|
|
16
|
-
const disallow = textArea({ rows: 5,
|
|
17
|
-
const allow = textArea({ rows: 3,
|
|
16
|
+
const disallow = textArea({ rows: 5, placeholder: "/admin\n/private", "aria-label": "Disallow paths" });
|
|
17
|
+
const allow = textArea({ rows: 3, placeholder: "/public", "aria-label": "Allow paths" });
|
|
18
18
|
const sitemap = textInput({ value: "https://example.com/sitemap.xml", "aria-label": "Sitemap URL" });
|
|
19
19
|
const result = output({ rows: 8 });
|
|
20
20
|
const error = notice("error");
|
|
@@ -49,8 +49,7 @@ export function mount(slot) {
|
|
|
49
49
|
),
|
|
50
50
|
stack(panel("robots.txt", result))
|
|
51
51
|
),
|
|
52
|
-
foot: actions(copyButton(() => result.textContent, "Copy robots.txt", "fill"))
|
|
53
|
-
});
|
|
52
|
+
foot: actions(copyButton(() => result.textContent, "Copy robots.txt", "fill"))});
|
|
54
53
|
slot.append(card.node);
|
|
55
54
|
build();
|
|
56
55
|
|
|
@@ -3,8 +3,7 @@ import { el, bench, stack, panel, textInput, notice, copyButton, actions, toolca
|
|
|
3
3
|
|
|
4
4
|
const NUMERALS = [
|
|
5
5
|
[1000, "M"], [900, "CM"], [500, "D"], [400, "CD"], [100, "C"], [90, "XC"],
|
|
6
|
-
[50, "L"], [40, "XL"], [10, "X"], [9, "IX"], [5, "V"], [4, "IV"], [1, "I"]
|
|
7
|
-
];
|
|
6
|
+
[50, "L"], [40, "XL"], [10, "X"], [9, "IX"], [5, "V"], [4, "IV"], [1, "I"]];
|
|
8
7
|
|
|
9
8
|
function toRoman(n) {
|
|
10
9
|
let rest = n;
|
|
@@ -32,15 +31,15 @@ function fromRoman(text) {
|
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
const kvRow = (key, value) =>
|
|
35
|
-
el("div", { class: "
|
|
34
|
+
el("div", { class: "grid gap-3 bg-deck px-3 py-[9px] [grid-template-columns:minmax(90px,34%)_minmax(0,1fr)]" }, el("span", { class: "wrap-anywhere text-2xs font-semibold text-ink-2" }, key), el("span", { class: "wrap-anywhere font-mono text-2xs" }, value));
|
|
36
35
|
|
|
37
36
|
export function mount(slot) {
|
|
38
37
|
const source = textInput({ value: "2026", "aria-label": "Number or Roman numeral", placeholder: "2026 or MMXXVI" });
|
|
39
|
-
const detected = el("span", { class: "
|
|
40
|
-
const result = el("span", { class: "
|
|
38
|
+
const detected = el("span", { class: "wrap-anywhere font-mono text-2xs" }, "-");
|
|
39
|
+
const result = el("span", { class: "wrap-anywhere font-mono text-2xs" }, "-");
|
|
41
40
|
const kv = el(
|
|
42
41
|
"div",
|
|
43
|
-
{ class: "
|
|
42
|
+
{ class: "grid gap-px overflow-hidden rounded-r1 border border-orbit bg-orbit" },
|
|
44
43
|
kvRow("Input", detected),
|
|
45
44
|
kvRow("Result", result)
|
|
46
45
|
);
|
|
@@ -95,8 +94,7 @@ export function mount(slot) {
|
|
|
95
94
|
stack(panel("Number or Roman numeral", source), error),
|
|
96
95
|
stack(panel("Result", kv))
|
|
97
96
|
),
|
|
98
|
-
foot: actions(copyButton(() => text, "Copy result", "fill"))
|
|
99
|
-
});
|
|
97
|
+
foot: actions(copyButton(() => text, "Copy result", "fill"))});
|
|
100
98
|
slot.append(card.node);
|
|
101
99
|
run();
|
|
102
100
|
|
|
@@ -16,14 +16,14 @@ export function mount(slot) {
|
|
|
16
16
|
const rate = numberInput({ value: "5", min: "0", "aria-label": "Rate" });
|
|
17
17
|
const threshold = numberInput({ placeholder: "Threshold", min: "0", "aria-label": "Tier threshold" });
|
|
18
18
|
const higher = numberInput({ placeholder: "Higher rate", min: "0", "aria-label": "Higher rate" });
|
|
19
|
-
const result = el("div", { class: "
|
|
20
|
-
const stats = el("div", { class: "
|
|
19
|
+
const result = el("div", { class: "max-h-80 overflow-auto" });
|
|
20
|
+
const stats = el("div", { class: "grid gap-2.5 [grid-template-columns:repeat(auto-fit,minmax(120px,1fr))]" });
|
|
21
21
|
const error = notice("error");
|
|
22
22
|
let text = "";
|
|
23
23
|
|
|
24
|
-
const tile = (key, value) => el("div", { class: "
|
|
25
|
-
el("span", { class: "
|
|
26
|
-
el("span", { class: "
|
|
24
|
+
const tile = (key, value) => el("div", { class: "grid gap-0.5 rounded-r1 border border-orbit bg-deck-2 px-3.5 py-3" },
|
|
25
|
+
el("span", { class: "wrap-anywhere text-xl font-bold tracking-[-0.02em] tabular-nums" }, String(value)),
|
|
26
|
+
el("span", { class: "text-2xs font-semibold text-ink-3" }, key));
|
|
27
27
|
|
|
28
28
|
const tiered = () => threshold.value.trim() !== "" && higher.value.trim() !== "";
|
|
29
29
|
|
|
@@ -43,7 +43,7 @@ export function mount(slot) {
|
|
|
43
43
|
const { nums, invalid } = parseNumbers(sales.value);
|
|
44
44
|
const r = Number(rate.value);
|
|
45
45
|
if (!sales.value.trim()) {
|
|
46
|
-
result.replaceChildren(el("p", { class: "
|
|
46
|
+
result.replaceChildren(el("p", { class: "border-s-[3px] border-transparent ps-2 text-sm text-ink-3" }, "Add one sale amount per line."));
|
|
47
47
|
stats.replaceChildren();
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
@@ -53,7 +53,7 @@ export function mount(slot) {
|
|
|
53
53
|
stats.replaceChildren();
|
|
54
54
|
return;
|
|
55
55
|
}
|
|
56
|
-
result.replaceChildren(el("table", { class: "
|
|
56
|
+
result.replaceChildren(el("table", { class: "w-full border-collapse font-mono text-sm [&_th]:wrap-anywhere [&_td]:wrap-anywhere [&_th]:border-b [&_td]:border-b [&_th]:border-orbit [&_td]:border-orbit [&_th]:px-2.5 [&_td]:px-2.5 [&_th]:py-2 [&_td]:py-2 [&_th]:text-start [&_td]:text-start [&_th]:font-sans [&_th]:text-2xs [&_th]:font-semibold [&_th]:text-ink-2 [&_tbody>tr:last-child>th]:border-b-0 [&_tbody>tr:last-child>td]:border-b-0" },
|
|
57
57
|
el("thead", {}, el("tr", {}, el("th", {}, "Sale"), el("th", {}, "Commission"))),
|
|
58
58
|
el("tbody", {}, ...nums.map((amount) => el("tr", {},
|
|
59
59
|
el("th", {}, fmt(amount)),
|
|
@@ -85,8 +85,7 @@ export function mount(slot) {
|
|
|
85
85
|
foot: actions(
|
|
86
86
|
downloadButton(() => csv(), "commission.csv", "Save CSV", "text/csv"),
|
|
87
87
|
copyButton(() => text, "Copy commission", "fill")
|
|
88
|
-
)
|
|
89
|
-
});
|
|
88
|
+
)});
|
|
90
89
|
slot.append(card.node);
|
|
91
90
|
run();
|
|
92
91
|
|
|
@@ -51,8 +51,7 @@ const FUNCTIONS = {
|
|
|
51
51
|
ln: (x) => Math.log(x),
|
|
52
52
|
sqrt: (x) => Math.sqrt(x),
|
|
53
53
|
abs: (x) => Math.abs(x),
|
|
54
|
-
exp: (x) => Math.exp(x)
|
|
55
|
-
};
|
|
54
|
+
exp: (x) => Math.exp(x)};
|
|
56
55
|
|
|
57
56
|
function evaluate(src, degrees) {
|
|
58
57
|
const tokens = tokenize(src);
|
|
@@ -146,20 +145,18 @@ export function mount(slot) {
|
|
|
146
145
|
const input = textInput({ value: "sin(30) + 2^3", "aria-label": "Expression", placeholder: "sin(30) + 2^3" });
|
|
147
146
|
const display = output({ rows: 2 });
|
|
148
147
|
const error = notice("error");
|
|
149
|
-
const history = el("div", { class: "
|
|
148
|
+
const history = el("div", { class: "grid gap-px overflow-hidden rounded-r1 border border-orbit bg-orbit" });
|
|
150
149
|
const chips = chipRow(
|
|
151
150
|
[
|
|
152
151
|
{ value: "deg", label: "Degrees" },
|
|
153
|
-
{ value: "rad", label: "Radians" },
|
|
154
|
-
],
|
|
152
|
+
{ value: "rad", label: "Radians" }],
|
|
155
153
|
{
|
|
156
154
|
value: "deg",
|
|
157
155
|
label: "Angle unit",
|
|
158
156
|
onChange: (value) => {
|
|
159
157
|
degrees = value === "deg";
|
|
160
158
|
run();
|
|
161
|
-
}
|
|
162
|
-
}
|
|
159
|
+
}}
|
|
163
160
|
);
|
|
164
161
|
const recent = [];
|
|
165
162
|
let degrees = true;
|
|
@@ -169,9 +166,9 @@ export function mount(slot) {
|
|
|
169
166
|
history.replaceChildren();
|
|
170
167
|
for (const entry of recent) {
|
|
171
168
|
history.append(
|
|
172
|
-
el("div", { class: "
|
|
173
|
-
el("span", { class: "
|
|
174
|
-
el("span", { class: "
|
|
169
|
+
el("div", { class: "grid gap-3 bg-deck px-3 py-[9px] [grid-template-columns:minmax(90px,34%)_minmax(0,1fr)]" },
|
|
170
|
+
el("span", { class: "wrap-anywhere text-2xs font-semibold text-ink-2" }, entry.expression),
|
|
171
|
+
el("span", { class: "wrap-anywhere font-mono text-2xs" }, entry.result))
|
|
175
172
|
);
|
|
176
173
|
}
|
|
177
174
|
}
|
|
@@ -219,9 +216,9 @@ export function mount(slot) {
|
|
|
219
216
|
run();
|
|
220
217
|
}
|
|
221
218
|
|
|
222
|
-
const keypad = el("div", { class: "
|
|
219
|
+
const keypad = el("div", { class: "flex flex-wrap gap-1.5" });
|
|
223
220
|
for (const key of KEYS) {
|
|
224
|
-
keypad.append(el("button", { class: "
|
|
221
|
+
keypad.append(el("button", { class: "min-h-[var(--ctl)] cursor-pointer rounded-r1 border border-orbit bg-deck px-[13px] text-sm font-medium text-ink-2 transition-colors duration-150 hover:border-orbit-hard hover:text-ink data-[on]:border-jade data-[on]:bg-jade-soft data-[on]:text-ink", type: "button", onclick: () => insert(key) }, key));
|
|
225
222
|
}
|
|
226
223
|
|
|
227
224
|
input.addEventListener("input", run);
|
|
@@ -236,8 +233,7 @@ export function mount(slot) {
|
|
|
236
233
|
),
|
|
237
234
|
stack(display, error, panel("History", history))
|
|
238
235
|
),
|
|
239
|
-
foot: actions(copyButton(() => current, "Copy result"), evaluateButton)
|
|
240
|
-
});
|
|
236
|
+
foot: actions(copyButton(() => current, "Copy result"), evaluateButton)});
|
|
241
237
|
slot.append(card.node);
|
|
242
238
|
run();
|
|
243
239
|
|
|
@@ -17,18 +17,18 @@ function decimalForm(n) {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const kvRow = (key, value) =>
|
|
20
|
-
el("div", { class: "
|
|
20
|
+
el("div", { class: "grid gap-3 bg-deck px-3 py-[9px] [grid-template-columns:minmax(90px,34%)_minmax(0,1fr)]" }, el("span", { class: "wrap-anywhere text-2xs font-semibold text-ink-2" }, key), el("span", { class: "wrap-anywhere font-mono text-2xs" }, value));
|
|
21
21
|
|
|
22
22
|
export function mount(slot) {
|
|
23
23
|
const source = textInput({ value: "3.2e8", "aria-label": "Number", placeholder: "3.2e8 or 320000000" });
|
|
24
|
-
const scientific = el("span", { class: "
|
|
25
|
-
const eForm = el("span", { class: "
|
|
26
|
-
const decimal = el("span", { class: "
|
|
27
|
-
const coefficient = el("span", { class: "
|
|
28
|
-
const exponent = el("span", { class: "
|
|
24
|
+
const scientific = el("span", { class: "wrap-anywhere font-mono text-2xs" }, "-");
|
|
25
|
+
const eForm = el("span", { class: "wrap-anywhere font-mono text-2xs" }, "-");
|
|
26
|
+
const decimal = el("span", { class: "wrap-anywhere font-mono text-2xs" }, "-");
|
|
27
|
+
const coefficient = el("span", { class: "wrap-anywhere font-mono text-2xs" }, "-");
|
|
28
|
+
const exponent = el("span", { class: "wrap-anywhere font-mono text-2xs" }, "-");
|
|
29
29
|
const kv = el(
|
|
30
30
|
"div",
|
|
31
|
-
{ class: "
|
|
31
|
+
{ class: "grid gap-px overflow-hidden rounded-r1 border border-orbit bg-orbit" },
|
|
32
32
|
kvRow("Scientific", scientific),
|
|
33
33
|
kvRow("E notation", eForm),
|
|
34
34
|
kvRow("Decimal", decimal),
|
|
@@ -72,8 +72,7 @@ export function mount(slot) {
|
|
|
72
72
|
stack(panel("Number", source), error),
|
|
73
73
|
stack(panel("Forms", kv))
|
|
74
74
|
),
|
|
75
|
-
foot: actions(copyButton(() => text, "Copy scientific", "fill"))
|
|
76
|
-
});
|
|
75
|
+
foot: actions(copyButton(() => text, "Copy scientific", "fill"))});
|
|
77
76
|
slot.append(card.node);
|
|
78
77
|
run();
|
|
79
78
|
|
|
@@ -5,8 +5,7 @@ const SECTIONS = [
|
|
|
5
5
|
["hook", "Hook"],
|
|
6
6
|
["intro", "Intro"],
|
|
7
7
|
["body", "Body"],
|
|
8
|
-
["outro", "Outro"]
|
|
9
|
-
];
|
|
8
|
+
["outro", "Outro"]];
|
|
10
9
|
|
|
11
10
|
const clock = (seconds) => {
|
|
12
11
|
const total = Math.max(0, Math.round(seconds));
|
|
@@ -15,9 +14,9 @@ const clock = (seconds) => {
|
|
|
15
14
|
|
|
16
15
|
const countWords = (text) => (text.trim() ? text.trim().split(/\s+/).length : 0);
|
|
17
16
|
|
|
18
|
-
const kvRow = (key, value) => el("div", { class: "
|
|
19
|
-
el("span", { class: "
|
|
20
|
-
el("span", { class: "
|
|
17
|
+
const kvRow = (key, value) => el("div", { class: "grid gap-3 bg-deck px-3 py-[9px] [grid-template-columns:minmax(90px,34%)_minmax(0,1fr)]" },
|
|
18
|
+
el("span", { class: "wrap-anywhere text-2xs font-semibold text-ink-2" }, key),
|
|
19
|
+
el("span", { class: "wrap-anywhere font-mono text-2xs" }, value));
|
|
21
20
|
|
|
22
21
|
export function mount(slot) {
|
|
23
22
|
const inputs = {};
|
|
@@ -30,13 +29,13 @@ export function mount(slot) {
|
|
|
30
29
|
const rate = numberInput({ min: "60", max: "400", value: "150", "aria-label": "Speaking rate in words per minute" });
|
|
31
30
|
|
|
32
31
|
const rows = {};
|
|
33
|
-
const list = el("div", { class: "
|
|
32
|
+
const list = el("div", { class: "grid gap-px overflow-hidden rounded-r1 border border-orbit bg-orbit" });
|
|
34
33
|
for (const [id, label] of SECTIONS) {
|
|
35
|
-
const value = el("span", { class: "
|
|
34
|
+
const value = el("span", { class: "wrap-anywhere font-mono text-2xs" }, "0 words");
|
|
36
35
|
rows[id] = value;
|
|
37
36
|
list.append(kvRow(label, value));
|
|
38
37
|
}
|
|
39
|
-
const total = el("span", { class: "
|
|
38
|
+
const total = el("span", { class: "wrap-anywhere font-mono text-2xs" }, "0 words");
|
|
40
39
|
list.append(kvRow("Total", total));
|
|
41
40
|
|
|
42
41
|
let fullScript = "";
|
|
@@ -61,8 +60,7 @@ export function mount(slot) {
|
|
|
61
60
|
stack(...fields),
|
|
62
61
|
stack(panel("Speaking rate", rate, "Words per minute"), list)
|
|
63
62
|
),
|
|
64
|
-
foot: actions(copyButton(() => fullScript, "Copy script", "fill"))
|
|
65
|
-
});
|
|
63
|
+
foot: actions(copyButton(() => fullScript, "Copy script", "fill"))});
|
|
66
64
|
slot.append(card.node);
|
|
67
65
|
run();
|
|
68
66
|
|
|
@@ -6,8 +6,8 @@ function fmt(n) {
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
function tile(label) {
|
|
9
|
-
const value = el("span", { class: "
|
|
10
|
-
const node = el("div", { class: "
|
|
9
|
+
const value = el("span", { class: "wrap-anywhere text-xl font-bold tracking-[-0.02em] tabular-nums" }, "-");
|
|
10
|
+
const node = el("div", { class: "grid gap-0.5 rounded-r1 border border-orbit bg-deck-2 px-3.5 py-3" }, value, el("span", { class: "text-2xs font-semibold text-ink-3" }, label));
|
|
11
11
|
node.set = (text) => { value.textContent = text; };
|
|
12
12
|
return node;
|
|
13
13
|
}
|
|
@@ -22,7 +22,7 @@ export function mount(slot) {
|
|
|
22
22
|
);
|
|
23
23
|
const price = tile("Selling price");
|
|
24
24
|
const profit = tile("Profit");
|
|
25
|
-
const stats = el("div", { class: "
|
|
25
|
+
const stats = el("div", { class: "grid gap-2.5 [grid-template-columns:repeat(auto-fit,minmax(120px,1fr))]" }, price, profit);
|
|
26
26
|
const error = notice("error");
|
|
27
27
|
let text = "";
|
|
28
28
|
|
|
@@ -63,8 +63,7 @@ export function mount(slot) {
|
|
|
63
63
|
stack(panel("Cost per unit", cost), panel("Target", chips), panel("Percent", percent), error),
|
|
64
64
|
stack(stats)
|
|
65
65
|
),
|
|
66
|
-
foot: actions(copyButton(() => text, "Copy result", "fill"))
|
|
67
|
-
});
|
|
66
|
+
foot: actions(copyButton(() => text, "Copy result", "fill"))});
|
|
68
67
|
slot.append(card.node);
|
|
69
68
|
run();
|
|
70
69
|
|
|
@@ -4,11 +4,10 @@ import { bench, stack, panel, textInput, chipRow, output, notice, copyButton, ac
|
|
|
4
4
|
const BUMPS = [
|
|
5
5
|
{ value: "major", label: "Major" },
|
|
6
6
|
{ value: "minor", label: "Minor" },
|
|
7
|
-
{ value: "patch", label: "Patch" }
|
|
8
|
-
];
|
|
7
|
+
{ value: "patch", label: "Patch" }];
|
|
9
8
|
|
|
10
9
|
export function mount(slot) {
|
|
11
|
-
const version = textInput({ value: "1.2.3",
|
|
10
|
+
const version = textInput({ value: "1.2.3", mono: true, "aria-label": "Current version" });
|
|
12
11
|
const prerelease = textInput({ value: "", placeholder: "rc.1", "aria-label": "Prerelease tag" });
|
|
13
12
|
const error = notice("error");
|
|
14
13
|
const out = output({ rows: 1 });
|
|
@@ -43,8 +42,7 @@ export function mount(slot) {
|
|
|
43
42
|
stack(panel("Current version", version), panel("Bump", chips), panel("Prerelease", prerelease), error),
|
|
44
43
|
stack(panel("New version", out))
|
|
45
44
|
),
|
|
46
|
-
foot: actions(copyButton(() => text, "Copy version", "fill"))
|
|
47
|
-
});
|
|
45
|
+
foot: actions(copyButton(() => text, "Copy version", "fill"))});
|
|
48
46
|
slot.append(card.node);
|
|
49
47
|
run();
|
|
50
48
|
|
|
@@ -8,15 +8,15 @@ const splitSentences = (text) => text.trim()
|
|
|
8
8
|
const countWords = (text) => text.trim() ? text.trim().split(/\s+/).length : 0;
|
|
9
9
|
|
|
10
10
|
function tile(label) {
|
|
11
|
-
const value = el("span", { class: "
|
|
12
|
-
const node = el("div", { class: "
|
|
11
|
+
const value = el("span", { class: "wrap-anywhere text-xl font-bold tracking-[-0.02em] tabular-nums" }, "0");
|
|
12
|
+
const node = el("div", { class: "grid gap-0.5 rounded-r1 border border-orbit bg-deck-2 px-3.5 py-3" }, value, el("span", { class: "text-2xs font-semibold text-ink-3" }, label));
|
|
13
13
|
node.set = (text) => { value.textContent = text; };
|
|
14
14
|
return node;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
const kvRow = (key, value) => el("div", { class: "
|
|
18
|
-
el("span", { class: "
|
|
19
|
-
el("span", { class: "
|
|
17
|
+
const kvRow = (key, value) => el("div", { class: "grid gap-3 bg-deck px-3 py-[9px] [grid-template-columns:minmax(90px,34%)_minmax(0,1fr)]" },
|
|
18
|
+
el("span", { class: "wrap-anywhere text-2xs font-semibold text-ink-2" }, key),
|
|
19
|
+
el("span", { class: "wrap-anywhere font-mono text-2xs" }, value));
|
|
20
20
|
|
|
21
21
|
export function mount(slot) {
|
|
22
22
|
const source = textArea({ rows: 12, "aria-label": "Text", placeholder: "Type or paste text" });
|
|
@@ -26,9 +26,9 @@ export function mount(slot) {
|
|
|
26
26
|
const shortestTile = tile("Shortest");
|
|
27
27
|
const longestTile = tile("Longest");
|
|
28
28
|
const averageTile = tile("Average");
|
|
29
|
-
const stats = el("div", { class: "
|
|
29
|
+
const stats = el("div", { class: "grid gap-2.5 [grid-template-columns:repeat(auto-fit,minmax(120px,1fr))]" }, sentencesTile, shortestTile, longestTile, averageTile);
|
|
30
30
|
|
|
31
|
-
const listWrap = el("div", { class: "
|
|
31
|
+
const listWrap = el("div", { class: "max-h-80 overflow-auto" });
|
|
32
32
|
const note = notice("note");
|
|
33
33
|
|
|
34
34
|
let longText = "";
|
|
@@ -56,7 +56,7 @@ export function mount(slot) {
|
|
|
56
56
|
if (!long.length) {
|
|
57
57
|
listWrap.replaceChildren(blank("text-align-start", "No sentence runs past the threshold."));
|
|
58
58
|
} else {
|
|
59
|
-
listWrap.replaceChildren(el("div", { class: "
|
|
59
|
+
listWrap.replaceChildren(el("div", { class: "grid gap-px overflow-hidden rounded-r1 border border-orbit bg-orbit" },
|
|
60
60
|
...long.map((sentence) => kvRow(`${countWords(sentence)} words`, sentence))));
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -69,8 +69,7 @@ export function mount(slot) {
|
|
|
69
69
|
stack(panel("Text", source), panel("Flag past", threshold, "Words")),
|
|
70
70
|
stack(stats, note, panel("Long sentences", listWrap))
|
|
71
71
|
),
|
|
72
|
-
foot: actions(copyButton(() => longText, "Copy long sentences", "fill"))
|
|
73
|
-
});
|
|
72
|
+
foot: actions(copyButton(() => longText, "Copy long sentences", "fill"))});
|
|
74
73
|
slot.append(card.node);
|
|
75
74
|
run();
|
|
76
75
|
|
|
@@ -12,17 +12,17 @@ function parseNumbers(text) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const kvRow = (key, value) =>
|
|
15
|
-
el("div", { class: "
|
|
15
|
+
el("div", { class: "grid gap-3 bg-deck px-3 py-[9px] [grid-template-columns:minmax(90px,34%)_minmax(0,1fr)]" }, el("span", { class: "wrap-anywhere text-2xs font-semibold text-ink-2" }, key), el("span", { class: "wrap-anywhere font-mono text-2xs" }, value));
|
|
16
16
|
|
|
17
17
|
export function mount(slot) {
|
|
18
18
|
const source = textArea({ rows: 6, value: "2, 5, 8, 11", "aria-label": "Numbers", placeholder: "2, 5, 8, 11" });
|
|
19
19
|
const error = notice("error");
|
|
20
20
|
|
|
21
|
-
const terms = el("span", { class: "
|
|
22
|
-
const differences = el("span", { class: "
|
|
23
|
-
const pattern = el("span", { class: "
|
|
24
|
-
const next = el("span", { class: "
|
|
25
|
-
const kv = el("div", { class: "
|
|
21
|
+
const terms = el("span", { class: "wrap-anywhere font-mono text-2xs" }, "-");
|
|
22
|
+
const differences = el("span", { class: "wrap-anywhere font-mono text-2xs" }, "-");
|
|
23
|
+
const pattern = el("span", { class: "wrap-anywhere font-mono text-2xs" }, "-");
|
|
24
|
+
const next = el("span", { class: "wrap-anywhere font-mono text-2xs" }, "-");
|
|
25
|
+
const kv = el("div", { class: "grid gap-px overflow-hidden rounded-r1 border border-orbit bg-orbit" },
|
|
26
26
|
kvRow("Terms", terms),
|
|
27
27
|
kvRow("Differences", differences),
|
|
28
28
|
kvRow("Pattern", pattern),
|
|
@@ -79,8 +79,7 @@ export function mount(slot) {
|
|
|
79
79
|
stack(panel("Numbers", source), error),
|
|
80
80
|
stack(panel("Analysis", kv))
|
|
81
81
|
),
|
|
82
|
-
foot: actions(copyButton(() => text, "Copy result", "fill"))
|
|
83
|
-
});
|
|
82
|
+
foot: actions(copyButton(() => text, "Copy result", "fill"))});
|
|
84
83
|
slot.append(card.node);
|
|
85
84
|
run();
|
|
86
85
|
|
|
@@ -15,7 +15,7 @@ const isUrl = (value) => {
|
|
|
15
15
|
|
|
16
16
|
export function mount(slot) {
|
|
17
17
|
const base = textInput({ value: "https://example.com", "aria-label": "Base URL" });
|
|
18
|
-
const pages = textArea({ rows: 8,
|
|
18
|
+
const pages = textArea({ rows: 8, value: "/\n/about", placeholder: "/\n/about\n/blog", "aria-label": "Pages" });
|
|
19
19
|
const freq = selectInput(["always", "hourly", "daily", "weekly", "monthly", "yearly", "never"], { value: "weekly", "aria-label": "Change frequency" });
|
|
20
20
|
const priority = numberInput({ value: "0.8", min: "0", max: "1", step: "0.1", "aria-label": "Priority" });
|
|
21
21
|
const result = output({ rows: 14 });
|
|
@@ -43,15 +43,13 @@ export function mount(slot) {
|
|
|
43
43
|
` <lastmod>${today}</lastmod>`,
|
|
44
44
|
` <changefreq>${esc(freq.value)}</changefreq>`,
|
|
45
45
|
` <priority>${esc(priority.value || "0.5")}</priority>`,
|
|
46
|
-
" </url>"
|
|
47
|
-
].join("\n");
|
|
46
|
+
" </url>"].join("\n");
|
|
48
47
|
});
|
|
49
48
|
result.write([
|
|
50
49
|
'<?xml version="1.0" encoding="UTF-8"?>',
|
|
51
50
|
'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">',
|
|
52
51
|
...entries,
|
|
53
|
-
"</urlset>"
|
|
54
|
-
].join("\n"));
|
|
52
|
+
"</urlset>"].join("\n"));
|
|
55
53
|
}
|
|
56
54
|
|
|
57
55
|
for (const input of [base, pages, priority]) input.addEventListener("input", build);
|
|
@@ -71,8 +69,7 @@ export function mount(slot) {
|
|
|
71
69
|
foot: actions(
|
|
72
70
|
downloadButton(() => result.textContent, "sitemap.xml", "Save XML", "application/xml"),
|
|
73
71
|
copyButton(() => result.textContent, "Copy XML", "fill")
|
|
74
|
-
)
|
|
75
|
-
});
|
|
72
|
+
)});
|
|
76
73
|
slot.append(card.node);
|
|
77
74
|
build();
|
|
78
75
|
|
|
@@ -14,15 +14,14 @@ function slugify(text, sep) {
|
|
|
14
14
|
|
|
15
15
|
export function mount(slot) {
|
|
16
16
|
const source = textInput({ value: "Hello mevebu world", placeholder: "Title", "aria-label": "Title" });
|
|
17
|
-
const result = textInput({ readonly: true,
|
|
17
|
+
const result = textInput({ readonly: true, mono: true, "aria-label": "Slug" });
|
|
18
18
|
|
|
19
19
|
let sep = "-";
|
|
20
20
|
const chips = chipRow(
|
|
21
21
|
[
|
|
22
22
|
{ value: "-", label: "Hyphen" },
|
|
23
23
|
{ value: "_", label: "Underscore" },
|
|
24
|
-
{ value: ".", label: "Dot" },
|
|
25
|
-
],
|
|
24
|
+
{ value: ".", label: "Dot" }],
|
|
26
25
|
{ value: "-", label: "Separator", onChange: (value) => { sep = value; run(); } }
|
|
27
26
|
);
|
|
28
27
|
|
|
@@ -37,8 +36,7 @@ export function mount(slot) {
|
|
|
37
36
|
stack(panel("Title", source), panel("Separator", chips)),
|
|
38
37
|
stack(panel("Slug", result))
|
|
39
38
|
),
|
|
40
|
-
foot: actions(copyButton(() => result.value, "Copy slug", "fill"))
|
|
41
|
-
});
|
|
39
|
+
foot: actions(copyButton(() => result.value, "Copy slug", "fill"))});
|
|
42
40
|
slot.append(card.node);
|
|
43
41
|
run();
|
|
44
42
|
|
|
@@ -20,19 +20,19 @@ function slugify(text) {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const kvRow = (key, value) =>
|
|
23
|
-
el("div", { class: "
|
|
23
|
+
el("div", { class: "grid gap-3 bg-deck px-3 py-[9px] [grid-template-columns:minmax(90px,34%)_minmax(0,1fr)]" }, el("span", { class: "wrap-anywhere text-2xs font-semibold text-ink-2" }, key), el("span", { class: "wrap-anywhere font-mono text-2xs" }, value));
|
|
24
24
|
|
|
25
25
|
export function mount(slot) {
|
|
26
26
|
const title = textInput({ value: "Best running shoes", "aria-label": "Title" });
|
|
27
27
|
const base = textInput({ value: "https://example.com", "aria-label": "Base URL" });
|
|
28
28
|
const error = notice("error");
|
|
29
29
|
|
|
30
|
-
const slugValue = el("span", { class: "
|
|
31
|
-
const urlValue = el("span", { class: "
|
|
32
|
-
const lengthValue = el("span", { class: "
|
|
30
|
+
const slugValue = el("span", { class: "wrap-anywhere font-mono text-2xs" }, "-");
|
|
31
|
+
const urlValue = el("span", { class: "wrap-anywhere font-mono text-2xs" }, "-");
|
|
32
|
+
const lengthValue = el("span", { class: "wrap-anywhere font-mono text-2xs" }, "-");
|
|
33
33
|
const kv = el(
|
|
34
34
|
"div",
|
|
35
|
-
{ class: "
|
|
35
|
+
{ class: "grid gap-px overflow-hidden rounded-r1 border border-orbit bg-orbit" },
|
|
36
36
|
kvRow("Slug", slugValue),
|
|
37
37
|
kvRow("URL", urlValue),
|
|
38
38
|
kvRow("Length", lengthValue)
|
|
@@ -72,8 +72,7 @@ export function mount(slot) {
|
|
|
72
72
|
foot: actions(
|
|
73
73
|
copyButton(() => urlValue.textContent === "-" ? "" : urlValue.textContent, "Copy URL"),
|
|
74
74
|
copyButton(() => slugValue.textContent === "-" ? "" : slugValue.textContent, "Copy slug", "fill")
|
|
75
|
-
)
|
|
76
|
-
});
|
|
75
|
+
)});
|
|
77
76
|
slot.append(card.node);
|
|
78
77
|
run();
|
|
79
78
|
|
|
@@ -3,7 +3,7 @@ import { bench, stack, panel, textArea, chipRow, toggleRow, copyButton, actions,
|
|
|
3
3
|
|
|
4
4
|
export function mount(slot) {
|
|
5
5
|
const source = textArea({ rows: 12, "aria-label": "Text", placeholder: "Paste your list, one entry per line" });
|
|
6
|
-
const result = textArea({ rows: 12, readonly: true,
|
|
6
|
+
const result = textArea({ rows: 12, readonly: true, "aria-label": "Result" });
|
|
7
7
|
|
|
8
8
|
let direction = "asc";
|
|
9
9
|
const dirChips = chipRow(
|
|
@@ -12,8 +12,7 @@ export function mount(slot) {
|
|
|
12
12
|
);
|
|
13
13
|
const options = toggleRow([
|
|
14
14
|
{ value: "ignore", label: "Ignore case", checked: false },
|
|
15
|
-
{ value: "numeric", label: "Numeric", checked: false }
|
|
16
|
-
]);
|
|
15
|
+
{ value: "numeric", label: "Numeric", checked: false }]);
|
|
17
16
|
|
|
18
17
|
function run() {
|
|
19
18
|
const text = source.value;
|
|
@@ -43,8 +42,7 @@ export function mount(slot) {
|
|
|
43
42
|
stack(panel("Direction", dirChips), options),
|
|
44
43
|
stack(panel("Result", result))
|
|
45
44
|
),
|
|
46
|
-
foot: actions(copyButton(() => result.value, "Copy result", "fill"))
|
|
47
|
-
});
|
|
45
|
+
foot: actions(copyButton(() => result.value, "Copy result", "fill"))});
|
|
48
46
|
slot.append(card.node);
|
|
49
47
|
run();
|
|
50
48
|
|