@vev/silke 1.1.9 → 1.2.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.
Files changed (189) hide show
  1. package/.turbo/turbo-build.log +162 -77
  2. package/CHANGELOG.md +40 -0
  3. package/dist/index.js +47 -40
  4. package/dist/index.js.LEGAL.txt +1 -1
  5. package/dist/index.js.map +7 -0
  6. package/dist/styles.css +1596 -1013
  7. package/dist/types/components/index.d.ts +2 -0
  8. package/dist/types/components/silke-autocomplete-field/autocomplete-item.d.ts +1 -1
  9. package/dist/types/components/silke-autocomplete-field/silke-autocomplete-field-native.d.ts +5 -0
  10. package/dist/types/components/silke-box/silke-box.d.ts +2 -0
  11. package/dist/types/components/silke-button/silke-dropdown-button.d.ts +3 -1
  12. package/dist/types/components/silke-card/silke-card-grid.d.ts +1 -0
  13. package/dist/types/components/silke-card/silke-card.d.ts +1 -0
  14. package/dist/types/components/silke-command-text-field/index.d.ts +1 -1
  15. package/dist/types/components/silke-command-text-field/silke-command-text-field.d.ts +16 -0
  16. package/dist/types/components/silke-command-text-field/utils.d.ts +25 -0
  17. package/dist/types/components/silke-css-number-field/silke-css-number-field.spec.d.ts +1 -0
  18. package/dist/types/components/silke-expression-input/index.d.ts +3 -0
  19. package/dist/types/components/silke-expression-input/silke-expression-input-tag.d.ts +6 -0
  20. package/dist/types/components/silke-expression-input/silke-expression-input.d.ts +29 -0
  21. package/dist/types/components/silke-expression-input/utils.d.ts +18 -0
  22. package/dist/types/components/silke-form-schema/fields/array-field-inline.d.ts +2 -1
  23. package/dist/types/components/silke-form-schema/fields/array-field-modal.d.ts +2 -1
  24. package/dist/types/components/silke-form-schema/fields/array-field.d.ts +1 -1
  25. package/dist/types/components/silke-form-schema/fields/group-field.d.ts +1 -1
  26. package/dist/types/components/silke-form-schema/fields/layout-field.d.ts +1 -1
  27. package/dist/types/components/silke-form-schema/fields/object-field.d.ts +1 -1
  28. package/dist/types/components/silke-form-schema/fields/popover-field.d.ts +1 -1
  29. package/dist/types/components/silke-form-schema/fields/string-field.d.ts +1 -1
  30. package/dist/types/components/silke-form-schema/index.d.ts +1 -0
  31. package/dist/types/components/silke-form-schema/silke-form-schema.d.ts +4 -1
  32. package/dist/types/components/silke-form-schema/silke-schema-decorator.d.ts +17 -0
  33. package/dist/types/components/silke-form-schema/silke-schema-field.d.ts +2 -1
  34. package/dist/types/components/silke-form-schema/silke-schema-fields.d.ts +2 -0
  35. package/dist/types/components/silke-form-schema/silke-schema-path.spec.d.ts +1 -0
  36. package/dist/types/components/silke-gradient-picker/silke-gradient-utils.d.ts +2 -0
  37. package/dist/types/components/silke-icon-picker/color-swatch-section.d.ts +6 -0
  38. package/dist/types/components/silke-icon-picker/emoji-tab.d.ts +1 -1
  39. package/dist/types/components/silke-icon-picker/icons-tab.d.ts +1 -1
  40. package/dist/types/components/silke-icon-picker/silke-icon-picker.d.ts +2 -0
  41. package/dist/types/components/silke-icon-picker/utils.d.ts +2 -0
  42. package/dist/types/components/silke-list/silke-list-item.d.ts +5 -1
  43. package/dist/types/components/silke-list/types.d.ts +1 -0
  44. package/dist/types/components/silke-navigation-link/silke-navigation-link.d.ts +15 -0
  45. package/dist/types/components/silke-popover/popover-context.spec.d.ts +1 -0
  46. package/dist/types/components/silke-rich-text-field/blockquote.d.ts +21 -0
  47. package/dist/types/components/silke-rich-text-field/blockquote.spec.d.ts +1 -0
  48. package/dist/types/components/silke-rich-text-field/dropcap.d.ts +27 -0
  49. package/dist/types/components/silke-rich-text-field/dropcap.spec.d.ts +1 -0
  50. package/dist/types/components/silke-rich-text-field/floating-layer.d.ts +12 -0
  51. package/dist/types/components/silke-rich-text-field/font-size.d.ts +2 -0
  52. package/dist/types/components/silke-rich-text-field/formatting-toolbar.d.ts +9 -0
  53. package/dist/types/components/silke-rich-text-field/index.d.ts +1 -0
  54. package/dist/types/components/silke-rich-text-field/jsdom-rects.d.ts +10 -0
  55. package/dist/types/components/silke-rich-text-field/link-menu.d.ts +26 -0
  56. package/dist/types/components/silke-rich-text-field/link-menu.spec.d.ts +1 -0
  57. package/dist/types/components/silke-rich-text-field/link-suggestions.d.ts +48 -0
  58. package/dist/types/components/silke-rich-text-field/link-suggestions.spec.d.ts +1 -0
  59. package/dist/types/components/silke-rich-text-field/link-tooltip.d.ts +15 -0
  60. package/dist/types/components/silke-rich-text-field/list-item.d.ts +15 -0
  61. package/dist/types/components/silke-rich-text-field/list-link-fontsize.spec.d.ts +1 -0
  62. package/dist/types/components/silke-rich-text-field/lorem-ipsum.d.ts +10 -0
  63. package/dist/types/components/silke-rich-text-field/lorem-ipsum.spec.d.ts +1 -0
  64. package/dist/types/components/silke-rich-text-field/paste.d.ts +1 -0
  65. package/dist/types/components/silke-rich-text-field/paste.spec.d.ts +1 -0
  66. package/dist/types/components/silke-rich-text-field/plugins.d.ts +18 -0
  67. package/dist/types/components/silke-rich-text-field/plugins.spec.d.ts +1 -0
  68. package/dist/types/components/silke-rich-text-field/silke-rich-text-field.d.ts +60 -0
  69. package/dist/types/components/silke-rich-text-field/slash-menu-items.d.ts +10 -0
  70. package/dist/types/components/silke-rich-text-field/slash-menu.d.ts +11 -0
  71. package/dist/types/components/silke-rich-text-field/table-content-sync.spec.d.ts +1 -0
  72. package/dist/types/components/silke-rich-text-field/table-toolbar.d.ts +17 -0
  73. package/dist/types/components/silke-rich-text-field/table-toolbar.spec.d.ts +1 -0
  74. package/dist/types/components/silke-rich-text-field/table.spec.d.ts +1 -0
  75. package/dist/types/components/silke-rich-text-field/use-link-hover.d.ts +15 -0
  76. package/dist/types/components/silke-rich-text-field/use-slash-menu.d.ts +13 -0
  77. package/dist/types/components/silke-rich-text-field/utils.d.ts +13 -0
  78. package/dist/types/components/silke-sortable-list/index.d.ts +1 -1
  79. package/dist/types/components/silke-sortable-list/silke-nested-sortable-list.d.ts +8 -1
  80. package/dist/types/components/silke-theme-card/silke-theme-card.d.ts +13 -6
  81. package/dist/types/components/silke-theme-swatch/silke-theme-swatch.d.ts +6 -1
  82. package/dist/types/icons.d.ts +18 -0
  83. package/esbuild.config.mjs +9 -4
  84. package/package.json +22 -9
  85. package/src/components/index.ts +2 -0
  86. package/src/components/silke-alert-banner/silke-alert-banner.tsx +1 -1
  87. package/src/components/silke-autocomplete-field/autocomplete-item.tsx +47 -61
  88. package/src/components/silke-autocomplete-field/silke-autocomplete-field-native.tsx +13 -2
  89. package/src/components/silke-autocomplete-field/silke-autocomplete-field.tsx +8 -5
  90. package/src/components/silke-autocomplete-field/silke-autocomplete-popup-native.tsx +2 -1
  91. package/src/components/silke-box/silke-box.scss +4 -0
  92. package/src/components/silke-box/silke-box.tsx +4 -0
  93. package/src/components/silke-button/silke-dropdown-button.tsx +4 -1
  94. package/src/components/silke-card/silke-card.scss +4 -0
  95. package/src/components/silke-card/silke-card.tsx +3 -0
  96. package/src/components/silke-command-text-field/index.ts +1 -0
  97. package/src/components/silke-command-text-field/silke-command-parser.spec.ts +55 -0
  98. package/src/components/silke-command-text-field/silke-command-parser.ts +33 -2
  99. package/src/components/silke-command-text-field/silke-command-text-field.module.scss +3 -0
  100. package/src/components/silke-command-text-field/silke-command-text-field.tsx +53 -48
  101. package/src/components/silke-command-text-field/utils.spec.ts +192 -0
  102. package/src/components/silke-command-text-field/utils.ts +99 -16
  103. package/src/components/silke-css-number-field/silke-css-number-field.spec.tsx +115 -0
  104. package/src/components/silke-css-number-field/silke-css-number-field.tsx +33 -0
  105. package/src/components/silke-expression-input/index.ts +3 -0
  106. package/src/components/silke-expression-input/silke-expression-input-tag.tsx +37 -0
  107. package/src/components/silke-expression-input/silke-expression-input.mdx +40 -0
  108. package/src/components/silke-expression-input/silke-expression-input.scss +24 -0
  109. package/src/components/silke-expression-input/silke-expression-input.tsx +343 -0
  110. package/src/components/silke-expression-input/utils.ts +144 -0
  111. package/src/components/silke-form-schema/fields/array-field-inline.tsx +4 -0
  112. package/src/components/silke-form-schema/fields/array-field-modal.tsx +4 -0
  113. package/src/components/silke-form-schema/fields/array-field.tsx +6 -11
  114. package/src/components/silke-form-schema/fields/group-field.tsx +2 -0
  115. package/src/components/silke-form-schema/fields/layout-field.tsx +2 -0
  116. package/src/components/silke-form-schema/fields/number-field.tsx +114 -4
  117. package/src/components/silke-form-schema/fields/object-field.tsx +2 -0
  118. package/src/components/silke-form-schema/fields/popover-field.tsx +2 -0
  119. package/src/components/silke-form-schema/fields/string-field.tsx +27 -1
  120. package/src/components/silke-form-schema/index.ts +1 -0
  121. package/src/components/silke-form-schema/silke-form-schema.mdx +30 -1
  122. package/src/components/silke-form-schema/silke-form-schema.tsx +12 -6
  123. package/src/components/silke-form-schema/silke-schema-decorator.tsx +32 -0
  124. package/src/components/silke-form-schema/silke-schema-field.tsx +19 -2
  125. package/src/components/silke-form-schema/silke-schema-fields.tsx +30 -4
  126. package/src/components/silke-form-schema/silke-schema-path.spec.tsx +160 -0
  127. package/src/components/silke-gradient-picker/silke-gradient-picker.tsx +3 -1
  128. package/src/components/silke-gradient-picker/silke-gradient-utils.ts +23 -3
  129. package/src/components/silke-icon/silke-shape.tsx +1 -1
  130. package/src/components/silke-icon-picker/color-swatch-section.tsx +61 -0
  131. package/src/components/silke-icon-picker/emoji-tab.tsx +8 -6
  132. package/src/components/silke-icon-picker/icons-tab.tsx +8 -7
  133. package/src/components/silke-icon-picker/silke-icon-picker.tsx +52 -25
  134. package/src/components/silke-icon-picker/styles.scss +66 -1
  135. package/src/components/silke-icon-picker/utils.ts +2 -0
  136. package/src/components/silke-list/silke-list-item.scss +10 -0
  137. package/src/components/silke-list/silke-list-item.tsx +16 -3
  138. package/src/components/silke-list/silke-list.mdx +18 -0
  139. package/src/components/silke-list/types.ts +1 -0
  140. package/src/components/silke-navigation-link/silke-navigation-link.scss +162 -42
  141. package/src/components/silke-navigation-link/silke-navigation-link.tsx +99 -21
  142. package/src/components/silke-popover/popover-context.spec.tsx +44 -0
  143. package/src/components/silke-popover-native/silke-popover-native.scss +5 -3
  144. package/src/components/silke-rich-text-field/blockquote.spec.ts +151 -0
  145. package/src/components/silke-rich-text-field/blockquote.ts +90 -0
  146. package/src/components/silke-rich-text-field/dropcap.spec.ts +67 -0
  147. package/src/components/silke-rich-text-field/dropcap.ts +59 -0
  148. package/src/components/silke-rich-text-field/floating-layer.tsx +15 -0
  149. package/src/components/silke-rich-text-field/font-size.ts +62 -0
  150. package/src/components/silke-rich-text-field/formatting-toolbar.tsx +145 -0
  151. package/src/components/silke-rich-text-field/index.ts +1 -0
  152. package/src/components/silke-rich-text-field/jsdom-rects.ts +15 -0
  153. package/src/components/silke-rich-text-field/link-menu.spec.tsx +502 -0
  154. package/src/components/silke-rich-text-field/link-menu.tsx +553 -0
  155. package/src/components/silke-rich-text-field/link-suggestions.spec.ts +203 -0
  156. package/src/components/silke-rich-text-field/link-suggestions.ts +188 -0
  157. package/src/components/silke-rich-text-field/link-tooltip.tsx +60 -0
  158. package/src/components/silke-rich-text-field/list-item.ts +64 -0
  159. package/src/components/silke-rich-text-field/list-link-fontsize.spec.ts +135 -0
  160. package/src/components/silke-rich-text-field/lorem-ipsum.spec.ts +131 -0
  161. package/src/components/silke-rich-text-field/lorem-ipsum.ts +51 -0
  162. package/src/components/silke-rich-text-field/paste.spec.ts +93 -0
  163. package/src/components/silke-rich-text-field/paste.ts +39 -0
  164. package/src/components/silke-rich-text-field/plugins.spec.ts +143 -0
  165. package/src/components/silke-rich-text-field/plugins.ts +230 -0
  166. package/src/components/silke-rich-text-field/silke-rich-text-field.mdx +180 -0
  167. package/src/components/silke-rich-text-field/silke-rich-text-field.scss +343 -0
  168. package/src/components/silke-rich-text-field/silke-rich-text-field.tsx +505 -0
  169. package/src/components/silke-rich-text-field/slash-menu-items.ts +112 -0
  170. package/src/components/silke-rich-text-field/slash-menu.tsx +50 -0
  171. package/src/components/silke-rich-text-field/table-content-sync.spec.tsx +61 -0
  172. package/src/components/silke-rich-text-field/table-toolbar.spec.tsx +168 -0
  173. package/src/components/silke-rich-text-field/table-toolbar.tsx +121 -0
  174. package/src/components/silke-rich-text-field/table.spec.ts +87 -0
  175. package/src/components/silke-rich-text-field/use-link-hover.ts +63 -0
  176. package/src/components/silke-rich-text-field/use-slash-menu.ts +130 -0
  177. package/src/components/silke-rich-text-field/utils.ts +55 -0
  178. package/src/components/silke-sortable-list/index.ts +1 -1
  179. package/src/components/silke-sortable-list/silke-nested-sortable-list.scss +11 -1
  180. package/src/components/silke-sortable-list/silke-nested-sortable-list.tsx +9 -0
  181. package/src/components/silke-sortable-list/silke-sortable-list.mdx +13 -0
  182. package/src/components/silke-tag/silke-tag.scss +12 -3
  183. package/src/components/silke-theme-card/silke-theme-card.module.scss +141 -45
  184. package/src/components/silke-theme-card/silke-theme-card.tsx +76 -47
  185. package/src/components/silke-theme-swatch/silke-theme-swatch.mdx +56 -0
  186. package/src/components/silke-theme-swatch/silke-theme-swatch.module.scss +53 -63
  187. package/src/components/silke-theme-swatch/silke-theme-swatch.tsx +99 -14
  188. package/src/icons.tsx +65 -4
  189. package/tsconfig.build.tsbuildinfo +0 -1
