@heyramzi/ui 2.9.0 → 2.10.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.
Files changed (313) hide show
  1. package/dist/agents/helpers.js +52 -0
  2. package/dist/agents/index.js +3 -0
  3. package/dist/agents/page-state.js +65 -0
  4. package/dist/agents/types.js +1 -0
  5. package/dist/agents/vendor/color.js +149 -0
  6. package/dist/agents/vendor/draw.js +548 -0
  7. package/dist/agents/vendor/engine.js +632 -0
  8. package/dist/agents/vendor/mesh.js +727 -0
  9. package/dist/agents/vendor/plastic.js +3273 -0
  10. package/dist/agents/vendor/presets.js +171 -0
  11. package/dist/agents/vendor/shapes.js +24 -0
  12. package/dist/agents/vendor/ticker.js +56 -0
  13. package/dist/agents/vendor/types.js +0 -0
  14. package/dist/agents/vendor/wear.js +1525 -0
  15. package/dist/ai/ai-button/index.js +2 -0
  16. package/dist/ai/confirmation/confirmation-context.svelte.js +12 -0
  17. package/dist/ai/confirmation/index.js +9 -0
  18. package/dist/ai/generation-progress/index.js +2 -0
  19. package/dist/ai/index.js +11 -0
  20. package/dist/ai/loading-state/index.js +3 -0
  21. package/dist/ai/prompt-input/index.js +6 -0
  22. package/dist/ai/reasoning/index.js +4 -0
  23. package/dist/ai/reasoning/reasoning-context.svelte.js +12 -0
  24. package/dist/ai/response/index.js +3 -0
  25. package/dist/ai/suggestion/index.js +3 -0
  26. package/dist/ai/thinking-dots/index.js +3 -0
  27. package/dist/ai/typing-dots/index.js +2 -0
  28. package/dist/ai/voice-waveform/index.js +3 -0
  29. package/dist/animations/text-swap.js +30 -0
  30. package/dist/brand/index.js +65 -0
  31. package/dist/canvas/card/resize.js +10 -0
  32. package/dist/canvas/edges/edge-path.js +284 -0
  33. package/dist/canvas/editor/context-menu.js +42 -0
  34. package/dist/canvas/editor/dispatch.svelte.js +157 -0
  35. package/dist/canvas/editor/editor-context.js +8 -0
  36. package/dist/canvas/editor/editor-mode.js +0 -0
  37. package/dist/canvas/editor/frame.js +87 -0
  38. package/dist/canvas/editor/hand-context.js +8 -0
  39. package/dist/canvas/editor/history-core.js +221 -0
  40. package/dist/canvas/editor/keymap.js +193 -0
  41. package/dist/canvas/editor/layout-actions.js +170 -0
  42. package/dist/canvas/editor/lock.js +65 -0
  43. package/dist/canvas/editor/rebase.js +279 -0
  44. package/dist/canvas/editor/style.js +174 -0
  45. package/dist/canvas/editor/text-field-context.js +8 -0
  46. package/dist/canvas/editor/z-order.js +82 -0
  47. package/dist/canvas/headless/alignment.js +20 -0
  48. package/dist/canvas/headless/break-apart-find.js +324 -0
  49. package/dist/canvas/headless/break-apart-pieces.js +74 -0
  50. package/dist/canvas/headless/break-apart-plan.js +378 -0
  51. package/dist/canvas/headless/break-apart-style.js +93 -0
  52. package/dist/canvas/headless/break-apart.js +206 -0
  53. package/dist/canvas/headless/canvas-cleanup.js +70 -0
  54. package/dist/canvas/headless/edge-anchors.js +134 -0
  55. package/dist/canvas/headless/edge-memo.js +28 -0
  56. package/dist/canvas/headless/edge-serialization.js +31 -0
  57. package/dist/canvas/headless/figure-geometry.js +331 -0
  58. package/dist/canvas/headless/fit-viewport.js +82 -0
  59. package/dist/canvas/headless/grid.js +96 -0
  60. package/dist/canvas/headless/icon-node.js +45 -0
  61. package/dist/canvas/headless/index.js +1 -0
  62. package/dist/canvas/headless/linkify.js +25 -0
  63. package/dist/canvas/headless/pen-marks.js +115 -0
  64. package/dist/canvas/headless/sketch.js +250 -0
  65. package/dist/canvas/headless/snap-guides.js +100 -0
  66. package/dist/canvas/headless/svg-figure.js +137 -0
  67. package/dist/canvas/headless/table-layout.js +161 -0
  68. package/dist/canvas/index.js +25 -0
  69. package/dist/canvas/lod/lod-mode.svelte.js +22 -0
  70. package/dist/canvas/lod/render-all.svelte.js +45 -0
  71. package/dist/canvas/ops/arrange.js +83 -0
  72. package/dist/canvas/ops/ops.js +318 -0
  73. package/dist/canvas/pen/colors.js +41 -0
  74. package/dist/canvas/pen/eraser.js +35 -0
  75. package/dist/canvas/pen/geometry.js +143 -0
  76. package/dist/canvas/pen/index.js +9 -0
  77. package/dist/canvas/pen/ops.js +15 -0
  78. package/dist/canvas/pen/pen-session.js +171 -0
  79. package/dist/canvas/pen/plugin.js +129 -0
  80. package/dist/canvas/pen/shapes.js +80 -0
  81. package/dist/canvas/pen/stroke-path.js +37 -0
  82. package/dist/canvas/pen/types.js +30 -0
  83. package/dist/canvas/pen/ui.js +20 -0
  84. package/dist/canvas/plugin.js +51 -0
  85. package/dist/canvas/screen/glyphs.js +24 -0
  86. package/dist/canvas/screen/labels.js +24 -0
  87. package/dist/canvas/screen/parts.js +140 -0
  88. package/dist/canvas/screen/plugin.js +71 -0
  89. package/dist/canvas/screen/types.js +44 -0
  90. package/dist/canvas/screen/ui.js +13 -0
  91. package/dist/canvas/test-utils.js +18 -0
  92. package/dist/canvas/types.js +0 -0
  93. package/dist/canvas/ui/forward-wheel.js +27 -0
  94. package/dist/canvas/ui/icons.js +133 -0
  95. package/dist/canvas/ui/place-panel.js +57 -0
  96. package/dist/canvas/ui/shortcut-tip.js +18 -0
  97. package/dist/canvas/ui/tools.js +411 -0
  98. package/dist/charts/dashboard/chart.js +1 -0
  99. package/dist/charts/dashboard/data-table.js +7 -0
  100. package/dist/charts/dashboard/index.js +13 -0
  101. package/dist/charts/dashboard/windows.js +5 -0
  102. package/dist/charts/edge-fade.js +7 -0
  103. package/dist/charts/hover-band.js +13 -0
  104. package/dist/charts/index.js +19 -0
  105. package/dist/charts/motion.js +15 -0
  106. package/dist/charts/primitives/chart-utils.js +22 -0
  107. package/dist/charts/primitives/index.js +4 -0
  108. package/dist/components/copy/clipboard.js +38 -0
  109. package/dist/components/copy/copied.svelte.js +26 -0
  110. package/dist/components/copy/index.js +3 -0
  111. package/dist/components/data-table/data-table.js +55 -0
  112. package/dist/components/data-table/index.js +7 -0
  113. package/dist/components/docs/index.js +3 -0
  114. package/dist/components/docs/scroll-spy.svelte.js +71 -0
  115. package/dist/components/field-row/index.js +1 -0
  116. package/dist/components/hold-to-confirm/index.js +1 -0
  117. package/dist/components/icon/index.js +1 -0
  118. package/dist/components/language-flag/index.js +1 -0
  119. package/dist/components/list-page/filter-section.js +4 -0
  120. package/dist/components/list-page/index.js +25 -0
  121. package/dist/components/list-page/list-table.js +5 -0
  122. package/dist/components/list-page/queue-rail.js +3 -0
  123. package/dist/components/list-page/section-host.js +8 -0
  124. package/dist/components/list-page/step.js +5 -0
  125. package/dist/components/list-page/types.js +0 -0
  126. package/dist/components/locale-switch/index.js +1 -0
  127. package/dist/components/mark/index.js +1 -0
  128. package/dist/components/open-in/index.js +1 -0
  129. package/dist/components/picker/index.js +3 -0
  130. package/dist/components/picker/trigger.js +33 -0
  131. package/dist/components/picker/types.js +0 -0
  132. package/dist/components/section-card/index.js +1 -0
  133. package/dist/components/section-header/index.js +2 -0
  134. package/dist/components/segmented/collapse.js +32 -0
  135. package/dist/components/segmented/index.js +8 -0
  136. package/dist/components/segmented/segmented.js +50 -0
  137. package/dist/components/star-rating-input/index.js +2 -0
  138. package/dist/components/svg/index.js +1 -0
  139. package/dist/components/table-view/index.js +1 -0
  140. package/dist/components/table-view/types.js +0 -0
  141. package/dist/components/tags-input/index.js +2 -0
  142. package/dist/components/tags-input/tags.js +90 -0
  143. package/dist/components/theme/index.js +3 -0
  144. package/dist/components/toolbar/index.js +3 -0
  145. package/dist/components/toolbar/toolbar-trigger.js +4 -0
  146. package/dist/editor/anchors.js +17 -0
  147. package/dist/editor/block-id.js +62 -0
  148. package/dist/editor/block-ops.js +105 -0
  149. package/dist/editor/doc-blocks.js +181 -0
  150. package/dist/editor/extensions.js +200 -0
  151. package/dist/editor/index.js +4 -0
  152. package/dist/editor/markdown-test-helpers.js +6 -0
  153. package/dist/editor/markdown.js +486 -0
  154. package/dist/editor/serializer.js +268 -0
  155. package/dist/editor/slash-items.js +104 -0
  156. package/dist/editor/youtube-url.js +27 -0
  157. package/dist/effects/animated-beam/index.js +1 -0
  158. package/dist/effects/animated-beam/path-calculator.svelte.js +42 -0
  159. package/dist/effects/animated-beam/types.js +0 -0
  160. package/dist/effects/border-beam/css.js +420 -0
  161. package/dist/effects/border-beam/presets.js +1792 -0
  162. package/dist/effects/border-beam/register-properties.js +39 -0
  163. package/dist/effects/border-beam/types.js +0 -0
  164. package/dist/effects/image-comparison/compare.js +4 -0
  165. package/dist/effects/image-reveal/index.js +1 -0
  166. package/dist/effects/image-reveal/types.js +0 -0
  167. package/dist/effects/magnetic/magnetic.js +54 -0
  168. package/dist/effects/reveal/index.js +4 -0
  169. package/dist/effects/reveal/observe.js +43 -0
  170. package/dist/effects/reveal/types.js +0 -0
  171. package/dist/effects/shader-gradient/color.js +34 -0
  172. package/dist/effects/shader-gradient/index.js +1 -0
  173. package/dist/effects/shader-gradient/renderer.js +320 -0
  174. package/dist/effects/shader-gradient/shaders.js +280 -0
  175. package/dist/effects/shader-gradient/types.js +0 -0
  176. package/dist/icons/apple-symbol-exports.js +126 -0
  177. package/dist/icons/sf-symbols.js +465 -0
  178. package/dist/icons/trades.js +34 -0
  179. package/dist/inbox/index.js +4 -0
  180. package/dist/inbox/logic.js +156 -0
  181. package/dist/inbox/types.js +46 -0
  182. package/dist/index.js +18 -0
  183. package/dist/lib/arrive.js +13 -0
  184. package/dist/lib/icon-types.js +0 -0
  185. package/dist/lib/initials.js +17 -0
  186. package/dist/lib/layout.js +1 -0
  187. package/dist/lib/panel.js +3 -0
  188. package/dist/lib/result.js +26 -0
  189. package/dist/lib/sliding-pill.js +45 -0
  190. package/dist/lib/theme-transition.js +53 -0
  191. package/dist/lib/tone.js +32 -0
  192. package/dist/lib/utils.js +5 -0
  193. package/dist/onboarding/define-tours.js +28 -0
  194. package/dist/onboarding/index.js +4 -0
  195. package/dist/onboarding/onboarding.svelte.js +15 -0
  196. package/dist/onboarding/pick.js +16 -0
  197. package/dist/onboarding/stores.js +50 -0
  198. package/dist/onboarding/types.js +1 -0
  199. package/dist/onboarding/wait.js +25 -0
  200. package/dist/panel/index.js +1 -0
  201. package/dist/panel/side-panel-types.js +0 -0
  202. package/dist/record/demo-data.js +512 -0
  203. package/dist/record/fields.js +148 -0
  204. package/dist/record/format.js +97 -0
  205. package/dist/record/gutter.js +1 -0
  206. package/dist/record/index.js +15 -0
  207. package/dist/record/kinds.js +110 -0
  208. package/dist/record/logic.js +255 -0
  209. package/dist/record/types.js +52 -0
  210. package/dist/shadcn/accordion/index.js +5 -0
  211. package/dist/shadcn/alert/index.js +5 -0
  212. package/dist/shadcn/alert-dialog/index.js +12 -0
  213. package/dist/shadcn/attachment/index.js +10 -0
  214. package/dist/shadcn/avatar/index.js +7 -0
  215. package/dist/shadcn/badge/index.js +2 -0
  216. package/dist/shadcn/breadcrumb/index.js +8 -0
  217. package/dist/shadcn/bubble/index.js +5 -0
  218. package/dist/shadcn/button/index.js +2 -0
  219. package/dist/shadcn/calendar/index.js +19 -0
  220. package/dist/shadcn/card/index.js +8 -0
  221. package/dist/shadcn/checkbox/index.js +2 -0
  222. package/dist/shadcn/code-block/index.js +9 -0
  223. package/dist/shadcn/collapsible/index.js +4 -0
  224. package/dist/shadcn/command/index.js +13 -0
  225. package/dist/shadcn/context-menu/index.js +17 -0
  226. package/dist/shadcn/dialog/index.js +11 -0
  227. package/dist/shadcn/dropdown-menu/index.js +19 -0
  228. package/dist/shadcn/dropdown-menu/menu-item.js +23 -0
  229. package/dist/shadcn/empty/index.js +7 -0
  230. package/dist/shadcn/field/index.js +12 -0
  231. package/dist/shadcn/hooks/highlighter.js +92 -0
  232. package/dist/shadcn/hooks/is-mobile.svelte.js +7 -0
  233. package/dist/shadcn/hooks/use-highlighted-code.svelte.js +65 -0
  234. package/dist/shadcn/hover-card/index.js +5 -0
  235. package/dist/shadcn/input/index.js +3 -0
  236. package/dist/shadcn/input-otp/index.js +5 -0
  237. package/dist/shadcn/kbd/index.js +3 -0
  238. package/dist/shadcn/label/index.js +2 -0
  239. package/dist/shadcn/marker/index.js +4 -0
  240. package/dist/shadcn/message/index.js +7 -0
  241. package/dist/shadcn/message-scroller/index.js +8 -0
  242. package/dist/shadcn/popover/index.js +9 -0
  243. package/dist/shadcn/progress/index.js +2 -0
  244. package/dist/shadcn/progress/tone.js +11 -0
  245. package/dist/shadcn/radio-group/index.js +3 -0
  246. package/dist/shadcn/scroll-area/index.js +3 -0
  247. package/dist/shadcn/select/index.js +12 -0
  248. package/dist/shadcn/separator/index.js +2 -0
  249. package/dist/shadcn/sheet/index.js +11 -0
  250. package/dist/shadcn/sidebar/constants.js +6 -0
  251. package/dist/shadcn/sidebar/context.svelte.js +38 -0
  252. package/dist/shadcn/sidebar/index.js +25 -0
  253. package/dist/shadcn/skeleton/index.js +2 -0
  254. package/dist/shadcn/slider/index.js +2 -0
  255. package/dist/shadcn/sonner/index.js +1 -0
  256. package/dist/shadcn/spinner/index.js +1 -0
  257. package/dist/shadcn/switch/index.js +2 -0
  258. package/dist/shadcn/table/index.js +9 -0
  259. package/dist/shadcn/tabs/index.js +5 -0
  260. package/dist/shadcn/textarea/index.js +2 -0
  261. package/dist/shadcn/toggle/index.js +3 -0
  262. package/dist/shadcn/toggle-group/index.js +3 -0
  263. package/dist/shadcn/tooltip/context.js +8 -0
  264. package/dist/shadcn/tooltip/index.js +6 -0
  265. package/dist/shadcn/trace/index.js +9 -0
  266. package/dist/slides/bridges.js +66 -0
  267. package/dist/slides/deck-controller.svelte.js +221 -0
  268. package/dist/slides/export/capture.js +81 -0
  269. package/dist/slides/export/ffmpeg.js +85 -0
  270. package/dist/slides/export/index.js +4 -0
  271. package/dist/slides/export/launch.js +8 -0
  272. package/dist/slides/export/pdf.js +78 -0
  273. package/dist/slides/export/types.js +0 -0
  274. package/dist/slides/index.js +7 -0
  275. package/dist/slides/labels.js +26 -0
  276. package/dist/slides/layout.js +47 -0
  277. package/dist/slides/model.js +9 -0
  278. package/dist/slides/navigation.js +89 -0
  279. package/dist/slides/types.js +6 -0
  280. package/dist/status/define-statuses.js +16 -0
  281. package/dist/status/index.js +4 -0
  282. package/dist/status/status-types.js +0 -0
  283. package/dist/test-setup.js +26 -0
  284. package/dist/thread/index.js +3 -0
  285. package/dist/thread/logic.js +94 -0
  286. package/dist/thread/types.js +23 -0
  287. package/dist/work/board-order.js +109 -0
  288. package/dist/work/dates.js +19 -0
  289. package/dist/work/detail/detail-types.js +20 -0
  290. package/dist/work/docs/edited.js +39 -0
  291. package/dist/work/docs/index.js +7 -0
  292. package/dist/work/docs/labels.js +38 -0
  293. package/dist/work/docs/menu.js +121 -0
  294. package/dist/work/docs/outline.js +39 -0
  295. package/dist/work/gantt/logic.js +260 -0
  296. package/dist/work/inbox/inbox-logic.js +94 -0
  297. package/dist/work/inbox/inbox-statuses.js +86 -0
  298. package/dist/work/inbox/inbox-types.js +0 -0
  299. package/dist/work/inbox/index.js +1 -0
  300. package/dist/work/index.js +21 -0
  301. package/dist/work/kanban-drag.js +25 -0
  302. package/dist/work/kanban-types.js +0 -0
  303. package/dist/work/presets/sales.js +35 -0
  304. package/dist/work/reorder.js +10 -0
  305. package/dist/work/task-types.js +0 -0
  306. package/dist/work/time/duration.js +60 -0
  307. package/dist/work/time/time-types.js +25 -0
  308. package/dist/work/use-kanban-dnd.svelte.js +128 -0
  309. package/package.json +45 -3
  310. package/src/components/toolbar/toolbar-trigger.ts +8 -2
  311. package/src/record/demo-data.ts +4 -4
  312. package/src/record/record-demo.svelte +2 -2
  313. package/src/status/status-dot.svelte +0 -2
