pixelagent 0.1.24 → 0.1.25
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/edit/ColorPickerPopover.d.ts +4 -1
- package/dist/edit/ColorPickerPopover.d.ts.map +1 -1
- package/dist/edit/ColorTokenPopover.d.ts +11 -0
- package/dist/edit/ColorTokenPopover.d.ts.map +1 -0
- package/dist/edit/EditPropertiesPanel.d.ts.map +1 -1
- package/dist/edit/colorPresets.d.ts +23 -0
- package/dist/edit/colorPresets.d.ts.map +1 -0
- package/dist/pixelagent.js +1465 -1231
- package/dist/pixelagent.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
1
2
|
interface ColorPickerPopoverProps {
|
|
2
3
|
label: string;
|
|
3
4
|
value: string;
|
|
4
5
|
onChange: (value: string) => void;
|
|
6
|
+
/** Optional control rendered to the right of the field label (e.g. a token picker). */
|
|
7
|
+
labelAction?: ReactNode;
|
|
5
8
|
}
|
|
6
|
-
export declare function ColorPickerPopover({ label, value, onChange }: ColorPickerPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function ColorPickerPopover({ label, value, onChange, labelAction }: ColorPickerPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
7
10
|
export {};
|
|
8
11
|
//# sourceMappingURL=ColorPickerPopover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorPickerPopover.d.ts","sourceRoot":"","sources":["../../src/edit/ColorPickerPopover.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ColorPickerPopover.d.ts","sourceRoot":"","sources":["../../src/edit/ColorPickerPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuF,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAc5H,UAAU,uBAAuB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,uFAAuF;IACvF,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB;AAyBD,wBAAgB,kBAAkB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,uBAAuB,2CAqOlG"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ColorPreset } from './colorPresets.js';
|
|
2
|
+
interface ColorTokenPopoverProps {
|
|
3
|
+
presets: ColorPreset[];
|
|
4
|
+
value: string;
|
|
5
|
+
onApply: (color: string) => void;
|
|
6
|
+
/** Popover heading + aria label, e.g. "Text color", "Fill color". */
|
|
7
|
+
title?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function ColorTokenPopover({ presets, value, onApply, title }: ColorTokenPopoverProps): import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=ColorTokenPopover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ColorTokenPopover.d.ts","sourceRoot":"","sources":["../../src/edit/ColorTokenPopover.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAoB,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEvE,UAAU,sBAAsB;IAC9B,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAgCD,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAe,EAAE,EAAE,sBAAsB,kDAiKrG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditPropertiesPanel.d.ts","sourceRoot":"","sources":["../../src/edit/EditPropertiesPanel.ts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,2CAyW1B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface ColorPreset {
|
|
2
|
+
/** Token key after `--`, e.g. "color-ink". */
|
|
3
|
+
id: string;
|
|
4
|
+
/** Display name, e.g. "Ink", "Accent Sunset". */
|
|
5
|
+
name: string;
|
|
6
|
+
/** Raw token value, used directly as the swatch color. */
|
|
7
|
+
value: string;
|
|
8
|
+
/** Source CSS custom property, e.g. "--color-ink". */
|
|
9
|
+
varName: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Derive color presets from a flat map of resolved CSS custom properties.
|
|
13
|
+
* Any token whose value parses as a hex/rgb(a) color becomes a swatch; tokens
|
|
14
|
+
* holding lengths, gradients, shadows, etc. are ignored. Discovery order is
|
|
15
|
+
* preserved (roughly the declaration order in `:root`), which usually matches
|
|
16
|
+
* the designer's intended palette order.
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseColorPresets(vars: Record<string, string>): ColorPreset[];
|
|
19
|
+
/** Find the preset matching the element's current color (compared as hex). */
|
|
20
|
+
export declare function matchColorPreset(presets: ColorPreset[], currentColor: string): ColorPreset | null;
|
|
21
|
+
/** Read color presets from the live document's :root custom properties. */
|
|
22
|
+
export declare function readColorPresets(): ColorPreset[];
|
|
23
|
+
//# sourceMappingURL=colorPresets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colorPresets.d.ts","sourceRoot":"","sources":["../../src/edit/colorPresets.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,8CAA8C;IAC9C,EAAE,EAAE,MAAM,CAAC;IACX,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC;CACjB;AAaD;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,WAAW,EAAE,CAa7E;AAED,8EAA8E;AAC9E,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,WAAW,EAAE,EACtB,YAAY,EAAE,MAAM,GACnB,WAAW,GAAG,IAAI,CAUpB;AA+BD,2EAA2E;AAC3E,wBAAgB,gBAAgB,IAAI,WAAW,EAAE,CAahD"}
|