@pairdraw/design-jsx 0.19.2 → 0.20.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/chunks/effects.js +54 -2
- package/dist/chunks/effects.js.map +1 -1
- package/dist/chunks/elements.js +37 -5
- package/dist/chunks/elements.js.map +1 -1
- package/dist/chunks/export/index.js +22 -2
- package/dist/chunks/export/index.js.map +1 -1
- package/dist/index.d.ts +29 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/package.json +3 -3
- package/src/effects.ts +81 -2
- package/src/elements.ts +1 -1
- package/src/export/index.ts +2 -0
- package/src/export/paint.ts +50 -9
- package/src/export/props.ts +1 -1
- package/src/helpers.ts +26 -1
- package/src/index.ts +6 -1
package/dist/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as v from "valibot";
|
|
|
3
3
|
import { GradientTransformRows } from "@pairdraw/scene-graph/gradient";
|
|
4
4
|
import { ShaderComponent, ShaderPaint, ShaderPreset, ShaderUniformValue } from "@pairdraw/scene-graph/shaders";
|
|
5
5
|
import { Color, Rect as Rect$1, Vector as Vector$1 } from "@pairdraw/scene-graph/primitives";
|
|
6
|
-
import { BlendMode, Effect, Fill, FillType, GradientTransform, NodeType, SceneGraph, SceneNode, VectorNetwork } from "@pairdraw/scene-graph";
|
|
6
|
+
import { BlendMode, Effect, Fill, FillType, GradientTransform, NodeType, NoiseEffectParams, SceneGraph, SceneNode, TextureEffectParams, VectorNetwork } from "@pairdraw/scene-graph";
|
|
7
7
|
//#region src/components.d.ts
|
|
8
8
|
type Child$1 = TreeNode | string;
|
|
9
9
|
declare function Frame(props: BaseProps, ...children: Child$1[]): TreeNode;
|
|
@@ -200,6 +200,31 @@ declare function innerShadow(options?: ShadowEffectOptions): Effect;
|
|
|
200
200
|
declare function layerBlur(radiusOrOptions?: number | BlurEffectOptions): Effect;
|
|
201
201
|
declare function backgroundBlur(radiusOrOptions?: number | BlurEffectOptions): Effect;
|
|
202
202
|
declare function foregroundBlur(radiusOrOptions?: number | BlurEffectOptions): Effect;
|
|
203
|
+
/** A grain size as Figma's plugin API takes it, one number for both axes, or each axis apart. */
|
|
204
|
+
type NoiseSize = number | Vector$1;
|
|
205
|
+
/**
|
|
206
|
+
* A noise effect in Figma's terms: grains in `color`, a duotone's `secondaryColor` too, or a
|
|
207
|
+
* multitone's many colours at `opacity`. Left out, each value is what Figma's panel starts with.
|
|
208
|
+
*/
|
|
209
|
+
interface NoiseEffectOptions extends Partial<Omit<NoiseEffectParams, 'noiseSize' | 'secondaryColor'>> {
|
|
210
|
+
noiseSize?: NoiseSize;
|
|
211
|
+
color?: EffectColor;
|
|
212
|
+
secondaryColor?: EffectColor;
|
|
213
|
+
visible?: boolean;
|
|
214
|
+
}
|
|
215
|
+
/** A texture effect in Figma's terms, `radius` being how far its grain moves the edges. */
|
|
216
|
+
interface TextureEffectOptions extends Partial<Omit<TextureEffectParams, 'noiseSize'>> {
|
|
217
|
+
noiseSize?: NoiseSize;
|
|
218
|
+
radius?: number;
|
|
219
|
+
visible?: boolean;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* A noise effect. A duotone's second colour starts white at the first colour's opacity and a
|
|
223
|
+
* multitone's opacity at that opacity, as Figma's panel switches them.
|
|
224
|
+
*/
|
|
225
|
+
declare function noise(options?: NoiseEffectOptions): Effect;
|
|
226
|
+
/** A texture effect, which roughens the layer's edges by `radius`. */
|
|
227
|
+
declare function texture(options?: TextureEffectOptions): Effect;
|
|
203
228
|
//#endregion
|
|
204
229
|
//#region src/paints.d.ts
|
|
205
230
|
type PaintColor = string | Color;
|
|
@@ -394,6 +419,8 @@ declare function designJSXHelpers(warnings: string[]): {
|
|
|
394
419
|
layerBlur: (radiusOrOptions?: number | BlurEffectOptions | undefined) => import("@pairdraw/scene-graph").Effect;
|
|
395
420
|
backgroundBlur: (radiusOrOptions?: number | BlurEffectOptions | undefined) => import("@pairdraw/scene-graph").Effect;
|
|
396
421
|
foregroundBlur: (radiusOrOptions?: number | BlurEffectOptions | undefined) => import("@pairdraw/scene-graph").Effect;
|
|
422
|
+
noise: (options?: NoiseEffectOptions | undefined) => import("@pairdraw/scene-graph").Effect;
|
|
423
|
+
texture: (options?: TextureEffectOptions | undefined) => import("@pairdraw/scene-graph").Effect;
|
|
397
424
|
defineVars: typeof defineVars;
|
|
398
425
|
defineMode: typeof defineMode;
|
|
399
426
|
designVar: typeof designVar;
|
|
@@ -544,5 +571,5 @@ declare function createStreamingJSXParser(): {
|
|
|
544
571
|
reset: () => void;
|
|
545
572
|
};
|
|
546
573
|
//#endregion
|
|
547
|
-
export { AUTHORING_EXAMPLES, Accordion, type ArtworkPlacement, type AuthoringExample, type BaseProps, type BlurEffectOptions, Button, Checkbox, Collapsible, Component, type ComponentProperty, type ComponentProps, ComponentSet, DESIGN_JSX_ELEMENTS, DESIGN_JSX_HELPERS, DESIGN_JSX_PARAGRAPH_PROPERTY_NAMES, DESIGN_JSX_PROPERTIES, DESIGN_JSX_PROPERTY_ALIASES, DESIGN_JSX_SPAN_PROPERTY_NAMES, DESIGN_JSX_STYLE_KEYS, DESIGN_JSX_SUPPORTED_PROPERTIES, DESIGN_JSX_SUPPORTED_PROPERTY_NAMES, DESIGN_JSX_TEXT_PARAGRAPH_PROPERTY_NAMES, type DesignJSXElement, type DesignJSXElementDefinition, type DesignJSXHelperDefinition, type DesignJSXHelperName, type DesignJSXProgram, type DesignJSXPropertyDefinition, type DesignJSXRenderer, type DesignJSXServices, type DesignJSXStyleKey, type DesignJSXWithLayers, type DesignMode, type DesignVariable, type EffectColor, Ellipse, type EllipseProps, Frame, type GradientPaintOptions, Group, INTRINSIC_ELEMENTS, Instance, type InstanceProps, type JSXAttributeSource, type JSXExportOptions, type JSXNodeFields, type JSXPreviewNode, type JSXPreviewPending, type JSXPreviewSnapshot, JSX_REFERENCE, type LayerRef, Line, NumberField, Page, type PaintColor, type PaintProp, type PaintStop, Paragraph, type ParagraphProps, Polygon, Progress, RadioGroup, Rect, Rectangle, type RekaElement, type RekaProps, type RenderOptions, type RenderResult, type SVGSource, Section, type ShaderFill, type ShaderSourceOptions, type ShadowEffectOptions, Slider, type SolidPaintOptions, Span, type SpanProps, Star, type StyleProps, Switch, Tabs, Text, TextField, type TextProps, Textarea, Toggle, ToggleGroup, type TreeNode, type VariableInput, Vector, type VectorProps, View, angularGradient, backgroundBlur, buildComponent, createDesignJSXRenderer, createElement, createStreamingJSXParser, defineMode, defineVars, designJSXElement, designJSXHelpers, designJSXProp, designJSXPropertyNames, designMode, designVar, diamondGradient, dropShadow, elementPropsByName, foregroundBlur, gradient, innerShadow, isComponentProperty, isLayerRef, isMode, isTreeNode, isVariable, isVariableInput, jsxNodeFields, layerBlur, linearGradient, node, parseJSXAttributes, property, radialGradient, reconcileRenderedLayers, ref, resolveToTree, sceneNodeAttributes, sceneNodeToJSX, selectionToJSX, selectionToJSXWithLayers, shader, shaderSource, solid, transformDesignJSXExpression, transformDesignJSXProgram };
|
|
574
|
+
export { AUTHORING_EXAMPLES, Accordion, type ArtworkPlacement, type AuthoringExample, type BaseProps, type BlurEffectOptions, Button, Checkbox, Collapsible, Component, type ComponentProperty, type ComponentProps, ComponentSet, DESIGN_JSX_ELEMENTS, DESIGN_JSX_HELPERS, DESIGN_JSX_PARAGRAPH_PROPERTY_NAMES, DESIGN_JSX_PROPERTIES, DESIGN_JSX_PROPERTY_ALIASES, DESIGN_JSX_SPAN_PROPERTY_NAMES, DESIGN_JSX_STYLE_KEYS, DESIGN_JSX_SUPPORTED_PROPERTIES, DESIGN_JSX_SUPPORTED_PROPERTY_NAMES, DESIGN_JSX_TEXT_PARAGRAPH_PROPERTY_NAMES, type DesignJSXElement, type DesignJSXElementDefinition, type DesignJSXHelperDefinition, type DesignJSXHelperName, type DesignJSXProgram, type DesignJSXPropertyDefinition, type DesignJSXRenderer, type DesignJSXServices, type DesignJSXStyleKey, type DesignJSXWithLayers, type DesignMode, type DesignVariable, type EffectColor, Ellipse, type EllipseProps, Frame, type GradientPaintOptions, Group, INTRINSIC_ELEMENTS, Instance, type InstanceProps, type JSXAttributeSource, type JSXExportOptions, type JSXNodeFields, type JSXPreviewNode, type JSXPreviewPending, type JSXPreviewSnapshot, JSX_REFERENCE, type LayerRef, Line, type NoiseEffectOptions, type NoiseSize, NumberField, Page, type PaintColor, type PaintProp, type PaintStop, Paragraph, type ParagraphProps, Polygon, Progress, RadioGroup, Rect, Rectangle, type RekaElement, type RekaProps, type RenderOptions, type RenderResult, type SVGSource, Section, type ShaderFill, type ShaderSourceOptions, type ShadowEffectOptions, Slider, type SolidPaintOptions, Span, type SpanProps, Star, type StyleProps, Switch, Tabs, Text, TextField, type TextProps, Textarea, type TextureEffectOptions, Toggle, ToggleGroup, type TreeNode, type VariableInput, Vector, type VectorProps, View, angularGradient, backgroundBlur, buildComponent, createDesignJSXRenderer, createElement, createStreamingJSXParser, defineMode, defineVars, designJSXElement, designJSXHelpers, designJSXProp, designJSXPropertyNames, designMode, designVar, diamondGradient, dropShadow, elementPropsByName, foregroundBlur, gradient, innerShadow, isComponentProperty, isLayerRef, isMode, isTreeNode, isVariable, isVariableInput, jsxNodeFields, layerBlur, linearGradient, node, noise, parseJSXAttributes, property, radialGradient, reconcileRenderedLayers, ref, resolveToTree, sceneNodeAttributes, sceneNodeToJSX, selectionToJSX, selectionToJSXWithLayers, shader, shaderSource, solid, texture, transformDesignJSXExpression, transformDesignJSXProgram };
|
|
548
575
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/components.ts","../src/behaviours/index.ts","../src/behaviours/elements.ts","../src/services.ts","../src/types.ts","../src/renderer.ts","../src/effects.ts","../src/paints.ts","../src/refs.ts","../src/mini-react.ts","../src/render.ts","../src/schema.ts","../src/elements.ts","../src/definitions.ts","../src/helpers.ts","../src/transform.ts","../src/export/index.ts","../src/attributes.ts","../src/fields.ts","../src/reconcile.ts","../src/reference/examples.ts","../src/reference.ts","../src/streaming/projection.ts","../src/streaming/index.ts"],"mappings":";;;;;;;KAaK,UAAQ;iBASG,MAAM,OAAO,cAAc,UAAU,YAAU;iBAI/C,KAAK,OAAO,cAAc,UAAU,YAAU;iBAI9C,KAAK,OAAO,cAAc,UAAU,YAAU;iBAI9C,UAAU,OAAO,mBAAmB,UAAU,YAAU;iBAIxD,UAAU,OAAO,cAAc,UAAU,YAAU;iBAInD,QAAQ,OAAO,YAAY,iBAAiB,UAAU,YAAU;iBAIhE,KAAK,OAAO,cAAc,UAAU,YAAU;iBAI9C,KACd,OAAO;EAAc;EAAiB;MACnC,UAAU,YACZ;iBAIa,QACd,OAAO;EAAc;MAClB,UAAU,YACZ;iBAIa,OAAO,OAAO,YAAY,gBAAgB,UAAU,YAAU;iBAI9D,MAAM,OAAO,cAAc,UAAU,YAAU;iBAI/C,QAAQ,OAAO,cAAc,UAAU,YAAU;iBAIjD,UAAU,OAAO,mBAAmB,UAAU,YAAU;iBAIxD,aAAa,OAAO,mBAAmB,UAAU,YAAU;iBAI3D,SAAS,OAAO,kBAAkB,UAAU,YAAU;cAIzD,aAAI;cACJ,aAAI;cACJ,aAAI;cAEJ;;;;KCkHD;EAAyB;EAAkB;EAAa;;;;;UC1MnD,kBAAkB;EACjC,aAAa;EACb,OAAO;EACP,WAAW;EACX,SAAS;;EAET;EACA;EACA;EACA;EACA;;EAEA;;KAGG,QAAQ;KACD,eAAe,QAAQ,cAAc,UAAU,YAAY;cAa1D;iBAAA;;cACA;iBAAA;;cACA;iBAAA;kBAAA;;cACA;iBAAA;sBAAA;;cACA;;;;;cACA;iBAAA;iBAAA;;cACA;;;;;;cACA;;;;;cACA;;;;;;cACA;;;;;cACA;;;;;;;cACA;;;;;;cACA;iBAAA;kBAAA;;cACA;iBAAA;kBAAA;;;;;UCxCI;EACf;EACA,UAAU;EACV,OAAO;;;UAIQ;EACf;EACA;EACA,OAAO;EACP,WAAW,QAAQ;;;;;;UAOJ,kBAAkB;;EAEjC,KAAK,cAAc,eAAe,QAAQ;;EAE1C,IAAI,QAAQ,WAAW,eAAe;;EAEtC,cAAc,OAAO,YAAY,SAAS,SAAS,WAAW,mBAAmB;;EAEjF,OAAO,OAAO,YAAY;;EAE1B,aAAa,SAAS,gBAAgB;;;;UC7BvB;EACf;EACA;;EAEA,YAAY,cAAc,QAAQ;EAClC;;EAEA,UAAU,MAAM,UAAU,MAAM;;EAEhC;;;;UC2Be;EACf;EACA;EACA,MAAM;EACN;EACA;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/components.ts","../src/behaviours/index.ts","../src/behaviours/elements.ts","../src/services.ts","../src/types.ts","../src/renderer.ts","../src/effects.ts","../src/paints.ts","../src/refs.ts","../src/mini-react.ts","../src/render.ts","../src/schema.ts","../src/elements.ts","../src/definitions.ts","../src/helpers.ts","../src/transform.ts","../src/export/index.ts","../src/attributes.ts","../src/fields.ts","../src/reconcile.ts","../src/reference/examples.ts","../src/reference.ts","../src/streaming/projection.ts","../src/streaming/index.ts"],"mappings":";;;;;;;KAaK,UAAQ;iBASG,MAAM,OAAO,cAAc,UAAU,YAAU;iBAI/C,KAAK,OAAO,cAAc,UAAU,YAAU;iBAI9C,KAAK,OAAO,cAAc,UAAU,YAAU;iBAI9C,UAAU,OAAO,mBAAmB,UAAU,YAAU;iBAIxD,UAAU,OAAO,cAAc,UAAU,YAAU;iBAInD,QAAQ,OAAO,YAAY,iBAAiB,UAAU,YAAU;iBAIhE,KAAK,OAAO,cAAc,UAAU,YAAU;iBAI9C,KACd,OAAO;EAAc;EAAiB;MACnC,UAAU,YACZ;iBAIa,QACd,OAAO;EAAc;MAClB,UAAU,YACZ;iBAIa,OAAO,OAAO,YAAY,gBAAgB,UAAU,YAAU;iBAI9D,MAAM,OAAO,cAAc,UAAU,YAAU;iBAI/C,QAAQ,OAAO,cAAc,UAAU,YAAU;iBAIjD,UAAU,OAAO,mBAAmB,UAAU,YA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G;EAAmB,KAAK;;;;UCvHZ;EACf;EACA;;;cAIW,6BAA6B;;;;cCC7B;;;UCII,uBAAuB;;EAEtC;EACA,WAAW;;UAGI;EACf;EACA;EACA;;UAGe;EACf,MAAM;EACN,SAAS;;;;;;;;;;iBCXK;EAIS,SAAA,kBAAS;EAoBd"}
|
package/dist/index.js
CHANGED
|
@@ -2,10 +2,10 @@ import { buildComponent, createDesignJSXRenderer, createElement, jsxNodeFields,
|
|
|
2
2
|
import { Accordion, Button, Checkbox, Collapsible, NumberField, Progress, RadioGroup, Slider, Switch, Tabs, TextField, Textarea, Toggle, ToggleGroup, isTreeNode, node, resolveToTree } from "./chunks/behaviours/elements.js";
|
|
3
3
|
import { Component, ComponentSet, Ellipse, Frame, Group, INTRINSIC_ELEMENTS, Instance, Line, Page, Paragraph, Polygon, Rect, Rectangle, Section, Span, Star, Text, Vector, View } from "./chunks/components.js";
|
|
4
4
|
import { defineMode, defineVars, designMode, designVar, isComponentProperty, isLayerRef, isMode, isVariable, isVariableInput, property, ref } from "./chunks/component-properties.js";
|
|
5
|
-
import { backgroundBlur, dropShadow, foregroundBlur, innerShadow, layerBlur } from "./chunks/effects.js";
|
|
5
|
+
import { backgroundBlur, dropShadow, foregroundBlur, innerShadow, layerBlur, noise, texture } from "./chunks/effects.js";
|
|
6
6
|
import { DESIGN_JSX_PARAGRAPH_PROPERTY_NAMES, DESIGN_JSX_PROPERTIES, DESIGN_JSX_PROPERTY_ALIASES, DESIGN_JSX_SPAN_PROPERTY_NAMES, DESIGN_JSX_STYLE_KEYS, DESIGN_JSX_SUPPORTED_PROPERTIES, DESIGN_JSX_SUPPORTED_PROPERTY_NAMES, DESIGN_JSX_TEXT_PARAGRAPH_PROPERTY_NAMES, designJSXProp, designJSXPropertyNames } from "./chunks/behaviours/render.js";
|
|
7
7
|
import { DESIGN_JSX_HELPERS, angularGradient, designJSXElement, designJSXHelpers, diamondGradient, gradient, linearGradient, radialGradient, sceneNodeAttributes, sceneNodeToJSX, selectionToJSX, selectionToJSXWithLayers, shader, shaderSource, solid } from "./chunks/export/index.js";
|
|
8
8
|
import { DESIGN_JSX_ELEMENTS, elementPropsByName } from "./chunks/elements.js";
|
|
9
9
|
import { parseJSXAttributes } from "./chunks/attributes.js";
|
|
10
10
|
import { AUTHORING_EXAMPLES, JSX_REFERENCE, createStreamingJSXParser, reconcileRenderedLayers } from "./chunks/index.js";
|
|
11
|
-
export { AUTHORING_EXAMPLES, Accordion, Button, Checkbox, Collapsible, Component, ComponentSet, DESIGN_JSX_ELEMENTS, DESIGN_JSX_HELPERS, DESIGN_JSX_PARAGRAPH_PROPERTY_NAMES, DESIGN_JSX_PROPERTIES, DESIGN_JSX_PROPERTY_ALIASES, DESIGN_JSX_SPAN_PROPERTY_NAMES, DESIGN_JSX_STYLE_KEYS, DESIGN_JSX_SUPPORTED_PROPERTIES, DESIGN_JSX_SUPPORTED_PROPERTY_NAMES, DESIGN_JSX_TEXT_PARAGRAPH_PROPERTY_NAMES, Ellipse, Frame, Group, INTRINSIC_ELEMENTS, Instance, JSX_REFERENCE, Line, NumberField, Page, Paragraph, Polygon, Progress, RadioGroup, Rect, Rectangle, Section, Slider, Span, Star, Switch, Tabs, Text, TextField, Textarea, Toggle, ToggleGroup, Vector, View, angularGradient, backgroundBlur, buildComponent, createDesignJSXRenderer, createElement, createStreamingJSXParser, defineMode, defineVars, designJSXElement, designJSXHelpers, designJSXProp, designJSXPropertyNames, designMode, designVar, diamondGradient, dropShadow, elementPropsByName, foregroundBlur, gradient, innerShadow, isComponentProperty, isLayerRef, isMode, isTreeNode, isVariable, isVariableInput, jsxNodeFields, layerBlur, linearGradient, node, parseJSXAttributes, property, radialGradient, reconcileRenderedLayers, ref, resolveToTree, sceneNodeAttributes, sceneNodeToJSX, selectionToJSX, selectionToJSXWithLayers, shader, shaderSource, solid, transformDesignJSXExpression, transformDesignJSXProgram };
|
|
11
|
+
export { AUTHORING_EXAMPLES, Accordion, Button, Checkbox, Collapsible, Component, ComponentSet, DESIGN_JSX_ELEMENTS, DESIGN_JSX_HELPERS, DESIGN_JSX_PARAGRAPH_PROPERTY_NAMES, DESIGN_JSX_PROPERTIES, DESIGN_JSX_PROPERTY_ALIASES, DESIGN_JSX_SPAN_PROPERTY_NAMES, DESIGN_JSX_STYLE_KEYS, DESIGN_JSX_SUPPORTED_PROPERTIES, DESIGN_JSX_SUPPORTED_PROPERTY_NAMES, DESIGN_JSX_TEXT_PARAGRAPH_PROPERTY_NAMES, Ellipse, Frame, Group, INTRINSIC_ELEMENTS, Instance, JSX_REFERENCE, Line, NumberField, Page, Paragraph, Polygon, Progress, RadioGroup, Rect, Rectangle, Section, Slider, Span, Star, Switch, Tabs, Text, TextField, Textarea, Toggle, ToggleGroup, Vector, View, angularGradient, backgroundBlur, buildComponent, createDesignJSXRenderer, createElement, createStreamingJSXParser, defineMode, defineVars, designJSXElement, designJSXHelpers, designJSXProp, designJSXPropertyNames, designMode, designVar, diamondGradient, dropShadow, elementPropsByName, foregroundBlur, gradient, innerShadow, isComponentProperty, isLayerRef, isMode, isTreeNode, isVariable, isVariableInput, jsxNodeFields, layerBlur, linearGradient, node, noise, parseJSXAttributes, property, radialGradient, reconcileRenderedLayers, ref, resolveToTree, sceneNodeAttributes, sceneNodeToJSX, selectionToJSX, selectionToJSXWithLayers, shader, shaderSource, solid, texture, transformDesignJSXExpression, transformDesignJSXProgram };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pairdraw/design-jsx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@lezer/common": "^1.5.2",
|
|
14
14
|
"@lezer/javascript": "^1.5.4",
|
|
15
|
-
"@pairdraw/emit": "^0.
|
|
15
|
+
"@pairdraw/emit": "^0.20.0",
|
|
16
16
|
"acorn": "^8.18.0",
|
|
17
17
|
"dedent": "^1.7.2",
|
|
18
18
|
"entities": "^8.0.0",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"valibot": "^1.5.0"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@pairdraw/scene-graph": "^0.
|
|
24
|
+
"@pairdraw/scene-graph": "^0.20.0"
|
|
25
25
|
},
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
package/src/effects.ts
CHANGED
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
BlendMode,
|
|
3
|
+
Effect,
|
|
4
|
+
NoiseEffectParams,
|
|
5
|
+
TextureEffectParams
|
|
6
|
+
} from '@pairdraw/scene-graph'
|
|
2
7
|
import { parseColor } from '@pairdraw/scene-graph/color'
|
|
3
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
BLACK,
|
|
10
|
+
DEFAULT_NOISE,
|
|
11
|
+
DEFAULT_NOISE_COLOR,
|
|
12
|
+
DEFAULT_TEXTURE,
|
|
13
|
+
TRANSPARENT
|
|
14
|
+
} from '@pairdraw/scene-graph/constants'
|
|
4
15
|
import type { Color, Vector } from '@pairdraw/scene-graph/primitives'
|
|
5
16
|
|
|
6
17
|
import { BLEND_MODE } from './enums'
|
|
@@ -86,3 +97,71 @@ export function backgroundBlur(radiusOrOptions?: number | BlurEffectOptions): Ef
|
|
|
86
97
|
export function foregroundBlur(radiusOrOptions?: number | BlurEffectOptions): Effect {
|
|
87
98
|
return blurEffect('FOREGROUND_BLUR', radiusOrOptions)
|
|
88
99
|
}
|
|
100
|
+
|
|
101
|
+
/** A grain size as Figma's plugin API takes it, one number for both axes, or each axis apart. */
|
|
102
|
+
export type NoiseSize = number | Vector
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* A noise effect in Figma's terms: grains in `color`, a duotone's `secondaryColor` too, or a
|
|
106
|
+
* multitone's many colours at `opacity`. Left out, each value is what Figma's panel starts with.
|
|
107
|
+
*/
|
|
108
|
+
export interface NoiseEffectOptions extends Partial<
|
|
109
|
+
Omit<NoiseEffectParams, 'noiseSize' | 'secondaryColor'>
|
|
110
|
+
> {
|
|
111
|
+
noiseSize?: NoiseSize
|
|
112
|
+
color?: EffectColor
|
|
113
|
+
secondaryColor?: EffectColor
|
|
114
|
+
visible?: boolean
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/** A texture effect in Figma's terms, `radius` being how far its grain moves the edges. */
|
|
118
|
+
export interface TextureEffectOptions extends Partial<Omit<TextureEffectParams, 'noiseSize'>> {
|
|
119
|
+
noiseSize?: NoiseSize
|
|
120
|
+
radius?: number
|
|
121
|
+
visible?: boolean
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/** Radius of a new texture effect, as Figma's effects panel starts one. */
|
|
125
|
+
const DEFAULT_TEXTURE_RADIUS = 4
|
|
126
|
+
|
|
127
|
+
function noiseSize(size: NoiseSize | undefined, fallback: Vector): Vector {
|
|
128
|
+
if (size === undefined) return { ...fallback }
|
|
129
|
+
return typeof size === 'number' ? { x: size, y: size } : { ...size }
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* A noise effect. A duotone's second colour starts white at the first colour's opacity and a
|
|
134
|
+
* multitone's opacity at that opacity, as Figma's panel switches them.
|
|
135
|
+
*/
|
|
136
|
+
export function noise(options: NoiseEffectOptions = {}): Effect {
|
|
137
|
+
const color = options.color === undefined ? { ...DEFAULT_NOISE_COLOR } : toColor(options.color)
|
|
138
|
+
const params: NoiseEffectParams = {
|
|
139
|
+
noiseType: options.noiseType ?? DEFAULT_NOISE.noiseType,
|
|
140
|
+
noiseSize: noiseSize(options.noiseSize, DEFAULT_NOISE.noiseSize),
|
|
141
|
+
density: options.density ?? DEFAULT_NOISE.density
|
|
142
|
+
}
|
|
143
|
+
// A second colour or opacity given is kept whatever the type, so switching back finds it; a
|
|
144
|
+
// duotone or multitone that lacks one starts where Figma's panel does.
|
|
145
|
+
if (options.secondaryColor !== undefined) params.secondaryColor = toColor(options.secondaryColor)
|
|
146
|
+
else if (params.noiseType === 'DUOTONE') params.secondaryColor = { r: 1, g: 1, b: 1, a: color.a }
|
|
147
|
+
if (options.opacity !== undefined) params.opacity = options.opacity
|
|
148
|
+
else if (params.noiseType === 'MULTITONE') params.opacity = color.a
|
|
149
|
+
if (options.seed !== undefined) params.seed = options.seed
|
|
150
|
+
return { type: 'NOISE', color, visible: options.visible ?? true, noise: params }
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/** A texture effect, which roughens the layer's edges by `radius`. */
|
|
154
|
+
export function texture(options: TextureEffectOptions = {}): Effect {
|
|
155
|
+
const params: TextureEffectParams = {
|
|
156
|
+
noiseSize: noiseSize(options.noiseSize, DEFAULT_TEXTURE.noiseSize),
|
|
157
|
+
clipToShape: options.clipToShape ?? DEFAULT_TEXTURE.clipToShape
|
|
158
|
+
}
|
|
159
|
+
if (options.seed !== undefined) params.seed = options.seed
|
|
160
|
+
return {
|
|
161
|
+
type: 'TEXTURE',
|
|
162
|
+
color: { ...BLACK },
|
|
163
|
+
radius: options.radius ?? DEFAULT_TEXTURE_RADIUS,
|
|
164
|
+
visible: options.visible ?? true,
|
|
165
|
+
texture: params
|
|
166
|
+
}
|
|
167
|
+
}
|
package/src/elements.ts
CHANGED
|
@@ -140,7 +140,7 @@ export const DESIGN_JSX_ELEMENTS: DesignJSXElementDefinition[] = [
|
|
|
140
140
|
runtimeType: 'vector',
|
|
141
141
|
description: 'A vector layer.',
|
|
142
142
|
nodeType: 'VECTOR',
|
|
143
|
-
writes: ['VECTOR']
|
|
143
|
+
writes: ['VECTOR', 'BOOLEAN_OPERATION']
|
|
144
144
|
},
|
|
145
145
|
{
|
|
146
146
|
name: 'Group',
|
package/src/export/index.ts
CHANGED
|
@@ -162,6 +162,8 @@ function nodeToJSX(
|
|
|
162
162
|
for (let count = elementCount(content); count > 0; count--) layerIds?.push(null)
|
|
163
163
|
return [jsx.element(tag, attributes, content, depth, inline)]
|
|
164
164
|
}
|
|
165
|
+
// A boolean's result path draws it, so its operands are not written as children.
|
|
166
|
+
if (node.type === 'BOOLEAN_OPERATION') return [jsx.element(tag, attributes, [], depth)]
|
|
165
167
|
return [jsx.element(tag, attributes, children(depth + 1), depth)]
|
|
166
168
|
}
|
|
167
169
|
|
package/src/export/paint.ts
CHANGED
|
@@ -3,10 +3,11 @@ import type {
|
|
|
3
3
|
Fill,
|
|
4
4
|
GradientTransform,
|
|
5
5
|
SceneNode,
|
|
6
|
-
|
|
6
|
+
ShaderEffect,
|
|
7
7
|
Stroke
|
|
8
8
|
} from '@pairdraw/scene-graph'
|
|
9
9
|
import { gradientTransformRows, isIdentityGradientTransform } from '@pairdraw/scene-graph/gradient'
|
|
10
|
+
import type { Vector } from '@pairdraw/scene-graph/primitives'
|
|
10
11
|
import { isShaderPresetPaint, shaderOfPaint } from '@pairdraw/scene-graph/shaders'
|
|
11
12
|
|
|
12
13
|
import { STROKE_ALIGN, STROKE_CAP, STROKE_JOIN } from '../enums'
|
|
@@ -215,15 +216,22 @@ export function collectStrokeProps(node: SceneNode, props: JSXProp[]): void {
|
|
|
215
216
|
}
|
|
216
217
|
}
|
|
217
218
|
|
|
218
|
-
const EFFECT_HELPERS: Record<
|
|
219
|
+
const EFFECT_HELPERS: Record<Exclude<Effect['type'], 'SHADER'>, string> = {
|
|
219
220
|
DROP_SHADOW: 'dropShadow',
|
|
220
221
|
INNER_SHADOW: 'innerShadow',
|
|
221
222
|
LAYER_BLUR: 'layerBlur',
|
|
222
223
|
BACKGROUND_BLUR: 'backgroundBlur',
|
|
223
|
-
FOREGROUND_BLUR: 'foregroundBlur'
|
|
224
|
+
FOREGROUND_BLUR: 'foregroundBlur',
|
|
225
|
+
NOISE: 'noise',
|
|
226
|
+
TEXTURE: 'texture'
|
|
224
227
|
}
|
|
225
228
|
|
|
226
|
-
|
|
229
|
+
/** A grain size as one number when both axes match, as Figma's plugin API writes it. */
|
|
230
|
+
function noiseSizeValue(size: Vector): JSXValue {
|
|
231
|
+
return size.x === size.y ? size.x : { x: size.x, y: size.y }
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function effectValue(effect: Exclude<Effect, ShaderEffect>): HelperCall {
|
|
227
235
|
const visible = effect.visible ? undefined : false
|
|
228
236
|
if (effect.type === 'DROP_SHADOW' || effect.type === 'INNER_SHADOW') {
|
|
229
237
|
return helperCall(
|
|
@@ -240,6 +248,37 @@ function effectValue(effect: ShadowEffect): HelperCall {
|
|
|
240
248
|
})
|
|
241
249
|
)
|
|
242
250
|
}
|
|
251
|
+
if (effect.type === 'NOISE') {
|
|
252
|
+
const grain = effect.noise
|
|
253
|
+
return helperCall(
|
|
254
|
+
EFFECT_HELPERS.NOISE,
|
|
255
|
+
options({
|
|
256
|
+
noiseType: grain.noiseType,
|
|
257
|
+
noiseSize: noiseSizeValue(grain.noiseSize),
|
|
258
|
+
density: grain.density,
|
|
259
|
+
color: formatColor(effect.color, effect.color.a),
|
|
260
|
+
secondaryColor: grain.secondaryColor
|
|
261
|
+
? formatColor(grain.secondaryColor, grain.secondaryColor.a)
|
|
262
|
+
: undefined,
|
|
263
|
+
opacity: grain.opacity,
|
|
264
|
+
seed: grain.seed,
|
|
265
|
+
visible
|
|
266
|
+
})
|
|
267
|
+
)
|
|
268
|
+
}
|
|
269
|
+
if (effect.type === 'TEXTURE') {
|
|
270
|
+
const grain = effect.texture
|
|
271
|
+
return helperCall(
|
|
272
|
+
EFFECT_HELPERS.TEXTURE,
|
|
273
|
+
options({
|
|
274
|
+
noiseSize: noiseSizeValue(grain.noiseSize),
|
|
275
|
+
radius: effect.radius,
|
|
276
|
+
clipToShape: grain.clipToShape,
|
|
277
|
+
seed: grain.seed,
|
|
278
|
+
visible
|
|
279
|
+
})
|
|
280
|
+
)
|
|
281
|
+
}
|
|
243
282
|
return helperCall(
|
|
244
283
|
EFFECT_HELPERS[effect.type],
|
|
245
284
|
visible === undefined ? effect.radius : { radius: effect.radius, visible }
|
|
@@ -259,20 +298,22 @@ function plainDropShadow(effect: Effect): string | null {
|
|
|
259
298
|
* `shadow` and `blur` describe a plain drop shadow followed by a layer blur, each optional,
|
|
260
299
|
* in the order the renderer appends them; anything else needs `effects`.
|
|
261
300
|
*/
|
|
262
|
-
function effectShorthand(effects:
|
|
301
|
+
function effectShorthand(effects: Effect[]): JSXProp[] | null {
|
|
263
302
|
if (effects.some((effect) => !effect.visible)) return null
|
|
264
303
|
const shadow = effects.length > 0 ? plainDropShadow(effects[0]) : null
|
|
265
304
|
const rest = shadow ? effects.slice(1) : effects
|
|
266
305
|
if (rest.length > 1 || rest.some((effect) => effect.type !== 'LAYER_BLUR')) return null
|
|
267
306
|
const props: JSXProp[] = []
|
|
268
307
|
if (shadow) props.push(['shadow', shadow])
|
|
269
|
-
for (const blur of rest)
|
|
308
|
+
for (const blur of rest) {
|
|
309
|
+
if (blur.type === 'LAYER_BLUR') props.push(['blur', blur.radius])
|
|
310
|
+
}
|
|
270
311
|
return props
|
|
271
312
|
}
|
|
272
313
|
|
|
273
|
-
/** An effect JSX has a helper for;
|
|
274
|
-
function hasJSXHelper(effect: Effect): effect is
|
|
275
|
-
return Object.hasOwn(EFFECT_HELPERS, effect.type)
|
|
314
|
+
/** An effect JSX has a helper for; a shader effect is not written back as JSX source. */
|
|
315
|
+
function hasJSXHelper(effect: Effect): effect is Exclude<Effect, ShaderEffect> {
|
|
316
|
+
return effect.type !== 'SHADER' && Object.hasOwn(EFFECT_HELPERS, effect.type)
|
|
276
317
|
}
|
|
277
318
|
|
|
278
319
|
export function collectEffectProps(node: SceneNode, props: JSXProp[]): void {
|
package/src/export/props.ts
CHANGED
|
@@ -331,7 +331,7 @@ function collectShapeNodeProps(node: SceneNode, props: JSXProp[]): void {
|
|
|
331
331
|
if (node.type === 'POLYGON' && node.pointCount !== 3) {
|
|
332
332
|
props.push(['points', node.pointCount])
|
|
333
333
|
}
|
|
334
|
-
if (node.type === 'VECTOR' && node.vectorNetwork) {
|
|
334
|
+
if ((node.type === 'VECTOR' || node.type === 'BOOLEAN_OPERATION') && node.vectorNetwork) {
|
|
335
335
|
// Figma's own form of a vector's geometry, which <Vector> reads back as written.
|
|
336
336
|
const paths = vectorNetworkPaths(node.vectorNetwork)
|
|
337
337
|
if (paths.length > 0) props.push(['paths', paths.map((path) => ({ ...path }))])
|
package/src/helpers.ts
CHANGED
|
@@ -9,8 +9,12 @@ import {
|
|
|
9
9
|
foregroundBlur,
|
|
10
10
|
innerShadow,
|
|
11
11
|
layerBlur,
|
|
12
|
+
noise,
|
|
13
|
+
texture,
|
|
12
14
|
type BlurEffectOptions,
|
|
13
|
-
type
|
|
15
|
+
type NoiseEffectOptions,
|
|
16
|
+
type ShadowEffectOptions,
|
|
17
|
+
type TextureEffectOptions
|
|
14
18
|
} from './effects'
|
|
15
19
|
import {
|
|
16
20
|
angularGradient,
|
|
@@ -48,6 +52,25 @@ const BLUR_OPTIONS = {
|
|
|
48
52
|
visible: true
|
|
49
53
|
} satisfies OptionKeys<BlurEffectOptions>
|
|
50
54
|
|
|
55
|
+
const NOISE_OPTIONS = {
|
|
56
|
+
noiseType: true,
|
|
57
|
+
noiseSize: true,
|
|
58
|
+
density: true,
|
|
59
|
+
color: true,
|
|
60
|
+
secondaryColor: true,
|
|
61
|
+
opacity: true,
|
|
62
|
+
seed: true,
|
|
63
|
+
visible: true
|
|
64
|
+
} satisfies OptionKeys<NoiseEffectOptions>
|
|
65
|
+
|
|
66
|
+
const TEXTURE_OPTIONS = {
|
|
67
|
+
noiseSize: true,
|
|
68
|
+
radius: true,
|
|
69
|
+
clipToShape: true,
|
|
70
|
+
seed: true,
|
|
71
|
+
visible: true
|
|
72
|
+
} satisfies OptionKeys<TextureEffectOptions>
|
|
73
|
+
|
|
51
74
|
const SOLID_OPTIONS = {
|
|
52
75
|
opacity: true,
|
|
53
76
|
visible: true,
|
|
@@ -119,6 +142,8 @@ export function designJSXHelpers(warnings: string[]) {
|
|
|
119
142
|
layerBlur: checked(warnings, 'layerBlur', layerBlur, BLUR_OPTIONS, 0),
|
|
120
143
|
backgroundBlur: checked(warnings, 'backgroundBlur', backgroundBlur, BLUR_OPTIONS, 0),
|
|
121
144
|
foregroundBlur: checked(warnings, 'foregroundBlur', foregroundBlur, BLUR_OPTIONS, 0),
|
|
145
|
+
noise: checked(warnings, 'noise', noise, NOISE_OPTIONS, 0),
|
|
146
|
+
texture: checked(warnings, 'texture', texture, TEXTURE_OPTIONS, 0),
|
|
122
147
|
defineVars,
|
|
123
148
|
defineMode,
|
|
124
149
|
designVar,
|
package/src/index.ts
CHANGED
|
@@ -63,9 +63,14 @@ export {
|
|
|
63
63
|
foregroundBlur,
|
|
64
64
|
innerShadow,
|
|
65
65
|
layerBlur,
|
|
66
|
+
noise,
|
|
67
|
+
texture,
|
|
66
68
|
type BlurEffectOptions,
|
|
67
69
|
type EffectColor,
|
|
68
|
-
type
|
|
70
|
+
type NoiseEffectOptions,
|
|
71
|
+
type NoiseSize,
|
|
72
|
+
type ShadowEffectOptions,
|
|
73
|
+
type TextureEffectOptions
|
|
69
74
|
} from './effects'
|
|
70
75
|
|
|
71
76
|
export {
|