@kolkrabbi/kol-component 0.328.0 → 0.330.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/package.json +4 -4
- package/src/atoms/BezierPathEditor.jsx +171 -0
- package/src/atoms/FunctionPlot.jsx +109 -0
- package/src/atoms/OriginPicker.jsx +111 -0
- package/src/index.js +6 -0
- package/src/molecules/Combobox.jsx +5 -5
- package/src/molecules/ContextMenu.jsx +9 -39
- package/src/molecules/Dropdown.jsx +49 -72
- package/src/molecules/Menu.jsx +77 -38
- package/src/molecules/MenuItem.jsx +51 -53
- package/src/molecules/MultiSelect.jsx +44 -41
- package/src/molecules/ParamBindDot.jsx +79 -0
- package/src/molecules/ShapeDropdown.jsx +5 -5
- package/src/molecules/SplitToolButton.jsx +3 -2
- package/src/molecules/StepList.jsx +34 -8
- package/src/organisms/AppItemMenuProvider.jsx +4 -4
- package/src/organisms/ColorPickerPopover.jsx +7 -1
- package/src/organisms/LayerStack.jsx +7 -7
- package/src/organisms/MediaLibrary.jsx +4 -4
- package/src/organisms/MediaLibraryPages.jsx +46 -46
- package/src/organisms/NavRail.jsx +1 -1
- package/src/organisms/SettingsPanel.jsx +3 -6
- package/src/utilities/tone.js +4 -2
|
@@ -24,7 +24,7 @@ import SearchInput from '../molecules/SearchInput.jsx'
|
|
|
24
24
|
import TabsRow, { TABBAR_H } from '../molecules/TabsRow.jsx'
|
|
25
25
|
import { filterMedia, rankMedia } from '../utilities/mediaSearch.js'
|
|
26
26
|
import { useMasthead, mastheadTitleClass } from '../utilities/masthead.js'
|
|
27
|
-
import { MenuItem,
|
|
27
|
+
import { MenuItem, MenuRow, MenuDivider } from '../molecules/MenuItem.jsx'
|
|
28
28
|
import { Tooltip } from '../utilities/Popover.jsx'
|
|
29
29
|
import ContextMenu, { useContextMenu } from '../molecules/ContextMenu.jsx'
|
|
30
30
|
import useMarquee from '../hooks/useMarquee.js'
|
|
@@ -1035,8 +1035,8 @@ function TrashPanel({ trash, onClose, run, confirm }) {
|
|
|
1035
1035
|
const n = target.ids.length
|
|
1036
1036
|
return (
|
|
1037
1037
|
<>
|
|
1038
|
-
{trash.restore && <
|
|
1039
|
-
{trash.purge && <
|
|
1038
|
+
{trash.restore && <MenuRow iconLeft={<Icon name="refresh" size={14} />} onClick={() => restore(target.ids)}>{n > 1 ? `Restore ${n}` : 'Restore'}</MenuRow>}
|
|
1039
|
+
{trash.purge && <MenuRow iconLeft={<Icon name="trash" size={14} />} onClick={() => purge(target.ids)}>{n > 1 ? `Delete ${n} forever` : 'Delete forever'}</MenuRow>}
|
|
1040
1040
|
</>
|
|
1041
1041
|
)
|
|
1042
1042
|
}}
|
|
@@ -2683,17 +2683,17 @@ export function MediaLibraryBrowse({
|
|
|
2683
2683
|
{({ close }) => (
|
|
2684
2684
|
<div className="py-1 w-[200px]">
|
|
2685
2685
|
{STACK_VIEW_OPTIONS.map((opt) => (
|
|
2686
|
-
<
|
|
2686
|
+
<MenuRow
|
|
2687
2687
|
key={opt.value}
|
|
2688
2688
|
onClick={() => { setSettings({ ...settings, stackView: opt.value }); close() }}
|
|
2689
|
-
|
|
2689
|
+
indicator={(settings.stackView ?? 'list') === opt.value ? 'dot' : undefined}
|
|
2690
2690
|
>
|
|
2691
2691
|
{opt.label}
|
|
2692
|
-
</
|
|
2692
|
+
</MenuRow>
|
|
2693
2693
|
))}
|
|
2694
|
-
<
|
|
2694
|
+
<MenuDivider />
|
|
2695
2695
|
{SORT_OPTIONS.map((opt) => (
|
|
2696
|
-
<
|
|
2696
|
+
<MenuRow
|
|
2697
2697
|
key={opt.value}
|
|
2698
2698
|
/* tapping the ACTIVE key flips the direction, which is how
|
|
2699
2699
|
both references let you reverse without a second control */
|
|
@@ -2711,12 +2711,12 @@ export function MediaLibraryBrowse({
|
|
|
2711
2711
|
: undefined}
|
|
2712
2712
|
>
|
|
2713
2713
|
{opt.label}
|
|
2714
|
-
</
|
|
2714
|
+
</MenuRow>
|
|
2715
2715
|
))}
|
|
2716
2716
|
{onKinds && (
|
|
2717
2717
|
<>
|
|
2718
|
-
<
|
|
2719
|
-
<
|
|
2718
|
+
<MenuDivider />
|
|
2719
|
+
<MenuRow onClick={() => { onKinds(); close() }} kbd="K">File formats</MenuRow>
|
|
2720
2720
|
</>
|
|
2721
2721
|
)}
|
|
2722
2722
|
</div>
|
|
@@ -2864,29 +2864,29 @@ export function MediaLibraryBrowse({
|
|
|
2864
2864
|
const custom = (fa.items ?? []).filter((it) => !it.when || it.when(target))
|
|
2865
2865
|
const customItems = custom.length > 0 && (
|
|
2866
2866
|
<>
|
|
2867
|
-
<
|
|
2867
|
+
<MenuDivider />
|
|
2868
2868
|
{custom.map((it) => (
|
|
2869
|
-
<
|
|
2869
|
+
<MenuRow key={it.label} iconLeft={it.icon ? <Icon name={it.icon} size={14} /> : undefined} onClick={() => runAction(() => it.run(target))}>{it.label}</MenuRow>
|
|
2870
2870
|
))}
|
|
2871
2871
|
</>
|
|
2872
2872
|
)
|
|
2873
2873
|
if (many) {
|
|
2874
2874
|
return (
|
|
2875
2875
|
<>
|
|
2876
|
-
<
|
|
2877
|
-
<
|
|
2876
|
+
<MenuRow disabled>{many.length} selected</MenuRow>
|
|
2877
|
+
<MenuDivider />
|
|
2878
2878
|
{fa.move && (
|
|
2879
|
-
<
|
|
2879
|
+
<MenuRow iconLeft={<Icon name="arrow-right" size={14} />} onClick={() => doBatch(many, 'move', 'Move')}>Move {many.length} to…</MenuRow>
|
|
2880
2880
|
)}
|
|
2881
2881
|
{hasUrl && many.every((p) => !p.endsWith('/')) && (
|
|
2882
2882
|
<>
|
|
2883
|
-
<
|
|
2884
|
-
<
|
|
2885
|
-
{canTag && <
|
|
2883
|
+
<MenuRow iconLeft={<Icon name="copy" size={14} />} onClick={() => doCopyUrl(many)}>Copy {many.length} URLs</MenuRow>
|
|
2884
|
+
<MenuRow iconLeft={<Icon name="download" size={14} />} onClick={() => doDownload(many)}>Download {many.length}</MenuRow>
|
|
2885
|
+
{canTag && <MenuRow iconLeft={<Icon name="hash-01" size={14} />} onClick={() => doTags(many)}>Add tags to {many.length}…</MenuRow>}
|
|
2886
2886
|
</>
|
|
2887
2887
|
)}
|
|
2888
2888
|
{fa.remove && (
|
|
2889
|
-
<
|
|
2889
|
+
<MenuRow iconLeft={<Icon name="trash" size={14} />} onClick={() => doBatch(many, 'remove', 'Delete')}>Delete {many.length}</MenuRow>
|
|
2890
2890
|
)}
|
|
2891
2891
|
{customItems}
|
|
2892
2892
|
</>
|
|
@@ -2898,71 +2898,71 @@ export function MediaLibraryBrowse({
|
|
|
2898
2898
|
<>
|
|
2899
2899
|
{insFile && (!canInsert || canInsert(insFile)) && (
|
|
2900
2900
|
<>
|
|
2901
|
-
<
|
|
2902
|
-
<
|
|
2901
|
+
<MenuRow iconLeft={<Icon name="plus" size={14} />} onClick={() => { onInsert(insFile); close() }}>Insert</MenuRow>
|
|
2902
|
+
<MenuDivider />
|
|
2903
2903
|
</>
|
|
2904
2904
|
)}
|
|
2905
2905
|
{/* A PICKER'S TAP SELECTS (`tapSelects`), so Quick Look needs a door of its own on a
|
|
2906
2906
|
* phone — the menu (kol-fxr 2026-10-08). Only with `onPickFile`; others are unchanged. */}
|
|
2907
2907
|
{qlFile && (
|
|
2908
2908
|
<>
|
|
2909
|
-
<
|
|
2910
|
-
<
|
|
2909
|
+
<MenuRow iconLeft={<Icon name="eye-on" size={14} />} onClick={() => openQuickLook({ files: [qlFile], index: 0 })}>Quick Look</MenuRow>
|
|
2910
|
+
<MenuDivider />
|
|
2911
2911
|
</>
|
|
2912
2912
|
)}
|
|
2913
2913
|
{fa.createFolder && (
|
|
2914
|
-
<
|
|
2914
|
+
<MenuRow iconLeft={<Icon name="folder" size={14} />} onClick={() => doCreateFolder(isFolder ? target.path : (isLevel ? target.path : prefix))}>
|
|
2915
2915
|
New folder{isFolder ? ` in ${target.path.replace(/\/$/, '').split('/').pop()}` : ''}
|
|
2916
|
-
</
|
|
2916
|
+
</MenuRow>
|
|
2917
2917
|
)}
|
|
2918
2918
|
{/* NEW DOCUMENT is the writing page (a name, a type, fields for markdown); New file stays for
|
|
2919
2919
|
a client that cannot write text — it makes the empty file and nothing else */}
|
|
2920
2920
|
{canNewDoc ? (
|
|
2921
|
-
<
|
|
2921
|
+
<MenuRow iconLeft={<Icon name="file" size={14} />} onClick={() => newDocument(isFolder ? target.path : (isLevel ? target.path : prefix))}>
|
|
2922
2922
|
New document…
|
|
2923
|
-
</
|
|
2923
|
+
</MenuRow>
|
|
2924
2924
|
) : fa.createFile && (
|
|
2925
|
-
<
|
|
2925
|
+
<MenuRow iconLeft={<Icon name="file" size={14} />} onClick={() => doCreateFile(isFolder ? target.path : (isLevel ? target.path : prefix))}>
|
|
2926
2926
|
New file
|
|
2927
|
-
</
|
|
2927
|
+
</MenuRow>
|
|
2928
2928
|
)}
|
|
2929
2929
|
{dropFilesTo && !(target.type === 'file') && (
|
|
2930
|
-
<
|
|
2930
|
+
<MenuRow iconLeft={<Icon name="upload" size={14} />} onClick={() => doUpload(target.path)}>
|
|
2931
2931
|
{isFolder ? `Upload into ${target.path.replace(/\/$/, '').split('/').pop()}…` : 'Upload here…'}
|
|
2932
|
-
</
|
|
2932
|
+
</MenuRow>
|
|
2933
2933
|
)}
|
|
2934
|
-
{!isLevel && <
|
|
2934
|
+
{!isLevel && <MenuDivider />}
|
|
2935
2935
|
{!isLevel && fa.rename && (
|
|
2936
|
-
<
|
|
2936
|
+
<MenuRow iconLeft={<Icon name="edit" size={14} />} onClick={() => doRename(target.path, isFolder)}>Rename</MenuRow>
|
|
2937
2937
|
)}
|
|
2938
2938
|
{!isLevel && fa.move && (
|
|
2939
|
-
<
|
|
2939
|
+
<MenuRow iconLeft={<Icon name="arrow-right" size={14} />} onClick={() => doMove(target.path)}>Move to…</MenuRow>
|
|
2940
2940
|
)}
|
|
2941
2941
|
{/* A FOLDER GETS COPY URL TOO (user 2026-09-23) — through the SAME `mediaUrl`
|
|
2942
2942
|
seam a file goes through, so what a folder URL means is the consumer's call
|
|
2943
2943
|
(a CDN prefix, a listing, a signed path) and never this page's guess. No
|
|
2944
2944
|
Download: a folder is not an object to fetch. */}
|
|
2945
2945
|
{hasUrl && !isLevel && (
|
|
2946
|
-
<
|
|
2946
|
+
<MenuRow iconLeft={<Icon name="copy" size={14} />} onClick={() => doCopyUrl([target.path])}>Copy URL</MenuRow>
|
|
2947
2947
|
)}
|
|
2948
2948
|
{hasUrl && target.type === 'file' && (
|
|
2949
|
-
<
|
|
2949
|
+
<MenuRow iconLeft={<Icon name="download" size={14} />} onClick={() => doDownload([target.path])}>Download</MenuRow>
|
|
2950
2950
|
)}
|
|
2951
2951
|
{!isLevel && canTag && (
|
|
2952
|
-
<
|
|
2952
|
+
<MenuRow iconLeft={<Icon name="hash-01" size={14} />} onClick={() => doTags([target.path])}>Tags…</MenuRow>
|
|
2953
2953
|
)}
|
|
2954
2954
|
{!isLevel && canFavourite && (
|
|
2955
|
-
<
|
|
2955
|
+
<MenuRow iconLeft={<Icon name={isFavourite(target.path) ? 'star-solid' : 'star'} size={14} />} onClick={() => toggleFavourite(target.path)}>
|
|
2956
2956
|
{isFavourite(target.path) ? 'Remove from favourites' : 'Add to favourites'}
|
|
2957
|
-
</
|
|
2957
|
+
</MenuRow>
|
|
2958
2958
|
)}
|
|
2959
2959
|
{target.type === 'file' && canEdit && editKindOf(target.o ?? { key: target.path }) && (
|
|
2960
|
-
<
|
|
2960
|
+
<MenuRow iconLeft={<Icon name="edit" size={14} />} onClick={() => openEditor(objects.find((o) => o.key === target.path) ?? { key: target.path })}>Edit</MenuRow>
|
|
2961
2961
|
)}
|
|
2962
2962
|
{!isLevel && fa.remove && (
|
|
2963
2963
|
<>
|
|
2964
|
-
<
|
|
2965
|
-
<
|
|
2964
|
+
<MenuDivider />
|
|
2965
|
+
<MenuRow iconLeft={<Icon name="trash" size={14} />} onClick={() => doDelete(target.path, isFolder)}>Delete</MenuRow>
|
|
2966
2966
|
</>
|
|
2967
2967
|
)}
|
|
2968
2968
|
{customItems}
|
|
@@ -3398,11 +3398,11 @@ export function MediaLibraryLibrary({
|
|
|
3398
3398
|
{({ close }) => (
|
|
3399
3399
|
<div className="py-1 w-[200px]">
|
|
3400
3400
|
{LAYOUT_OPTIONS.map((opt) => (
|
|
3401
|
-
<
|
|
3401
|
+
<MenuRow key={opt.value} onClick={() => { setLayout(opt.value); close() }} indicator={layout === opt.value ? 'dot' : undefined}>{opt.label}</MenuRow>
|
|
3402
3402
|
))}
|
|
3403
|
-
<
|
|
3403
|
+
<MenuDivider />
|
|
3404
3404
|
{SORT_OPTIONS.map((opt) => (
|
|
3405
|
-
<
|
|
3405
|
+
<MenuRow key={opt.value} onClick={() => { handleSort(opt.value); close() }} shortcut={sortBy === opt.value ? <Icon name={sortDir === 'desc' ? 'arrow-down' : 'arrow-up'} size={11} /> : undefined}>{opt.label}</MenuRow>
|
|
3406
3406
|
))}
|
|
3407
3407
|
</div>
|
|
3408
3408
|
)}
|
|
@@ -129,7 +129,7 @@ const openWidth = () => {
|
|
|
129
129
|
* expanded — any width past CLOSED closes, CLOSED opens to the open width — so a click resets a custom width.
|
|
130
130
|
*
|
|
131
131
|
* THE LABEL THRESHOLD (LABELS): below it the rail is icons only — labels, chevrons and the mark's title hide (the
|
|
132
|
-
*
|
|
132
|
+
* max-width `hidden` container query on the rows, measured on the rail's content box = LABELS − its px-2 gutter), never
|
|
133
133
|
* a label clipped in a narrow strip. `onSnap` reports from the same threshold: crossings during a drag report live,
|
|
134
134
|
* a snap reports its target once at the start of the tween (as before) — the sub rows render only while it is true,
|
|
135
135
|
* because closed they would still take their height and push the rungs below them.
|
|
@@ -222,7 +222,7 @@ export const chipCls = (on) => `${CHIP_CLS} ${on ? 'kol-control--filled' : 'text
|
|
|
222
222
|
/**
|
|
223
223
|
* SettingsMulti — A many-of-many setting in one dropdown. a many-of-N control as ONE Dropdown (SettingsPanelApproved,
|
|
224
224
|
* 2026-08-27 — the kinds row): the trigger reads `N of M <noun>`, every entry
|
|
225
|
-
* toggles
|
|
225
|
+
* toggles with the list held open, the check icon marks the ones that are on (Dropdown `multiple`). No grouping.
|
|
226
226
|
* @param {Array} options [{ value, label }]
|
|
227
227
|
* @param {Array|Set} selected
|
|
228
228
|
* @param {Function} onToggle (value) => void
|
|
@@ -233,11 +233,8 @@ export const chipCls = (on) => `${CHIP_CLS} ${on ? 'kol-control--filled' : 'text
|
|
|
233
233
|
*/
|
|
234
234
|
export function SettingsMulti({ options = [], selected = [], onToggle, noun = 'kinds', tone = 'default', size = 'sm', variant, className = '' }) {
|
|
235
235
|
const on = selected instanceof Set ? selected : new Set(selected)
|
|
236
|
-
const opts =
|
|
237
|
-
|
|
238
|
-
...options.map((o) => ({ value: o.value, label: `${on.has(o.value) ? '✓ ' : ''}${o.label ?? String(o.value)}` })),
|
|
239
|
-
]
|
|
240
|
-
return <Dropdown size={size} variant={variant} tone={tone} value="__summary" options={opts} onChange={(v) => (v === '__summary' ? null : onToggle?.(v))} className={`w-full ${className}`.trim()} />
|
|
236
|
+
const opts = options.map((o) => ({ value: o.value, label: o.label ?? String(o.value) }))
|
|
237
|
+
return <Dropdown multiple label={`${on.size} of ${options.length} ${noun}`} size={size} variant={variant} tone={tone} value={on} options={opts} onChange={(v) => onToggle?.(v)} className={`w-full ${className}`.trim()} />
|
|
241
238
|
}
|
|
242
239
|
|
|
243
240
|
/**
|
package/src/utilities/tone.js
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
* toneClass — the control set's TONE, six values (tone-is-the-ground-axis,
|
|
3
3
|
* kol-client-olina 2026-09-03; the six-tone list is the user's).
|
|
4
4
|
*
|
|
5
|
-
* primary · secondary · inverted · outline · ghost · grey · sunken
|
|
5
|
+
* primary · secondary · inverted · outline · ghost · grey · faint · sunken
|
|
6
|
+
*
|
|
7
|
+
* `faint` (2026-10-31) is grey one step down, oq-06 — Dropdown's retired `variant="raised"`.
|
|
6
8
|
*
|
|
7
9
|
* `secondary` paints the PAGE SURFACE and `inverted` the text color as fill
|
|
8
10
|
* (tone-secondary-is-inverse, 2026-09-03; user: "that tone should be called
|
|
@@ -21,7 +23,7 @@
|
|
|
21
23
|
* it sits BELOW the plane it is on) — NOT `inverted`; one kol-website call
|
|
22
24
|
* still passes it, and it drops when that moves.
|
|
23
25
|
*/
|
|
24
|
-
export const TONES = ['primary', 'secondary', 'inverted', 'outline', 'ghost', 'grey', 'sunken']
|
|
26
|
+
export const TONES = ['primary', 'secondary', 'inverted', 'outline', 'ghost', 'grey', 'faint', 'sunken']
|
|
25
27
|
|
|
26
28
|
export const toneClass = (tone) =>
|
|
27
29
|
tone === 'inverse' ? 'kol-tone-sunken' : TONES.includes(tone) ? `kol-tone-${tone}` : ''
|