@vev/silke 1.1.10 → 1.2.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/.turbo/turbo-build.log +162 -77
- package/CHANGELOG.md +41 -0
- package/dist/index.js +44 -41
- package/dist/index.js.LEGAL.txt +1 -1
- package/dist/index.js.map +7 -0
- package/dist/styles.css +1596 -1013
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/silke-autocomplete-field/autocomplete-item.d.ts +1 -1
- package/dist/types/components/silke-autocomplete-field/silke-autocomplete-field-native.d.ts +5 -0
- package/dist/types/components/silke-box/silke-box.d.ts +2 -0
- package/dist/types/components/silke-button/silke-dropdown-button.d.ts +3 -1
- package/dist/types/components/silke-card/silke-card-grid.d.ts +1 -0
- package/dist/types/components/silke-card/silke-card.d.ts +1 -0
- package/dist/types/components/silke-command-text-field/index.d.ts +1 -1
- package/dist/types/components/silke-command-text-field/silke-command-text-field.d.ts +16 -0
- package/dist/types/components/silke-command-text-field/utils.d.ts +25 -0
- package/dist/types/components/silke-css-number-field/silke-css-number-field.spec.d.ts +1 -0
- package/dist/types/components/silke-expression-input/index.d.ts +3 -0
- package/dist/types/components/silke-expression-input/silke-expression-input-tag.d.ts +6 -0
- package/dist/types/components/silke-expression-input/silke-expression-input.d.ts +29 -0
- package/dist/types/components/silke-expression-input/utils.d.ts +18 -0
- package/dist/types/components/silke-form-schema/fields/array-field-inline.d.ts +2 -1
- package/dist/types/components/silke-form-schema/fields/array-field-modal.d.ts +2 -1
- package/dist/types/components/silke-form-schema/fields/array-field.d.ts +1 -1
- package/dist/types/components/silke-form-schema/fields/group-field.d.ts +1 -1
- package/dist/types/components/silke-form-schema/fields/layout-field.d.ts +1 -1
- package/dist/types/components/silke-form-schema/fields/object-field.d.ts +1 -1
- package/dist/types/components/silke-form-schema/fields/popover-field.d.ts +1 -1
- package/dist/types/components/silke-form-schema/fields/string-field.d.ts +1 -1
- package/dist/types/components/silke-form-schema/fields/utils/generate-preview.spec.d.ts +1 -0
- package/dist/types/components/silke-form-schema/fields/utils/generate-title.d.ts +10 -0
- package/dist/types/components/silke-form-schema/index.d.ts +1 -0
- package/dist/types/components/silke-form-schema/silke-form-schema.d.ts +4 -1
- package/dist/types/components/silke-form-schema/silke-schema-decorator.d.ts +17 -0
- package/dist/types/components/silke-form-schema/silke-schema-field.d.ts +2 -1
- package/dist/types/components/silke-form-schema/silke-schema-fields.d.ts +2 -0
- package/dist/types/components/silke-form-schema/silke-schema-path.spec.d.ts +1 -0
- package/dist/types/components/silke-gradient-picker/silke-gradient-utils.d.ts +2 -0
- package/dist/types/components/silke-icon-picker/color-swatch-section.d.ts +6 -0
- package/dist/types/components/silke-icon-picker/emoji-tab.d.ts +1 -1
- package/dist/types/components/silke-icon-picker/icons-tab.d.ts +1 -1
- package/dist/types/components/silke-icon-picker/silke-icon-picker.d.ts +2 -0
- package/dist/types/components/silke-icon-picker/utils.d.ts +2 -0
- package/dist/types/components/silke-list/silke-list-item.d.ts +5 -1
- package/dist/types/components/silke-list/types.d.ts +1 -0
- package/dist/types/components/silke-navigation-link/silke-navigation-link.d.ts +15 -0
- package/dist/types/components/silke-popover/popover-context.spec.d.ts +1 -0
- package/dist/types/components/silke-rich-text-field/blockquote.d.ts +21 -0
- package/dist/types/components/silke-rich-text-field/blockquote.spec.d.ts +1 -0
- package/dist/types/components/silke-rich-text-field/dropcap.d.ts +27 -0
- package/dist/types/components/silke-rich-text-field/dropcap.spec.d.ts +1 -0
- package/dist/types/components/silke-rich-text-field/floating-layer.d.ts +12 -0
- package/dist/types/components/silke-rich-text-field/font-size.d.ts +2 -0
- package/dist/types/components/silke-rich-text-field/formatting-toolbar.d.ts +9 -0
- package/dist/types/components/silke-rich-text-field/index.d.ts +1 -0
- package/dist/types/components/silke-rich-text-field/jsdom-rects.d.ts +10 -0
- package/dist/types/components/silke-rich-text-field/link-menu.d.ts +26 -0
- package/dist/types/components/silke-rich-text-field/link-menu.spec.d.ts +1 -0
- package/dist/types/components/silke-rich-text-field/link-suggestions.d.ts +48 -0
- package/dist/types/components/silke-rich-text-field/link-suggestions.spec.d.ts +1 -0
- package/dist/types/components/silke-rich-text-field/link-tooltip.d.ts +15 -0
- package/dist/types/components/silke-rich-text-field/list-item.d.ts +15 -0
- package/dist/types/components/silke-rich-text-field/list-link-fontsize.spec.d.ts +1 -0
- package/dist/types/components/silke-rich-text-field/lorem-ipsum.d.ts +10 -0
- package/dist/types/components/silke-rich-text-field/lorem-ipsum.spec.d.ts +1 -0
- package/dist/types/components/silke-rich-text-field/paste.d.ts +1 -0
- package/dist/types/components/silke-rich-text-field/paste.spec.d.ts +1 -0
- package/dist/types/components/silke-rich-text-field/plugins.d.ts +18 -0
- package/dist/types/components/silke-rich-text-field/plugins.spec.d.ts +1 -0
- package/dist/types/components/silke-rich-text-field/silke-rich-text-field.d.ts +60 -0
- package/dist/types/components/silke-rich-text-field/slash-menu-items.d.ts +10 -0
- package/dist/types/components/silke-rich-text-field/slash-menu.d.ts +11 -0
- package/dist/types/components/silke-rich-text-field/table-content-sync.spec.d.ts +1 -0
- package/dist/types/components/silke-rich-text-field/table-toolbar.d.ts +17 -0
- package/dist/types/components/silke-rich-text-field/table-toolbar.spec.d.ts +1 -0
- package/dist/types/components/silke-rich-text-field/table.spec.d.ts +1 -0
- package/dist/types/components/silke-rich-text-field/use-link-hover.d.ts +15 -0
- package/dist/types/components/silke-rich-text-field/use-slash-menu.d.ts +13 -0
- package/dist/types/components/silke-rich-text-field/utils.d.ts +13 -0
- package/dist/types/components/silke-sortable-list/index.d.ts +1 -1
- package/dist/types/components/silke-sortable-list/silke-nested-sortable-list.d.ts +8 -1
- package/dist/types/components/silke-theme-card/silke-theme-card.d.ts +13 -6
- package/dist/types/components/silke-theme-swatch/silke-theme-swatch.d.ts +6 -1
- package/dist/types/icons.d.ts +16 -0
- package/esbuild.config.mjs +9 -4
- package/package.json +22 -9
- package/src/components/index.ts +2 -0
- package/src/components/silke-alert-banner/silke-alert-banner.tsx +1 -1
- package/src/components/silke-autocomplete-field/autocomplete-item.tsx +47 -61
- package/src/components/silke-autocomplete-field/silke-autocomplete-field-native.tsx +13 -2
- package/src/components/silke-autocomplete-field/silke-autocomplete-field.tsx +8 -5
- package/src/components/silke-autocomplete-field/silke-autocomplete-popup-native.tsx +2 -1
- package/src/components/silke-box/silke-box.scss +4 -0
- package/src/components/silke-box/silke-box.tsx +4 -0
- package/src/components/silke-button/silke-dropdown-button.tsx +4 -1
- package/src/components/silke-card/silke-card.scss +4 -0
- package/src/components/silke-card/silke-card.tsx +3 -0
- package/src/components/silke-command-text-field/index.ts +1 -0
- package/src/components/silke-command-text-field/silke-command-parser.spec.ts +55 -0
- package/src/components/silke-command-text-field/silke-command-parser.ts +33 -2
- package/src/components/silke-command-text-field/silke-command-text-field.module.scss +3 -0
- package/src/components/silke-command-text-field/silke-command-text-field.tsx +53 -48
- package/src/components/silke-command-text-field/utils.spec.ts +192 -0
- package/src/components/silke-command-text-field/utils.ts +99 -16
- package/src/components/silke-css-number-field/silke-css-number-field.spec.tsx +115 -0
- package/src/components/silke-css-number-field/silke-css-number-field.tsx +33 -0
- package/src/components/silke-expression-input/index.ts +3 -0
- package/src/components/silke-expression-input/silke-expression-input-tag.tsx +37 -0
- package/src/components/silke-expression-input/silke-expression-input.mdx +40 -0
- package/src/components/silke-expression-input/silke-expression-input.scss +24 -0
- package/src/components/silke-expression-input/silke-expression-input.tsx +343 -0
- package/src/components/silke-expression-input/utils.ts +144 -0
- package/src/components/silke-form-schema/fields/array-field-inline.tsx +4 -0
- package/src/components/silke-form-schema/fields/array-field-modal.tsx +4 -0
- package/src/components/silke-form-schema/fields/array-field.tsx +6 -11
- package/src/components/silke-form-schema/fields/group-field.tsx +2 -0
- package/src/components/silke-form-schema/fields/layout-field.tsx +2 -0
- package/src/components/silke-form-schema/fields/object-field.tsx +2 -0
- package/src/components/silke-form-schema/fields/popover-field.tsx +2 -0
- package/src/components/silke-form-schema/fields/string-field.tsx +33 -5
- package/src/components/silke-form-schema/fields/utils/generate-image.ts +5 -14
- package/src/components/silke-form-schema/fields/utils/generate-preview.spec.ts +49 -0
- package/src/components/silke-form-schema/fields/utils/generate-title.ts +23 -10
- package/src/components/silke-form-schema/index.ts +1 -0
- package/src/components/silke-form-schema/silke-form-schema.mdx +30 -1
- package/src/components/silke-form-schema/silke-form-schema.tsx +12 -6
- package/src/components/silke-form-schema/silke-schema-decorator.tsx +32 -0
- package/src/components/silke-form-schema/silke-schema-field.tsx +19 -2
- package/src/components/silke-form-schema/silke-schema-fields.tsx +30 -4
- package/src/components/silke-form-schema/silke-schema-path.spec.tsx +160 -0
- package/src/components/silke-gradient-picker/silke-gradient-picker.tsx +3 -1
- package/src/components/silke-gradient-picker/silke-gradient-utils.ts +23 -3
- package/src/components/silke-icon/silke-shape.tsx +1 -1
- package/src/components/silke-icon-picker/color-swatch-section.tsx +61 -0
- package/src/components/silke-icon-picker/emoji-tab.tsx +8 -6
- package/src/components/silke-icon-picker/icons-tab.tsx +8 -7
- package/src/components/silke-icon-picker/silke-icon-picker.tsx +52 -25
- package/src/components/silke-icon-picker/styles.scss +66 -1
- package/src/components/silke-icon-picker/utils.ts +2 -0
- package/src/components/silke-list/silke-list-item.scss +10 -0
- package/src/components/silke-list/silke-list-item.tsx +16 -3
- package/src/components/silke-list/silke-list.mdx +18 -0
- package/src/components/silke-list/types.ts +1 -0
- package/src/components/silke-navigation-link/silke-navigation-link.scss +162 -42
- package/src/components/silke-navigation-link/silke-navigation-link.tsx +99 -21
- package/src/components/silke-popover/popover-context.spec.tsx +44 -0
- package/src/components/silke-popover-native/silke-popover-native.scss +5 -3
- package/src/components/silke-rich-text-field/blockquote.spec.ts +151 -0
- package/src/components/silke-rich-text-field/blockquote.ts +90 -0
- package/src/components/silke-rich-text-field/dropcap.spec.ts +67 -0
- package/src/components/silke-rich-text-field/dropcap.ts +59 -0
- package/src/components/silke-rich-text-field/floating-layer.tsx +15 -0
- package/src/components/silke-rich-text-field/font-size.ts +62 -0
- package/src/components/silke-rich-text-field/formatting-toolbar.tsx +145 -0
- package/src/components/silke-rich-text-field/index.ts +1 -0
- package/src/components/silke-rich-text-field/jsdom-rects.ts +15 -0
- package/src/components/silke-rich-text-field/link-menu.spec.tsx +502 -0
- package/src/components/silke-rich-text-field/link-menu.tsx +553 -0
- package/src/components/silke-rich-text-field/link-suggestions.spec.ts +203 -0
- package/src/components/silke-rich-text-field/link-suggestions.ts +188 -0
- package/src/components/silke-rich-text-field/link-tooltip.tsx +60 -0
- package/src/components/silke-rich-text-field/list-item.ts +64 -0
- package/src/components/silke-rich-text-field/list-link-fontsize.spec.ts +135 -0
- package/src/components/silke-rich-text-field/lorem-ipsum.spec.ts +131 -0
- package/src/components/silke-rich-text-field/lorem-ipsum.ts +51 -0
- package/src/components/silke-rich-text-field/paste.spec.ts +93 -0
- package/src/components/silke-rich-text-field/paste.ts +39 -0
- package/src/components/silke-rich-text-field/plugins.spec.ts +143 -0
- package/src/components/silke-rich-text-field/plugins.ts +230 -0
- package/src/components/silke-rich-text-field/silke-rich-text-field.mdx +180 -0
- package/src/components/silke-rich-text-field/silke-rich-text-field.scss +343 -0
- package/src/components/silke-rich-text-field/silke-rich-text-field.tsx +505 -0
- package/src/components/silke-rich-text-field/slash-menu-items.ts +112 -0
- package/src/components/silke-rich-text-field/slash-menu.tsx +50 -0
- package/src/components/silke-rich-text-field/table-content-sync.spec.tsx +61 -0
- package/src/components/silke-rich-text-field/table-toolbar.spec.tsx +168 -0
- package/src/components/silke-rich-text-field/table-toolbar.tsx +121 -0
- package/src/components/silke-rich-text-field/table.spec.ts +87 -0
- package/src/components/silke-rich-text-field/use-link-hover.ts +63 -0
- package/src/components/silke-rich-text-field/use-slash-menu.ts +130 -0
- package/src/components/silke-rich-text-field/utils.ts +55 -0
- package/src/components/silke-sortable-list/index.ts +1 -1
- package/src/components/silke-sortable-list/silke-nested-sortable-list.scss +11 -1
- package/src/components/silke-sortable-list/silke-nested-sortable-list.tsx +9 -0
- package/src/components/silke-sortable-list/silke-sortable-list.mdx +13 -0
- package/src/components/silke-tag/silke-tag.scss +12 -3
- package/src/components/silke-theme-card/silke-theme-card.module.scss +141 -45
- package/src/components/silke-theme-card/silke-theme-card.tsx +76 -47
- package/src/components/silke-theme-swatch/silke-theme-swatch.mdx +56 -0
- package/src/components/silke-theme-swatch/silke-theme-swatch.module.scss +53 -63
- package/src/components/silke-theme-swatch/silke-theme-swatch.tsx +99 -14
- package/src/icons.tsx +51 -5
- package/tsconfig.build.tsbuildinfo +0 -1
|
@@ -54,9 +54,11 @@ export * from './silke-icon-picker';
|
|
|
54
54
|
export * from './silke-object-field';
|
|
55
55
|
export * from './silke-radio-button';
|
|
56
56
|
export * from './silke-select-field';
|
|
57
|
+
export * from './silke-rich-text-field';
|
|
57
58
|
export * from './silke-text-field';
|
|
58
59
|
export * from './silke-toggle';
|
|
59
60
|
export * from './silke-upload-field';
|
|
60
61
|
export * from './silke-virtual';
|
|
61
62
|
export * from './silke-variables-wrapper';
|
|
62
63
|
export * from './silke-conditions-input';
|
|
64
|
+
export * from './silke-expression-input';
|
|
@@ -17,4 +17,4 @@ export interface AutocompleteItemProps<T, U extends Entry<T>> {
|
|
|
17
17
|
onMouseDown: (e: React.MouseEvent<HTMLButtonElement>) => void;
|
|
18
18
|
ItemRender?: React.FC<AutocompleteRenderItemProps<U>>;
|
|
19
19
|
}
|
|
20
|
-
export default function AutocompleteItem<T, U extends Entry<T>>({ item, selected, multiple, highlight, size,
|
|
20
|
+
export default function AutocompleteItem<T, U extends Entry<T>>({ item, selected, multiple, highlight, size, onMouseDown, ItemRender, }: AutocompleteItemProps<T, U>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -51,10 +51,15 @@ export type SilkeAutocompleteFieldNativeProps<T = any, U extends Entry<T> = any>
|
|
|
51
51
|
* Custom sort of items (default sorts by label)
|
|
52
52
|
*/
|
|
53
53
|
sort?: (one: Entry<T>, other: Entry<T>) => number;
|
|
54
|
+
searchPlaceholder?: string;
|
|
54
55
|
onSearch?: (value: string) => void;
|
|
55
56
|
/**
|
|
56
57
|
* Called when dropdown closes for any reason
|
|
57
58
|
*/
|
|
58
59
|
onClose?: () => void;
|
|
60
|
+
/**
|
|
61
|
+
* Always show reset when a value is selected
|
|
62
|
+
*/
|
|
63
|
+
showReset?: boolean;
|
|
59
64
|
};
|
|
60
65
|
export declare function SilkeAutocompleteFieldNative<T>(props: SilkeAutocompleteFieldNativeProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -57,6 +57,8 @@ type BaseProps = {
|
|
|
57
57
|
userSelect?: 'none' | 'text';
|
|
58
58
|
/** Text color on hover */
|
|
59
59
|
colorHover?: SilkeColor;
|
|
60
|
+
/** Adds a 1px border using surface-2 color */
|
|
61
|
+
border?: boolean;
|
|
60
62
|
aspectRatio?: '16:9' | '4:3' | '1:1';
|
|
61
63
|
/** Flex item */
|
|
62
64
|
flex?: boolean;
|
|
@@ -9,5 +9,7 @@ export type SilkeDropdownButtonProps = {
|
|
|
9
9
|
animate?: boolean;
|
|
10
10
|
size?: 's' | 'base';
|
|
11
11
|
closeOnSelect?: boolean;
|
|
12
|
+
/** Max height (px) of the dropdown list before it scrolls. Defaults to 400. */
|
|
13
|
+
maxHeight?: number;
|
|
12
14
|
} & SilkeButtonProps & Omit<SilkePopoverProps, 'anchor' | 'hide' | 'children' | 'kind'>;
|
|
13
|
-
export declare function SilkeDropdownButton({ label, icon, items, offsetX, offsetY, placement, matchWidth, size, animate, closeOnSelect, ...rest }: SilkeDropdownButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function SilkeDropdownButton({ label, icon, items, offsetX, offsetY, placement, matchWidth, size, animate, closeOnSelect, maxHeight, ...rest }: SilkeDropdownButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -29,6 +29,7 @@ export declare const SilkeSkeletonCard: React.ForwardRefExoticComponent<{
|
|
|
29
29
|
cursor?: "pointer" | "grab" | "text";
|
|
30
30
|
userSelect?: "none" | "text";
|
|
31
31
|
colorHover?: import("../..").SilkeColor;
|
|
32
|
+
border?: boolean;
|
|
32
33
|
aspectRatio?: "16:9" | "4:3" | "1:1";
|
|
33
34
|
flex?: boolean;
|
|
34
35
|
wrap?: boolean;
|
|
@@ -6,6 +6,7 @@ export declare const SilkeCard: React.ForwardRefExoticComponent<{
|
|
|
6
6
|
title: React.ReactNode;
|
|
7
7
|
subTitle?: React.ReactNode;
|
|
8
8
|
image?: string | React.ReactElement | string[];
|
|
9
|
+
imageFit?: "cover" | "contain";
|
|
9
10
|
autoFocus?: boolean;
|
|
10
11
|
text?: string;
|
|
11
12
|
customTags?: React.ReactNode;
|
|
@@ -6,4 +6,4 @@ export type { SilkeFileCategory } from './file-utils';
|
|
|
6
6
|
export { fileToImageValue, imageValueToDataUrl } from './image-utils';
|
|
7
7
|
export { parseTextToSilkeCommands } from './silke-command-parser';
|
|
8
8
|
export * from './silke-command-text-field';
|
|
9
|
-
export { SilkeCommand, SilkeCommandTextFieldValue, SilkeCommandType, SilkeFileValue, SilkeImageValue, SilkeTextValue, convertSilkeCommandsToString, isAttachment, isFile, isImage, } from './utils';
|
|
9
|
+
export { getCommandLabel, SilkeCommand, SilkeCommandTextFieldValue, SilkeCommandType, SilkeFileValue, SilkeImageValue, SilkeTextValue, convertSilkeCommandsToString, isAttachment, isFile, isImage, } from './utils';
|
|
@@ -12,6 +12,14 @@ export type SilkeCommandTextFieldProps = SilkeTextFieldOutlineProps & {
|
|
|
12
12
|
acceptedFileTypes?: SilkeFileCategory[];
|
|
13
13
|
autoFocus?: boolean;
|
|
14
14
|
availableCommands: SilkeCommand[];
|
|
15
|
+
/**
|
|
16
|
+
* Chips shown inside the field, above the text, on their own row.
|
|
17
|
+
*
|
|
18
|
+
* Placed here rather than passed as `children` (which land after the text, where the absolutely
|
|
19
|
+
* positioned placeholder sits) so a chip stays legible on an empty field and does not move as
|
|
20
|
+
* the text wraps.
|
|
21
|
+
*/
|
|
22
|
+
chips?: React.ReactNode;
|
|
15
23
|
disabled?: boolean;
|
|
16
24
|
/** Maximum height in pixels before the field starts scrolling */
|
|
17
25
|
maxHeight?: number;
|
|
@@ -49,6 +57,14 @@ declare const SilkeCommandTextField: React.ForwardRefExoticComponent<SilkeTextFi
|
|
|
49
57
|
acceptedFileTypes?: SilkeFileCategory[];
|
|
50
58
|
autoFocus?: boolean;
|
|
51
59
|
availableCommands: SilkeCommand[];
|
|
60
|
+
/**
|
|
61
|
+
* Chips shown inside the field, above the text, on their own row.
|
|
62
|
+
*
|
|
63
|
+
* Placed here rather than passed as `children` (which land after the text, where the absolutely
|
|
64
|
+
* positioned placeholder sits) so a chip stays legible on an empty field and does not move as
|
|
65
|
+
* the text wraps.
|
|
66
|
+
*/
|
|
67
|
+
chips?: React.ReactNode;
|
|
52
68
|
disabled?: boolean;
|
|
53
69
|
/** Maximum height in pixels before the field starts scrolling */
|
|
54
70
|
maxHeight?: number;
|
|
@@ -6,7 +6,18 @@ export type SilkeCommand = {
|
|
|
6
6
|
partialMatch?: boolean;
|
|
7
7
|
type: SilkeCommandType;
|
|
8
8
|
value: string;
|
|
9
|
+
/**
|
|
10
|
+
* Text shown in the field in place of `value`. Use it when the value is an
|
|
11
|
+
* opaque id (a user id, say) but the field should read as a human name.
|
|
12
|
+
*
|
|
13
|
+
* The field parses its own rendered text back into values, so labels must be
|
|
14
|
+
* unique within `availableCommands` — two commands sharing a label cannot be
|
|
15
|
+
* told apart once written.
|
|
16
|
+
*/
|
|
17
|
+
label?: string;
|
|
9
18
|
};
|
|
19
|
+
/** The text a command renders as, without its `@` or `/` prefix */
|
|
20
|
+
export declare function getCommandLabel(command: SilkeCommand): string;
|
|
10
21
|
export type SilkeTextValue = {
|
|
11
22
|
type: 'text';
|
|
12
23
|
value: string;
|
|
@@ -46,6 +57,20 @@ export declare function getActiveCommandIndex(caretPos: number, value: SilkeComm
|
|
|
46
57
|
export declare function getTextLength(value: SilkeCommandTextFieldValue[], index?: number): number;
|
|
47
58
|
/** Get the rendered length of a single command/text value */
|
|
48
59
|
export declare function getItemLength(item: SilkeCommandTextFieldValue): number;
|
|
60
|
+
export interface InsertCharacterAtCommandBoundaryResult {
|
|
61
|
+
index: number;
|
|
62
|
+
localOffset: number;
|
|
63
|
+
value: SilkeCommandTextFieldValue[];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Insert a typed character at the boundary of a completed command.
|
|
67
|
+
* Returns null when the caret is strictly inside the command (no insertion).
|
|
68
|
+
*
|
|
69
|
+
* After a mention the field inserts a trailing space. If the caret is past the
|
|
70
|
+
* chip, insert at that offset in the following text — do not always prepend,
|
|
71
|
+
* or each keystroke lands at the front and reverses the word.
|
|
72
|
+
*/
|
|
73
|
+
export declare function insertCharacterAtCommandBoundary(value: SilkeCommandTextFieldValue[], commandIndex: number, localOffset: number, char: string): InsertCharacterAtCommandBoundaryResult | null;
|
|
49
74
|
/** Convert command values to HTML for rendering (excludes images) */
|
|
50
75
|
export declare function valueToHtml(value: SilkeCommandTextFieldValue[], styles: Record<string, string>): string;
|
|
51
76
|
/** Convert command values to plain string (excludes images) */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DisplayToken } from '@vev/variables';
|
|
2
|
+
export interface SilkeExpressionInputTagProps {
|
|
3
|
+
token: DisplayToken;
|
|
4
|
+
label?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function SilkeExpressionInputTag({ token, label }: SilkeExpressionInputTagProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SilkeTextFieldOutlineProps } from '../silke-text-field/silke-text-field-outline';
|
|
3
|
+
import { ExpressionSource, ExpressionVariable } from './utils';
|
|
4
|
+
export type SilkeExpressionInputProps = SilkeTextFieldOutlineProps & {
|
|
5
|
+
value: string;
|
|
6
|
+
onChange: (next: string) => void;
|
|
7
|
+
variables?: ExpressionVariable[];
|
|
8
|
+
triggerSources?: ExpressionSource[];
|
|
9
|
+
systemSources?: ExpressionSource[];
|
|
10
|
+
functions?: string[];
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
onClear?: () => void;
|
|
14
|
+
onFocus?: (e: FocusEvent) => void;
|
|
15
|
+
onBlur?: (e: FocusEvent) => void;
|
|
16
|
+
};
|
|
17
|
+
export declare const SilkeExpressionInput: React.ForwardRefExoticComponent<SilkeTextFieldOutlineProps & {
|
|
18
|
+
value: string;
|
|
19
|
+
onChange: (next: string) => void;
|
|
20
|
+
variables?: ExpressionVariable[];
|
|
21
|
+
triggerSources?: ExpressionSource[];
|
|
22
|
+
systemSources?: ExpressionSource[];
|
|
23
|
+
functions?: string[];
|
|
24
|
+
placeholder?: string;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
onClear?: () => void;
|
|
27
|
+
onFocus?: (e: FocusEvent) => void;
|
|
28
|
+
onBlur?: (e: FocusEvent) => void;
|
|
29
|
+
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SilkeIcons } from '../silke-icon';
|
|
2
|
+
import { ConditionSuggestion } from '../silke-conditions-input';
|
|
3
|
+
export interface ExpressionVariable {
|
|
4
|
+
key: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ExpressionSource {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
icon?: SilkeIcons;
|
|
12
|
+
}
|
|
13
|
+
export declare const DEFAULT_FUNCTIONS: string[];
|
|
14
|
+
export declare const ZERO_ARG_FUNCTIONS: Set<string>;
|
|
15
|
+
export declare const isZeroArgFunction: (name: string) => boolean;
|
|
16
|
+
export declare const getOperandSuggestions: (query: string, variables: ExpressionVariable[], functions?: string[], triggerSources?: ExpressionSource[], systemSources?: ExpressionSource[]) => ConditionSuggestion[];
|
|
17
|
+
export declare const getOperatorSuggestions: (query: string, openParens: number) => ConditionSuggestion[];
|
|
18
|
+
export declare const getFunctionFollowupSuggestions: () => ConditionSuggestion[];
|
|
@@ -7,6 +7,7 @@ type Props = {
|
|
|
7
7
|
onChange: (value: any[]) => void;
|
|
8
8
|
onDelete: () => void;
|
|
9
9
|
onClose: () => void;
|
|
10
|
+
path?: string;
|
|
10
11
|
};
|
|
11
|
-
export declare function ArrayFieldInline({ value, disabled, selected, schema, onChange, onDelete, onClose, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function ArrayFieldInline({ value, disabled, selected, schema, onChange, onDelete, onClose, path, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -9,6 +9,7 @@ type Props = {
|
|
|
9
9
|
onChange: (value: any[]) => void;
|
|
10
10
|
onDelete: () => void;
|
|
11
11
|
onClose: () => void;
|
|
12
|
+
path?: string;
|
|
12
13
|
};
|
|
13
|
-
export declare function ArrayFieldModal({ anchor, value, selected, schema, disabled, onChange, onDelete, onClose, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function ArrayFieldModal({ anchor, value, selected, schema, disabled, onChange, onDelete, onClose, path, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { ArrayField as ArrayFieldType, SchemaFieldProps } from '@vev/utils';
|
|
2
|
-
declare const ArrayField: ({ value, schema, disabled, readonly, onChange, }: SchemaFieldProps<ArrayFieldType>) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const ArrayField: ({ value, schema, disabled, readonly, onChange, path, }: SchemaFieldProps<ArrayFieldType>) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default ArrayField;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { GroupField as GroupFieldType, SchemaFieldProps } from '@vev/utils';
|
|
2
2
|
/** Collapsible card section. Renders a clickable header with chevron inside a surface-1 card. */
|
|
3
|
-
export default function GroupField({ value, schema, disabled, readonly, }: SchemaFieldProps<GroupFieldType>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default function GroupField({ value, schema, disabled, readonly, path, }: SchemaFieldProps<GroupFieldType>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { LayoutField as LayoutFieldType, SchemaFieldProps } from '@vev/utils';
|
|
2
|
-
export default function LayoutField({ value, schema, disabled, readonly, }: SchemaFieldProps<LayoutFieldType>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function LayoutField({ value, schema, disabled, readonly, path, }: SchemaFieldProps<LayoutFieldType>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ObjectField as ObjectFieldType, SchemaFieldProps } from '@vev/utils';
|
|
2
|
-
export default function ObjectField({ value, schema, disabled, readonly, onChange, itemIndex, }: SchemaFieldProps<ObjectFieldType>): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function ObjectField({ value, schema, disabled, readonly, onChange, itemIndex, path, }: SchemaFieldProps<ObjectFieldType>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PopoverField as PopoverFieldType, SchemaFieldProps } from '@vev/utils';
|
|
2
2
|
/** Icon button that opens a popover with nested fields. Closes on outside click or Escape. */
|
|
3
|
-
export default function PopoverField({ value, schema, disabled, readonly, }: SchemaFieldProps<PopoverFieldType>): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default function PopoverField({ value, schema, disabled, readonly, path, }: SchemaFieldProps<PopoverFieldType>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { SchemaFieldProps, StringField as StringFieldType } from '@vev/utils';
|
|
2
|
-
declare const StringField: ({ schema, value, disabled, readonly, onChange, }: SchemaFieldProps<StringFieldType>) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const StringField: ({ schema, value, disabled, readonly, onChange, context, }: SchemaFieldProps<StringFieldType>) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default StringField;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
import { VevProps } from '@vev/utils';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the schema's `preview` for an array item. A `preview` function is component code
|
|
5
|
+
* (often AI-generated) that runs for every item as soon as the list renders, so a throw or a
|
|
6
|
+
* missing return value falls back to the derived title/image instead of crashing the form.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getPreview: (data: any, schema?: VevProps | VevProps[] | string) => {
|
|
9
|
+
title?: string;
|
|
10
|
+
image?: string | ReactNode;
|
|
11
|
+
};
|
|
2
12
|
export declare const generateTitle: (data: {
|
|
3
13
|
[key: string]: any;
|
|
4
14
|
} | {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LocalVariable, Schema, SchemaContextModel } from '@vev/utils';
|
|
2
2
|
import { SilkeFormProps } from '../silke-form';
|
|
3
|
+
import { SilkeSchemaFieldDecorator } from './silke-schema-decorator';
|
|
3
4
|
import { SilkeTextFieldOutlineProps } from '../silke-text-field/silke-text-field-outline';
|
|
4
5
|
type SilkeFormSchemaProps<T extends {
|
|
5
6
|
[key: string]: any;
|
|
@@ -12,8 +13,10 @@ type SilkeFormSchemaProps<T extends {
|
|
|
12
13
|
readonly?: boolean;
|
|
13
14
|
disabled?: boolean;
|
|
14
15
|
variables?: LocalVariable[];
|
|
16
|
+
/** Renders extra UI beside every field, eg a per-breakpoint status dot. */
|
|
17
|
+
fieldDecorator?: SilkeSchemaFieldDecorator;
|
|
15
18
|
} & SilkeFormProps<T>;
|
|
16
19
|
export declare function SilkeFormSchema<T extends {
|
|
17
20
|
[key: string]: any;
|
|
18
|
-
}>({ schema, value, context, inline, ...rest }: SilkeFormSchemaProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
}>({ schema, value, context, inline, fieldDecorator, ...rest }: SilkeFormSchemaProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
19
22
|
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { VevProps } from '@vev/utils';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Renders extra UI beside a schema field — a status dot, a badge, a menu.
|
|
5
|
+
*
|
|
6
|
+
* `path` is the field's address inside the form value, eg `slides.1.label`, so
|
|
7
|
+
* the decorator can look the field's stored value up. It is undefined when the
|
|
8
|
+
* form was rendered without a path.
|
|
9
|
+
*/
|
|
10
|
+
export type SilkeSchemaFieldDecorator = (field: VevProps, path?: string) => ReactNode;
|
|
11
|
+
export declare function SilkeSchemaDecoratorProvider({ decorator, children, }: {
|
|
12
|
+
decorator?: SilkeSchemaFieldDecorator;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function useSchemaFieldDecorator(): SilkeSchemaFieldDecorator | undefined;
|
|
16
|
+
/** Joins a parent path with a field name or an array index. */
|
|
17
|
+
export declare function joinSchemaPath(path: string | undefined, segment: string | number): string;
|
|
@@ -7,6 +7,7 @@ type SilkeSchemaFieldProps = {
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
readonly?: boolean;
|
|
9
9
|
itemIndex?: number;
|
|
10
|
+
path?: string;
|
|
10
11
|
};
|
|
11
|
-
export declare function SilkeSchemaField({ field, value: fieldValue, noPad, isFirst, disabled, readonly, itemIndex, }: SilkeSchemaFieldProps): import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
export declare function SilkeSchemaField({ field, value: fieldValue, noPad, isFirst, disabled, readonly, itemIndex, path, }: SilkeSchemaFieldProps): import("react/jsx-runtime").JSX.Element | null;
|
|
12
13
|
export {};
|
|
@@ -9,6 +9,8 @@ type SilkeSchemaFieldsProps<T extends {
|
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
readonly?: boolean;
|
|
11
11
|
itemIndex?: number;
|
|
12
|
+
/** Address of the object these fields write into, eg `slides.1`. */
|
|
13
|
+
path?: string;
|
|
12
14
|
} & SilkeFormProps<T>;
|
|
13
15
|
export declare function SilkeSchemaFields<T extends {
|
|
14
16
|
[key: string]: any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -6,6 +6,8 @@ export type SilkeGradient = {
|
|
|
6
6
|
type SilkeGradientStop = {
|
|
7
7
|
color: string;
|
|
8
8
|
position: number;
|
|
9
|
+
/** Optional alpha (0–1) applied via color-mix when `color` is a CSS var() reference. */
|
|
10
|
+
opacity?: number;
|
|
9
11
|
};
|
|
10
12
|
export declare function getGradientModelFromCSS(cssGradient: string): SilkeGradient;
|
|
11
13
|
export declare function getCSSFromGradientModel({ stops, pos, type }: SilkeGradient): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { TabProps } from './utils';
|
|
2
|
-
export default function EmojiTab({ onSelect }: TabProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function EmojiTab({ onSelect, extra }: TabProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { TabProps } from './utils';
|
|
2
|
-
export default function IconsTab({ onSelect }: TabProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function IconsTab({ onSelect, extra }: TabProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,6 +6,8 @@ type SilkeIconPickerProps = {
|
|
|
6
6
|
fallback?: SilkeIcons;
|
|
7
7
|
required?: boolean;
|
|
8
8
|
type?: 'emojis' | 'icon' | 'upload';
|
|
9
|
+
colorName?: string;
|
|
10
|
+
presetColors?: string[];
|
|
9
11
|
} & FormFieldProps<IEmojiIcon> & Omit<SilkeButtonProps, 'icon' | 'type' | 'onChange'>;
|
|
10
12
|
export declare function SilkeIconPicker(props: SilkeIconPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
export {};
|
|
@@ -13,12 +13,16 @@ type SilkeListItemProps = {
|
|
|
13
13
|
size?: 's' | 'base';
|
|
14
14
|
tag?: SilkeTagProps;
|
|
15
15
|
active?: boolean;
|
|
16
|
+
highlight?: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
16
18
|
gap?: boolean;
|
|
17
19
|
maxHeight?: number;
|
|
18
20
|
children?: React.ReactNode;
|
|
19
21
|
alwaysShowChildren?: boolean;
|
|
20
22
|
onClick?: (e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;
|
|
23
|
+
onMouseDown?: (e: React.MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => void;
|
|
24
|
+
onMouseEnter?: () => void;
|
|
21
25
|
onSelect?: () => void;
|
|
22
26
|
} & 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;
|
|
27
|
+
export declare const SilkeListItem: ({ label, subLabel, icon, items, link, tag, active, highlight, disabled, size, gap, maxHeight, children, alwaysShowChildren, onClick, onMouseDown, onMouseEnter, onSelect, ...rest }: SilkeListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
28
|
export {};
|
|
@@ -13,6 +13,7 @@ export type SilkeListItemData = {
|
|
|
13
13
|
children?: React.ReactNode;
|
|
14
14
|
alwaysShowChildren?: boolean;
|
|
15
15
|
onClick?: () => void;
|
|
16
|
+
onMouseEnter?: () => void;
|
|
16
17
|
};
|
|
17
18
|
export type SilkeListItemType = SilkeListItemData | React.ReactElement | 'divider';
|
|
18
19
|
export type GroupedSilkeListItems = {
|
|
@@ -19,6 +19,21 @@ type SilkeNavigationLinkProps = {
|
|
|
19
19
|
*/
|
|
20
20
|
rightButtons?: ReactNode;
|
|
21
21
|
expanded?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* When true, the expand caret replaces the icon on hover instead of
|
|
24
|
+
* showing a separate chevron button. No blue active indicator bar.
|
|
25
|
+
*/
|
|
26
|
+
compactExpand?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* When true, renders the expand caret on hover (compactExpand mode) even
|
|
29
|
+
* if `items` is empty. Use when child rows are rendered by a parent
|
|
30
|
+
* container (e.g. SilkeNestedSortableList) rather than by this component.
|
|
31
|
+
*/
|
|
32
|
+
hasChildren?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Called when the expand caret is clicked. Use for parent-controlled expand.
|
|
35
|
+
*/
|
|
36
|
+
onToggleExpand?: () => void;
|
|
22
37
|
} & (({
|
|
23
38
|
link: string;
|
|
24
39
|
} & Omit<BoxLinkProps, 'to' | 'tag' | 'link'>) | ({
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stock `setBlockquote` is `wrapIn`, and blockquote's content spec is `block+`
|
|
3
|
+
* — so the quote wraps *around* whatever block is there instead of converting
|
|
4
|
+
* it, and wraps again every time it is applied. Quoting a heading produced
|
|
5
|
+
* `<blockquote><h3>…</h3></blockquote>`, and picking Quote a second time
|
|
6
|
+
* produced `<blockquote><blockquote><h3>…</h3></blockquote></blockquote>`.
|
|
7
|
+
*
|
|
8
|
+
* Neither is visible in the editor. The inner heading keeps the theme's h3
|
|
9
|
+
* font-family/size, so the quote renders as a heading, and any block nested
|
|
10
|
+
* under the quote inherits the quote's font-family (theme heading styles fall
|
|
11
|
+
* back to `font-family: inherit` when the theme sets no family for that level —
|
|
12
|
+
* see viewer/theme.css) — so an h5 attribution line inside the quote turned
|
|
13
|
+
* serif. The stacking is silent too: a theme with no quote margin emits
|
|
14
|
+
* `--vev-blockquote-margin: 0`, so the doubled indent that would have given it
|
|
15
|
+
* away is zeroed out.
|
|
16
|
+
*
|
|
17
|
+
* Same class of bug as the heading-in-`<li>` fix in list-item.ts (E-1228), and
|
|
18
|
+
* the same two-part shape: normalize what is already saved while parsing, and
|
|
19
|
+
* stop the command creating more of it.
|
|
20
|
+
*/
|
|
21
|
+
export declare const blockquoteExtension: import("@tiptap/core").Node<import("@tiptap/extension-blockquote").BlockquoteOptions, any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Mark } from '@tiptap/core';
|
|
2
|
+
/**
|
|
3
|
+
* The dropcap the old plate editor shipped, ported to TipTap.
|
|
4
|
+
*
|
|
5
|
+
* Registering it is not only what puts the toolbar button back — ProseMirror does not
|
|
6
|
+
* preserve inline elements it has no mark for, it unwraps them and keeps the text. So
|
|
7
|
+
* without this mark every legacy `<span class="dropcap">` parsed away on load, and the
|
|
8
|
+
* first keystroke in the element saved the stripped HTML over the user's content.
|
|
9
|
+
*
|
|
10
|
+
* The markup is deliberately identical to what plate serialized. That keeps three things
|
|
11
|
+
* working with no migration and no viewer change:
|
|
12
|
+
* - `.text span.dropcap` in viewer/static-components.css styles the published render,
|
|
13
|
+
* - the text element's package CSS declares `span.dropcap` with `vev()` properties, which
|
|
14
|
+
* is what gives the design panel its "Span Dropcap" style section,
|
|
15
|
+
* - the panel only reveals that section when the saved text contains the literal
|
|
16
|
+
* `<span class="dropcap"` (see editor data/selection/utils/helpers.ts).
|
|
17
|
+
*/
|
|
18
|
+
export declare const Dropcap: Mark<any, any>;
|
|
19
|
+
declare module '@tiptap/core' {
|
|
20
|
+
interface Commands<ReturnType> {
|
|
21
|
+
dropcap: {
|
|
22
|
+
setDropcap: () => ReturnType;
|
|
23
|
+
toggleDropcap: () => ReturnType;
|
|
24
|
+
unsetDropcap: () => ReturnType;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Renders the editor's floating menus into `document.body`.
|
|
4
|
+
*
|
|
5
|
+
* The menus have to escape the editor's own DOM: hosts position the field inside
|
|
6
|
+
* containers that create a stacking context (the Vev editor canvas is one), which
|
|
7
|
+
* traps the menus underneath neighbouring panels no matter how high their z-index.
|
|
8
|
+
* Positioned as `fixed` with viewport coordinates once they live on the body.
|
|
9
|
+
*/
|
|
10
|
+
export declare function FloatingLayer({ children }: {
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/react';
|
|
2
|
+
interface FormattingToolbarProps {
|
|
3
|
+
editor: Editor;
|
|
4
|
+
onLinkClick: () => void;
|
|
5
|
+
onBlockTypeClick: () => void;
|
|
6
|
+
onAIClick?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function FormattingToolbar({ editor, onLinkClick, onBlockTypeClick, onAIClick, }: FormattingToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './silke-rich-text-field';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* jsdom implements neither `getClientRects` nor `Range.getBoundingClientRect`, and
|
|
3
|
+
* ProseMirror calls them via `coordsAtPos` — on every focus, and on mount as soon as a
|
|
4
|
+
* BubbleMenu is present, since it positions against the caret rect. Any spec that renders
|
|
5
|
+
* SilkeRichTextField needs these or it throws "target.getClientRects is not a function".
|
|
6
|
+
*
|
|
7
|
+
* They return empty rects: enough to get through the call, not enough to assert position
|
|
8
|
+
* against. Placement has to be checked in a browser.
|
|
9
|
+
*/
|
|
10
|
+
export declare function stubProseMirrorRects(): void;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Entry } from '../silke-autocomplete-field/autocomplete-types';
|
|
3
|
+
export interface LinkAttributes {
|
|
4
|
+
class?: string | null;
|
|
5
|
+
/** Set for uploaded files: makes the browser save rather than navigate. */
|
|
6
|
+
download?: string | null;
|
|
7
|
+
/** Inline font-size on the <a> itself (plate / pasted HTML). See linkExtension. */
|
|
8
|
+
fontSize?: string | null;
|
|
9
|
+
href: string;
|
|
10
|
+
rel?: string | null;
|
|
11
|
+
target?: string | null;
|
|
12
|
+
title?: string | null;
|
|
13
|
+
}
|
|
14
|
+
interface LinkMenuProps {
|
|
15
|
+
items: Entry<string>[];
|
|
16
|
+
position: React.CSSProperties;
|
|
17
|
+
current?: LinkAttributes | null;
|
|
18
|
+
onSelect: (attrs: LinkAttributes) => void;
|
|
19
|
+
onUpdate?: (attrs: LinkAttributes) => void;
|
|
20
|
+
onAdd?: (value: string) => void;
|
|
21
|
+
onUnlink?: () => void;
|
|
22
|
+
onClose: () => void;
|
|
23
|
+
menuRef: React.RefObject<HTMLDivElement | null>;
|
|
24
|
+
}
|
|
25
|
+
export declare function LinkMenu({ items, position, current, onSelect, onUpdate, onAdd, onUnlink, onClose, menuRef, }: LinkMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|