@vizejs/fresco 0.817.0 → 0.818.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/dist/{app-CDSThgku.mjs → app-ByxmaQXv.mjs} +8 -119
- package/dist/app-ByxmaQXv.mjs.map +1 -0
- package/dist/ascii-font/index.d.mts +15 -0
- package/dist/ascii-font/index.d.mts.map +1 -1
- package/dist/ascii-font/index.mjs +0 -3
- package/dist/ascii-font/index.mjs.map +1 -1
- package/dist/components/index.d.mts +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/{components-CkggYTVQ.mjs → components-0LBWpsQe.mjs} +5 -116
- package/dist/components-0LBWpsQe.mjs.map +1 -0
- package/dist/composables/index.d.mts +3 -3
- package/dist/composables/index.mjs +3 -3
- package/dist/{composables-amARnyjm.mjs → composables-D1oKPS0m.mjs} +3 -15
- package/dist/composables-D1oKPS0m.mjs.map +1 -0
- package/dist/{index-BOV-0YqV.d.mts → index-C7_vgg04.d.mts} +64 -22
- package/dist/index-C7_vgg04.d.mts.map +1 -0
- package/dist/{index-BF-rzRoS.d.mts → index-Cb1yVHhF.d.mts} +973 -372
- package/dist/index-Cb1yVHhF.d.mts.map +1 -0
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +4 -30
- package/dist/index.mjs.map +1 -1
- package/dist/qr-code/index.d.mts +29 -0
- package/dist/qr-code/index.d.mts.map +1 -1
- package/dist/qr-code/index.mjs +0 -3
- package/dist/qr-code/index.mjs.map +1 -1
- package/dist/testing/index.d.mts +23 -6
- package/dist/testing/index.d.mts.map +1 -1
- package/dist/testing/index.mjs +1 -42
- package/dist/testing/index.mjs.map +1 -1
- package/dist/{useApp-vIRJ5Th3.d.mts → useApp-CZwf8lOA.d.mts} +10 -7
- package/dist/useApp-CZwf8lOA.d.mts.map +1 -0
- package/dist/{useBoxMetrics-9FFVE-tA.mjs → useBoxMetrics-DyBYcQEp.mjs} +2 -22
- package/dist/useBoxMetrics-DyBYcQEp.mjs.map +1 -0
- package/dist/{useVirtualViewport-TxTapifg.d.mts → useVirtualViewport-CCWjx3oS.d.mts} +7 -1
- package/dist/useVirtualViewport-CCWjx3oS.d.mts.map +1 -0
- package/package.json +2 -2
- package/dist/app-CDSThgku.mjs.map +0 -1
- package/dist/components-CkggYTVQ.mjs.map +0 -1
- package/dist/composables-amARnyjm.mjs.map +0 -1
- package/dist/index-BF-rzRoS.d.mts.map +0 -1
- package/dist/index-BOV-0YqV.d.mts.map +0 -1
- package/dist/useApp-vIRJ5Th3.d.mts.map +0 -1
- package/dist/useBoxMetrics-9FFVE-tA.mjs.map +0 -1
- package/dist/useVirtualViewport-TxTapifg.d.mts.map +0 -1
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import { A as useFocusManager, O as provideFocusScope, k as useFocus, m as getLastRenderLayout } from "./app-
|
|
2
|
-
import { a as useInput, c as useIsScreenReaderEnabled, i as useMouse, n as createVirtualViewport, t as useBoxMetrics } from "./useBoxMetrics-
|
|
1
|
+
import { A as useFocusManager, O as provideFocusScope, j as createFocusId, k as useFocus, m as getLastRenderLayout } from "./app-ByxmaQXv.mjs";
|
|
2
|
+
import { a as useInput, c as useIsScreenReaderEnabled, i as useMouse, n as createVirtualViewport, t as useBoxMetrics } from "./useBoxMetrics-DyBYcQEp.mjs";
|
|
3
3
|
import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, h, mergeProps, nextTick, normalizeStyle, onMounted, onUnmounted, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toRaw, unref, useSlots, useTemplateRef, watch, withCtx } from "vue";
|
|
4
4
|
//#region src/components/Box.ts
|
|
5
|
-
/**
|
|
6
|
-
* Box Component - Container with flexbox layout
|
|
7
|
-
*/
|
|
8
5
|
const dimensionProp = [Number, String];
|
|
9
6
|
function normalizeBorderStyle(style) {
|
|
10
7
|
if (style === "round") return "rounded";
|
|
@@ -369,9 +366,6 @@ var FrescoVStack_default = /* @__PURE__ */ defineComponent({
|
|
|
369
366
|
});
|
|
370
367
|
//#endregion
|
|
371
368
|
//#region src/components/Grid.ts
|
|
372
|
-
/**
|
|
373
|
-
* Grid Component - Grid layout helper
|
|
374
|
-
*/
|
|
375
369
|
const Grid = defineComponent({
|
|
376
370
|
name: "Grid",
|
|
377
371
|
props: {
|
|
@@ -513,9 +507,6 @@ var FrescoCard_default = /* @__PURE__ */ defineComponent({
|
|
|
513
507
|
});
|
|
514
508
|
//#endregion
|
|
515
509
|
//#region src/utils/text.ts
|
|
516
|
-
/**
|
|
517
|
-
* Unicode-aware text helpers shared by input and text components.
|
|
518
|
-
*/
|
|
519
510
|
const segmenter = typeof Intl !== "undefined" && "Segmenter" in Intl ? new Intl.Segmenter(void 0, { granularity: "grapheme" }) : null;
|
|
520
511
|
function graphemes(value) {
|
|
521
512
|
if (!value) return [];
|
|
@@ -555,9 +546,6 @@ function stringifyChildren(children) {
|
|
|
555
546
|
}
|
|
556
547
|
//#endregion
|
|
557
548
|
//#region src/components/Text.ts
|
|
558
|
-
/**
|
|
559
|
-
* Text Component - Text display
|
|
560
|
-
*/
|
|
561
549
|
const Text = defineComponent({
|
|
562
550
|
name: "Text",
|
|
563
551
|
props: {
|
|
@@ -1121,9 +1109,6 @@ var FrescoTransform_default = /* @__PURE__ */ defineComponent({
|
|
|
1121
1109
|
});
|
|
1122
1110
|
//#endregion
|
|
1123
1111
|
//#region src/components/LineNumber.ts
|
|
1124
|
-
/**
|
|
1125
|
-
* Standalone line-number gutter for code, diagnostics, and diff views.
|
|
1126
|
-
*/
|
|
1127
1112
|
function normalizeInteger(value, minimum) {
|
|
1128
1113
|
if (!Number.isFinite(value)) return minimum;
|
|
1129
1114
|
return Math.max(minimum, Math.trunc(value));
|
|
@@ -1186,7 +1171,6 @@ function retainLastLines(content, maxLines) {
|
|
|
1186
1171
|
const lines = content.split("\n");
|
|
1187
1172
|
return lines.length <= limit ? content : lines.slice(-limit).join("\n");
|
|
1188
1173
|
}
|
|
1189
|
-
/** Create a reactive stream buffer with optional bounded line retention. */
|
|
1190
1174
|
function createCodeBuffer(initial = "", options = {}) {
|
|
1191
1175
|
const content = ref(retainLastLines(initial, options.maxLines));
|
|
1192
1176
|
return {
|
|
@@ -1204,7 +1188,6 @@ function createCodeBuffer(initial = "", options = {}) {
|
|
|
1204
1188
|
}
|
|
1205
1189
|
//#endregion
|
|
1206
1190
|
//#region src/components/Code.ts
|
|
1207
|
-
/** Bounded code viewer with streaming, selection, diagnostics, and syntax providers. */
|
|
1208
1191
|
function finiteInteger$1(value, fallback = 0) {
|
|
1209
1192
|
return Number.isFinite(value) ? Math.trunc(value) : fallback;
|
|
1210
1193
|
}
|
|
@@ -1545,7 +1528,6 @@ function parseTaskItem(content) {
|
|
|
1545
1528
|
checked: (task[1] ?? "").toLowerCase() === "x"
|
|
1546
1529
|
} : { content };
|
|
1547
1530
|
}
|
|
1548
|
-
/** Parse the block-level subset of CommonMark used by Fresco Markdown. */
|
|
1549
1531
|
function parseMarkdown(source) {
|
|
1550
1532
|
const lines = source.replaceAll("\r\n", "\n").replaceAll("\r", "\n").split("\n");
|
|
1551
1533
|
const blocks = [];
|
|
@@ -1689,7 +1671,6 @@ function mergeAdjacentSpans(spans) {
|
|
|
1689
1671
|
}
|
|
1690
1672
|
return merged;
|
|
1691
1673
|
}
|
|
1692
|
-
/** A search that only moves forward, so text behind the last result is never scanned again. */
|
|
1693
1674
|
function forwardSearch(search) {
|
|
1694
1675
|
let found = Number.NEGATIVE_INFINITY;
|
|
1695
1676
|
return (from) => {
|
|
@@ -1697,13 +1678,6 @@ function forwardSearch(search) {
|
|
|
1697
1678
|
return found;
|
|
1698
1679
|
};
|
|
1699
1680
|
}
|
|
1700
|
-
/**
|
|
1701
|
-
* Match `[label](url)` or `[label](url "title")` at an index of `content`.
|
|
1702
|
-
*
|
|
1703
|
-
* Each part ends at the first character that can end it, so it is located with a
|
|
1704
|
-
* forward search instead of a pattern retried at every index: a long run of
|
|
1705
|
-
* unmatched `[` is scanned once, not once per bracket.
|
|
1706
|
-
*/
|
|
1707
1681
|
function createLinkMatcher(content) {
|
|
1708
1682
|
const urlBoundary = /[\s)]/gu;
|
|
1709
1683
|
const labelEnd = forwardSearch((from) => content.indexOf("]", from));
|
|
@@ -1886,11 +1860,9 @@ function renderWithProviders(block, options) {
|
|
|
1886
1860
|
}
|
|
1887
1861
|
return defaultBlockLines(block, options);
|
|
1888
1862
|
}
|
|
1889
|
-
/** Built-in source renderer with per-block provider delegation. */
|
|
1890
1863
|
const defaultMarkdownRenderer = { render(source, options) {
|
|
1891
1864
|
return parseMarkdown(source).flatMap((block) => renderWithProviders(block, options));
|
|
1892
1865
|
} };
|
|
1893
|
-
/** Render Markdown with either the built-in renderer or a complete replacement. */
|
|
1894
1866
|
function renderMarkdown(source, options = {}, renderer = defaultMarkdownRenderer) {
|
|
1895
1867
|
return renderer.render(source, options);
|
|
1896
1868
|
}
|
|
@@ -2053,7 +2025,6 @@ var FrescoFrameBuffer_default = /* @__PURE__ */ defineComponent({
|
|
|
2053
2025
|
function diagonalValue(diagonals, diagonal) {
|
|
2054
2026
|
return diagonals.get(diagonal) ?? Number.NEGATIVE_INFINITY;
|
|
2055
2027
|
}
|
|
2056
|
-
/** Compute a shortest edit script with Myers' O((N + M)D) algorithm. */
|
|
2057
2028
|
function diffSequence(previous, next) {
|
|
2058
2029
|
if (previous.length === 0) return next.map((value) => ({
|
|
2059
2030
|
kind: "added",
|
|
@@ -2209,7 +2180,6 @@ function normalizeChangeBlocks(lines) {
|
|
|
2209
2180
|
}
|
|
2210
2181
|
return normalized;
|
|
2211
2182
|
}
|
|
2212
|
-
/** Build numbered line edits and word-level highlight segments. */
|
|
2213
2183
|
function createDiffLines(previous, next) {
|
|
2214
2184
|
let oldLine = 1;
|
|
2215
2185
|
let newLine = 1;
|
|
@@ -2273,7 +2243,6 @@ function hunkHeader(lines, start, end) {
|
|
|
2273
2243
|
text: `@@ -${oldStart},${oldCount} +${newStart},${newCount} @@`
|
|
2274
2244
|
};
|
|
2275
2245
|
}
|
|
2276
|
-
/** Retain only requested context around changes and insert stable hunk headers. */
|
|
2277
2246
|
function createUnifiedRows(previous, next, context) {
|
|
2278
2247
|
const lines = createDiffLines(previous, next);
|
|
2279
2248
|
const changed = lines.flatMap((line, index) => line.kind === "context" ? [] : [index]);
|
|
@@ -2292,7 +2261,6 @@ function createUnifiedRows(previous, next, context) {
|
|
|
2292
2261
|
}
|
|
2293
2262
|
return ranges.flatMap(({ start, end }) => [hunkHeader(lines, start, end), ...lines.slice(start, end)]);
|
|
2294
2263
|
}
|
|
2295
|
-
/** Pair removed and added lines for a side-by-side view. */
|
|
2296
2264
|
function createSplitRows(rows) {
|
|
2297
2265
|
const split = [];
|
|
2298
2266
|
for (let index = 0; index < rows.length;) {
|
|
@@ -2329,7 +2297,6 @@ function createSplitRows(rows) {
|
|
|
2329
2297
|
}
|
|
2330
2298
|
//#endregion
|
|
2331
2299
|
//#region src/components/Diff.ts
|
|
2332
|
-
/** Unified and side-by-side text diff with bounded viewport rendering. */
|
|
2333
2300
|
function normalizedInteger(value, fallback) {
|
|
2334
2301
|
if (value === void 0 || !Number.isFinite(value)) return fallback;
|
|
2335
2302
|
return Math.max(0, Math.trunc(value));
|
|
@@ -2697,9 +2664,6 @@ function replaceExternalText(state, value) {
|
|
|
2697
2664
|
}
|
|
2698
2665
|
//#endregion
|
|
2699
2666
|
//#region src/components/TextInput.ts
|
|
2700
|
-
/**
|
|
2701
|
-
* TextInput Component - Text input with builtin cursor management and IME support
|
|
2702
|
-
*/
|
|
2703
2667
|
const TextInput = defineComponent({
|
|
2704
2668
|
name: "TextInput",
|
|
2705
2669
|
props: {
|
|
@@ -2991,7 +2955,6 @@ function boundedPosition(value, position) {
|
|
|
2991
2955
|
const length = graphemes(value).length;
|
|
2992
2956
|
return Math.max(0, Math.min(Number.isFinite(position) ? Math.trunc(position) : 0, length));
|
|
2993
2957
|
}
|
|
2994
|
-
/** Convert a global grapheme position into its line and column. */
|
|
2995
2958
|
function positionToTextAreaPoint(value, position) {
|
|
2996
2959
|
const parts = graphemes(value);
|
|
2997
2960
|
const end = boundedPosition(value, position);
|
|
@@ -3006,7 +2969,6 @@ function positionToTextAreaPoint(value, position) {
|
|
|
3006
2969
|
column
|
|
3007
2970
|
};
|
|
3008
2971
|
}
|
|
3009
|
-
/** Convert a line and column into a clamped global grapheme position. */
|
|
3010
2972
|
function textAreaPointToPosition(value, line, column) {
|
|
3011
2973
|
const targetLine = Math.max(0, Number.isFinite(line) ? Math.trunc(line) : 0);
|
|
3012
2974
|
const targetColumn = Math.max(0, Number.isFinite(column) ? Math.trunc(column) : 0);
|
|
@@ -3023,11 +2985,9 @@ function textAreaPointToPosition(value, line, column) {
|
|
|
3023
2985
|
}
|
|
3024
2986
|
return parts.length;
|
|
3025
2987
|
}
|
|
3026
|
-
/** Find the start or end position of the line containing a global position. */
|
|
3027
2988
|
function lineBoundary(value, position, edge) {
|
|
3028
2989
|
return textAreaPointToPosition(value, positionToTextAreaPoint(value, position).line, edge === "start" ? 0 : Number.MAX_SAFE_INTEGER);
|
|
3029
2990
|
}
|
|
3030
|
-
/** Move between logical lines while retaining the caller's preferred column. */
|
|
3031
2991
|
function moveTextAreaCursorVertically(value, position, lineDelta, preferredColumn) {
|
|
3032
2992
|
const point = positionToTextAreaPoint(value, position);
|
|
3033
2993
|
const lastLine = value.split("\n").length - 1;
|
|
@@ -3035,9 +2995,6 @@ function moveTextAreaCursorVertically(value, position, lineDelta, preferredColum
|
|
|
3035
2995
|
}
|
|
3036
2996
|
//#endregion
|
|
3037
2997
|
//#region src/components/TextArea.ts
|
|
3038
|
-
/**
|
|
3039
|
-
* TextArea Component - controlled or uncontrolled multiline text editing.
|
|
3040
|
-
*/
|
|
3041
2998
|
const TextArea = defineComponent({
|
|
3042
2999
|
name: "TextArea",
|
|
3043
3000
|
props: {
|
|
@@ -3323,7 +3280,6 @@ const TextArea = defineComponent({
|
|
|
3323
3280
|
});
|
|
3324
3281
|
//#endregion
|
|
3325
3282
|
//#region src/components/collection-navigation.ts
|
|
3326
|
-
/** Create a typeahead buffer with repeated-character cycling and an idle timeout. */
|
|
3327
3283
|
function createTypeaheadBuffer(timeoutMs = 700, now = Date.now) {
|
|
3328
3284
|
let query = "";
|
|
3329
3285
|
let lastInputAt = 0;
|
|
@@ -3341,21 +3297,13 @@ function createTypeaheadBuffer(timeoutMs = 700, now = Date.now) {
|
|
|
3341
3297
|
}
|
|
3342
3298
|
};
|
|
3343
3299
|
}
|
|
3344
|
-
/** Return the first enabled item, or -1 when the collection cannot be focused. */
|
|
3345
3300
|
function firstEnabledIndex(items) {
|
|
3346
3301
|
return items.findIndex((item) => !item.disabled);
|
|
3347
3302
|
}
|
|
3348
|
-
/** Return the last enabled item, or -1 when the collection cannot be focused. */
|
|
3349
3303
|
function lastEnabledIndex(items) {
|
|
3350
3304
|
for (let index = items.length - 1; index >= 0; index--) if (!items[index]?.disabled) return index;
|
|
3351
3305
|
return -1;
|
|
3352
3306
|
}
|
|
3353
|
-
/**
|
|
3354
|
-
* Move to the next enabled item, wrapping at collection boundaries.
|
|
3355
|
-
*
|
|
3356
|
-
* A missing current index starts before the first item when moving forward and
|
|
3357
|
-
* after the last item when moving backward.
|
|
3358
|
-
*/
|
|
3359
3307
|
function adjacentEnabledIndex(items, current, direction) {
|
|
3360
3308
|
if (items.length === 0) return -1;
|
|
3361
3309
|
const start = current >= 0 && current < items.length ? current : direction > 0 ? -1 : 0;
|
|
@@ -3365,7 +3313,6 @@ function adjacentEnabledIndex(items, current, direction) {
|
|
|
3365
3313
|
}
|
|
3366
3314
|
return -1;
|
|
3367
3315
|
}
|
|
3368
|
-
/** Find the next enabled item whose label starts with the typeahead query. */
|
|
3369
3316
|
function typeaheadIndex(items, current, query, label) {
|
|
3370
3317
|
const normalizedQuery = query.trim().toLocaleLowerCase();
|
|
3371
3318
|
if (!normalizedQuery || items.length === 0) return current;
|
|
@@ -3378,7 +3325,6 @@ function typeaheadIndex(items, current, query, label) {
|
|
|
3378
3325
|
}
|
|
3379
3326
|
return current;
|
|
3380
3327
|
}
|
|
3381
|
-
/** Keep a highlighted item inside a bounded visible window. */
|
|
3382
3328
|
function visibleCollectionOffset(highlightedIndex, currentOffset, windowSize, itemCount) {
|
|
3383
3329
|
if (!windowSize || windowSize <= 0 || itemCount <= windowSize || highlightedIndex < 0) return 0;
|
|
3384
3330
|
const maximumOffset = itemCount - windowSize;
|
|
@@ -3388,7 +3334,6 @@ function visibleCollectionOffset(highlightedIndex, currentOffset, windowSize, it
|
|
|
3388
3334
|
}
|
|
3389
3335
|
//#endregion
|
|
3390
3336
|
//#region src/components/collection-values.ts
|
|
3391
|
-
/** Compare collection values by identity, an object key, or a custom comparator. */
|
|
3392
3337
|
function collectionValuesEqual(left, right, by) {
|
|
3393
3338
|
if (typeof by === "function") return by(left, right);
|
|
3394
3339
|
if (by !== void 0 && typeof left === "object" && left !== null && typeof right === "object" && right !== null) return Object.is(Reflect.get(left, by), Reflect.get(right, by));
|
|
@@ -3396,9 +3341,6 @@ function collectionValuesEqual(left, right, by) {
|
|
|
3396
3341
|
}
|
|
3397
3342
|
//#endregion
|
|
3398
3343
|
//#region src/components/Select.ts
|
|
3399
|
-
/**
|
|
3400
|
-
* Select Component - Dropdown/menu selection
|
|
3401
|
-
*/
|
|
3402
3344
|
function optionKey(option, index) {
|
|
3403
3345
|
if (option.key !== void 0) return option.key;
|
|
3404
3346
|
const value = option.value;
|
|
@@ -3630,9 +3572,6 @@ var FrescoSelect_default = /* @__PURE__ */ defineComponent({
|
|
|
3630
3572
|
});
|
|
3631
3573
|
//#endregion
|
|
3632
3574
|
//#region src/components/Checkbox.ts
|
|
3633
|
-
/**
|
|
3634
|
-
* Checkbox Component - Toggle checkbox
|
|
3635
|
-
*/
|
|
3636
3575
|
const Checkbox = defineComponent({
|
|
3637
3576
|
name: "Checkbox",
|
|
3638
3577
|
props: {
|
|
@@ -3690,9 +3629,6 @@ const Checkbox = defineComponent({
|
|
|
3690
3629
|
});
|
|
3691
3630
|
//#endregion
|
|
3692
3631
|
//#region src/components/RadioGroup.ts
|
|
3693
|
-
/**
|
|
3694
|
-
* RadioGroup Component - Radio button group selection
|
|
3695
|
-
*/
|
|
3696
3632
|
const RadioGroup = defineComponent({
|
|
3697
3633
|
name: "RadioGroup",
|
|
3698
3634
|
props: {
|
|
@@ -3797,9 +3733,6 @@ const RadioGroup = defineComponent({
|
|
|
3797
3733
|
});
|
|
3798
3734
|
//#endregion
|
|
3799
3735
|
//#region src/components/Confirm.ts
|
|
3800
|
-
/**
|
|
3801
|
-
* Confirm Component - Confirmation dialog
|
|
3802
|
-
*/
|
|
3803
3736
|
const Confirm = defineComponent({
|
|
3804
3737
|
name: "Confirm",
|
|
3805
3738
|
props: {
|
|
@@ -3887,7 +3820,6 @@ const Confirm = defineComponent({
|
|
|
3887
3820
|
function finiteOr(value, fallback) {
|
|
3888
3821
|
return value !== void 0 && Number.isFinite(value) ? value : fallback;
|
|
3889
3822
|
}
|
|
3890
|
-
/** Normalize malformed public range inputs without producing NaN or infinities. */
|
|
3891
3823
|
function normalizeSliderRange(min, max, step) {
|
|
3892
3824
|
const lower = finiteOr(min, 0);
|
|
3893
3825
|
const requestedUpper = finiteOr(max, 100);
|
|
@@ -3905,7 +3837,6 @@ function decimalPlaces(value) {
|
|
|
3905
3837
|
const fractionLength = coefficient.split(".")[1]?.length ?? 0;
|
|
3906
3838
|
return Math.max(0, fractionLength - exponent);
|
|
3907
3839
|
}
|
|
3908
|
-
/** Clamp and step-align a candidate while preserving exact inclusive endpoints. */
|
|
3909
3840
|
function normalizeSliderValue(value, range) {
|
|
3910
3841
|
const finiteValue = Number.isFinite(value) ? value : range.min;
|
|
3911
3842
|
if (finiteValue <= range.min || range.min === range.max) return range.min;
|
|
@@ -3915,7 +3846,6 @@ function normalizeSliderValue(value, range) {
|
|
|
3915
3846
|
const precision = Math.min(12, Math.max(decimalPlaces(range.min), decimalPlaces(range.step)));
|
|
3916
3847
|
return Math.min(range.max, Math.max(range.min, Number(snapped.toFixed(precision))));
|
|
3917
3848
|
}
|
|
3918
|
-
/** Map a normalized track fraction onto the public range. */
|
|
3919
3849
|
function sliderValueAtRatio(ratio, range) {
|
|
3920
3850
|
const boundedRatio = Number.isFinite(ratio) ? Math.min(1, Math.max(0, ratio)) : 0;
|
|
3921
3851
|
return normalizeSliderValue(range.min + boundedRatio * (range.max - range.min), range);
|
|
@@ -4127,9 +4057,6 @@ var FrescoSlider_default = /* @__PURE__ */ defineComponent({
|
|
|
4127
4057
|
});
|
|
4128
4058
|
//#endregion
|
|
4129
4059
|
//#region src/components/Form.ts
|
|
4130
|
-
/**
|
|
4131
|
-
* Form Component - Form container with labels
|
|
4132
|
-
*/
|
|
4133
4060
|
const Form = defineComponent({
|
|
4134
4061
|
name: "Form",
|
|
4135
4062
|
props: {
|
|
@@ -4304,7 +4231,6 @@ const Form = defineComponent({
|
|
|
4304
4231
|
});
|
|
4305
4232
|
//#endregion
|
|
4306
4233
|
//#region src/components/display-primitive-types.ts
|
|
4307
|
-
/** Default foreground and background colors for each Badge variant. */
|
|
4308
4234
|
const badgeVariantColors = {
|
|
4309
4235
|
default: { fg: "white" },
|
|
4310
4236
|
success: { fg: "green" },
|
|
@@ -4312,7 +4238,6 @@ const badgeVariantColors = {
|
|
|
4312
4238
|
error: { fg: "red" },
|
|
4313
4239
|
info: { fg: "cyan" }
|
|
4314
4240
|
};
|
|
4315
|
-
/** Built-in animation frame sets for Spinner. */
|
|
4316
4241
|
const spinnerTypes = {
|
|
4317
4242
|
dots: [
|
|
4318
4243
|
"⠋",
|
|
@@ -4470,9 +4395,6 @@ var FrescoSpinner_default = /* @__PURE__ */ defineComponent({
|
|
|
4470
4395
|
});
|
|
4471
4396
|
//#endregion
|
|
4472
4397
|
//#region src/components/ProgressBar.ts
|
|
4473
|
-
/**
|
|
4474
|
-
* ProgressBar Component - Progress indicator
|
|
4475
|
-
*/
|
|
4476
4398
|
const ProgressBar = defineComponent({
|
|
4477
4399
|
name: "ProgressBar",
|
|
4478
4400
|
props: {
|
|
@@ -4572,7 +4494,6 @@ defineComponent({
|
|
|
4572
4494
|
});
|
|
4573
4495
|
//#endregion
|
|
4574
4496
|
//#region src/components/presentational-primitive-types.ts
|
|
4575
|
-
/** Visual defaults for each alert type. */
|
|
4576
4497
|
const alertConfigs = {
|
|
4577
4498
|
info: {
|
|
4578
4499
|
icon: "ℹ",
|
|
@@ -4595,14 +4516,12 @@ const alertConfigs = {
|
|
|
4595
4516
|
title: "Error"
|
|
4596
4517
|
}
|
|
4597
4518
|
};
|
|
4598
|
-
/** Foreground colors for avatar statuses. */
|
|
4599
4519
|
const avatarStatusColors = {
|
|
4600
4520
|
online: "green",
|
|
4601
4521
|
offline: "gray",
|
|
4602
4522
|
away: "yellow",
|
|
4603
4523
|
busy: "red"
|
|
4604
4524
|
};
|
|
4605
|
-
/** Glyphs for avatar statuses. */
|
|
4606
4525
|
const avatarStatusIcons = {
|
|
4607
4526
|
online: "●",
|
|
4608
4527
|
offline: "○",
|
|
@@ -4732,9 +4651,6 @@ var FrescoBadge_default = /* @__PURE__ */ defineComponent({
|
|
|
4732
4651
|
});
|
|
4733
4652
|
//#endregion
|
|
4734
4653
|
//#region src/components/Timer.ts
|
|
4735
|
-
/**
|
|
4736
|
-
* Timer Component - Countdown/stopwatch timer
|
|
4737
|
-
*/
|
|
4738
4654
|
const Timer = defineComponent({
|
|
4739
4655
|
name: "Timer",
|
|
4740
4656
|
props: {
|
|
@@ -4959,9 +4875,6 @@ var FrescoTooltip_default = /* @__PURE__ */ defineComponent({
|
|
|
4959
4875
|
});
|
|
4960
4876
|
//#endregion
|
|
4961
4877
|
//#region src/components/List.ts
|
|
4962
|
-
/**
|
|
4963
|
-
* List Component - Scrollable list of items
|
|
4964
|
-
*/
|
|
4965
4878
|
function listItemValue(item) {
|
|
4966
4879
|
return Object.hasOwn(item, "value") ? item.value : item.key;
|
|
4967
4880
|
}
|
|
@@ -5187,7 +5100,6 @@ var FrescoList_default = /* @__PURE__ */ defineComponent({
|
|
|
5187
5100
|
function finiteInteger(value, fallback) {
|
|
5188
5101
|
return Number.isFinite(value) ? Math.trunc(value) : fallback;
|
|
5189
5102
|
}
|
|
5190
|
-
/** Resolve a controlled or declared numeric width inside the column limits. */
|
|
5191
5103
|
function tableColumnWidth(column, widths) {
|
|
5192
5104
|
const requested = widths?.[String(column.key)] ?? column.width;
|
|
5193
5105
|
if (typeof requested !== "number" || !Number.isFinite(requested)) return void 0;
|
|
@@ -5195,7 +5107,6 @@ function tableColumnWidth(column, widths) {
|
|
|
5195
5107
|
const maximum = Math.max(minimum, finiteInteger(column.maxWidth ?? Number.MAX_SAFE_INTEGER, minimum));
|
|
5196
5108
|
return Math.min(maximum, Math.max(minimum, Math.trunc(requested)));
|
|
5197
5109
|
}
|
|
5198
|
-
/** Convert supported primitive values and structured values into table text. */
|
|
5199
5110
|
function stringifyTableCell(value) {
|
|
5200
5111
|
if (value == null) return "";
|
|
5201
5112
|
if (typeof value === "string") return value;
|
|
@@ -5206,7 +5117,6 @@ function stringifyTableCell(value) {
|
|
|
5206
5117
|
return "";
|
|
5207
5118
|
}
|
|
5208
5119
|
}
|
|
5209
|
-
/** Truncate and align a cell without splitting a Unicode grapheme cluster. */
|
|
5210
5120
|
function fitTableCell(value, width, alignment = "left") {
|
|
5211
5121
|
if (width === void 0) return value;
|
|
5212
5122
|
const size = Math.max(0, Math.trunc(width));
|
|
@@ -5231,7 +5141,6 @@ function compareTableValues(left, right) {
|
|
|
5231
5141
|
}
|
|
5232
5142
|
return stringifyTableCell(left).localeCompare(stringifyTableCell(right));
|
|
5233
5143
|
}
|
|
5234
|
-
/** Stable controlled sorting that retains each row's original source index. */
|
|
5235
5144
|
function sortTableRows(rows, columns, sortKey, direction) {
|
|
5236
5145
|
const indexed = rows.map((row, sourceIndex) => ({
|
|
5237
5146
|
row,
|
|
@@ -5246,7 +5155,6 @@ function sortTableRows(rows, columns, sortKey, direction) {
|
|
|
5246
5155
|
return compared === 0 ? left.sourceIndex - right.sourceIndex : compared * factor;
|
|
5247
5156
|
});
|
|
5248
5157
|
}
|
|
5249
|
-
/** Clamp visible and retained row ranges for bounded rendering. */
|
|
5250
5158
|
function tableViewportRange(itemCount, offset, viewportSize, overscan) {
|
|
5251
5159
|
const count = Math.max(0, finiteInteger(itemCount, 0));
|
|
5252
5160
|
const visibleSize = viewportSize === void 0 ? count : Math.min(count, Math.max(0, finiteInteger(viewportSize, 0)));
|
|
@@ -5262,7 +5170,6 @@ function tableViewportRange(itemCount, offset, viewportSize, overscan) {
|
|
|
5262
5170
|
}
|
|
5263
5171
|
//#endregion
|
|
5264
5172
|
//#region src/components/Table.ts
|
|
5265
|
-
/** Table Component - sortable, resizable, bounded tabular data. */
|
|
5266
5173
|
const Table = defineComponent({
|
|
5267
5174
|
name: "Table",
|
|
5268
5175
|
props: {
|
|
@@ -5456,9 +5363,6 @@ const Table = defineComponent({
|
|
|
5456
5363
|
});
|
|
5457
5364
|
//#endregion
|
|
5458
5365
|
//#region src/components/Tree.ts
|
|
5459
|
-
/**
|
|
5460
|
-
* Tree Component - Tree view for hierarchical data
|
|
5461
|
-
*/
|
|
5462
5366
|
function treeNodeValue(node) {
|
|
5463
5367
|
return Object.hasOwn(node, "value") ? node.value : node.key;
|
|
5464
5368
|
}
|
|
@@ -5784,9 +5688,6 @@ var FrescoTree_default = /* @__PURE__ */ defineComponent({
|
|
|
5784
5688
|
});
|
|
5785
5689
|
//#endregion
|
|
5786
5690
|
//#region src/components/Menu.ts
|
|
5787
|
-
/**
|
|
5788
|
-
* Menu Component - Command menu/palette
|
|
5789
|
-
*/
|
|
5790
5691
|
function menuItemValue(item) {
|
|
5791
5692
|
return Object.hasOwn(item, "value") ? item.value : item.key;
|
|
5792
5693
|
}
|
|
@@ -6030,9 +5931,6 @@ var FrescoMenu_default = /* @__PURE__ */ defineComponent({
|
|
|
6030
5931
|
});
|
|
6031
5932
|
//#endregion
|
|
6032
5933
|
//#region src/components/Tabs.ts
|
|
6033
|
-
/**
|
|
6034
|
-
* Tabs Component - Tab navigation
|
|
6035
|
-
*/
|
|
6036
5934
|
function tabValue(tab) {
|
|
6037
5935
|
return Object.hasOwn(tab, "value") ? tab.value : tab.key;
|
|
6038
5936
|
}
|
|
@@ -6350,9 +6248,6 @@ var FrescoBreadcrumb_default = /* @__PURE__ */ defineComponent({
|
|
|
6350
6248
|
});
|
|
6351
6249
|
//#endregion
|
|
6352
6250
|
//#region src/components/Stepper.ts
|
|
6353
|
-
/**
|
|
6354
|
-
* Stepper Component - Step indicator for wizards
|
|
6355
|
-
*/
|
|
6356
6251
|
const Stepper = defineComponent({
|
|
6357
6252
|
name: "Stepper",
|
|
6358
6253
|
props: {
|
|
@@ -6510,7 +6405,7 @@ var FrescoModal_default = /* @__PURE__ */ defineComponent({
|
|
|
6510
6405
|
focusId: {
|
|
6511
6406
|
type: String,
|
|
6512
6407
|
required: false,
|
|
6513
|
-
default:
|
|
6408
|
+
default: () => createFocusId("modal")
|
|
6514
6409
|
},
|
|
6515
6410
|
initialFocusId: {
|
|
6516
6411
|
type: String,
|
|
@@ -6674,7 +6569,7 @@ var FrescoPopover_default = /* @__PURE__ */ defineComponent({
|
|
|
6674
6569
|
focusId: {
|
|
6675
6570
|
type: String,
|
|
6676
6571
|
required: false,
|
|
6677
|
-
default:
|
|
6572
|
+
default: () => createFocusId("popover")
|
|
6678
6573
|
},
|
|
6679
6574
|
initialFocusId: {
|
|
6680
6575
|
type: String,
|
|
@@ -6819,9 +6714,6 @@ var FrescoPopover_default = /* @__PURE__ */ defineComponent({
|
|
|
6819
6714
|
});
|
|
6820
6715
|
//#endregion
|
|
6821
6716
|
//#region src/components/StatusBar.ts
|
|
6822
|
-
/**
|
|
6823
|
-
* StatusBar Component - Status bar (typically at bottom of screen)
|
|
6824
|
-
*/
|
|
6825
6717
|
const StatusBar = defineComponent({
|
|
6826
6718
|
name: "StatusBar",
|
|
6827
6719
|
props: {
|
|
@@ -6968,9 +6860,6 @@ var FrescoHeader_default = /* @__PURE__ */ defineComponent({
|
|
|
6968
6860
|
});
|
|
6969
6861
|
//#endregion
|
|
6970
6862
|
//#region src/components/KeyHint.ts
|
|
6971
|
-
/**
|
|
6972
|
-
* KeyHint Component - Display keyboard shortcut hints
|
|
6973
|
-
*/
|
|
6974
6863
|
const KeyHint = defineComponent({
|
|
6975
6864
|
name: "KeyHint",
|
|
6976
6865
|
props: {
|
|
@@ -7105,4 +6994,4 @@ var FrescoAvatar_default = /* @__PURE__ */ defineComponent({
|
|
|
7105
6994
|
//#endregion
|
|
7106
6995
|
export { FrescoFrameBuffer_default as A, FrescoNewline_default as B, RadioGroup as C, TextInput as D, TextArea as E, Code as F, Grid as G, ScrollBar_default as H, createCodeBuffer as I, FrescoStack_default as J, FrescoVStack_default as K, LineNumber as L, defaultMarkdownRenderer as M, parseMarkdown as N, FrescoLink_default as O, renderMarkdown as P, FrescoTransform_default as R, Confirm as S, FrescoSelect_default as T, Text as U, ScrollBox_default as V, FrescoCard_default as W, FrescoSpacer_default as X, FrescoDivider_default as Y, Box as Z, FrescoAlert_default as _, FrescoPopover_default as a, Form as b, FrescoBreadcrumb_default as c, FrescoTree_default as d, Table as f, FrescoBadge_default as g, Timer as h, StatusBar as i, FrescoMarkdown_default as j, Diff as k, FrescoTabs_default as l, FrescoTooltip_default as m, KeyHint as n, FrescoModal_default as o, FrescoList_default as p, FrescoHStack_default as q, FrescoHeader_default as r, Stepper as s, FrescoAvatar_default as t, FrescoMenu_default as u, ProgressBar as v, Checkbox as w, FrescoSlider_default as x, FrescoSpinner_default as y, FrescoStatic_default as z };
|
|
7107
6996
|
|
|
7108
|
-
//# sourceMappingURL=components-
|
|
6997
|
+
//# sourceMappingURL=components-0LBWpsQe.mjs.map
|