@vev/silke 1.1.6 → 1.1.8
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/CHANGELOG.md +14 -0
- package/dist/index.js +34 -34
- package/dist/index.js.LEGAL.txt +12 -12
- package/dist/styles.css +4416 -4020
- package/dist/types/components/index.d.ts +3 -2
- package/dist/types/components/silke-button/silke-dropdown-button.d.ts +8 -13
- package/dist/types/components/silke-card/silke-card-grid.d.ts +33 -1
- package/dist/types/components/silke-command-text-field/image-utils.d.ts +20 -0
- package/dist/types/components/silke-command-text-field/index.d.ts +4 -0
- package/dist/types/components/silke-command-text-field/silke-command-parser.d.ts +3 -0
- package/dist/types/components/silke-command-text-field/silke-command-parser.spec.d.ts +1 -0
- package/dist/types/components/silke-command-text-field/silke-command-text-field.d.ts +46 -0
- package/dist/types/components/silke-command-text-field/utils.d.ts +61 -0
- package/dist/types/components/silke-command-text-field/utils.spec.d.ts +1 -0
- package/dist/types/components/silke-conditions-input/utils.d.ts +1 -1
- package/dist/types/components/silke-form-schema/fields/color-field.d.ts +3 -0
- package/dist/types/components/silke-form-schema/schema-utils.d.ts +6 -1
- package/dist/types/components/silke-form-schema/silke-schema-fields.d.ts +1 -0
- package/dist/types/components/silke-image/silke-image.d.ts +2 -1
- package/dist/types/components/silke-list/index.d.ts +1 -0
- package/dist/types/components/silke-list/silke-list-item.d.ts +24 -6
- package/dist/types/components/silke-list/silke-list.d.ts +9 -9
- package/dist/types/components/silke-list/types.d.ts +19 -0
- package/dist/types/components/silke-list/utils.d.ts +3 -0
- package/dist/types/components/silke-navigation-link/silke-navigation-link.d.ts +1 -0
- package/dist/types/components/silke-overflow-menu/silke-overflow-menu.d.ts +6 -1
- package/dist/types/components/silke-popover-native/silke-popover-native.d.ts +3 -1
- package/dist/types/components/silke-shortcut-button/index.d.ts +1 -0
- package/dist/types/components/silke-shortcut-button/silke-shortcut-button.d.ts +15 -0
- package/dist/types/components/silke-tag/silke-tag.d.ts +1 -1
- package/dist/types/icons.d.ts +32 -0
- package/jest.config.js +2 -3
- package/package.json +7 -2
- package/src/_variables.scss +125 -129
- package/src/components/index.ts +3 -2
- package/src/components/silke-action-box/silke-action-box.scss +2 -3
- package/src/components/silke-alert-banner/silke-alert-banner.scss +9 -10
- package/src/components/silke-autocomplete-field/autocomplete-item.tsx +2 -2
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.scss +18 -12
- package/src/components/silke-autocomplete-field/silke-autocomplete-popup-native.tsx +3 -2
- package/src/components/silke-autocomplete-field/silke-autocomplete-popup.tsx +63 -44
- package/src/components/silke-box/silke-box.mdx +321 -21
- package/src/components/silke-box/silke-box.scss +5 -5
- package/src/components/silke-breadcrumbs/silke-breadcrumb.mdx +147 -9
- package/src/components/silke-breadcrumbs/silke-breadcrumb.scss +3 -3
- package/src/components/silke-button/silke-big-button.scss +1 -1
- package/src/components/silke-button/silke-button.scss +24 -15
- package/src/components/silke-button/silke-dropdown-button.mdx +67 -0
- package/src/components/silke-button/silke-dropdown-button.tsx +40 -122
- package/src/components/silke-card/silke-card-grid.tsx +5 -3
- package/src/components/silke-card/silke-card.scss +8 -7
- package/src/components/silke-card/silke-card.tsx +7 -1
- package/src/components/silke-checkbox/silke-checkbox.mdx +139 -14
- package/src/components/silke-checkbox/silke-checkbox.scss +11 -11
- package/src/components/silke-color-picker/color-picker.scss +8 -8
- package/src/components/silke-color-swatches/silke-color-swatches.mdx +130 -0
- package/src/components/silke-command-text-field/image-utils.ts +71 -0
- package/src/components/silke-command-text-field/index.ts +12 -0
- package/src/components/silke-command-text-field/silke-command-parser.spec.ts +89 -0
- package/src/components/silke-command-text-field/silke-command-parser.ts +47 -0
- package/src/components/silke-command-text-field/silke-command-text-field.mdx +301 -0
- package/src/components/silke-command-text-field/silke-command-text-field.module.scss +119 -0
- package/src/components/silke-command-text-field/silke-command-text-field.tsx +672 -0
- package/src/components/silke-command-text-field/utils.spec.ts +366 -0
- package/src/components/silke-command-text-field/utils.ts +287 -0
- package/src/components/silke-conditions-input/silke-conditions-input.scss +4 -4
- package/src/components/silke-content-column/silke-content-column.scss +1 -1
- package/src/components/silke-context-menu/silke-context-menu.scss +3 -4
- package/src/components/silke-context-menu/silke-context-menu.tsx +1 -1
- package/src/components/silke-css-number-field/silke-css-number-field.scss +14 -12
- package/src/components/silke-divider/silke-divider.mdx +154 -32
- package/src/components/silke-divider/silke-divider.scss +3 -2
- package/src/components/silke-drawer/silke-drawer.scss +6 -2
- package/src/components/silke-form/silke-form.mdx +254 -27
- package/src/components/silke-form-schema/fields/array-field-inline.tsx +1 -0
- package/src/components/silke-form-schema/fields/array-field-modal.tsx +9 -4
- package/src/components/silke-form-schema/fields/array-field.tsx +27 -3
- package/src/components/silke-form-schema/fields/color-field.tsx +36 -0
- package/src/components/silke-form-schema/fields/styles.scss +34 -35
- package/src/components/silke-form-schema/schema-utils.ts +27 -1
- package/src/components/silke-form-schema/silke-schema-field.tsx +2 -0
- package/src/components/silke-form-schema/silke-schema-fields.tsx +4 -3
- package/src/components/silke-gradient-picker/silke-gradient-picker.module.scss +2 -2
- package/src/components/silke-icon/silke-icon.mdx +212 -8
- package/src/components/silke-icon/silke-icon.scss +10 -2
- package/src/components/silke-icon/silke-icon.tsx +1 -0
- package/src/components/silke-icon/silke-stacked-icon.scss +42 -45
- package/src/components/silke-icon-browser/silke-icon-browser.mdx +143 -0
- package/src/components/silke-image/silke-image-color-backdrop.scss +6 -6
- package/src/components/silke-image/silke-image.mdx +189 -41
- package/src/components/silke-image/silke-image.scss +3 -3
- package/src/components/silke-image/silke-image.tsx +14 -1
- package/src/components/silke-link/silke-link.scss +3 -5
- package/src/components/silke-list/index.ts +1 -0
- package/src/components/silke-list/silke-list-item.mdx +83 -0
- package/src/components/silke-list/silke-list-item.scss +119 -0
- package/src/components/silke-list/silke-list-item.tsx +137 -12
- package/src/components/silke-list/silke-list.mdx +108 -13
- package/src/components/silke-list/silke-list.scss +8 -15
- package/src/components/silke-list/silke-list.tsx +63 -9
- package/src/components/silke-list/types.ts +22 -0
- package/src/components/silke-list/utils.ts +24 -0
- package/src/components/silke-loader/silke-loader.mdx +139 -5
- package/src/components/silke-loader/silke-loader.scss +1 -1
- package/src/components/silke-modal/silke-modal.scss +9 -9
- package/src/components/silke-navigation-link/silke-navigation-link.mdx +27 -2
- package/src/components/silke-navigation-link/silke-navigation-link.scss +34 -40
- package/src/components/silke-navigation-link/silke-navigation-link.tsx +7 -6
- package/src/components/silke-overflow-menu/silke-overflow-menu.mdx +228 -31
- package/src/components/silke-overflow-menu/silke-overflow-menu.scss +8 -8
- package/src/components/silke-overflow-menu/silke-overflow-menu.tsx +14 -8
- package/src/components/silke-popover/silke-popover.scss +5 -5
- package/src/components/silke-popover-native/silke-popover-native.scss +93 -78
- package/src/components/silke-popover-native/silke-popover-native.tsx +4 -0
- package/src/components/silke-popover-native/use-popover-positioning.ts +1 -3
- package/src/components/silke-progress-indicator/silke-progress-indicator.scss +1 -1
- package/src/components/silke-radio-button/silke-radio-button.scss +18 -11
- package/src/components/silke-search-field/silke-search-field.mdx +161 -7
- package/src/components/silke-shortcut-button/index.ts +1 -0
- package/src/components/silke-shortcut-button/silke-shortcut-button.mdx +89 -0
- package/src/components/silke-shortcut-button/silke-shortcut-button.scss +145 -0
- package/src/components/silke-shortcut-button/silke-shortcut-button.tsx +55 -0
- package/src/components/silke-skeleton/silke-skeleton.mdx +109 -0
- package/src/components/silke-skeleton/silke-skeleton.scss +1 -1
- package/src/components/silke-slider/silke-slider.module.scss +19 -19
- package/src/components/silke-sortable-list/silke-nested-sortable-list.scss +3 -3
- package/src/components/silke-sortable-list/silke-sortable-list.scss +4 -5
- package/src/components/silke-table/silke-table.scss +1 -1
- package/src/components/silke-tabs/silke-tabs.scss +3 -3
- package/src/components/silke-tag/silke-tag.mdx +179 -43
- package/src/components/silke-tag/silke-tag.scss +50 -13
- package/src/components/silke-tag/silke-tag.tsx +17 -7
- package/src/components/silke-text/silke-text.scss +6 -4
- package/src/components/silke-text/silke-title.scss +7 -14
- package/src/components/silke-text-field/silke-text-field.scss +9 -9
- package/src/components/silke-text-field/silke-text-field.tsx +1 -1
- package/src/components/silke-tile/silke-tile.scss +7 -3
- package/src/components/silke-toast-notification/silke-toast-notification.scss +4 -5
- package/src/components/silke-toggle/silke-toggle.mdx +163 -33
- package/src/components/silke-toggle/silke-toggle.scss +4 -4
- package/src/components/silke-toolbar/silke-toolbar.scss +1 -1
- package/src/components/silke-tooltip/silke-shortcuts.tsx +3 -3
- package/src/components/silke-tooltip/silke-tooltip.scss +11 -16
- package/src/components/silke-variables-wrapper/silke-variables-wrapper.scss +9 -7
- package/src/components/silke-virtual/silke-virtual.mdx +161 -0
- package/src/components/silke-virtual/silke-virtual.scss +8 -8
- package/src/icons.tsx +58 -1
- package/src/styles/core.scss +42 -45
- package/src/styles/math.scss +66 -66
- package/tsconfig.build.json +2 -6
- package/tsconfig.build.tsbuildinfo +1 -1
- package/tsconfig.json +3 -14
- package/dist/types/components/silke-action-list/index.d.ts +0 -1
- package/dist/types/components/silke-action-list/silke-action-list.d.ts +0 -11
- package/dist/types/components/silke-list-card/index.d.ts +0 -1
- package/dist/types/components/silke-list-card/silke-list-card.d.ts +0 -14
- package/src/components/silke-action-list/index.ts +0 -1
- package/src/components/silke-action-list/silke-action-list.mdx +0 -48
- package/src/components/silke-action-list/silke-action-list.scss +0 -21
- package/src/components/silke-action-list/silke-action-list.tsx +0 -85
- package/src/components/silke-list-card/index.ts +0 -1
- package/src/components/silke-list-card/silke-list-card.mdx +0 -46
- package/src/components/silke-list-card/silke-list-card.scss +0 -57
- package/src/components/silke-list-card/silke-list-card.tsx +0 -63
|
@@ -9,6 +9,7 @@ export * from './silke-color-palettes';
|
|
|
9
9
|
export * from './silke-color-swatches';
|
|
10
10
|
export * from './silke-content-column';
|
|
11
11
|
export * from './silke-context-menu';
|
|
12
|
+
export * from './silke-command-text-field';
|
|
12
13
|
export * from './silke-divider';
|
|
13
14
|
export * from './silke-drawer';
|
|
14
15
|
export * from './silke-form-schema';
|
|
@@ -17,7 +18,6 @@ export * from './silke-iframe-portal';
|
|
|
17
18
|
export * from './silke-image';
|
|
18
19
|
export * from './silke-link';
|
|
19
20
|
export * from './silke-list';
|
|
20
|
-
export * from './silke-list-card';
|
|
21
21
|
export * from './silke-loader';
|
|
22
22
|
export * from './silke-modal';
|
|
23
23
|
export * from './silke-navigation-link';
|
|
@@ -39,8 +39,9 @@ export * from './silke-tile';
|
|
|
39
39
|
export * from './silke-toolbar';
|
|
40
40
|
export * from './silke-tooltip';
|
|
41
41
|
export * from './silke-action-box';
|
|
42
|
+
export * from './silke-shortcut-button';
|
|
42
43
|
export * from './silke-popover-native';
|
|
43
|
-
export * from './silke-
|
|
44
|
+
export * from './silke-list';
|
|
44
45
|
export * from './silke-autocomplete-field';
|
|
45
46
|
export * from './silke-checkbox';
|
|
46
47
|
export * from './silke-color-picker';
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { SilkeButtonProps } from './silke-button';
|
|
3
2
|
import { SilkePopoverProps } from '../silke-popover';
|
|
4
|
-
import {
|
|
3
|
+
import type { SilkeListItemType } from '../silke-list/types';
|
|
4
|
+
import { PopoverPlacement } from '../silke-popover-native/types';
|
|
5
5
|
export type SilkeDropdownButtonProps = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* What triggers the opening of the overflow menu
|
|
10
|
-
* @default "click"
|
|
11
|
-
*/
|
|
12
|
-
trigger?: 'click' | 'right-click';
|
|
13
|
-
onToggleOpen?: (open: boolean) => void;
|
|
14
|
-
/** Pass items or children */
|
|
15
|
-
items?: (SilkeOverflowMenuItem | React.ReactElement | 'divider')[] | (() => (SilkeOverflowMenuItem | React.ReactElement | 'divider')[]);
|
|
6
|
+
items?: SilkeListItemType[];
|
|
7
|
+
placement?: PopoverPlacement;
|
|
16
8
|
matchWidth?: boolean;
|
|
9
|
+
animate?: boolean;
|
|
10
|
+
size?: 's' | 'base';
|
|
11
|
+
closeOnSelect?: boolean;
|
|
17
12
|
} & SilkeButtonProps & Omit<SilkePopoverProps, 'anchor' | 'hide' | 'children' | 'kind'>;
|
|
18
|
-
export declare function SilkeDropdownButton({
|
|
13
|
+
export declare function SilkeDropdownButton({ label, icon, items, offsetX, offsetY, placement, matchWidth, size, animate, closeOnSelect, ...rest }: SilkeDropdownButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,5 +6,37 @@ type SilkeCardGridProps = {
|
|
|
6
6
|
loading?: boolean;
|
|
7
7
|
} & Omit<BoxDivProps, 'tag' | 'gap' | 'size'>;
|
|
8
8
|
export declare function SilkeCardGrid({ loading, children, small, className, style, ...rest }: SilkeCardGridProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export declare
|
|
9
|
+
export declare const SilkeSkeletonCard: React.ForwardRefExoticComponent<{
|
|
10
|
+
tag?: "div";
|
|
11
|
+
} & Omit<React.HTMLAttributes<HTMLDivElement>, "color"> & {
|
|
12
|
+
column?: boolean;
|
|
13
|
+
fill?: boolean;
|
|
14
|
+
gap?: import("..").BoxSpace;
|
|
15
|
+
pad?: import("..").BoxSpace;
|
|
16
|
+
vPad?: import("..").BoxSpace;
|
|
17
|
+
hPad?: import("..").BoxSpace;
|
|
18
|
+
size?: import("..").BoxSize;
|
|
19
|
+
height?: import("..").BoxSize;
|
|
20
|
+
width?: import("..").BoxSize;
|
|
21
|
+
minHeight?: import("..").BoxSize;
|
|
22
|
+
minWidth?: import("..").BoxSize;
|
|
23
|
+
bg?: import("../..").SilkeColor | "blur";
|
|
24
|
+
bgHover?: import("../..").SilkeColor;
|
|
25
|
+
color?: import("../..").SilkeColor;
|
|
26
|
+
rounded?: boolean | "tiny" | "small" | "medium" | "full";
|
|
27
|
+
shadow?: "level1" | "level2" | "level3" | "level4";
|
|
28
|
+
overflow?: "hidden" | "scroll-y";
|
|
29
|
+
cursor?: "pointer" | "grab" | "text";
|
|
30
|
+
userSelect?: "none" | "text";
|
|
31
|
+
colorHover?: import("../..").SilkeColor;
|
|
32
|
+
aspectRatio?: "16:9" | "4:3" | "1:1";
|
|
33
|
+
flex?: boolean;
|
|
34
|
+
wrap?: boolean;
|
|
35
|
+
align?: import("..").BoxAlign | [import("..").BoxAlign, import("..").BoxAlign];
|
|
36
|
+
vAlign?: import("..").BoxAlign;
|
|
37
|
+
hAlign?: import("..").BoxAlign;
|
|
38
|
+
debug?: boolean;
|
|
39
|
+
scroll?: boolean | "show";
|
|
40
|
+
rel?: string;
|
|
41
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
10
42
|
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SilkeImageValue } from './utils';
|
|
2
|
+
/**
|
|
3
|
+
* Reads a File and converts it to a SilkeImageValue with base64 data.
|
|
4
|
+
* Returns a promise that resolves with the image value or null if reading fails.
|
|
5
|
+
*/
|
|
6
|
+
export declare function fileToImageValue(file: File): Promise<SilkeImageValue | null>;
|
|
7
|
+
/**
|
|
8
|
+
* Extracts the first image file from a ClipboardEvent.
|
|
9
|
+
* Returns the File or null if no image is found.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getImageFromClipboard(e: React.ClipboardEvent): File | null;
|
|
12
|
+
/**
|
|
13
|
+
* Extracts the first image file from a DragEvent.
|
|
14
|
+
* Returns the File or null if no image is found.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getImageFromDragEvent(e: DragEvent): File | null;
|
|
17
|
+
/**
|
|
18
|
+
* Generates a data URL from a SilkeImageValue for use in img src.
|
|
19
|
+
*/
|
|
20
|
+
export declare function imageValueToDataUrl(img: SilkeImageValue): string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { fileToImageValue, imageValueToDataUrl } from './image-utils';
|
|
2
|
+
export { parseTextToSilkeCommands } from './silke-command-parser';
|
|
3
|
+
export * from './silke-command-text-field';
|
|
4
|
+
export { SilkeCommand, SilkeCommandTextFieldValue, SilkeCommandType, SilkeImageValue, SilkeTextValue, convertSilkeCommandsToString, isImage, } from './utils';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SilkeTextFieldOutlineProps } from '../silke-text-field/silke-text-field-outline';
|
|
3
|
+
import { SilkeCommand, SilkeCommandTextFieldValue } from './utils';
|
|
4
|
+
export type SilkeCommandTextFieldProps = Omit<SilkeTextFieldOutlineProps, 'children'> & {
|
|
5
|
+
autoFocus?: boolean;
|
|
6
|
+
availableCommands: SilkeCommand[];
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/** When true, images cannot be added via paste or drag-and-drop */
|
|
9
|
+
disableImages?: boolean;
|
|
10
|
+
name?: string;
|
|
11
|
+
onChange: (value: SilkeCommandTextFieldValue[]) => void;
|
|
12
|
+
onCommandFocus?: (index: number, command: SilkeCommandTextFieldValue | undefined) => void;
|
|
13
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
14
|
+
onSuggestions?: (suggestions: SilkeCommand[]) => void;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
value: SilkeCommandTextFieldValue[];
|
|
17
|
+
};
|
|
18
|
+
export type SilkeCommandTextFieldHandle = {
|
|
19
|
+
/** Remove focus from the input */
|
|
20
|
+
blur: () => void;
|
|
21
|
+
/** Focus the input */
|
|
22
|
+
focus: () => void;
|
|
23
|
+
/** Get the current value as a string */
|
|
24
|
+
toString: (value?: SilkeCommandTextFieldValue[]) => string;
|
|
25
|
+
/**
|
|
26
|
+
* Update command in the commands array.
|
|
27
|
+
* @param command - the command to update
|
|
28
|
+
* @param index - defaults to active index, use -1 to append
|
|
29
|
+
*/
|
|
30
|
+
update: (command: SilkeCommand, index?: number) => void;
|
|
31
|
+
};
|
|
32
|
+
declare const SilkeCommandTextField: React.ForwardRefExoticComponent<Omit<SilkeTextFieldOutlineProps, "children"> & {
|
|
33
|
+
autoFocus?: boolean;
|
|
34
|
+
availableCommands: SilkeCommand[];
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
/** When true, images cannot be added via paste or drag-and-drop */
|
|
37
|
+
disableImages?: boolean;
|
|
38
|
+
name?: string;
|
|
39
|
+
onChange: (value: SilkeCommandTextFieldValue[]) => void;
|
|
40
|
+
onCommandFocus?: (index: number, command: SilkeCommandTextFieldValue | undefined) => void;
|
|
41
|
+
onKeyDown?: (e: React.KeyboardEvent<HTMLDivElement>) => void;
|
|
42
|
+
onSuggestions?: (suggestions: SilkeCommand[]) => void;
|
|
43
|
+
placeholder?: string;
|
|
44
|
+
value: SilkeCommandTextFieldValue[];
|
|
45
|
+
} & React.RefAttributes<SilkeCommandTextFieldHandle>>;
|
|
46
|
+
export { SilkeCommandTextField };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export declare enum SilkeCommandType {
|
|
2
|
+
ACTION = "/",
|
|
3
|
+
MENTION = "@"
|
|
4
|
+
}
|
|
5
|
+
export type SilkeCommand = {
|
|
6
|
+
partialMatch?: boolean;
|
|
7
|
+
type: SilkeCommandType;
|
|
8
|
+
value: string;
|
|
9
|
+
};
|
|
10
|
+
export type SilkeTextValue = {
|
|
11
|
+
type: 'text';
|
|
12
|
+
value: string;
|
|
13
|
+
};
|
|
14
|
+
export type SilkeImageValue = {
|
|
15
|
+
type: 'image';
|
|
16
|
+
/** Base64-encoded image data */
|
|
17
|
+
data: string;
|
|
18
|
+
/** MIME type (e.g., 'image/png', 'image/jpeg') */
|
|
19
|
+
mimeType: string;
|
|
20
|
+
/** Optional filename */
|
|
21
|
+
name?: string;
|
|
22
|
+
};
|
|
23
|
+
export type SilkeCommandTextFieldValue = SilkeCommand | SilkeTextValue | SilkeImageValue;
|
|
24
|
+
/** Key direction mappings for navigation and editing */
|
|
25
|
+
export declare const KEY_DIRECTION: Record<string, number>;
|
|
26
|
+
/** Get the caret offset within a contentEditable element */
|
|
27
|
+
export declare function getCaretOffset(element: HTMLDivElement | null): number;
|
|
28
|
+
/** Check if there is a text selection with length > 0 */
|
|
29
|
+
export declare function hasSelectionLength(): boolean;
|
|
30
|
+
/** Set the caret to a specific character offset within a contentEditable element */
|
|
31
|
+
export declare function setCaretOffset(element: HTMLDivElement | null, offset: number): void;
|
|
32
|
+
/** Escape HTML special characters to prevent XSS */
|
|
33
|
+
export declare function escapeHtml(text: string): string;
|
|
34
|
+
/** Get the index of the command at a given caret position */
|
|
35
|
+
export declare function getActiveCommandIndex(caretPos: number, value: SilkeCommandTextFieldValue[]): number;
|
|
36
|
+
/** Calculate total text length up to a given index */
|
|
37
|
+
export declare function getTextLength(value: SilkeCommandTextFieldValue[], index?: number): number;
|
|
38
|
+
/** Get the rendered length of a single command/text value */
|
|
39
|
+
export declare function getItemLength(item: SilkeCommandTextFieldValue): number;
|
|
40
|
+
/** Convert command values to HTML for rendering (excludes images) */
|
|
41
|
+
export declare function valueToHtml(value: SilkeCommandTextFieldValue[], styles: Record<string, string>): string;
|
|
42
|
+
/** Convert command values to plain string (excludes images) */
|
|
43
|
+
export declare function convertSilkeCommandsToString(value: SilkeCommandTextFieldValue[]): string;
|
|
44
|
+
/** Check if a command value is a non-text, non-image command */
|
|
45
|
+
export declare function isSilkeCommand(value: SilkeCommandTextFieldValue | undefined): value is SilkeCommand;
|
|
46
|
+
/** Check if a command value is a text segment */
|
|
47
|
+
export declare function isText(value: SilkeCommandTextFieldValue | undefined): value is SilkeTextValue;
|
|
48
|
+
/** Check if a command value is an image */
|
|
49
|
+
export declare function isImage(value: SilkeCommandTextFieldValue | undefined): value is SilkeImageValue;
|
|
50
|
+
/**
|
|
51
|
+
* Calculate a match score for a command against a search query.
|
|
52
|
+
* Higher scores indicate better matches.
|
|
53
|
+
* Returns -1 if there's no match.
|
|
54
|
+
*/
|
|
55
|
+
export declare function getCommandMatchScore(command: SilkeCommand, query: string): number;
|
|
56
|
+
/**
|
|
57
|
+
* Filter and sort commands based on partial matching against a query.
|
|
58
|
+
* Returns commands sorted by match quality (best matches first).
|
|
59
|
+
* If query is empty, returns all commands of the given type sorted alphabetically.
|
|
60
|
+
*/
|
|
61
|
+
export declare function filterAndSortCommands(commands: SilkeCommand[], query: string, type: SilkeCommandType): SilkeCommand[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,4 +8,4 @@ export declare const getSuggestions: (searchValue: string, variables: SilkeCSSCo
|
|
|
8
8
|
export declare const getSystemSuggestionOptions: (value: string | number | boolean, systemOptions?: VevConditionSuggestion[]) => ConditionSuggestion[];
|
|
9
9
|
export declare const getWidgetSuggestionOptions: (value: string | number | boolean, widgetOptions?: VevProps[]) => ConditionSuggestion[];
|
|
10
10
|
export declare const isWidgetOption: (value: string | number | boolean, widgetOptions?: VevProps[]) => boolean;
|
|
11
|
-
export declare const getWidgetOptionType: (value: string | number | boolean, widgetOptions?: VevProps[]) => "string" | "number" | "boolean" | "object" | "link" | "audio" | "menu" | "select" | "video" | "image" | "layout" | "icon" | "upload" | "divider" | "variable" | "array" | "event" | "widgetSelect" | "mainComponent" | undefined;
|
|
11
|
+
export declare const getWidgetOptionType: (value: string | number | boolean, widgetOptions?: VevProps[]) => "string" | "number" | "boolean" | "object" | "link" | "audio" | "menu" | "select" | "video" | "image" | "color" | "layout" | "icon" | "upload" | "divider" | "variable" | "array" | "event" | "widgetSelect" | "mainComponent" | undefined;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { EvalCallback, Schema, SchemaContextModel } from '@vev/utils';
|
|
1
|
+
import { EvalCallback, Schema, SchemaContextModel, VevProps } from '@vev/utils';
|
|
2
2
|
export declare function isEvalCallback(value: any): value is EvalCallback;
|
|
3
3
|
type InitialValue = {
|
|
4
4
|
[key: string]: any;
|
|
5
5
|
};
|
|
6
6
|
export declare function getSchemaInitialValue<T extends InitialValue>(schema: Schema, context: Omit<SchemaContextModel, 'actions'>): Promise<InitialValue>;
|
|
7
|
+
/**
|
|
8
|
+
* Synchronously compute default/initial values from a schema.
|
|
9
|
+
* Handles static initialValue only (skips eval callbacks and functions).
|
|
10
|
+
*/
|
|
11
|
+
export declare function getSchemaDefaultValue(schema: VevProps | VevProps[]): InitialValue;
|
|
7
12
|
export declare function useStorageField<T>(name: string, storageScope: 'project' | 'workspace' | 'account'): {
|
|
8
13
|
value: T | undefined;
|
|
9
14
|
onChange: (value: T) => Promise<void>;
|
|
@@ -6,5 +6,6 @@ export type SilkeImageProps = {
|
|
|
6
6
|
icon?: IEmojiIcon | SilkeIcons;
|
|
7
7
|
alt?: string;
|
|
8
8
|
avatar?: BoxSize | true;
|
|
9
|
+
bgColor?: string;
|
|
9
10
|
} & BoxProps;
|
|
10
|
-
export declare function SilkeImage({ src, alt, avatar, icon, draggable, ...rest }: SilkeImageProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function SilkeImage({ src, alt, avatar, icon, draggable, bgColor, ...rest }: SilkeImageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SilkeListItemData } from './types';
|
|
3
|
+
import { IEmojiIcon } from '@vev/utils';
|
|
4
|
+
import { SilkeBox } from '../silke-box';
|
|
5
|
+
import { SilkeIcons } from '../silke-icon';
|
|
6
|
+
import { SilkeTagProps } from '../silke-tag';
|
|
7
|
+
type SilkeListItemProps = {
|
|
8
|
+
label: string | React.ReactNode;
|
|
9
|
+
subLabel?: string | React.ReactNode;
|
|
10
|
+
icon?: IEmojiIcon | SilkeIcons | React.ReactElement;
|
|
11
|
+
items?: SilkeListItemData[];
|
|
12
|
+
link?: string;
|
|
13
|
+
size?: 's' | 'base';
|
|
14
|
+
tag?: SilkeTagProps;
|
|
15
|
+
active?: boolean;
|
|
16
|
+
gap?: boolean;
|
|
17
|
+
maxHeight?: number;
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
alwaysShowChildren?: boolean;
|
|
20
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;
|
|
21
|
+
onSelect?: () => void;
|
|
22
|
+
} & Omit<React.ComponentProps<typeof SilkeBox>, 'children' | 'tag'>;
|
|
23
|
+
export declare const SilkeListItem: ({ label, subLabel, icon, items, link, tag, active, size, gap, maxHeight, children, alwaysShowChildren, onClick, onSelect, ...rest }: SilkeListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
export declare function SilkeList({
|
|
1
|
+
import type { SilkeListItemType } from './types';
|
|
2
|
+
type SilkeListProps = {
|
|
3
|
+
items: SilkeListItemType[] | (() => SilkeListItemType[]);
|
|
4
|
+
size?: 's' | 'base';
|
|
5
|
+
gap?: boolean;
|
|
6
|
+
maxHeight?: number;
|
|
7
|
+
onSelect?: (item: SilkeListItemType) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function SilkeList({ items, size, gap, maxHeight, onSelect }: SilkeListProps): import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IEmojiIcon } from '@vev/utils';
|
|
3
|
+
import { SilkeIcons } from '../silke-icon';
|
|
4
|
+
import { SilkeTagProps } from '../silke-tag';
|
|
5
|
+
export type SilkeListItemData = {
|
|
6
|
+
label: string;
|
|
7
|
+
groupLabel?: string;
|
|
8
|
+
icon?: IEmojiIcon | SilkeIcons | React.ReactElement;
|
|
9
|
+
tag?: SilkeTagProps;
|
|
10
|
+
items?: SilkeListItemData[];
|
|
11
|
+
link?: string;
|
|
12
|
+
active?: boolean;
|
|
13
|
+
onClick?: () => void;
|
|
14
|
+
};
|
|
15
|
+
export type SilkeListItemType = SilkeListItemData | React.ReactElement | 'divider';
|
|
16
|
+
export type GroupedSilkeListItems = {
|
|
17
|
+
groupLabel?: string;
|
|
18
|
+
items: SilkeListItemType[];
|
|
19
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { GroupedSilkeListItems, SilkeListItemData, SilkeListItemType } from './types';
|
|
2
|
+
export declare function isSilkeListItem(item: SilkeListItemType): item is SilkeListItemData;
|
|
3
|
+
export declare function groupSilkeListItems(items: SilkeListItemType[]): GroupedSilkeListItems[];
|
|
@@ -17,5 +17,10 @@ export declare function SilkeOverflowMenu({ children, label, open: externalOpen,
|
|
|
17
17
|
export type SilkeOverflowMenuItem = {
|
|
18
18
|
label: React.ReactNode;
|
|
19
19
|
kind?: 'default' | 'danger' | 'selected';
|
|
20
|
+
groupLabel?: string;
|
|
20
21
|
} & Omit<SilkeButtonProps, 'height' | 'width' | 'align' | 'vAlign' | 'hAlign' | 'kind'>;
|
|
21
|
-
export declare const SilkeOverflowMenuItem:
|
|
22
|
+
export declare const SilkeOverflowMenuItem: React.ForwardRefExoticComponent<{
|
|
23
|
+
label: React.ReactNode;
|
|
24
|
+
kind?: "default" | "danger" | "selected";
|
|
25
|
+
groupLabel?: string;
|
|
26
|
+
} & Omit<SilkeButtonProps, "align" | "height" | "width" | "vAlign" | "hAlign" | "kind"> & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -29,7 +29,9 @@ export interface SilkePopoverNativeProps {
|
|
|
29
29
|
hint?: boolean;
|
|
30
30
|
/** Should the popover be animated */
|
|
31
31
|
animate?: boolean;
|
|
32
|
+
/** Shadow level of the popover */
|
|
33
|
+
shadow?: 'level1' | 'level2' | 'level3' | 'level4';
|
|
32
34
|
/** Triggered when the popover is dismissed (via light dismiss or escape key) */
|
|
33
35
|
onRequestClose?: () => void;
|
|
34
36
|
}
|
|
35
|
-
export declare function SilkePopoverNative({ anchor, children, hide, id, placement, anchorSlot, align, justify, offsetX, offsetY, hideBackdrop, matchWidth, hint, animate, onRequestClose, }: SilkePopoverNativeProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
export declare function SilkePopoverNative({ anchor, children, hide, id, placement, anchorSlot, align, justify, offsetX, offsetY, hideBackdrop, matchWidth, hint, animate, shadow, onRequestClose, }: SilkePopoverNativeProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './silke-shortcut-button';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { KeyboardEventCode } from '@vev/utils';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { SilkeIcons } from '../silke-icon';
|
|
4
|
+
export type SilkeShortcutButtonProps = {
|
|
5
|
+
label: string;
|
|
6
|
+
icon: SilkeIcons;
|
|
7
|
+
shortcut?: KeyboardEventCode[];
|
|
8
|
+
compressed?: boolean;
|
|
9
|
+
centered?: boolean;
|
|
10
|
+
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
11
|
+
};
|
|
12
|
+
export declare function SilkeShortcutButton({ label, icon, shortcut, compressed, centered, onClick, }: SilkeShortcutButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare namespace SilkeShortcutButton {
|
|
14
|
+
var displayName: string;
|
|
15
|
+
}
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { BoxProps, BoxSpace } from '../silke-box';
|
|
3
3
|
import { SilkeIcons } from '../silke-icon';
|
|
4
4
|
export type SilkeTagKind = 'primary' | 'secondary';
|
|
5
|
-
export type SilkeTagColor = 'yellow' | 'green' | 'red' | 'gray' | 'blue' | 'purple' | 'dark';
|
|
5
|
+
export type SilkeTagColor = 'yellow' | 'green' | 'red' | 'gray' | 'blue' | 'purple' | 'dark' | 'ai';
|
|
6
6
|
export type SilkeTagSize = 'tiny';
|
|
7
7
|
export type SilkeTagProps = {
|
|
8
8
|
disabled?: boolean;
|
package/dist/types/icons.d.ts
CHANGED
|
@@ -8,7 +8,9 @@ export declare const SilkeIconDefinitions: {
|
|
|
8
8
|
close: string;
|
|
9
9
|
delete: string;
|
|
10
10
|
edit: string;
|
|
11
|
+
'edit.line': string;
|
|
11
12
|
'edit.pen': string;
|
|
13
|
+
'pen.swirl': string;
|
|
12
14
|
error: string;
|
|
13
15
|
help: string;
|
|
14
16
|
community: string;
|
|
@@ -22,6 +24,14 @@ export declare const SilkeIconDefinitions: {
|
|
|
22
24
|
'cloud.check': string;
|
|
23
25
|
'cloud.slash': string;
|
|
24
26
|
ai: string;
|
|
27
|
+
'ai.sparkle': string;
|
|
28
|
+
'ai.page': string;
|
|
29
|
+
'ai.sparkels': string;
|
|
30
|
+
'ai.gradient': typeof AiGradientIcon;
|
|
31
|
+
'ai.image': string;
|
|
32
|
+
'ai.component': typeof AiGradientComponent;
|
|
33
|
+
'ai.text': string;
|
|
34
|
+
'ai.file': string;
|
|
25
35
|
sparkles: string;
|
|
26
36
|
compare: string;
|
|
27
37
|
menuMore: string;
|
|
@@ -69,6 +79,7 @@ export declare const SilkeIconDefinitions: {
|
|
|
69
79
|
square: string;
|
|
70
80
|
shapes: string;
|
|
71
81
|
sharedStyle: string;
|
|
82
|
+
paintbrush: string;
|
|
72
83
|
firefox: string;
|
|
73
84
|
safari: string;
|
|
74
85
|
'square.dashed': string;
|
|
@@ -83,14 +94,19 @@ export declare const SilkeIconDefinitions: {
|
|
|
83
94
|
'dots.vertical': string;
|
|
84
95
|
'dots.horizontal': string;
|
|
85
96
|
star: string;
|
|
97
|
+
'star.filled': string;
|
|
86
98
|
eyeDropper: string;
|
|
87
99
|
log: string;
|
|
88
100
|
dashboard: string;
|
|
89
101
|
test: string;
|
|
90
102
|
guest: string;
|
|
103
|
+
cartoon: string;
|
|
91
104
|
'network.on': string;
|
|
92
105
|
'network.off': string;
|
|
93
106
|
grid: string;
|
|
107
|
+
'memo.circle.check': string;
|
|
108
|
+
'bring.forward': string;
|
|
109
|
+
'bring.backward': string;
|
|
94
110
|
moon: string;
|
|
95
111
|
sun: string;
|
|
96
112
|
notification: string;
|
|
@@ -119,6 +135,7 @@ export declare const SilkeIconDefinitions: {
|
|
|
119
135
|
'code.fork': string;
|
|
120
136
|
'code.compare': string;
|
|
121
137
|
'code.history': string;
|
|
138
|
+
'code.rectangle': string;
|
|
122
139
|
messages: string;
|
|
123
140
|
'keyboard.command': string;
|
|
124
141
|
'keyboard.option': string;
|
|
@@ -163,6 +180,8 @@ export declare const SilkeIconDefinitions: {
|
|
|
163
180
|
'arrow.up.right.and.down.left': string;
|
|
164
181
|
'arrows.left.right': string;
|
|
165
182
|
'arrows.up.down': string;
|
|
183
|
+
'arrows.from.dotted.line': string;
|
|
184
|
+
'arrows.to.dotted.line': string;
|
|
166
185
|
'padding.all': string;
|
|
167
186
|
'padding.top.bottom': string;
|
|
168
187
|
'padding.left.right': string;
|
|
@@ -191,6 +210,7 @@ export declare const SilkeIconDefinitions: {
|
|
|
191
210
|
commentMarker: string;
|
|
192
211
|
template: string;
|
|
193
212
|
templates: string;
|
|
213
|
+
templatesLegacy: string;
|
|
194
214
|
page: string;
|
|
195
215
|
project: string;
|
|
196
216
|
projects: string;
|
|
@@ -224,6 +244,7 @@ export declare const SilkeIconDefinitions: {
|
|
|
224
244
|
'credit-card': string;
|
|
225
245
|
money: string;
|
|
226
246
|
dynamic: string;
|
|
247
|
+
slash: string;
|
|
227
248
|
'geo.fence.disabled': string;
|
|
228
249
|
'geo.fence.enabled': string;
|
|
229
250
|
'editor.design': string;
|
|
@@ -233,6 +254,7 @@ export declare const SilkeIconDefinitions: {
|
|
|
233
254
|
gradient: typeof GradientIcon;
|
|
234
255
|
image: string;
|
|
235
256
|
images: string;
|
|
257
|
+
camera: string;
|
|
236
258
|
video: string;
|
|
237
259
|
audio: string;
|
|
238
260
|
fill: string;
|
|
@@ -267,6 +289,7 @@ export declare const SilkeIconDefinitions: {
|
|
|
267
289
|
diamond: string;
|
|
268
290
|
crosshair: string;
|
|
269
291
|
clone: string;
|
|
292
|
+
'clone-plus': string;
|
|
270
293
|
'globe-pointer': string;
|
|
271
294
|
globe: string;
|
|
272
295
|
'align.text.right': string;
|
|
@@ -310,6 +333,9 @@ export declare const SilkeIconDefinitions: {
|
|
|
310
333
|
'file.export': string;
|
|
311
334
|
home: string;
|
|
312
335
|
qr: string;
|
|
336
|
+
'pin.on': string;
|
|
337
|
+
'pin.off': string;
|
|
338
|
+
eraser: string;
|
|
313
339
|
list: string;
|
|
314
340
|
'list.ol': string;
|
|
315
341
|
'list.check': string;
|
|
@@ -360,6 +386,9 @@ export declare const SilkeIconDefinitions: {
|
|
|
360
386
|
sass: string;
|
|
361
387
|
typescript: typeof TypescriptIcon;
|
|
362
388
|
html5: string;
|
|
389
|
+
translate: string;
|
|
390
|
+
spell: string;
|
|
391
|
+
'tone.of.voice': string;
|
|
363
392
|
'American Express': string;
|
|
364
393
|
Amex: string;
|
|
365
394
|
'Diners Club': string;
|
|
@@ -375,6 +404,7 @@ export declare const SilkeIconDefinitions: {
|
|
|
375
404
|
laptop: string;
|
|
376
405
|
mobile: string;
|
|
377
406
|
tablet: string;
|
|
407
|
+
devices: string;
|
|
378
408
|
'device.custom': string;
|
|
379
409
|
bar: string;
|
|
380
410
|
line: string;
|
|
@@ -464,4 +494,6 @@ declare function ContentChildParent(): import("react/jsx-runtime").JSX.Element;
|
|
|
464
494
|
declare function AnimationFillBackwards(): import("react/jsx-runtime").JSX.Element;
|
|
465
495
|
declare function AnimationFillForwards(): import("react/jsx-runtime").JSX.Element;
|
|
466
496
|
declare function AnimationFillBoth(): import("react/jsx-runtime").JSX.Element;
|
|
497
|
+
declare function AiGradientIcon(): import("react/jsx-runtime").JSX.Element;
|
|
498
|
+
declare function AiGradientComponent(): import("react/jsx-runtime").JSX.Element;
|
|
467
499
|
export {};
|
package/jest.config.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
|
|
2
|
+
const base = require('../../jest.config.base');
|
|
3
3
|
const package = require('./package.json');
|
|
4
4
|
|
|
5
5
|
const packageName = package.name.split('@vev/').pop();
|
|
@@ -10,7 +10,7 @@ module.exports = {
|
|
|
10
10
|
rootDir: '../..',
|
|
11
11
|
roots: [`<rootDir>/packages/${packageName}`],
|
|
12
12
|
testRegex: `(packages/${packageName}/.*/__tests__/.*|\\.(spec|test))\\.tsx?$`,
|
|
13
|
-
testEnvironmentOptions: { url: 'http://localhost/'
|
|
13
|
+
testEnvironmentOptions: { url: 'http://localhost/' },
|
|
14
14
|
moduleDirectories: ['node_modules', 'src'],
|
|
15
15
|
testEnvironment: 'jsdom',
|
|
16
16
|
setupFiles: [
|
|
@@ -22,5 +22,4 @@ module.exports = {
|
|
|
22
22
|
moduleNameMapper: {
|
|
23
23
|
'^.+\\.(css|less|scss)$': '<rootDir>/jest/empty-file.js',
|
|
24
24
|
},
|
|
25
|
-
transformIgnorePatterns: ['node_modules/(?!(nanoid|nanoid\/non-secure)/)'],
|
|
26
25
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vev/silke",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.8",
|
|
4
4
|
"license": "MIT",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/vev-design/vev.git",
|
|
8
|
+
"directory": "packages/silke"
|
|
9
|
+
},
|
|
5
10
|
"main": "dist/index.js",
|
|
6
11
|
"types": "dist/types/index.d.ts",
|
|
7
12
|
"scripts": {
|
|
@@ -19,7 +24,7 @@
|
|
|
19
24
|
"peerDependencies": {
|
|
20
25
|
"react": ">=16.0.0",
|
|
21
26
|
"react-dom": ">=16.0.0",
|
|
22
|
-
"react-router-dom": "^7.
|
|
27
|
+
"react-router-dom": "^7.12.0"
|
|
23
28
|
},
|
|
24
29
|
"dependencies": {
|
|
25
30
|
"@vev/interactions": "*",
|