@flesler/cursor-canvas-web 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cursor-canvas.cjs +1 -1
- package/dist/cursor-canvas.js +265 -266
- package/dist/{host-tokens-Dh2BFFjv.js → host-tokens-Bt6GPXN1.js} +134 -120
- package/dist/host-tokens-Lz69pkRj.cjs +1 -0
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.js +1 -1
- package/package.json +3 -2
- package/src/superset/chart-extra.d.ts +12 -12
- package/src/superset/index.d.ts +13 -13
- package/src/vendor/canvas/SKILL.md +1 -1
- package/src/vendor/canvas-sdk/index.d.ts +32 -29
- package/src/vendor/canvas-sdk/manifest.json +2 -2
- package/dist/host-tokens-Cjzmp0z_.cjs +0 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Be creative with layout — use Grid, Row, cards, charts, tables, and raw SVG
|
|
5
5
|
* in whatever combination serves the content. Read
|
|
6
|
-
*
|
|
6
|
+
* `../canvas/SKILL.md` for full design guidance. Key
|
|
7
7
|
* constraints:
|
|
8
8
|
*
|
|
9
9
|
* - Colors from `useHostTheme()` tokens (`theme.bg.editor`, not
|
|
@@ -15,51 +15,54 @@
|
|
|
15
15
|
* - Run that skill's Pre-delivery self-check before returning code.
|
|
16
16
|
*/
|
|
17
17
|
/** React authoring utilities re-exported so canvases need one public import. */
|
|
18
|
-
export
|
|
19
|
-
export {
|
|
18
|
+
export { useEffect, useMemo, useRef, useState } from "react"
|
|
19
|
+
export type { CSSProperties, RefObject } from "react"
|
|
20
20
|
/** Shared category color palette used by `Swatch`, `UsageBar`, etc. */
|
|
21
|
-
export
|
|
22
|
-
export {
|
|
21
|
+
export { categoryPaletteDark, categoryPaletteLight, colorPalette, usageColorSequence } from "./canvas-tokens.js"
|
|
22
|
+
export type { CanvasHostThemeBrand, CategoryPalette, ChartPalette, Color } from "./canvas-tokens.js"
|
|
23
23
|
/** Charts. */
|
|
24
|
-
export
|
|
25
|
-
export {
|
|
24
|
+
export { BarChart, LineChart, PieChart } from "./chart-primitives.js"
|
|
25
|
+
export type { BarChartProps, ChartDataPoint, ChartReferenceLine, ChartSeries, ChartTone, LineChartProps, PieChartProps } from "./chart-primitives.js"
|
|
26
26
|
/** Borderless collapsible disclosure row with a structured header. */
|
|
27
|
-
export
|
|
28
|
-
export {
|
|
27
|
+
export { CollapsibleSection } from "./collapsible-section.js"
|
|
28
|
+
export type { CollapsibleSectionProps } from "./collapsible-section.js"
|
|
29
29
|
/** DAG layout. */
|
|
30
|
-
export
|
|
31
|
-
export {
|
|
30
|
+
export { computeDAGLayout } from "./dag-layout.js"
|
|
31
|
+
export type { DAGLayoutEdge, DAGLayoutNode, DAGLayoutOptions, DAGLayoutRank, DAGLayoutResult } from "./dag-layout.js"
|
|
32
32
|
/**
|
|
33
33
|
* Diff rendering. Compose with the generic `Card` family for file-level
|
|
34
34
|
* chrome: use `DiffView` inside a `CardBody` (with `padding: 0`) and put
|
|
35
35
|
* `DiffStats` in the enclosing `CardHeader`'s `trailing` slot.
|
|
36
36
|
*/
|
|
37
|
-
export
|
|
38
|
-
export {
|
|
37
|
+
export { DiffStats, DiffView } from "./diff-view.js"
|
|
38
|
+
export type { DiffLineData, DiffLineType, DiffStatsProps, DiffViewProps } from "./diff-view.js"
|
|
39
39
|
/** Form controls. */
|
|
40
|
-
export
|
|
41
|
-
export {
|
|
40
|
+
export { Checkbox, IconButton, Select, TextArea, TextInput, Toggle } from "./form-primitives.js"
|
|
41
|
+
export type { CheckboxProps, IconButtonProps, SelectOption, SelectProps, TextAreaProps, TextInputProps, ToggleProps } from "./form-primitives.js"
|
|
42
42
|
/** Host state hooks. */
|
|
43
|
-
export
|
|
44
|
-
export {
|
|
43
|
+
export { useCanvasAction, useCanvasState, useHostTheme } from "./hooks.js"
|
|
44
|
+
export type { CanvasAction, CanvasHostTheme, SetCanvasState } from "./hooks.js"
|
|
45
45
|
/** Colored category swatch (uses the shared `Color` palette). */
|
|
46
|
-
export
|
|
47
|
-
export {
|
|
46
|
+
export { Swatch } from "./swatch.js"
|
|
47
|
+
export type { SwatchProps } from "./swatch.js"
|
|
48
48
|
/** Semantic design tokens for custom styling. */
|
|
49
|
-
export
|
|
50
|
-
export {
|
|
51
|
-
export
|
|
52
|
-
export {
|
|
49
|
+
export { canvasPaletteDark, canvasPaletteGrokDark, canvasPaletteGrokLight, canvasPaletteLight, canvasTokens, canvasTokensLight } from "./theme.js"
|
|
50
|
+
export type { CanvasPalette, CanvasTokens } from "./theme.js"
|
|
51
|
+
export { TodoList, TodoListCard } from "./todo-list.js"
|
|
52
|
+
export type { TodoItem, TodoListCardProps, TodoListProps, TodoStatus } from "./todo-list.js"
|
|
53
53
|
/** Component props types. */
|
|
54
|
-
export type { ButtonProps, CalloutProps, CalloutTone, CardBodyProps, CardHeaderProps, CardProps, CardSize, CardVariant, CodeProps, DividerProps, GridProps, H1Props, H2Props, H3Props, LinkProps, PillProps, PillSize, PillTone, RowProps, StackProps, StatProps, StatTone, TableColumnAlign, TableProps, TableRowTone, TextProps, TextWeight
|
|
54
|
+
export type { ButtonProps, CalloutProps, CalloutTone, CardBodyProps, CardHeaderProps, CardProps, CardSize, CardVariant, CodeProps, DividerProps, GridProps, H1Props, H2Props, H3Props, LinkProps, PillProps, PillSize, PillTone, RowProps, StackProps, StatProps, StatTone, TableColumnAlign, TableProps, TableRowTone, TextProps, TextWeight } from "./ui-primitives.js"
|
|
55
55
|
/** Layout. */
|
|
56
56
|
/** Typography. */
|
|
57
57
|
/** Surfaces. */
|
|
58
58
|
/** Actions. */
|
|
59
59
|
/** Feedback. */
|
|
60
|
-
export {
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
export {
|
|
61
|
+
Button, Callout, Card, CardBody, CardHeader, Code, Divider, Grid, H1, H2, H3, Link,
|
|
62
|
+
/** Shallow-merge two style objects. Useful for combining tokens with overrides. */
|
|
63
|
+
mergeStyle, Pill, Row, Spacer, Stack, Stat, Table, Text
|
|
64
|
+
} from "./ui-primitives.js"
|
|
63
65
|
/** Usage bar — segmented progress meter with optional labels above. */
|
|
64
|
-
export
|
|
65
|
-
export {
|
|
66
|
+
export { UsageBar } from "./usage-bar.js"
|
|
67
|
+
export type { UsageBarProps, UsageBarSegment } from "./usage-bar.js"
|
|
68
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"syncedAt": "2026-10-
|
|
2
|
+
"syncedAt": "2026-10-28",
|
|
3
3
|
"sdkSource": "~/.cursor/skills-cursor/canvas/sdk",
|
|
4
|
-
"contentHash": "
|
|
4
|
+
"contentHash": "1f789dcd66ab671526d584b5d5e0270f5eaf2d8a503828d3b6982ff796ee0bd6"
|
|
5
5
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const g={foreground:"#E4E4E4EB",foregroundSecondary:"#E4E4E48D",foregroundTertiary:"#E4E4E45E",foregroundQuaternary:"#E4E4E442",editor:"#181818",chrome:"#141414",sidebar:"#141414",elevated:"#181818",fillPrimary:"#E4E4E430",fillSecondary:"#E4E4E41E",fillTertiary:"#E4E4E411",fillQuaternary:"#E4E4E40A",strokePrimary:"#E4E4E433",strokeSecondary:"#E4E4E41F",strokeTertiary:"#E4E4E414",strokeFocused:"#599CE7",accent:"#599CE7",buttonBackground:"#599CE7",buttonForeground:"#191c22",buttonHoverBackground:"#6AABE9",link:"#87c3ff",diffInsertedLine:"#3FA26633",diffRemovedLine:"#B8004933",diffStripAdded:"#3FA2668F",diffStripRemoved:"#FC6B838F"},u={foreground:"#141414F0",foregroundSecondary:"#141414BD",foregroundTertiary:"#1414148A",foregroundQuaternary:"#1414145C",editor:"#FCFCFC",chrome:"#F8F8F8",sidebar:"#F3F3F3",elevated:"#FCFCFC",fillPrimary:"#14141433",fillSecondary:"#14141424",fillTertiary:"#14141414",fillQuaternary:"#1414140F",strokePrimary:"#14141433",strokeSecondary:"#1414141F",strokeTertiary:"#14141414",strokeFocused:"#3685BF",accent:"#3685BF",buttonBackground:"#3685BF",buttonForeground:"#FCFCFC",buttonHoverBackground:"#2E76AB",link:"#3685BF",diffInsertedLine:"#1F8A651F",diffRemovedLine:"#CF2D5614",diffStripAdded:"#1F8A65CC",diffStripRemoved:"#CF2D56CC"},A={accent:"#1084FE",buttonBackground:"#1084FE",buttonForeground:"#070707",buttonHoverBackground:"#459FFE",link:"#80BEFE",strokeFocused:"#1084FE"},b={accent:"#0C64C1",buttonBackground:"#0C64C1",buttonForeground:"#FAFAFA",buttonHoverBackground:"#1084FE",link:"#0C64C1",strokeFocused:"#0C64C1"},h={...g,...A},y={...u,...b},s={gray:"#8888A8E0",purple:"#7B64B8F0",green:"#1F8A65E8",yellow:"#E8C030E0",cyan:"#2A9A8AE0",pink:"#C85898E0",blue:"#2E79B5E0",orange:"#F0A040E0",red:"#C04848E0"},F={gray:"#8888A8E0",purple:"#7B64B8F0",green:"#1F8A65E8",yellow:"#E8C030E0",cyan:"#2A9A8AE0",pink:"#C85898E0",blue:"#2E79B5E0",orange:"#F0A088E0",red:"#CF2D56E0"},m={gray:"#777777E0",purple:"#9159FEF0",green:"#00C972E8",yellow:"#FF9800E0",cyan:"#00BCA6E0",pink:"#FF309BE0",blue:"#1084FEE0",orange:"#FF6700E0",red:"#FF263CE0"},v={...m},P=s,S=["blue","purple","green","yellow","cyan","pink","orange","red","gray"],i={green:"#1F8A65E8",darkGreen:"#0D855AE0",lightGreen:"#52B896E0",mintGreen:"#7DCAB0E0",blue:"#2E79B5E0",lightBlue:"#70B0D8E0",indigo:"#5A6CC0F0",lightIndigo:"#9AAADCE0",purple:"#7B64B8F0",lightPurple:"#AA98D8E0",warmPink:"#C85898E0",lightPink:"#E8A0C4E0",brightOrange:"#F0A040E0",deepOrange:"#C06028E0",goldenYellow:"#E8C030E0",darkAmber:"#C04848E0",warmPeach:"#F0A088E0",vibrantTeal:"#2A9A8AE0",muted:"#8888A8E0",neutralLine:"#888899D0"},a={green:"#00C972E8",darkGreen:"#009957E0",lightGreen:"#38D591E0",mintGreen:"#78E2B4E0",blue:"#1084FEE0",lightBlue:"#459FFEE0",indigo:"#0C64C1F0",lightIndigo:"#80BEFEE0",purple:"#9159FEF0",lightPurple:"#A97EFEE0",warmPink:"#FF309BE0",lightPink:"#FF5EB1E0",brightOrange:"#FF6700E0",deepOrange:"#C24E00E0",goldenYellow:"#FF9800E0",darkAmber:"#FF263CE0",warmPeach:"#FF8838E0",vibrantTeal:"#00BCA6E0",muted:"#777777E0",neutralLine:"#777777D0"},T=[i.green,i.lightBlue,i.indigo,i.brightOrange,i.deepOrange,i.goldenYellow,i.warmPink,i.warmPeach,i.purple,i.mintGreen,i.muted,i.vibrantTeal],L=[a.green,a.lightBlue,a.indigo,a.brightOrange,a.deepOrange,a.goldenYellow,a.warmPink,a.warmPeach,a.purple,a.mintGreen,a.muted,a.vibrantTeal],p={fontFamily:"inherit",h1:{fontSize:"24px",lineHeight:"30px",fontWeight:590},h2:{fontSize:"18px",lineHeight:"24px",fontWeight:590},h3:{fontSize:"16px",lineHeight:"22px",fontWeight:590},body:{fontSize:"14px",lineHeight:"20px",fontWeight:400},small:{fontSize:"12px",lineHeight:"16px",fontWeight:400}},x='ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',D={"0.5":2,1:4,"1.5":6,2:8,"2.5":10,3:12,"3.5":14,4:16,"4.5":18,5:20,6:24,7:28,8:32,9:36,10:40},C={none:0,xs:2,sm:4,md:6,lg:8,xl:12,full:9999},G={...C,md:8,lg:10,xl:14},H={...p,fontFamily:x};function f(e,n){return{bg:{editor:e.editor,chrome:e.chrome,elevated:e.elevated},text:{primary:e.foreground,secondary:e.foregroundSecondary,tertiary:e.foregroundTertiary,quaternary:e.foregroundQuaternary,link:e.link,onAccent:e.buttonForeground},stroke:{primary:e.strokePrimary,secondary:e.strokeSecondary,tertiary:e.strokeTertiary,focused:e.strokeFocused},fill:{primary:e.fillPrimary,secondary:e.fillSecondary,tertiary:e.fillTertiary,quaternary:e.fillQuaternary},accent:{primary:e.accent,control:e.buttonBackground,controlHover:e.buttonHoverBackground},diff:{insertedLine:e.diffInsertedLine,removedLine:e.diffRemovedLine,stripAdded:e.diffStripAdded,stripRemoved:e.diffStripRemoved},category:n}}const I=f(g,s),R=f(u,F);function E(e){const n=e.trim(),o=/^#([0-9a-f]{3,8})$/i.exec(n);if(!o)return;const r=o[1];if(r.length===3||r.length===4){const t=k=>k+k,c=parseInt(t(r[0]),16),d=parseInt(t(r[1]),16),l=parseInt(t(r[2]),16);return{r:c,g:d,b:l}}if(r.length===6||r.length===8){const t=parseInt(r.slice(0,2),16),c=parseInt(r.slice(2,4),16),d=parseInt(r.slice(4,6),16);return{r:t,g:c,b:d}}}function q(e){const n=o=>{const r=o/255;return r<=.03928?r/12.92:((r+.055)/1.055)**2.4};return .2126*n(e.r)+.7152*n(e.g)+.0722*n(e.b)}function M(e,n,o){const r=Math.min(1,Math.max(0,o));return{r:Math.round(e.r*(1-r)+n.r*r),g:Math.round(e.g*(1-r)+n.g*r),b:Math.round(e.b*(1-r)+n.b*r)}}function O(e){const n=o=>o.toString(16).padStart(2,"0");return`#${n(e.r)}${n(e.g)}${n(e.b)}`}function B(e){return e==="grok"?"grok":"cursor"}function Q(e,n){let o=e;if(typeof n.editorBackground=="string"&&E(n.editorBackground)){const r=n.editorBackground;o={...o,editor:r,chrome:r,sidebar:r,elevated:r}}if(typeof n.editorForeground=="string"&&E(n.editorForeground)){const r=n.editorForeground;o={...o,foreground:r,foregroundSecondary:r,foregroundTertiary:r,foregroundQuaternary:r}}return o}function W(e,n){const o=E(n);if(!o)return e;const r=M(o,{r:255,g:255,b:255},.12),t=q(o)>.45?"#141414":"#FAFAFA";return{...e,accent:n,buttonBackground:n,buttonHoverBackground:O(r),link:n,strokeFocused:n,buttonForeground:t}}const z=new Set(["light","hc-light"]);function Y(e){return z.has(e)}function $(e,n){const o=B(n==null?void 0:n.brand),r=Y(e);let t,c;return o==="grok"?(t=r?y:h,c=r?v:m):(t=r?u:g,c=r?F:s),t=Q(t,n??{}),o!=="grok"&&typeof(n==null?void 0:n.primary)=="string"&&(t=W(t,n.primary)),{tokens:f(t,c),palette:t,brand:o}}function _(e){return e==="grok"?{palette:a,sequence:L}:{palette:i,sequence:T}}function K(e){return e==="grok"?G:C}function N(e){return e==="grok"?H:p}function U(){var n;if(typeof window>"u")return;const e=window.__cursorCanvas;return(n=e==null?void 0:e.state)==null?void 0:n.theme}function j(e,n){let o=typeof(e==null?void 0:e.kind)=="string"&&e.kind.length>0?e.kind:void 0;o||(n?o=n:typeof window<"u"&&window.matchMedia?o=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":o="dark");const r={brand:B(e==null?void 0:e.brand),primary:typeof(e==null?void 0:e.primary)=="string"?e.primary:void 0,editorBackground:typeof(e==null?void 0:e.editorBackground)=="string"?e.editorBackground:void 0,editorForeground:typeof(e==null?void 0:e.editorForeground)=="string"?e.editorForeground:void 0},{tokens:t,palette:c,brand:d}=$(o,r),l=_(d);return{...t,kind:o,brand:d,tokens:t,palette:c,category:t.category,radius:K(d),typography:N(d),chart:l,spacing:D}}function w(e){const n=U();return j(n,e)}exports.canvasPaletteDark=g;exports.canvasPaletteGrokDark=h;exports.canvasPaletteGrokLight=y;exports.canvasPaletteLight=u;exports.canvasTokens=I;exports.canvasTokensLight=R;exports.categoryPaletteDark=s;exports.categoryPaletteLight=F;exports.colorPalette=P;exports.resolveThemeForColorScheme=w;exports.usageColorSequence=S;
|