@pairdraw/design-jsx 0.0.0-stage → 0.16.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 (109) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +48 -2
  3. package/dist/chunks/attributes.js +32 -0
  4. package/dist/chunks/attributes.js.map +1 -0
  5. package/dist/chunks/behaviours/elements.js +321 -0
  6. package/dist/chunks/behaviours/elements.js.map +1 -0
  7. package/dist/chunks/behaviours/render.js +368 -0
  8. package/dist/chunks/behaviours/render.js.map +1 -0
  9. package/dist/chunks/component-properties.js +809 -0
  10. package/dist/chunks/component-properties.js.map +1 -0
  11. package/dist/chunks/components.js +78 -0
  12. package/dist/chunks/components.js.map +1 -0
  13. package/dist/chunks/connectors.js +290 -0
  14. package/dist/chunks/connectors.js.map +1 -0
  15. package/dist/chunks/effects.js +57 -0
  16. package/dist/chunks/effects.js.map +1 -0
  17. package/dist/chunks/elements.js +618 -0
  18. package/dist/chunks/elements.js.map +1 -0
  19. package/dist/chunks/export/behaviours.js +113 -0
  20. package/dist/chunks/export/behaviours.js.map +1 -0
  21. package/dist/chunks/export/bindings.js +273 -0
  22. package/dist/chunks/export/bindings.js.map +1 -0
  23. package/dist/chunks/export/decoration.js +96 -0
  24. package/dist/chunks/export/decoration.js.map +1 -0
  25. package/dist/chunks/export/font.js +17 -0
  26. package/dist/chunks/export/font.js.map +1 -0
  27. package/dist/chunks/export/icons.js +34 -0
  28. package/dist/chunks/export/icons.js.map +1 -0
  29. package/dist/chunks/export/index.js +1390 -0
  30. package/dist/chunks/export/index.js.map +1 -0
  31. package/dist/chunks/fields.js +1065 -0
  32. package/dist/chunks/fields.js.map +1 -0
  33. package/dist/chunks/index.js +438 -0
  34. package/dist/chunks/index.js.map +1 -0
  35. package/dist/chunks/jsx-dev-runtime.js +16 -0
  36. package/dist/chunks/jsx-dev-runtime.js.map +1 -0
  37. package/dist/index.d.ts +543 -0
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.js +11 -0
  40. package/dist/jsx-dev-runtime.d.ts +2 -0
  41. package/dist/jsx-dev-runtime.js +2 -0
  42. package/dist/jsx-runtime.d.ts +44 -0
  43. package/dist/jsx-runtime.d.ts.map +1 -0
  44. package/dist/jsx-runtime.js +2 -0
  45. package/dist/tree.d.ts +261 -0
  46. package/dist/tree.d.ts.map +1 -0
  47. package/package.json +54 -4
  48. package/src/attributes.ts +30 -0
  49. package/src/behaviours/elements.ts +47 -0
  50. package/src/behaviours/index.ts +253 -0
  51. package/src/behaviours/render.ts +144 -0
  52. package/src/component-properties.ts +428 -0
  53. package/src/components.ts +109 -0
  54. package/src/connectors.ts +316 -0
  55. package/src/definitions.ts +277 -0
  56. package/src/effects.ts +80 -0
  57. package/src/elements.ts +321 -0
  58. package/src/enums.ts +182 -0
  59. package/src/export/behaviours.ts +143 -0
  60. package/src/export/bindings.ts +155 -0
  61. package/src/export/decoration.ts +39 -0
  62. package/src/export/font.ts +25 -0
  63. package/src/export/helpers.ts +75 -0
  64. package/src/export/icons.ts +42 -0
  65. package/src/export/index.ts +297 -0
  66. package/src/export/paint.ts +276 -0
  67. package/src/export/props.ts +369 -0
  68. package/src/export/state.ts +52 -0
  69. package/src/export/text.ts +155 -0
  70. package/src/export/value.ts +99 -0
  71. package/src/export/variables.ts +393 -0
  72. package/src/fields.ts +39 -0
  73. package/src/figjam-text.ts +37 -0
  74. package/src/global.d.ts +4 -0
  75. package/src/helpers.ts +135 -0
  76. package/src/index.ts +155 -0
  77. package/src/jsx-dev-runtime.ts +1 -0
  78. package/src/jsx-runtime.ts +51 -0
  79. package/src/mini-react.ts +23 -0
  80. package/src/overrides/effects.ts +39 -0
  81. package/src/overrides/fills.ts +56 -0
  82. package/src/overrides/state.ts +55 -0
  83. package/src/overrides/strokes.ts +109 -0
  84. package/src/overrides/text.ts +116 -0
  85. package/src/overrides/vector.ts +122 -0
  86. package/src/paints.ts +230 -0
  87. package/src/props-overrides.ts +481 -0
  88. package/src/reconcile.ts +134 -0
  89. package/src/reference/authoring.md +76 -0
  90. package/src/reference/examples.ts +49 -0
  91. package/src/reference.ts +19 -0
  92. package/src/refs.ts +48 -0
  93. package/src/render.ts +147 -0
  94. package/src/renderer.ts +598 -0
  95. package/src/scalar-bindings.ts +36 -0
  96. package/src/schema.ts +213 -0
  97. package/src/services.ts +36 -0
  98. package/src/shapes-with-text.ts +73 -0
  99. package/src/stickies.ts +72 -0
  100. package/src/streaming/index.ts +47 -0
  101. package/src/streaming/literals.ts +82 -0
  102. package/src/streaming/projection.ts +189 -0
  103. package/src/text-content.ts +233 -0
  104. package/src/transform.ts +78 -0
  105. package/src/tree.ts +285 -0
  106. package/src/types.ts +13 -0
  107. package/src/variables/graph.ts +265 -0
  108. package/src/variables/index.ts +124 -0
  109. package/src/variables/props.ts +77 -0