@@ -0,0 +1,411 @@
1
+ import { PEN_DEFAULTS } from "../pen/types.js";
2
+ export const TOOLS = [
3
+ {
4
+ id: "select",
5
+ key: "V"
6
+ },
7
+ {
8
+ id: "hand",
9
+ key: "H"
10
+ },
11
+ {
12
+ id: "connect",
13
+ key: "L"
14
+ },
15
+ {
16
+ id: "pen",
17
+ key: "P"
18
+ },
19
+ {
20
+ id: "highlighter",
21
+ key: "M"
22
+ },
23
+ {
24
+ id: "eraser",
25
+ key: "E"
26
+ },
27
+ {
28
+ id: "text",
29
+ key: "T"
30
+ },
31
+ {
32
+ id: "rectangle",
33
+ key: "R"
34
+ },
35
+ {
36
+ id: "ellipse",
37
+ key: "O"
38
+ },
39
+ {
40
+ id: "diamond",
41
+ key: "D"
42
+ },
43
+ {
44
+ id: "frame",
45
+ key: "F"
46
+ }
47
+ ];
48
+ const TOOL_BY_KEY = new Map(TOOLS.map((tool)=>[
49
+ tool.key.toLowerCase(),
50
+ tool.id
51
+ ]));
52
+ export function toolForKey(key) {
53
+ return TOOL_BY_KEY.get(key.toLowerCase()) ?? null;
54
+ }
55
+ export function keyForTool(tool) {
56
+ return TOOLS.find((entry)=>entry.id === tool)?.key ?? "";
57
+ }
58
+ export function isDrawingTool(tool) {
59
+ return tool !== "select" && tool !== "hand" && tool !== "connect" && tool !== "frame";
60
+ }
61
+ export function isFrameTool(tool) {
62
+ return tool === "frame";
63
+ }
64
+ export function isShapeTool(tool) {
65
+ return tool === "rectangle" || tool === "ellipse" || tool === "diamond";
66
+ }
67
+ const BRUSH_SIZES = {
68
+ pen: [
69
+ 2,
70
+ PEN_DEFAULTS.pen.size,
71
+ 8
72
+ ],
73
+ highlighter: [
74
+ 12,
75
+ PEN_DEFAULTS.highlighter.size,
76
+ 32
77
+ ]
78
+ };
79
+ export const DEFAULT_BRUSH_LEVEL = 1;
80
+ export function brushSize(tool, level) {
81
+ if (tool === "pen" || tool === "highlighter") return BRUSH_SIZES[tool][level];
82
+ return undefined;
83
+ }
84
+ export function hasBrush(tool) {
85
+ return tool === "pen" || tool === "highlighter";
86
+ }
87
+ export function isBrushTool(tool) {
88
+ return tool === "pen" || tool === "highlighter" || tool === "eraser";
89
+ }
90
+ export function hasColor(tool) {
91
+ return isDrawingTool(tool) && tool !== "eraser";
92
+ }
93
+ export const SHORTCUTS = [
94
+ {
95
+ id: "select",
96
+ group: "tools",
97
+ keys: [
98
+ "V"
99
+ ]
100
+ },
101
+ {
102
+ id: "hand",
103
+ group: "tools",
104
+ keys: [
105
+ "H"
106
+ ]
107
+ },
108
+ {
109
+ id: "connect",
110
+ group: "tools",
111
+ keys: [
112
+ "L"
113
+ ]
114
+ },
115
+ {
116
+ id: "pen",
117
+ group: "tools",
118
+ keys: [
119
+ "P"
120
+ ]
121
+ },
122
+ {
123
+ id: "highlighter",
124
+ group: "tools",
125
+ keys: [
126
+ "M"
127
+ ]
128
+ },
129
+ {
130
+ id: "eraser",
131
+ group: "tools",
132
+ keys: [
133
+ "E"
134
+ ]
135
+ },
136
+ {
137
+ id: "text",
138
+ group: "tools",
139
+ keys: [
140
+ "T"
141
+ ]
142
+ },
143
+ {
144
+ id: "rectangle",
145
+ group: "tools",
146
+ keys: [
147
+ "R"
148
+ ]
149
+ },
150
+ {
151
+ id: "ellipse",
152
+ group: "tools",
153
+ keys: [
154
+ "O"
155
+ ]
156
+ },
157
+ {
158
+ id: "diamond",
159
+ group: "tools",
160
+ keys: [
161
+ "D"
162
+ ]
163
+ },
164
+ {
165
+ id: "frame",
166
+ group: "tools",
167
+ keys: [
168
+ "F"
169
+ ]
170
+ },
171
+ {
172
+ id: "note",
173
+ group: "tools",
174
+ keys: [
175
+ "N"
176
+ ]
177
+ },
178
+ {
179
+ id: "cards",
180
+ group: "tools",
181
+ keys: [
182
+ "C"
183
+ ]
184
+ },
185
+ {
186
+ id: "comment",
187
+ group: "tools",
188
+ keys: [
189
+ "B"
190
+ ]
191
+ },
192
+ {
193
+ id: "panTemporarily",
194
+ group: "tools",
195
+ keys: [
196
+ "Space"
197
+ ]
198
+ },
199
+ {
200
+ id: "undo",
201
+ group: "edit",
202
+ keys: [
203
+ "mod",
204
+ "Z"
205
+ ]
206
+ },
207
+ {
208
+ id: "redo",
209
+ group: "edit",
210
+ keys: [
211
+ "mod",
212
+ "shift",
213
+ "Z"
214
+ ]
215
+ },
216
+ {
217
+ id: "copy",
218
+ group: "edit",
219
+ keys: [
220
+ "mod",
221
+ "C"
222
+ ]
223
+ },
224
+ {
225
+ id: "paste",
226
+ group: "edit",
227
+ keys: [
228
+ "mod",
229
+ "V"
230
+ ]
231
+ },
232
+ {
233
+ id: "selectAll",
234
+ group: "edit",
235
+ keys: [
236
+ "mod",
237
+ "A"
238
+ ]
239
+ },
240
+ {
241
+ id: "multiSelect",
242
+ group: "edit",
243
+ keys: [
244
+ "shift",
245
+ "Click"
246
+ ]
247
+ },
248
+ {
249
+ id: "duplicate",
250
+ group: "edit",
251
+ keys: [
252
+ "mod",
253
+ "D"
254
+ ]
255
+ },
256
+ {
257
+ id: "group",
258
+ group: "edit",
259
+ keys: [
260
+ "mod",
261
+ "G"
262
+ ]
263
+ },
264
+ {
265
+ id: "ungroup",
266
+ group: "edit",
267
+ keys: [
268
+ "mod",
269
+ "shift",
270
+ "G"
271
+ ]
272
+ },
273
+ {
274
+ id: "bringForward",
275
+ group: "edit",
276
+ keys: [
277
+ "]"
278
+ ]
279
+ },
280
+ {
281
+ id: "sendBackward",
282
+ group: "edit",
283
+ keys: [
284
+ "["
285
+ ]
286
+ },
287
+ {
288
+ id: "bringToFront",
289
+ group: "edit",
290
+ keys: [
291
+ "mod",
292
+ "]"
293
+ ]
294
+ },
295
+ {
296
+ id: "sendToBack",
297
+ group: "edit",
298
+ keys: [
299
+ "mod",
300
+ "["
301
+ ]
302
+ },
303
+ {
304
+ id: "lock",
305
+ group: "edit",
306
+ keys: [
307
+ "mod",
308
+ "shift",
309
+ "L"
310
+ ]
311
+ },
312
+ {
313
+ id: "copyAsPng",
314
+ group: "edit",
315
+ keys: [
316
+ "mod",
317
+ "shift",
318
+ "C"
319
+ ]
320
+ },
321
+ {
322
+ id: "nudge",
323
+ group: "edit",
324
+ keys: [
325
+ "Arrows"
326
+ ]
327
+ },
328
+ {
329
+ id: "nudgeFar",
330
+ group: "edit",
331
+ keys: [
332
+ "shift",
333
+ "Arrows"
334
+ ]
335
+ },
336
+ {
337
+ id: "delete",
338
+ group: "edit",
339
+ keys: [
340
+ "Del"
341
+ ]
342
+ },
343
+ {
344
+ id: "save",
345
+ group: "edit",
346
+ keys: [
347
+ "mod",
348
+ "S"
349
+ ]
350
+ },
351
+ {
352
+ id: "zoomIn",
353
+ group: "view",
354
+ keys: [
355
+ "+"
356
+ ]
357
+ },
358
+ {
359
+ id: "zoomOut",
360
+ group: "view",
361
+ keys: [
362
+ "-"
363
+ ]
364
+ },
365
+ {
366
+ id: "zoom100",
367
+ group: "view",
368
+ keys: [
369
+ "shift",
370
+ "0"
371
+ ]
372
+ },
373
+ {
374
+ id: "zoomFit",
375
+ group: "view",
376
+ keys: [
377
+ "shift",
378
+ "1"
379
+ ]
380
+ },
381
+ {
382
+ id: "zoomSelection",
383
+ group: "view",
384
+ keys: [
385
+ "shift",
386
+ "2"
387
+ ]
388
+ },
389
+ {
390
+ id: "present",
391
+ group: "view",
392
+ keys: [
393
+ "mod",
394
+ "Enter"
395
+ ]
396
+ },
397
+ {
398
+ id: "shortcuts",
399
+ group: "view",
400
+ keys: [
401
+ "?"
402
+ ]
403
+ },
404
+ {
405
+ id: "escape",
406
+ group: "view",
407
+ keys: [
408
+ "Esc"
409
+ ]
410
+ }
411
+ ];
@@ -0,0 +1 @@
1
+ export const CHART_HEIGHT = 240;
@@ -0,0 +1,7 @@
1
+ export const dataTableClass = "w-full text-sm";
2
+ export const dataTheadClass = "bg-muted/40 text-xs text-muted-foreground";
3
+ export const dataThClass = "px-4 py-2.5 text-left font-medium";
4
+ export const dataThNumClass = "px-4 py-2.5 text-right font-medium";
5
+ export const dataTrClass = "border-b border-border transition-colors last:border-0 hover:bg-muted/40";
6
+ export const dataTdClass = "px-4 py-2.5 align-top";
7
+ export const dataTdNumClass = "px-4 py-2.5 text-right align-top tabular-nums";
@@ -0,0 +1,13 @@
1
+ export { default as DataPanel } from "../../../src/charts/dashboard/data-panel.svelte";
2
+ export { default as DataSortHead } from "../../../src/charts/dashboard/data-sort-head.svelte";
3
+ export { default as DataTable } from "../../../src/charts/dashboard/data-table.svelte";
4
+ export { default as RatingChip } from "../../../src/charts/dashboard/rating-chip.svelte";
5
+ export { default as DashboardEmpty } from "../../../src/charts/dashboard/dashboard-empty.svelte";
6
+ export { default as DashboardSection } from "../../../src/charts/dashboard/dashboard-section.svelte";
7
+ export { default as PanelGrid } from "../../../src/charts/dashboard/panel-grid.svelte";
8
+ export { default as PeriodFilter } from "../../../src/charts/dashboard/period-filter.svelte";
9
+ export { default as StatBand } from "../../../src/charts/dashboard/stat-band.svelte";
10
+ export { default as StatTile } from "../../../src/charts/dashboard/stat-tile.svelte";
11
+ export { CHART_HEIGHT } from "./chart.js";
12
+ export { DAY_WINDOWS } from "./windows.js";
13
+ export { dataTableClass, dataTdClass, dataTdNumClass, dataThClass, dataThNumClass, dataTheadClass, dataTrClass } from "./data-table.js";
@@ -0,0 +1,5 @@
1
+ export const DAY_WINDOWS = [
2
+ 7,
3
+ 30,
4
+ 90
5
+ ];
@@ -0,0 +1,7 @@
1
+ export const EDGE_FADE_DEFAULT = 0.08;
2
+ export function resolveEdgeFade(value, fallback = EDGE_FADE_DEFAULT) {
3
+ if (value === false) return 0;
4
+ if (value === true || value == null) return fallback;
5
+ if (!Number.isFinite(value)) return 0;
6
+ return Math.min(0.45, Math.max(0, value));
7
+ }
@@ -0,0 +1,13 @@
1
+ export const HOVER_BAND_REACH = 0.8;
2
+ export function hoverBand(xs, i, width, reach = HOVER_BAND_REACH) {
3
+ if (i < 0 || i >= xs.length) return null;
4
+ const at = xs[i];
5
+ const before = i > 0 ? at - xs[i - 1] : Infinity;
6
+ const after = i < xs.length - 1 ? xs[i + 1] - at : Infinity;
7
+ const gap = Math.min(before, after);
8
+ const half = (Number.isFinite(gap) ? gap : width) * reach;
9
+ return {
10
+ x: at - half,
11
+ width: half * 2
12
+ };
13
+ }
@@ -0,0 +1,19 @@
1
+ import "../../src/charts/charts.css";
2
+ export { default as BarChart } from "../../src/charts/bar-chart.svelte";
3
+ export { default as AreaChart } from "../../src/charts/area-chart.svelte";
4
+ export { default as LineChart } from "../../src/charts/line-chart.svelte";
5
+ export { default as DonutChart } from "../../src/charts/donut-chart.svelte";
6
+ export { default as Sparkline } from "../../src/charts/sparkline.svelte";
7
+ export { default as TimeSeriesChart } from "../../src/charts/time-series-chart.svelte";
8
+ export { default as GaugeChart } from "../../src/charts/gauge-chart.svelte";
9
+ export { default as RingChart } from "../../src/charts/ring-chart.svelte";
10
+ export { default as Legend } from "../../src/charts/legend.svelte";
11
+ export { } from "../../src/charts/reference-line.svelte";
12
+ export { default as StatCard } from "../../src/charts/stat-card.svelte";
13
+ export { default as NumberChart } from "../../src/charts/number-chart.svelte";
14
+ export { default as Figure } from "../../src/charts/figure.svelte";
15
+ export { default as TrendPill } from "../../src/charts/trend-pill.svelte";
16
+ export { default as AnimatedValue } from "../../src/charts/animated-value.svelte";
17
+ export { default as EdgeFade } from "../../src/charts/edge-fade.svelte";
18
+ export { resolveEdgeFade, EDGE_FADE_DEFAULT } from "./edge-fade.js";
19
+ export { ChartContainer, ChartTooltip, ChartStyle, getPayloadConfigFromPayload, useChart, setChartContext, THEMES } from "./primitives/index.js";
@@ -0,0 +1,15 @@
1
+ import { cubicInOut } from "svelte/easing";
2
+ export const REVEAL_MS = 1100;
3
+ export const DOMAIN_MOTION = {
4
+ type: "tween",
5
+ duration: 500,
6
+ easing: cubicInOut
7
+ };
8
+ export const TOOLTIP_TOP = 8;
9
+ export const TOOLTIP_GAP = 16;
10
+ export function tokenMs(el, name, fallback) {
11
+ const raw = getComputedStyle(el).getPropertyValue(name).trim();
12
+ const n = Number.parseFloat(raw);
13
+ if (Number.isNaN(n)) return fallback;
14
+ return raw.endsWith("ms") ? n : n * 1000;
15
+ }
@@ -0,0 +1,22 @@
1
+ import { getContext, setContext } from "svelte";
2
+ export const THEMES = {
3
+ light: "",
4
+ dark: ".dark"
5
+ };
6
+ export function getPayloadConfigFromPayload(config, item, key) {
7
+ if (typeof item !== "object" || item === null) return undefined;
8
+ let configLabelKey = key;
9
+ if (item.key === key) {
10
+ configLabelKey = item.key;
11
+ } else if (item.label === key) {
12
+ configLabelKey = item.label;
13
+ }
14
+ return configLabelKey in config ? config[configLabelKey] : config[key];
15
+ }
16
+ const chartContextKey = Symbol("chart-context");
17
+ export function setChartContext(value) {
18
+ return setContext(chartContextKey, value);
19
+ }
20
+ export function useChart() {
21
+ return getContext(chartContextKey);
22
+ }
@@ -0,0 +1,4 @@
1
+ export { default as ChartContainer } from "../../../src/charts/primitives/chart-container.svelte";
2
+ export { default as ChartTooltip } from "../../../src/charts/primitives/chart-tooltip.svelte";
3
+ export { default as ChartStyle } from "../../../src/charts/primitives/chart-style.svelte";
4
+ export { getPayloadConfigFromPayload, useChart, setChartContext, THEMES } from "./chart-utils.js";
@@ -0,0 +1,38 @@
1
+ export async function copyText(value) {
2
+ try {
3
+ await navigator.clipboard.writeText(value);
4
+ return true;
5
+ } catch {
6
+ return false;
7
+ }
8
+ }
9
+ export async function copyRichText(html, plainText) {
10
+ const text = plainText ?? htmlToPlainText(html);
11
+ try {
12
+ await navigator.clipboard.write([
13
+ new ClipboardItem({
14
+ "text/html": new Blob([
15
+ html
16
+ ], {
17
+ type: "text/html"
18
+ }),
19
+ "text/plain": new Blob([
20
+ text
21
+ ], {
22
+ type: "text/plain"
23
+ })
24
+ })
25
+ ]);
26
+ return true;
27
+ } catch {
28
+ return copyText(text);
29
+ }
30
+ }
31
+ export function htmlToPlainText(html) {
32
+ if (typeof document === "undefined") {
33
+ return html.replace(/<br\s*\/?>/gi, "\n").replace(/<\/p>/gi, "\n\n").replace(/<\/li>/gi, "\n").replace(/<li>/gi, "• ").replace(/<[^>]+>/g, "").replace(/&nbsp;/g, " ").replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").trim();
34
+ }
35
+ const div = document.createElement("div");
36
+ div.innerHTML = html;
37
+ return div.textContent || div.innerText || "";
38
+ }
@@ -0,0 +1,26 @@
1
+ import { copyText } from "./clipboard.js";
2
+ export class Copied {
3
+ key = $state(null);
4
+ #timer = null;
5
+ is(key = "") {
6
+ return this.key === key;
7
+ }
8
+ async copy(value, key = "", hold = 1400) {
9
+ if (!await copyText(value)) return false;
10
+ this.mark(key, hold);
11
+ return true;
12
+ }
13
+ mark(key = "", hold = 1400) {
14
+ this.key = key;
15
+ if (this.#timer) clearTimeout(this.#timer);
16
+ this.#timer = setTimeout(()=>{
17
+ this.key = null;
18
+ this.#timer = null;
19
+ }, hold);
20
+ }
21
+ reset() {
22
+ if (this.#timer) clearTimeout(this.#timer);
23
+ this.#timer = null;
24
+ this.key = null;
25
+ }
26
+ }
@@ -0,0 +1,3 @@
1
+ export { default as CopyButton } from "../../../src/components/copy/copy-button.svelte";
2
+ export { copyText, copyRichText, htmlToPlainText } from "./clipboard.js";
3
+ export { Copied } from "./copied.svelte.js";
@@ -0,0 +1,55 @@
1
+ export function normalizeQuery(query) {
2
+ return query.trim().toLowerCase();
3
+ }
4
+ export function containsQuery(value, query) {
5
+ if (!query) return true;
6
+ return value?.toLowerCase().includes(query) ?? false;
7
+ }
8
+ export function anyContainsQuery(values, query) {
9
+ return values.some((value)=>containsQuery(value, query));
10
+ }
11
+ export function toggleSort(current, key) {
12
+ if (current?.key !== key) return {
13
+ key,
14
+ direction: "asc"
15
+ };
16
+ if (current.direction === "asc") return {
17
+ key,
18
+ direction: "desc"
19
+ };
20
+ return null;
21
+ }
22
+ export function sortRows(rows, sort) {
23
+ if (!sort) return rows;
24
+ const { key, direction } = sort;
25
+ const multiplier = direction === "asc" ? 1 : -1;
26
+ return [
27
+ ...rows
28
+ ].sort((a, b)=>{
29
+ const aVal = a[key];
30
+ const bVal = b[key];
31
+ if (aVal == null && bVal == null) return 0;
32
+ if (aVal == null) return 1;
33
+ if (bVal == null) return -1;
34
+ if (typeof aVal === "string" && typeof bVal === "string") {
35
+ return multiplier * aVal.localeCompare(bVal);
36
+ }
37
+ if (typeof aVal === "number" && typeof bVal === "number") {
38
+ return multiplier * (aVal - bVal);
39
+ }
40
+ return multiplier * String(aVal).localeCompare(String(bVal));
41
+ });
42
+ }
43
+ export function paginateRows(rows, page, pageSize) {
44
+ const start = (page - 1) * pageSize;
45
+ return rows.slice(start, start + pageSize);
46
+ }
47
+ export function totalPages(total, pageSize) {
48
+ return Math.max(1, Math.ceil(total / pageSize));
49
+ }
50
+ export function formatCount(visible, total, label) {
51
+ const singular = label.endsWith("s") ? label.slice(0, -1) : label;
52
+ const noun = total === 1 ? singular : label;
53
+ if (visible === total) return `${total.toLocaleString()} ${noun}`;
54
+ return `${visible.toLocaleString()} of ${total.toLocaleString()} ${noun}`;
55
+ }
@@ -0,0 +1,7 @@
1
+ export { default as InfiniteScroll } from "../../../src/components/data-table/infinite-scroll.svelte";
2
+ export { default as Pagination } from "../../../src/components/data-table/pagination.svelte";
3
+ export { default as RowArrow } from "../../../src/components/data-table/row-arrow.svelte";
4
+ export { default as RowContextMenu } from "../../../src/components/data-table/row-context-menu.svelte";
5
+ export { default as SortableHead } from "../../../src/components/data-table/sortable-head.svelte";
6
+ export { default as TableSkeleton } from "../../../src/components/data-table/table-skeleton.svelte";
7
+ export { anyContainsQuery, containsQuery, formatCount, normalizeQuery, paginateRows, sortRows, toggleSort, totalPages } from "./data-table.js";
@@ -0,0 +1,3 @@
1
+ export { default as DocPage } from "../../../src/components/docs/doc-page.svelte";
2
+ export { default as OnThisPage } from "../../../src/components/docs/on-this-page.svelte";
3
+ export { ScrollSpy, READ_LINE } from "./scroll-spy.svelte.js";