@@ -0,0 +1,48 @@
1
+ import type { SilkeIcons } from '../silke-icon';
2
+ export type LinkSuggestionKind = 'email' | 'phone' | 'external' | 'internal';
3
+ export interface LinkSuggestion {
4
+ kind: LinkSuggestionKind;
5
+ /** The href that will be saved. */
6
+ href: string;
7
+ /** Row label, e.g. "Email hello@vev.design". */
8
+ label: string;
9
+ icon: SilkeIcons;
10
+ }
11
+ export interface MailtoParts {
12
+ email: string;
13
+ subject: string;
14
+ }
15
+ /**
16
+ * Split a mailto href back into address and subject, so editing an existing mail
17
+ * link shows "hello@vev.design" in the field rather than the whole encoded href.
18
+ *
19
+ * The query key is matched case-insensitively: the previous text editor wrote
20
+ * `?Subject=`, so links made there have to round-trip too.
21
+ */
22
+ export declare function parseMailto(href: string): MailtoParts | null;
23
+ /** Build a mailto href, dropping the query entirely when there is no subject. */
24
+ export declare function buildMailto(email: string, subject?: string): string;
25
+ /**
26
+ * Best-effort href for free text. Returns the input untouched when it is already
27
+ * explicit, or when the intent isn't clear — it never guesses destructively, and
28
+ * anything it does change is shown back to the user via `getLinkSuggestion`.
29
+ */
30
+ export declare function normalizeHref(input: string): string;
31
+ /** tel: hrefs are unreliable with spaces in them, so keep only '+' and digits. */
32
+ export declare function telHref(value: string): string;
33
+ /** The bare address out of anything mailto-shaped, ignoring any query. */
34
+ export declare function mailAddress(value: string): string;
35
+ /**
36
+ * The action row shown above the page/element list. It exists so that typing an
37
+ * address gives you something to see and click — previously the list simply went
38
+ * empty and there was no sign that Enter would do anything.
39
+ *
40
+ * Returns null for plain search text, where the page/element list is the answer.
41
+ *
42
+ * `subject` is folded into mail links here so the row commits the same href the
43
+ * Subject field is showing.
44
+ */
45
+ export declare function getLinkSuggestion(input: string, options?: {
46
+ subject?: string;
47
+ kind?: 'email' | 'phone';
48
+ }): LinkSuggestion | null;
@@ -0,0 +1,15 @@
1
+ interface LinkTooltipProps {
2
+ href: string;
3
+ label?: string;
4
+ position: {
5
+ left: number;
6
+ top: number;
7
+ };
8
+ onOpen: () => void;
9
+ onEdit: () => void;
10
+ onUnlink: () => void;
11
+ onMouseEnter: () => void;
12
+ onMouseLeave: () => void;
13
+ }
14
+ export declare function LinkTooltip({ href, label, position, onOpen, onEdit, onUnlink, onMouseEnter, onMouseLeave, }: LinkTooltipProps): import("react/jsx-runtime").JSX.Element;
15
+ export {};
@@ -0,0 +1,15 @@
1
+ import { Extension } from '@tiptap/core';
2
+ /**
3
+ * Keep StarterKit's `paragraph block*` (needed so Tab can nest a list under an
4
+ * item). Convert a heading that is a *direct* child of `<li>` to a paragraph
5
+ * while parsing — otherwise the heading is lifted next to the list and the
6
+ * text sticks at the theme h1 size (~48px) instead of the element's set size
7
+ * (E-1228). Nested lists are left alone.
8
+ */
9
+ export declare const listItemExtension: import("@tiptap/core").Node<import("@tiptap/extension-list").ListItemOptions, any>;
10
+ /**
11
+ * Registered after StarterKit so these replace its setHeading / toggleHeading.
12
+ * `setNode('heading')` inside a list item lifts the item out of the list
13
+ * (TipTap #7197); no-op instead so the item keeps inheriting the element size.
14
+ */
15
+ export declare const StayInList: Extension<any, any>;
@@ -0,0 +1,10 @@
1
+ import { Extension, type Editor } from '@tiptap/react';
2
+ /** Verbatim from the old plate editor's lorem ipsum plugin, so the two stay in parity. */
3
+ export declare const LOREM_IPSUM_TEXT = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
4
+ /**
5
+ * Replaces a trailing `lorem` with the full paragraph. Returns false when the word
6
+ * before the caret is something else, which lets Tab fall through to whatever else
7
+ * binds it (ListItem sinks the item, otherwise the browser moves focus).
8
+ */
9
+ export declare function expandLoremIpsum(editor: Editor): boolean;
10
+ export declare const LoremIpsum: Extension<any, any>;
@@ -0,0 +1 @@
1
+ export declare function stripPastedInlineStyles(html: string): string;
@@ -0,0 +1,18 @@
1
+ import { Plugin, PluginKey } from '@tiptap/pm/state';
2
+ import { DecorationSet } from '@tiptap/pm/view';
3
+ import Underline from '@tiptap/extension-underline';
4
+ import Superscript from '@tiptap/extension-superscript';
5
+ import Subscript from '@tiptap/extension-subscript';
6
+ import { TableRow } from '@tiptap/extension-table';
7
+ export declare const starterKit: import("@tiptap/core").Extension<import("@tiptap/starter-kit").StarterKitOptions, any>;
8
+ export declare const linkExtension: import("@tiptap/core").Mark<import("@tiptap/extension-link").LinkOptions, any>;
9
+ export { Underline, Superscript, Subscript };
10
+ export declare const tableExtension: import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any>;
11
+ export declare const tableCellExtension: import("@tiptap/core").Node<import("@tiptap/extension-table").TableCellOptions, any>;
12
+ export declare const tableHeaderExtension: import("@tiptap/core").Node<import("@tiptap/extension-table").TableHeaderOptions, any>;
13
+ export { TableRow };
14
+ export declare const selectionHighlightKey: PluginKey<any>;
15
+ export declare const selectionHighlightPlugin: Plugin<DecorationSet>;
16
+ export declare function buildExtensions(commandPlaceholderRef: {
17
+ current: string;
18
+ }): (import("@tiptap/core").Node<import("@tiptap/extension-blockquote").BlockquoteOptions, any> | import("@tiptap/core").Mark<any, any> | import("@tiptap/core").Node<import("@tiptap/extension-list").ListItemOptions, any> | import("@tiptap/core").Extension<any, any> | import("@tiptap/core").Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | import("@tiptap/core").Mark<import("@tiptap/extension-link").LinkOptions, any> | import("@tiptap/core").Node<import("@tiptap/extension-table").TableOptions, any> | import("@tiptap/core").Extension<import("@tiptap/extension-placeholder").PlaceholderOptions, any> | import("@tiptap/core").Mark<import("@tiptap/extension-underline").UnderlineOptions, any>)[];
@@ -0,0 +1,60 @@
1
+ import React from 'react';
2
+ import type { Entry } from '../silke-autocomplete-field/autocomplete-types';
3
+ import { SilkeInputSize } from '../silke-text-field/silke-text-field';
4
+ export { PluginKey, Plugin as PmPlugin } from '@tiptap/pm/state';
5
+ export { Decoration, DecorationSet } from '@tiptap/pm/view';
6
+ export { Editor } from '@tiptap/react';
7
+ export interface SilkeRichTextFieldProps {
8
+ /** HTML content value */
9
+ value?: string;
10
+ /** Called when content changes with HTML string */
11
+ onChange?: (value: string) => void;
12
+ /** Placeholder text shown when editor is empty and unfocused */
13
+ placeholder?: string;
14
+ /** Placeholder shown on focused empty blocks */
15
+ commandPlaceholder?: string;
16
+ /** Label displayed above the editor */
17
+ label?: string;
18
+ /** Help text displayed below the editor */
19
+ help?: string;
20
+ /** Error message */
21
+ error?: string;
22
+ /** Field style variant. 'plain' renders just the editor with no outline or label. */
23
+ kind?: 'default' | 'ghost' | 'zombie' | 'plain';
24
+ /** Field size */
25
+ size?: SilkeInputSize;
26
+ /** Minimum height of the editor area */
27
+ minHeight?: number | string;
28
+ /** Maximum height (enables scrolling) */
29
+ maxHeight?: number | string;
30
+ /** Whether the field is disabled */
31
+ disabled?: boolean;
32
+ /** Whether the field is read-only */
33
+ readOnly?: boolean;
34
+ /** Auto focus on mount */
35
+ autoFocus?: boolean;
36
+ /** Makes text field flex */
37
+ flex?: boolean;
38
+ /** Called on blur */
39
+ onBlur?: () => void;
40
+ /** Called on focus */
41
+ onFocus?: () => void;
42
+ /** Autocomplete items for the link picker popover */
43
+ linkItems?: Entry<string>[];
44
+ /** Called when user creates a new link not in the list */
45
+ onAddLink?: (value: string) => void;
46
+ /** Called when space is pressed on an empty block */
47
+ onSpaceCommand?: () => void;
48
+ /** Ref to access the underlying TipTap editor instance */
49
+ editorRef?: React.MutableRefObject<any>;
50
+ /** Custom CSS class to override default typography styles. When not provided, built-in typography is applied. */
51
+ typographyClassName?: string;
52
+ /** Called when user clicks the AI button in the toolbar. Receives the currently selected text. Only shows the AI button when provided. */
53
+ onSelectionAI?: (selectedText: string) => void;
54
+ /** Additional class name */
55
+ className?: string;
56
+ }
57
+ export declare function SilkeRichTextField({ value, onChange, placeholder, commandPlaceholder, label, help, error, kind, size, minHeight, maxHeight, disabled, readOnly, autoFocus, flex, onBlur, onFocus, linkItems, onAddLink, onSpaceCommand, onSelectionAI, editorRef, typographyClassName, className, }: SilkeRichTextFieldProps): import("react/jsx-runtime").JSX.Element;
58
+ export declare namespace SilkeRichTextField {
59
+ var displayName: string;
60
+ }
@@ -0,0 +1,10 @@
1
+ import type { Editor } from '@tiptap/react';
2
+ import type { SilkeIcons } from '../silke-icon';
3
+ export interface SlashMenuItem {
4
+ label: string;
5
+ description: string;
6
+ icon: SilkeIcons;
7
+ keywords: string[];
8
+ command: (editor: Editor) => void;
9
+ }
10
+ export declare const SLASH_MENU_ITEMS: SlashMenuItem[];
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { SlashMenuItem } from './slash-menu-items';
3
+ interface SlashMenuProps {
4
+ items: SlashMenuItem[];
5
+ activeIndex: number;
6
+ position: React.CSSProperties;
7
+ onSelect: (item: SlashMenuItem) => void;
8
+ onHover: (index: number) => void;
9
+ }
10
+ export declare function SlashMenu({ items, activeIndex, position, onSelect, onHover }: SlashMenuProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,17 @@
1
+ import type { Editor } from '@tiptap/react';
2
+ interface TableToolbarProps {
3
+ editor: Editor;
4
+ /** Hide while the slash or link menu owns the area around the caret. */
5
+ suppressed?: boolean;
6
+ }
7
+ /**
8
+ * Row/column controls for the cell the caret sits in — the replacement for the table
9
+ * editor the old Plate-based editor had, and placed the way that one was: in the gutter to
10
+ * the left of the table, vertically level with the row being edited. Over the table it
11
+ * covered the cell above the caret, which made editing the top rows unworkable.
12
+ *
13
+ * The anchor is a zero-width box at (table's left edge, caret's line), so Floating UI puts
14
+ * the toolbar just outside the table without it having to know the toolbar's own size.
15
+ */
16
+ export declare function TableToolbar({ editor, suppressed }: TableToolbarProps): import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1,15 @@
1
+ interface LinkHoverState {
2
+ href: string;
3
+ /** Viewport coordinates — the tooltip renders in the floating layer. */
4
+ rect: {
5
+ left: number;
6
+ top: number;
7
+ };
8
+ }
9
+ export declare function useLinkHover(editorAreaRef: React.RefObject<HTMLDivElement | null>): {
10
+ hoveredLink: LinkHoverState | null;
11
+ hoveredAnchor: import("react").MutableRefObject<HTMLAnchorElement | null>;
12
+ cancelDismiss: () => void;
13
+ dismiss: () => void;
14
+ };
15
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { Editor } from '@tiptap/react';
2
+ import { SlashMenuItem } from './slash-menu-items';
3
+ export declare function useSlashMenu(editor: Editor | null, isFocused: boolean): {
4
+ open: boolean;
5
+ index: number;
6
+ filteredItems: SlashMenuItem[];
7
+ close: () => void;
8
+ selectItem: (item: SlashMenuItem) => void;
9
+ setIndex: (index: number) => void;
10
+ navigateUp: () => void;
11
+ navigateDown: () => void;
12
+ openFromToolbar: () => void;
13
+ };
@@ -0,0 +1,13 @@
1
+ import type { ResolvedPos } from '@tiptap/pm/model';
2
+ import type { Editor } from '@tiptap/react';
3
+ /** Viewport position of the cursor, for the menus that render in the floating layer */
4
+ export declare function getCursorPosition(editor: Editor | null): {
5
+ left: number;
6
+ top: number;
7
+ };
8
+ /** The <table> element the caret sits in, for anchoring the table toolbar to its edge. */
9
+ export declare function getTableElement(editor: Editor | null): HTMLElement | null;
10
+ /** Whether the caret sits inside a table cell. */
11
+ export declare function isInTable($from: ResolvedPos): boolean;
12
+ /** Stable ref that always points to the latest value. Avoids stale closures in useEditor callbacks. */
13
+ export declare function useLatest<T>(value: T): import("react").MutableRefObject<T>;
@@ -1,3 +1,3 @@
1
1
  export * from './silke-sortable-list';
2
2
  export * from './silke-nested-sortable-list';
3
- export { SilkeSortableIconComponent, SilkeSortableIconProps } from './silke-nested-sortable-utils';
3
+ export { Item, SilkeSortableIconComponent, SilkeSortableIconProps } from './silke-nested-sortable-utils';
@@ -7,6 +7,13 @@ type SilkeNestedSortableListProps<T> = {
7
7
  items: Item<T>[];
8
8
  selected?: string[];
9
9
  collapsed?: (item: Item<T>) => boolean;
10
+ /**
11
+ * Style used for hover highlight on rows. `'ring'` (default) paints a 1px
12
+ * inset outline — use for dense lists where hover and selected need to read
13
+ * differently. `'fill'` paints a full-width background — use for
14
+ * sidebar/nav style rows where hover and selected share the same shape.
15
+ */
16
+ hoverStyle?: 'ring' | 'fill';
10
17
  classNameItem?: string | ((item: Item<T>) => string);
11
18
  children: RenderFunction<T>;
12
19
  replaceIcon?: SilkeSortableIconComponent<T>;
@@ -22,5 +29,5 @@ type SilkeNestedSortableListProps<T> = {
22
29
  onItemMouseLeave?: (e: React.MouseEvent, item: Item<T>) => void;
23
30
  onItemContextMenu?: (e: React.MouseEvent, item: Item<T>) => void;
24
31
  } & Omit<BoxProps, 'children'>;
25
- export declare function SilkeNestedSortableList<T>({ rootItems, items, selected, collapsed, children, className, classNameItem, replaceIcon, onSort, canHaveChildren, canSort, canDrag, onCollapse, onItemClick, onItemDoubleClick, onItemMouseEnter, onItemMouseLeave, onItemContextMenu, ...rest }: SilkeNestedSortableListProps<T>): import("react/jsx-runtime").JSX.Element;
32
+ export declare function SilkeNestedSortableList<T>({ rootItems, items, selected, collapsed, hoverStyle, children, className, classNameItem, replaceIcon, onSort, canHaveChildren, canSort, canDrag, onCollapse, onItemClick, onItemDoubleClick, onItemMouseEnter, onItemMouseLeave, onItemContextMenu, ...rest }: SilkeNestedSortableListProps<T>): import("react/jsx-runtime").JSX.Element;
26
33
  export {};
@@ -1,18 +1,25 @@
1
- import React from 'react';
2
- import { SilkeOverflowMenuItem } from '../silke-overflow-menu';
3
1
  interface SilkeThemeCardProps {
4
- name: string;
5
- description?: string;
2
+ /** Layout variant. `compact` = single row (Aa, bar, swatches). `rich` = two-row with Button + Link. */
3
+ variant?: 'compact' | 'rich';
6
4
  primaryColor?: string;
7
5
  secondaryColor?: string;
8
6
  accentColor?: string;
9
7
  bgColor?: string;
10
8
  textColor?: string;
9
+ /** Color for the "Aa" heading preview. Falls back to `textColor` when unset. */
10
+ headingColor?: string;
11
11
  baseFont?: string;
12
+ /** CSS color for the themed Link element (rich variant only). */
13
+ linkColor?: string;
14
+ /** CSS border-radius for the themed Button (rich variant only). */
15
+ buttonRadius?: string;
16
+ /** Shows an "Applied" pill overlay in the top-right (primary kind). */
17
+ isApplied?: boolean;
18
+ /** Shows a "Default" tag in the bottom-right (secondary kind). */
12
19
  isDefault?: boolean;
20
+ /** Outlines the card to indicate selection/applied state. */
13
21
  isSelected?: boolean;
14
22
  onClick?: () => void;
15
- menu?: (SilkeOverflowMenuItem | React.ReactElement | 'divider')[];
16
23
  }
17
- export declare function SilkeThemeCard({ name, description, primaryColor, secondaryColor, accentColor, bgColor, textColor, baseFont, isDefault, isSelected, onClick, menu, }: SilkeThemeCardProps): import("react/jsx-runtime").JSX.Element;
24
+ export declare function SilkeThemeCard({ variant, primaryColor, secondaryColor, accentColor, bgColor, textColor, headingColor, baseFont, linkColor, buttonRadius, isApplied, isDefault, isSelected, onClick, }: SilkeThemeCardProps): import("react/jsx-runtime").JSX.Element;
18
25
  export {};
@@ -2,10 +2,15 @@ declare const SHADE_KEYS: readonly [50, 100, 200, 300, 400, 500, 600, 700, 800,
2
2
  type ShadeKey = (typeof SHADE_KEYS)[number];
3
3
  interface SilkeThemeSwatchProps {
4
4
  label: string;
5
+ subTitle?: string;
5
6
  token?: string;
6
7
  shades: Record<ShadeKey, string>;
7
8
  selectedShade?: ShadeKey;
8
9
  onSelect?: (shade: ShadeKey) => void;
10
+ /** When set, displays this shade as a separate square to the left of the strip */
11
+ primaryShade?: ShadeKey;
12
+ /** Shades hidden from the strip entirely. */
13
+ disabledShades?: ShadeKey[];
9
14
  }
10
- export declare function SilkeThemeSwatch({ label, token, shades, selectedShade, onSelect, }: SilkeThemeSwatchProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function SilkeThemeSwatch({ label, subTitle, token, shades, selectedShade, onSelect, primaryShade, disabledShades, }: SilkeThemeSwatchProps): import("react/jsx-runtime").JSX.Element;
11
16
  export {};
@@ -31,8 +31,10 @@ export declare const SilkeIconDefinitions: {
31
31
  'ai.image': string;
32
32
  'ai.component': typeof AiGradientComponent;
33
33
  'ai.component.flat': string;
34
+ 'ai.component.linked': typeof AiGradientLinked;
34
35
  'ai.text': string;
35
36
  'ai.file': string;
37
+ 'ai.clone.edit': typeof AiGradientCloneEdit;
36
38
  sparkles: string;
37
39
  compare: string;
38
40
  menuMore: string;
@@ -81,6 +83,7 @@ export declare const SilkeIconDefinitions: {
81
83
  shapes: string;
82
84
  sharedStyle: string;
83
85
  paintbrush: string;
86
+ corner: string;
84
87
  firefox: string;
85
88
  safari: string;
86
89
  'square.dashed': string;
@@ -105,6 +108,7 @@ export declare const SilkeIconDefinitions: {
105
108
  'network.on': string;
106
109
  'network.off': string;
107
110
  grid: string;
111
+ 'grid.dividers': string;
108
112
  'memo.circle.check': string;
109
113
  'bring.forward': string;
110
114
  'bring.backward': string;
@@ -228,6 +232,7 @@ export declare const SilkeIconDefinitions: {
228
232
  users: string;
229
233
  'users-class': string;
230
234
  team: string;
235
+ 'team.upgrade': string;
231
236
  workspace: string;
232
237
  admin: string;
233
238
  hosting: string;
@@ -434,6 +439,7 @@ export declare const SilkeIconDefinitions: {
434
439
  'interaction.translate': string;
435
440
  'variable.icon': string;
436
441
  'variable.color': string;
442
+ 'palette.slash': string;
437
443
  'variable.text': string;
438
444
  'variable.image': string;
439
445
  marketing: string;
@@ -498,5 +504,17 @@ declare function AnimationFillForwards(): import("react/jsx-runtime").JSX.Elemen
498
504
  declare function AnimationFillBoth(): import("react/jsx-runtime").JSX.Element;
499
505
  declare function AiGradientIcon(): import("react/jsx-runtime").JSX.Element;
500
506
  declare function AiGradientPage(): import("react/jsx-runtime").JSX.Element;
507
+ declare function AiGradientCloneEdit(): import("react/jsx-runtime").JSX.Element;
508
+ /**
509
+ * An AI element that shares its generated code with copies of itself.
510
+ *
511
+ * Same shape as the other ai.* icons on purpose: a kit glyph painted with the shared gradient
512
+ * through background-clip. Earlier versions drew it as an inline SVG, which meant hand-matching
513
+ * the box and baseline the FontAwesome glyphs sit on, reproducing the gradient in SVG (its teal
514
+ * stop sits past the end of the box, so it needed userSpaceOnUse to avoid clamping), and losing
515
+ * the gradient anyway wherever a consumer restyles icon paths — the layer list sets
516
+ * `.icon path { fill: currentColor }`. As a glyph none of that applies.
517
+ */
518
+ declare function AiGradientLinked(): import("react/jsx-runtime").JSX.Element;
501
519
  declare function AiGradientComponent(): import("react/jsx-runtime").JSX.Element;
502
520
  export {};
@@ -13,7 +13,7 @@ const cli = meow(
13
13
  `
14
14
  Usage
15
15
  $ node esbuild.js
16
-
16
+
17
17
  Options
18
18
  --watch watch for changes
19
19
  `,
@@ -33,18 +33,23 @@ buildSilke(watch);
33
33
  async function buildSilke(watch) {
34
34
  console.log(`🚧 @vev/silke building`);
35
35
  const time = Date.now();
36
-
36
+ /** @type {import('esbuild').BuildOptions} */
37
37
  const config = {
38
38
  entryPoints: [path.resolve(__dirname, './src/index.ts')],
39
39
  outdir: path.resolve(__dirname, './dist'),
40
40
  bundle: true,
41
41
  minify: !watch,
42
- sourcemap: watch ? 'inline' : false,
42
+ sourcemap: watch ? 'inline' : 'both',
43
43
  splitting: false,
44
44
  format: 'esm',
45
45
  legalComments: 'linked',
46
46
  target: ['es2020'],
47
- external: Object.keys(pkg.peerDependencies || {}),
47
+ external: [
48
+ ...Object.keys(pkg.peerDependencies || {}),
49
+ // Tiptap and its dependencies must be external to avoid bundling CJS code
50
+ // (use-sync-external-store) that does dynamic require('react') in ESM output
51
+ '@tiptap/*',
52
+ ],
48
53
  allowOverwrite: true,
49
54
  plugins: [
50
55
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vev/silke",
3
- "version": "1.1.9",
3
+ "version": "1.2.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,22 +12,35 @@
12
12
  "peerDependencies": {
13
13
  "react": ">=16.0.0",
14
14
  "react-dom": ">=16.0.0",
15
- "react-router-dom": "^7.12.0"
15
+ "react-router-dom": "^7.18.2"
16
16
  },
17
17
  "dependencies": {
18
- "invokers": "^1.8.0",
19
- "tinycolor2": "^1.6.0",
20
- "@types/tinycolor2": "^1.4.6",
21
- "dompurify": "^3.3.2",
22
18
  "@codemirror/lang-css": "^6.0.0",
23
19
  "@codemirror/lang-javascript": "^6.1.0",
24
20
  "@codemirror/lang-json": "^6.0.0",
25
- "@uiw/react-codemirror": "^4.12.3",
21
+ "@tiptap/core": "3.22.3",
22
+ "@tiptap/extension-blockquote": "3.22.3",
23
+ "@tiptap/extension-link": "^3.20.4",
24
+ "@tiptap/extension-list": "3.22.3",
25
+ "@tiptap/extension-placeholder": "^3.20.4",
26
+ "@tiptap/extension-subscript": "^3.20.4",
27
+ "@tiptap/extension-superscript": "^3.20.4",
28
+ "@tiptap/extension-table": "3.22.3",
29
+ "@tiptap/extension-underline": "^3.20.4",
30
+ "@tiptap/pm": "^3.20.4",
31
+ "@tiptap/react": "^3.20.4",
32
+ "@tiptap/starter-kit": "^3.20.4",
33
+ "@types/tinycolor2": "^1.4.6",
26
34
  "@uiw/codemirror-theme-dracula": "^4.25.4",
35
+ "@uiw/react-codemirror": "^4.12.3",
36
+ "dompurify": "^3.4.11",
37
+ "invokers": "^1.8.0",
27
38
  "prism-react-renderer": "^2.4.1",
39
+ "tinycolor2": "^1.6.0",
28
40
  "@vev/interactions": "1.0.2",
29
- "@vev/react": "0.3.4",
30
- "@vev/utils": "1.2.17"
41
+ "@vev/react": "0.4.0",
42
+ "@vev/utils": "1.3.0",
43
+ "@vev/variables": "1.0.3"
31
44
  },
32
45
  "devDependencies": {
33
46
  "@mdx-js/react": "^3.1.0",
@@ -58,9 +58,11 @@ export * from './silke-icon-picker';
58
58
  export * from './silke-object-field';
59
59
  export * from './silke-radio-button';
60
60
  export * from './silke-select-field';
61
+ export * from './silke-rich-text-field';
61
62
  export * from './silke-text-field';
62
63
  export * from './silke-toggle';
63
64
  export * from './silke-upload-field';
64
65
  export * from './silke-virtual';
65
66
  export * from './silke-variables-wrapper';
66
67
  export * from './silke-conditions-input';
68
+ export * from './silke-expression-input';
@@ -51,7 +51,7 @@ export function SilkeAlertBanner({
51
51
  if (fluid) cl.push(styles.fluid);
52
52
 
53
53
  return (
54
- <SilkeBox rounded="small" className={cl.join(' ')} {...rest}>
54
+ <SilkeBox rounded="small" className={cl.join(' ')} {...rest} vAlign="center">
55
55
  <SilkeBox size="m" align="center" ref={iconRef}>
56
56
  <SilkeIcon icon={icon ?? ICON_KIND[kind]} className={styles.icon} />
57
57
  </SilkeBox>