@@ -0,0 +1,543 @@
1
+ import { BaseProps, ComponentProperty, ComponentProps, DesignMode, DesignVariable, EllipseProps, InstanceProps, PaintProp, ParagraphProps, SpanProps, StyleProps, TextProps, TreeNode, VariableInput, VectorProps, defineMode, defineVars, designMode, designVar, isComponentProperty, isMode, isTreeNode, isVariable, isVariableInput, node, property, resolveToTree } from "./tree.js";
2
+ import * as v from "valibot";
3
+ import { GradientTransformRows } from "@pairdraw/scene-graph/gradient";
4
+ import { ShaderComponent, ShaderPaint, ShaderPreset, ShaderUniformValue } from "@pairdraw/scene-graph/shaders";
5
+ import { BlendMode, Effect, Fill, FillType, GradientTransform, NodeType, SceneGraph, SceneNode, VectorNetwork } from "@pairdraw/scene-graph";
6
+ import { Color, Rect as Rect$1, Vector as Vector$1 } from "@pairdraw/scene-graph/primitives";
7
+ //#region src/components.d.ts
8
+ type Child$1 = TreeNode | string;
9
+ declare function Frame(props: BaseProps, ...children: Child$1[]): TreeNode;
10
+ declare function Text(props: TextProps, ...children: Child$1[]): TreeNode;
11
+ declare function Span(props: SpanProps, ...children: Child$1[]): TreeNode;
12
+ declare function Paragraph(props: ParagraphProps, ...children: Child$1[]): TreeNode;
13
+ declare function Rectangle(props: BaseProps, ...children: Child$1[]): TreeNode;
14
+ declare function Ellipse(props: BaseProps & EllipseProps, ...children: Child$1[]): TreeNode;
15
+ declare function Line(props: BaseProps, ...children: Child$1[]): TreeNode;
16
+ declare function Star(props: BaseProps & {
17
+ points?: number;
18
+ innerRadius?: number;
19
+ }, ...children: Child$1[]): TreeNode;
20
+ declare function Polygon(props: BaseProps & {
21
+ pointCount?: number;
22
+ }, ...children: Child$1[]): TreeNode;
23
+ declare function Vector(props: BaseProps & VectorProps, ...children: Child$1[]): TreeNode;
24
+ declare function Group(props: BaseProps, ...children: Child$1[]): TreeNode;
25
+ declare function Section(props: BaseProps, ...children: Child$1[]): TreeNode;
26
+ declare function Component(props: ComponentProps, ...children: Child$1[]): TreeNode;
27
+ declare function ComponentSet(props: ComponentProps, ...children: Child$1[]): TreeNode;
28
+ declare function Instance(props: InstanceProps, ...children: Child$1[]): TreeNode;
29
+ declare const View: typeof Frame;
30
+ declare const Rect: typeof Rectangle;
31
+ declare const Page: typeof Frame;
32
+ declare const INTRINSIC_ELEMENTS: readonly ["frame", "text", "text-span", "text-paragraph", "rectangle", "ellipse", "line", "star", "polygon", "vector", "group", "section", "component", "component-set", "instance"];
33
+ //#endregion
34
+ //#region src/behaviours/index.d.ts
35
+ /** A value bound to a component property by name; a variant property may name its on and off. */
36
+ type BindingProp = string | {
37
+ property: string;
38
+ on?: string;
39
+ off?: string;
40
+ };
41
+ //#endregion
42
+ //#region src/behaviours/elements.d.ts
43
+ /** Props of a Reka element: a frame's, plus the behaviour a root binds and a group item's component. */
44
+ interface RekaProps extends BaseProps {
45
+ modelValue?: BindingProp;
46
+ open?: BindingProp;
47
+ disabled?: BindingProp;
48
+ filled?: BindingProp;
49
+ /** The variant property whose values draw rest, hover, pressed, focus, and disabled. */
50
+ states?: string;
51
+ min?: number;
52
+ max?: number;
53
+ step?: number;
54
+ defaultValue?: number;
55
+ /** For a group's item: the component or set it is an instance of. */
56
+ of?: string;
57
+ }
58
+ type Child = TreeNode | string;
59
+ type RekaElement = (props?: RekaProps, ...children: Child[]) => TreeNode;
60
+ declare const Button: {
61
+ readonly Root: RekaElement;
62
+ };
63
+ declare const Toggle: {
64
+ readonly Root: RekaElement;
65
+ };
66
+ declare const Switch: {
67
+ readonly Root: RekaElement;
68
+ readonly Thumb: RekaElement;
69
+ };
70
+ declare const Checkbox: {
71
+ readonly Root: RekaElement;
72
+ readonly Indicator: RekaElement;
73
+ };
74
+ declare const RadioGroup: {
75
+ readonly Root: RekaElement;
76
+ readonly Item: RekaElement;
77
+ readonly Indicator: RekaElement;
78
+ };
79
+ declare const ToggleGroup: {
80
+ readonly Root: RekaElement;
81
+ readonly Item: RekaElement;
82
+ };
83
+ declare const Slider: {
84
+ readonly Root: RekaElement;
85
+ readonly Track: RekaElement;
86
+ readonly Range: RekaElement;
87
+ readonly Thumb: RekaElement;
88
+ };
89
+ declare const Progress: {
90
+ readonly Root: RekaElement;
91
+ readonly Track: RekaElement;
92
+ readonly Indicator: RekaElement;
93
+ };
94
+ declare const Tabs: {
95
+ readonly Root: RekaElement;
96
+ readonly List: RekaElement;
97
+ readonly Trigger: RekaElement;
98
+ readonly Content: RekaElement;
99
+ };
100
+ declare const Collapsible: {
101
+ readonly Root: RekaElement;
102
+ readonly Trigger: RekaElement;
103
+ readonly Content: RekaElement;
104
+ };
105
+ declare const Accordion: {
106
+ readonly Root: RekaElement;
107
+ readonly Item: RekaElement;
108
+ readonly Header: RekaElement;
109
+ readonly Trigger: RekaElement;
110
+ readonly Content: RekaElement;
111
+ };
112
+ declare const NumberField: {
113
+ readonly Root: RekaElement;
114
+ readonly Input: RekaElement;
115
+ readonly Increment: RekaElement;
116
+ readonly Decrement: RekaElement;
117
+ };
118
+ declare const TextField: {
119
+ readonly Root: RekaElement;
120
+ readonly Input: RekaElement;
121
+ };
122
+ declare const Textarea: {
123
+ readonly Root: RekaElement;
124
+ readonly Input: RekaElement;
125
+ };
126
+ //#endregion
127
+ //#region src/services.d.ts
128
+ /** Inline `<svg>` content: markup, parsed shape elements, or both, with the element's props. */
129
+ interface SVGSource {
130
+ body: string;
131
+ elements: TreeNode[];
132
+ props: Record<string, unknown>;
133
+ }
134
+ /** Where to put artwork and how to size and color it. */
135
+ interface ArtworkPlacement {
136
+ parentId: string;
137
+ size: number;
138
+ color: Color;
139
+ overrides: Partial<SceneNode>;
140
+ }
141
+ /**
142
+ * Engine work the renderer delegates. `Artwork` is whatever the engine uses to describe
143
+ * vector paths; the renderer only passes it from `icon`/`svg` to `createArtwork`.
144
+ */
145
+ interface DesignJSXServices<Artwork> {
146
+ /** A named icon such as `lucide:heart` at `size`, or null when it does not exist. */
147
+ icon(name: string, size: number): Promise<Artwork | null>;
148
+ /** Inline SVG scaled to `size`, or null when it has no supported shapes. */
149
+ svg(source: SVGSource, size: number): Artwork | null;
150
+ /** Vector nodes for the artwork, created under the placement's parent. */
151
+ createArtwork(graph: SceneGraph, artwork: Artwork, placement: ArtworkPlacement): SceneNode;
152
+ /** Size and lay out the rendered roots once they are in place. */
153
+ layout(graph: SceneGraph, rootIds: readonly string[]): void;
154
+ /** The tight bounds of a vector network, its curves included, which size a `<Vector>`. */
155
+ vectorBounds(network: VectorNetwork): Rect$1;
156
+ }
157
+ //#endregion
158
+ //#region src/types.d.ts
159
+ interface RenderOptions {
160
+ x?: number;
161
+ y?: number;
162
+ parentId?: string;
163
+ /** Called for every layer created from an element, so callers can map source to layers. */
164
+ onNode?: (tree: TreeNode, node: SceneNode) => void;
165
+ /** Leave layout to the caller, which lays out once after moving the roots into place. */
166
+ deferLayout?: boolean;
167
+ }
168
+ //#endregion
169
+ //#region src/renderer.d.ts
170
+ interface RenderResult {
171
+ id: string;
172
+ name: string;
173
+ type: NodeType;
174
+ childIds: string[];
175
+ warnings?: string[];
176
+ }
177
+ //#endregion
178
+ //#region src/effects.d.ts
179
+ type EffectColor = string | Color;
180
+ interface ShadowEffectOptions {
181
+ color?: EffectColor;
182
+ x?: number;
183
+ y?: number;
184
+ offset?: Vector$1;
185
+ radius?: number;
186
+ spread?: number;
187
+ visible?: boolean;
188
+ blendMode?: BlendMode;
189
+ showShadowBehindNode?: boolean;
190
+ }
191
+ interface BlurEffectOptions {
192
+ radius?: number;
193
+ visible?: boolean;
194
+ }
195
+ declare function dropShadow(options?: ShadowEffectOptions): Effect;
196
+ declare function innerShadow(options?: ShadowEffectOptions): Effect;
197
+ declare function layerBlur(radiusOrOptions?: number | BlurEffectOptions): Effect;
198
+ declare function backgroundBlur(radiusOrOptions?: number | BlurEffectOptions): Effect;
199
+ declare function foregroundBlur(radiusOrOptions?: number | BlurEffectOptions): Effect;
200
+ //#endregion
201
+ //#region src/paints.d.ts
202
+ type PaintColor = string | Color;
203
+ type PaintStop = readonly [PaintColor, number] | {
204
+ color: PaintColor;
205
+ position: number;
206
+ };
207
+ interface SolidPaintOptions {
208
+ opacity?: number;
209
+ visible?: boolean;
210
+ blendMode?: BlendMode;
211
+ }
212
+ interface GradientPaintOptions extends SolidPaintOptions {
213
+ /** Figma's `gradientTransform`, as its plugin API's rows or as the matrix fields. */
214
+ transform?: GradientTransformRows | GradientTransform;
215
+ }
216
+ declare const GRADIENT_HELPERS: {
217
+ readonly GRADIENT_LINEAR: "linearGradient";
218
+ readonly GRADIENT_RADIAL: "radialGradient";
219
+ readonly GRADIENT_ANGULAR: "angularGradient";
220
+ readonly GRADIENT_DIAMOND: "diamondGradient";
221
+ };
222
+ type GradientType = keyof typeof GRADIENT_HELPERS;
223
+ declare function solid(color: PaintColor, options?: SolidPaintOptions): Fill;
224
+ declare function gradient(type: Extract<FillType, GradientType>, stops: PaintStop[], options?: GradientPaintOptions): Fill;
225
+ /** A paint that draws a shader, carrying its entry until the layer it fills stores it. */
226
+ interface ShaderFill extends Fill {
227
+ shader: ShaderPaint;
228
+ }
229
+ interface ShaderSourceOptions extends SolidPaintOptions {
230
+ uniforms?: Record<string, ShaderUniformValue>;
231
+ }
232
+ /**
233
+ * A paint that draws shader code written here rather than a preset from the `shaders` library.
234
+ * Its inputs are the `@directive` ones the code declares.
235
+ */
236
+ declare function shaderSource(source: string, options?: ShaderSourceOptions): ShaderFill;
237
+ /**
238
+ * A paint that draws a shader from the `shaders` library: a preset as shaders.com exports it, or
239
+ * just its effects, such as `shader([{ type: 'Aurora' }])`.
240
+ */
241
+ declare function shader(preset: ShaderPreset | ShaderComponent[], options?: SolidPaintOptions): ShaderFill;
242
+ declare function linearGradient(stops: PaintStop[], options?: GradientPaintOptions): Fill;
243
+ declare function radialGradient(stops: PaintStop[], options?: GradientPaintOptions): Fill;
244
+ declare function angularGradient(stops: PaintStop[], options?: GradientPaintOptions): Fill;
245
+ declare function diamondGradient(stops: PaintStop[], options?: GradientPaintOptions): Fill;
246
+ //#endregion
247
+ //#region src/refs.d.ts
248
+ declare const REF_SYMBOL: unique symbol;
249
+ /**
250
+ * A handle on one layer of the JSX: `ref={card}` marks the layer, and an element that refers to
251
+ * a layer, such as `<Connector from={card}>`, takes the handle where a name could be ambiguous.
252
+ */
253
+ interface LayerRef {
254
+ readonly [REF_SYMBOL]: true;
255
+ }
256
+ /** A new handle for `ref={…}` to mark a layer with. */
257
+ declare function ref(): LayerRef;
258
+ declare function isLayerRef(value: unknown): value is LayerRef;
259
+ //#endregion
260
+ //#region src/mini-react.d.ts
261
+ type ComponentType = (props: Record<string, unknown>) => ReactNode;
262
+ type ReactElement = {
263
+ type: string | ComponentType;
264
+ props: Record<string, unknown> & {
265
+ children?: ReactNode[];
266
+ };
267
+ };
268
+ type ReactNode = ReactElement | string | number | null | undefined | ReactNode[];
269
+ declare function createElement(type: string | ComponentType, props: Record<string, unknown> | null, ...children: ReactNode[]): ReactElement;
270
+ //#endregion
271
+ //#region src/render.d.ts
272
+ /**
273
+ * Build a component function from a JSX string: one JSX expression, sibling elements, or
274
+ * statements that end with `return` and the JSX. The statements run inside the component, so
275
+ * they may shadow an element or helper name. Works in both Node/Bun and the browser.
276
+ */
277
+ declare function buildComponent(jsxString: string, warnings?: string[]): ComponentType;
278
+ /**
279
+ * A Design JSX renderer bound to an engine. Rendering needs `services` for icons, inline
280
+ * SVG, and layout; Pairdraw's engine provides them through `@pairdraw/core/design-jsx`.
281
+ */
282
+ declare function createDesignJSXRenderer<Artwork>(services: DesignJSXServices<Artwork>): {
283
+ /** Render a Design JSX string into the graph, one result per top-level element. */
284
+ renderJSX: (graph: SceneGraph, jsxString: string, options?: RenderOptions) => Promise<RenderResult[]>;
285
+ /** Render a tree built with the element functions into the graph. */
286
+ renderTree: (graph: SceneGraph, tree: TreeNode, options?: RenderOptions) => Promise<RenderResult>;
287
+ };
288
+ type DesignJSXRenderer = ReturnType<typeof createDesignJSXRenderer>;
289
+ //#endregion
290
+ //#region src/schema.d.ts
291
+ /** The props of an element read one at a time, each of them optional. */
292
+ type ElementPropsSchema = v.ObjectSchema<v.ObjectEntries, undefined>;
293
+ //#endregion
294
+ //#region src/elements.d.ts
295
+ /** How an element that draws a layer of its own, such as a sticky note, renders it. */
296
+ interface OwnLayerRenderer {
297
+ /** The layer props it takes, made into fields as any layer's are. */
298
+ layer: ElementPropsSchema;
299
+ render(graph: SceneGraph, tree: TreeNode, parentId: string, layer: Partial<SceneNode>): SceneNode;
300
+ /** The layer a variable binding of `field` goes on, when not the element's own. */
301
+ bindingTarget?(graph: SceneGraph, node: SceneNode, field: string): string;
302
+ }
303
+ /**
304
+ * One design JSX element: what JSX names it, what it makes, the props it takes, and which layers
305
+ * export writes as it. The renderer, the export, the prop checks, the streaming preview, and the
306
+ * authoring reference all read this list rather than keeping their own.
307
+ */
308
+ type DesignJSXElementDefinition = {
309
+ name: string;
310
+ /** The type its tree nodes carry, such as `frame`. */
311
+ runtimeType: string;
312
+ description: string;
313
+ /** The layer a plain element makes; an element rendered its own way, such as `Icon`, has none. */
314
+ nodeType?: NodeType;
315
+ /** The props it takes; every layer prop when left out. */
316
+ props?: readonly string[];
317
+ /** The props it takes and what each holds, for an element that reads them by this schema. */
318
+ schema?: ElementPropsSchema;
319
+ /** How it draws its own layer, for an element that does. */
320
+ ownLayer?: OwnLayerRenderer;
321
+ /** The layers export writes as this element. */
322
+ writes?: readonly NodeType[];
323
+ };
324
+ declare const DESIGN_JSX_ELEMENTS: DesignJSXElementDefinition[];
325
+ /**
326
+ * The props an element written `<name>` takes, as the renderer checks them, for an editor that
327
+ * checks them as they are typed; null for a name that is no element, and for an instance, which
328
+ * also takes its component's properties by name.
329
+ */
330
+ declare function elementPropsByName(name: string): ReadonlySet<string> | null;
331
+ //#endregion
332
+ //#region src/definitions.d.ts
333
+ type DesignJSXNamedDefinition = {
334
+ name: string;
335
+ description: string;
336
+ };
337
+ type DesignJSXPropertyDefinition = DesignJSXNamedDefinition;
338
+ type DesignJSXHelperDefinition = DesignJSXNamedDefinition;
339
+ /** Props only `<Paragraph>` takes; like every element, it also takes `key`. */
340
+ declare const DESIGN_JSX_PARAGRAPH_PROPERTY_NAMES: readonly ["list", "level", "spacing", "listSpacing", "indent"];
341
+ /** Props `<Span>` takes: `<Text>`'s character styles, under the same names, and a link. */
342
+ declare const DESIGN_JSX_SPAN_PROPERTY_NAMES: readonly ["style", "size", "fontSize", "font", "fontFamily", "weight", "fontWeight", "italic", "color", "fill", "fills", "lineHeight", "letterSpacing", "textDecoration", "textDecorationStyle", "textDecorationColor", "textDecorationThickness", "textUnderlineOffset", "textDecorationSkipInk", "fontFeatures", "fontVariations", "lang", "textCase", "href"];
343
+ /** Props `<Text>` sets every paragraph's spacing with; a `<Paragraph>` sets its own. */
344
+ declare const DESIGN_JSX_TEXT_PARAGRAPH_PROPERTY_NAMES: readonly ["paragraphSpacing", "listSpacing", "paragraphIndent", "hangingList"];
345
+ declare const DESIGN_JSX_SUPPORTED_PROPERTY_NAMES: readonly ["name", "key", "ref", "flex", "flow", "dir", "gap", "wrap", "rowGap", "columnGap", "justify", "justifyContent", "items", "align", "alignItems", "grow", "w", "h", "width", "height", "minW", "maxW", "minH", "maxH", "x", "y", "top", "left", "position", "constraints", "p", "padding", "px", "py", "pt", "pr", "pb", "pl", "bg", "fill", "fills", "background", "backgroundColor", "stroke", "border", "borderColor", "strokeWidth", "borderWidth", "strokeAlign", "strokeDash", "strokeCap", "strokeJoin", "dashPattern", "strokes", "strokeWeights", "rounded", "borderRadius", "roundedTL", "roundedTR", "roundedBL", "roundedBR", "cornerRadius", "cornerSmoothing", "opacity", "blendMode", "rotate", "rotation", "flipX", "flipY", "overflow", "mask", "visible", "locked", "shadow", "blur", "effects", "size", "fontSize", "font", "fontFamily", "weight", "fontWeight", "italic", "color", "text", "characters", "content", "value", "title", "textAlign", "textAlignHorizontal", "textHorizontalAlignment", "textAlignVertical", "textVerticalAlignment", "textAutoResize", "lineHeight", "letterSpacing", "textDecoration", "textDecorationStyle", "textDecorationColor", "textDecorationThickness", "textUnderlineOffset", "textDecorationSkipInk", "fontFeatures", "fontVariations", "lang", "fontOpticalSizing", "textCase", "paragraphSpacing", "paragraphIndent", "hangingList", "list", "level", "spacing", "listSpacing", "indent", "maxLines", "truncate", "grid", "columns", "rows", "colStart", "rowStart", "col", "row", "colSpan", "rowSpan", "points", "pointCount", "innerRadius", "startAngle", "endAngle", "d", "fillRule", "paths", "label", "style", "bind", "component", "componentId", "properties", "of", "exposed", "mode", "modelValue", "open", "disabled", "filled", "states", "min", "max", "step", "defaultValue"];
346
+ declare const DESIGN_JSX_SUPPORTED_PROPERTIES: Set<string>;
347
+ /**
348
+ * Properties accepted under more than one name, keyed by the name Design JSX writes. The
349
+ * renderer reads the first one set, in this order; editors use it to find a value written
350
+ * under any of its names.
351
+ */
352
+ declare const DESIGN_JSX_PROPERTY_ALIASES: Readonly<Record<string, readonly string[]>>;
353
+ /** A CSS-style key read from the `style` prop; `px` values like `'320px'` become numbers. */
354
+ interface DesignJSXStyleKey {
355
+ key: string;
356
+ px?: boolean;
357
+ }
358
+ /**
359
+ * Properties also read from `style={{ … }}`, keyed by the name Design JSX writes, in the order
360
+ * the renderer reads them. An attribute under any of the property's names wins over `style`.
361
+ */
362
+ declare const DESIGN_JSX_STYLE_KEYS: Readonly<Record<string, readonly DesignJSXStyleKey[]>>;
363
+ /** Every name a property is accepted under, the written name first. */
364
+ declare function designJSXPropertyNames(name: string): readonly string[];
365
+ /** The value of a property under the first of its names that is set. */
366
+ declare function designJSXProp(props: Readonly<Record<string, unknown>>, name: string): unknown;
367
+ declare const DESIGN_JSX_PROPERTIES: DesignJSXPropertyDefinition[];
368
+ //#endregion
369
+ //#region src/helpers.d.ts
370
+ /**
371
+ * Every helper Design JSX code can call, reporting ignored options to `warnings`. This is the
372
+ * one list of them: the string renderer's scope, the code panel's sandbox, the editor's
373
+ * completions, and the authoring reference all read it.
374
+ */
375
+ declare function designJSXHelpers(warnings: string[]): {
376
+ solid: (color: PaintColor, options?: SolidPaintOptions | undefined) => import("@pairdraw/scene-graph").Fill;
377
+ gradient: (type: "GRADIENT_LINEAR" | "GRADIENT_RADIAL" | "GRADIENT_ANGULAR" | "GRADIENT_DIAMOND", stops: PaintStop[], options?: GradientPaintOptions | undefined) => import("@pairdraw/scene-graph").Fill;
378
+ linearGradient: (stops: PaintStop[], options?: GradientPaintOptions | undefined) => import("@pairdraw/scene-graph").Fill;
379
+ radialGradient: (stops: PaintStop[], options?: GradientPaintOptions | undefined) => import("@pairdraw/scene-graph").Fill;
380
+ angularGradient: (stops: PaintStop[], options?: GradientPaintOptions | undefined) => import("@pairdraw/scene-graph").Fill;
381
+ diamondGradient: (stops: PaintStop[], options?: GradientPaintOptions | undefined) => import("@pairdraw/scene-graph").Fill;
382
+ shader: (preset: import("@pairdraw/scene-graph/shaders").ShaderComponent[] | {
383
+ components: import("@pairdraw/scene-graph/shaders").ShaderComponent[];
384
+ structureVersion?: number | undefined;
385
+ }, options?: SolidPaintOptions | undefined) => ShaderFill;
386
+ shaderSource: (source: string, options?: ShaderSourceOptions | undefined) => ShaderFill;
387
+ dropShadow: (options?: ShadowEffectOptions | undefined) => import("@pairdraw/scene-graph").Effect;
388
+ innerShadow: (options?: ShadowEffectOptions | undefined) => import("@pairdraw/scene-graph").Effect;
389
+ layerBlur: (radiusOrOptions?: number | BlurEffectOptions | undefined) => import("@pairdraw/scene-graph").Effect;
390
+ backgroundBlur: (radiusOrOptions?: number | BlurEffectOptions | undefined) => import("@pairdraw/scene-graph").Effect;
391
+ foregroundBlur: (radiusOrOptions?: number | BlurEffectOptions | undefined) => import("@pairdraw/scene-graph").Effect;
392
+ defineVars: typeof defineVars;
393
+ defineMode: typeof defineMode;
394
+ designVar: typeof designVar;
395
+ designMode: typeof designMode;
396
+ property: typeof property;
397
+ ref: typeof ref;
398
+ };
399
+ type DesignJSXHelperName = keyof ReturnType<typeof designJSXHelpers>;
400
+ declare const DESIGN_JSX_HELPERS: DesignJSXHelperDefinition[];
401
+ //#endregion
402
+ //#region src/transform.d.ts
403
+ /**
404
+ * Transformed Design JSX: a function body that returns what the source renders. Its elements
405
+ * carry `__source: { lineNumber }` props; adding `lineOffset` to `lineNumber` gives the 1-based
406
+ * line in the source that was passed in.
407
+ */
408
+ interface DesignJSXProgram {
409
+ code: string;
410
+ lineOffset: number;
411
+ }
412
+ /** Transform Design JSX into the body of a function that returns what it renders. */
413
+ declare function transformDesignJSXExpression(source: string): string;
414
+ /** Like {@link transformDesignJSXExpression}, keeping the source line of every element. */
415
+ declare function transformDesignJSXProgram(source: string): DesignJSXProgram;
416
+ //#endregion
417
+ //#region src/export/index.d.ts
418
+ /** Design JSX with the layer behind each element, in the order elements open. */
419
+ interface DesignJSXWithLayers {
420
+ code: string;
421
+ /**
422
+ * One entry per JSX element, in pre-order, so editors can link elements to layers: the
423
+ * layer's id, or `null` for an element no layer is, such as a `<Span>` or `<Paragraph>`.
424
+ */
425
+ layerIds: Array<string | null>;
426
+ }
427
+ /** A JSX attribute as the export prints it: its name and its source, such as `w={320}`. */
428
+ interface JSXAttributeSource {
429
+ name: string;
430
+ source: string;
431
+ }
432
+ /**
433
+ * The attributes `sceneNodeToJSX` prints for a node, each on one line, with a text node's
434
+ * content, or a connector's label, as a `text` attribute. `null` for a node the export does not
435
+ * write. A connector's ends are written by their layers' names.
436
+ */
437
+ declare function sceneNodeAttributes(nodeId: string, graph: SceneGraph): JSXAttributeSource[] | null;
438
+ /**
439
+ * One layer as Design JSX writes it, so an editor can patch the code a person has edited
440
+ * instead of writing it again.
441
+ */
442
+ interface DesignJSXElement {
443
+ tag: string;
444
+ /** Each attribute as `sceneNodeAttributes` prints it, keyed by name: `w={320}`. */
445
+ attributes: Record<string, string>;
446
+ /**
447
+ * A text layer's content as JSX writes it between its tags, `<Span>`s and `<Paragraph>`s
448
+ * included, for an element at the start of its line; `null` for no content or another layer.
449
+ */
450
+ text: string | null;
451
+ /** The layers written as child elements, in order. */
452
+ childIds: string[];
453
+ }
454
+ declare function designJSXElement(nodeId: string, graph: SceneGraph): DesignJSXElement | null;
455
+ /** How an export is written: by default, with the declarations its JSX uses before it. */
456
+ interface JSXExportOptions {
457
+ /**
458
+ * `false` writes only JSX, for code that places it inside other JSX: a connector end whose
459
+ * layer would need a declared `ref()` is then written as the point it is drawn at, and the
460
+ * variables layers bind are written by reference (`designVar`) instead of with the
461
+ * `defineVars` and `defineMode` that define them.
462
+ */
463
+ declarations?: boolean;
464
+ }
465
+ declare function sceneNodeToJSX(nodeId: string, graph: SceneGraph): string;
466
+ declare function selectionToJSX(nodeIds: string[], graph: SceneGraph): string;
467
+ declare function selectionToJSXWithLayers(nodeIds: string[], graph: SceneGraph, options?: JSXExportOptions): DesignJSXWithLayers;
468
+ //#endregion
469
+ //#region src/attributes.d.ts
470
+ /**
471
+ * Split JSX attributes, such as `w={200} bg="#FF0000"`, into each attribute as written.
472
+ * Throws on a syntax error or a spread, whose props cannot be named.
473
+ */
474
+ declare function parseJSXAttributes(source: string): JSXAttributeSource[];
475
+ //#endregion
476
+ //#region src/fields.d.ts
477
+ interface JSXNodeFields {
478
+ /** Every field the attributes describe, with defaults for the ones they leave out. */
479
+ fields: Partial<SceneNode>;
480
+ /** Variable IDs by bound field, such as `fills/0/color`. */
481
+ bindings: Record<string, string>;
482
+ }
483
+ /**
484
+ * The node state a `nodeType` node under `parentId` gets from `attributes`, as rendering
485
+ * would set it, without creating a node. Diffing two results gives the fields an attribute
486
+ * change moves, so an update leaves state that JSX does not describe untouched.
487
+ */
488
+ declare function jsxNodeFields(graph: SceneGraph, nodeType: NodeType, attributes: JSXAttributeSource[], parentId: string): JSXNodeFields;
489
+ //#endregion
490
+ //#region src/reconcile.d.ts
491
+ /**
492
+ * Folds freshly rendered layers into the layers they replace, so code edits update layers in
493
+ * place: matched layers keep their ids, and only the properties that differ change. Roots pair
494
+ * by position; extra rendered roots stay, extra existing roots are deleted. Returns the id each
495
+ * rendered layer ends up with.
496
+ */
497
+ declare function reconcileRenderedLayers(graph: SceneGraph, existingRootIds: readonly string[], renderedRootIds: readonly string[]): {
498
+ rootIds: string[];
499
+ ids: Map<string, string>;
500
+ };
501
+ //#endregion
502
+ //#region src/reference/examples.d.ts
503
+ interface AuthoringExample {
504
+ title: string;
505
+ jsx: string;
506
+ }
507
+ /** Shared verbatim by runtime prompts and the installable skill; exercised in engine tests. */
508
+ declare const AUTHORING_EXAMPLES: readonly AuthoringExample[];
509
+ //#endregion
510
+ //#region src/reference.d.ts
511
+ /** Canonical scene-authoring guidance shared by runtime prompts and generated skill references. */
512
+ declare const JSX_REFERENCE: string;
513
+ //#endregion
514
+ //#region src/streaming/projection.d.ts
515
+ interface JSXPreviewNode extends TreeNode {
516
+ /** Stable identity within an append-only source stream; not a permanent scene node ID. */
517
+ sourceStart: number;
518
+ children: (JSXPreviewNode | string)[];
519
+ }
520
+ interface JSXPreviewPending {
521
+ from: number;
522
+ to: number;
523
+ reason: 'incomplete' | 'unsupported';
524
+ }
525
+ interface JSXPreviewSnapshot {
526
+ tree: JSXPreviewNode | null;
527
+ pending: JSXPreviewPending[];
528
+ }
529
+ //#endregion
530
+ //#region src/streaming/index.d.ts
531
+ /**
532
+ * Append-only, non-executing Design JSX preview parser. Own one instance per tool call.
533
+ * Snapshots contain fresh data; later appends never mutate an earlier preview.
534
+ * This is not final JSX validation: unsupported expressions are deliberately deferred.
535
+ * Call append on coalesced chunks, not once per token, to bound projection work.
536
+ */
537
+ declare function createStreamingJSXParser(): {
538
+ append: (chunk: string) => JSXPreviewSnapshot;
539
+ reset: () => void;
540
+ };
541
+ //#endregion
542
+ 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 };
543
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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;iB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Bd"}
package/dist/index.js ADDED
@@ -0,0 +1,11 @@
1
+ import { buildComponent, createDesignJSXRenderer, createElement, jsxNodeFields, transformDesignJSXExpression, transformDesignJSXProgram } from "./chunks/fields.js";
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
+ 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
+ import { backgroundBlur, dropShadow, foregroundBlur, innerShadow, layerBlur } from "./chunks/effects.js";
5
+ import { defineMode, defineVars, designMode, designVar, isComponentProperty, isLayerRef, isMode, isVariable, isVariableInput, property, ref } from "./chunks/component-properties.js";
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
+ import { DESIGN_JSX_HELPERS, angularGradient, designJSXElement, designJSXHelpers, diamondGradient, gradient, linearGradient, radialGradient, sceneNodeAttributes, sceneNodeToJSX, selectionToJSX, selectionToJSXWithLayers, shader, shaderSource, solid } from "./chunks/export/index.js";
8
+ import { DESIGN_JSX_ELEMENTS, elementPropsByName } from "./chunks/elements.js";
9
+ import { parseJSXAttributes } from "./chunks/attributes.js";
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 };
@@ -0,0 +1,2 @@
1
+ import { Fragment, JSX, jsxDEV } from "./jsx-runtime.js";
2
+ export { Fragment, type JSX, jsxDEV };
@@ -0,0 +1,2 @@
1
+ import { Fragment, jsxDEV } from "./chunks/jsx-dev-runtime.js";
2
+ export { Fragment, jsxDEV };
@@ -0,0 +1,44 @@
1
+ import { BaseProps, EllipseProps, ParagraphProps, SpanProps, TextProps, TreeNode } from "./tree.js";
2
+ //#region src/jsx-runtime.d.ts
3
+ declare function jsx(type: string | ((props: BaseProps) => TreeNode), props: BaseProps): TreeNode;
4
+ declare const jsxs: typeof jsx;
5
+ declare const jsxDEV: typeof jsx;
6
+ /** Groups siblings the way `<>…</>` does in `renderJSX` strings: a node with an empty type. */
7
+ declare function Fragment({ children }: {
8
+ children?: unknown;
9
+ }): TreeNode;
10
+ declare namespace JSX {
11
+ type Element = TreeNode;
12
+ interface IntrinsicElements {
13
+ frame: BaseProps;
14
+ text: TextProps;
15
+ 'text-span': SpanProps;
16
+ 'text-paragraph': ParagraphProps;
17
+ rectangle: BaseProps;
18
+ ellipse: BaseProps & EllipseProps;
19
+ line: BaseProps;
20
+ star: BaseProps & {
21
+ points?: number;
22
+ innerRadius?: number;
23
+ };
24
+ polygon: BaseProps & {
25
+ pointCount?: number;
26
+ };
27
+ vector: BaseProps;
28
+ group: BaseProps;
29
+ section: BaseProps;
30
+ component: BaseProps;
31
+ 'component-set': BaseProps;
32
+ instance: BaseProps & {
33
+ component?: string;
34
+ componentId?: string;
35
+ of?: string;
36
+ };
37
+ }
38
+ interface ElementChildrenAttribute {
39
+ children: unknown;
40
+ }
41
+ }
42
+ //#endregion
43
+ export { Fragment, JSX, jsx, jsxDEV, jsxs };
44
+ //# sourceMappingURL=jsx-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-runtime.d.ts","names":[],"sources":["../src/jsx-runtime.ts"],"mappings":";;iBAWgB,IAAI,iBAAiB,OAAO,cAAc,WAAW,OAAO,YAAY;cAO3E,aAAI;cACJ,eAAM;;iBAGH,WAAW;EAAc;IAAuB;kBAI/C;OACH,UAAU;YAEL;IACf,OAAO;IACP,MAAM;IACN,aAAa;IACb,kBAAkB;IAClB,WAAW;IACX,SAAS,YAAY;IACrB,MAAM;IACN,MAAM;MAAc;MAAiB;;IACrC,SAAS;MAAc;;IACvB,QAAQ;IACR,OAAO;IACP,SAAS;IACT,WAAW;IACX,iBAAiB;IACjB,UAAU;MAAc;MAAoB;MAAsB;;;YAGnD;IACf"}
@@ -0,0 +1,2 @@
1
+ import { Fragment, jsx, jsxDEV, jsxs } from "./chunks/jsx-dev-runtime.js";
2
+ export { Fragment, jsx, jsxDEV, jsxs };