@svgsketch/core 1.3.0 → 1.5.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/index.d.mts +113 -4
- package/dist/index.d.ts +113 -4
- package/dist/index.js +12 -12
- package/dist/index.mjs +12 -12
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -607,6 +607,12 @@ interface RichTextSegmentStyle {
|
|
|
607
607
|
fontFamily?: string;
|
|
608
608
|
fontWeight?: string;
|
|
609
609
|
fontStyle?: string;
|
|
610
|
+
fontVariant?: string;
|
|
611
|
+
fontVariantLigatures?: string;
|
|
612
|
+
fontVariantPosition?: string;
|
|
613
|
+
fontVariantCaps?: string;
|
|
614
|
+
fontVariantNumeric?: string;
|
|
615
|
+
fontVariantEastAsian?: string;
|
|
610
616
|
textDecoration?: {
|
|
611
617
|
underline?: boolean;
|
|
612
618
|
strikethrough?: boolean;
|
|
@@ -1562,6 +1568,12 @@ interface SerializedShape {
|
|
|
1562
1568
|
fontFamily?: string;
|
|
1563
1569
|
fontWeight?: string;
|
|
1564
1570
|
fontStyle?: string;
|
|
1571
|
+
fontVariant?: string;
|
|
1572
|
+
fontVariantLigatures?: string;
|
|
1573
|
+
fontVariantPosition?: string;
|
|
1574
|
+
fontVariantCaps?: string;
|
|
1575
|
+
fontVariantNumeric?: string;
|
|
1576
|
+
fontVariantEastAsian?: string;
|
|
1565
1577
|
textDecoration?: {
|
|
1566
1578
|
underline?: boolean;
|
|
1567
1579
|
strikethrough?: boolean;
|
|
@@ -1920,6 +1932,28 @@ interface SerializedShape {
|
|
|
1920
1932
|
* rendering tree.
|
|
1921
1933
|
*/
|
|
1922
1934
|
display?: 'none';
|
|
1935
|
+
/**
|
|
1936
|
+
* Passthrough inline CSS declarations the editor doesn't model as
|
|
1937
|
+
* typed state. Holds CSS Custom Properties (`--foo`, CSS Variables 1
|
|
1938
|
+
* §2 — scoped vars cascading to descendants via `var()` references)
|
|
1939
|
+
* and vendor-prefixed CSS (`-inkscape-*`, `-webkit-*`, …) authored
|
|
1940
|
+
* directly on the source element's `style="…"` attribute.
|
|
1941
|
+
*
|
|
1942
|
+
* Round-trip mechanism (`applyPresentationEntry` / `clearPresentationEntry`
|
|
1943
|
+
* in `apps/editor/src/canvas/import-export/ie-shared.ts`):
|
|
1944
|
+
* - Custom properties live on `el.style` via `setProperty`; browsers
|
|
1945
|
+
* cascade them natively.
|
|
1946
|
+
* - Vendor prefixes live in an editor-internal
|
|
1947
|
+
* `data-svgsketch-vendor-css` attribute (CSSOM `setProperty` drops
|
|
1948
|
+
* unknown vendor names per CSSOM §6.3.6 step 1); export merges
|
|
1949
|
+
* them into the visible `style="…"` attribute on serialize.
|
|
1950
|
+
*
|
|
1951
|
+
* Editor-modeled CSS (`fill`, `stroke`, `font-*`, `mix-blend-mode`,
|
|
1952
|
+
* `mask`, etc.) is captured into the dedicated typed slots above and
|
|
1953
|
+
* does NOT appear in this map — keeps a single source of truth per
|
|
1954
|
+
* declaration and avoids round-trip drift.
|
|
1955
|
+
*/
|
|
1956
|
+
inlineStyle?: Record<string, string>;
|
|
1923
1957
|
metadata?: Partial<ShapeMetadata>;
|
|
1924
1958
|
/**
|
|
1925
1959
|
* Shape-scoped `<script>` elements (SVG 2 §15.9 allows scripts as
|
|
@@ -2471,7 +2505,14 @@ interface SymbolLibraryDef extends LibraryDefBase {
|
|
|
2471
2505
|
*/
|
|
2472
2506
|
interface MarkerLibraryDef extends LibraryDefBase {
|
|
2473
2507
|
kind: 'marker';
|
|
2474
|
-
|
|
2508
|
+
/**
|
|
2509
|
+
* SVG 2 §11.6: when omitted, marker contents render directly in the
|
|
2510
|
+
* viewport coordinate system (scaled by markerUnits) rather than being
|
|
2511
|
+
* mapped from viewBox space to the markerWidth × markerHeight viewport.
|
|
2512
|
+
* Editor-authored markers always set this; imported markers preserve
|
|
2513
|
+
* "no viewBox" when the source `<marker>` had none.
|
|
2514
|
+
*/
|
|
2515
|
+
viewBox?: string;
|
|
2475
2516
|
/** X reference point — where the marker's tip aligns with the host vertex. */
|
|
2476
2517
|
refX: number;
|
|
2477
2518
|
refY: number;
|
|
@@ -2487,6 +2528,12 @@ interface MarkerLibraryDef extends LibraryDefBase {
|
|
|
2487
2528
|
* start marker; a number is a fixed rotation in degrees.
|
|
2488
2529
|
*/
|
|
2489
2530
|
orient: 'auto' | 'auto-start-reverse' | number;
|
|
2531
|
+
/**
|
|
2532
|
+
* SVG 2 §11.6: `'visible'` allows content to render past the
|
|
2533
|
+
* markerWidth × markerHeight viewport (default is `'hidden'`). Captured
|
|
2534
|
+
* from the source `overflow` attr; emitted only when explicitly set.
|
|
2535
|
+
*/
|
|
2536
|
+
overflow?: 'visible' | 'hidden';
|
|
2490
2537
|
/**
|
|
2491
2538
|
* Inner geometry (authoritative for user markers). Built-ins render from
|
|
2492
2539
|
* the descriptor registry and carry `shapes: []`.
|
|
@@ -2667,6 +2714,12 @@ interface TextNodeProps extends CommonNodeProps {
|
|
|
2667
2714
|
fontFamily: string;
|
|
2668
2715
|
fontWeight: string;
|
|
2669
2716
|
fontStyle: string;
|
|
2717
|
+
fontVariant: string;
|
|
2718
|
+
fontVariantLigatures: string;
|
|
2719
|
+
fontVariantPosition: string;
|
|
2720
|
+
fontVariantCaps: string;
|
|
2721
|
+
fontVariantNumeric: string;
|
|
2722
|
+
fontVariantEastAsian: string;
|
|
2670
2723
|
textDecoration: Record<string, boolean>;
|
|
2671
2724
|
textTransform: string;
|
|
2672
2725
|
baselineShift: string;
|
|
@@ -4326,6 +4379,18 @@ declare class Text extends ShapeBuilder<Text> {
|
|
|
4326
4379
|
fontWeight(weight: FontWeight): Text;
|
|
4327
4380
|
/** Set the font style (italic, normal, etc). */
|
|
4328
4381
|
fontStyle(style: FontStyle): Text;
|
|
4382
|
+
/** Set the CSS Fonts 3 `font-variant` shorthand. */
|
|
4383
|
+
fontVariant(value: string): Text;
|
|
4384
|
+
/** Set CSS `font-variant-ligatures`. */
|
|
4385
|
+
fontVariantLigatures(value: string): Text;
|
|
4386
|
+
/** Set CSS `font-variant-position`. */
|
|
4387
|
+
fontVariantPosition(value: string): Text;
|
|
4388
|
+
/** Set CSS `font-variant-caps`. */
|
|
4389
|
+
fontVariantCaps(value: string): Text;
|
|
4390
|
+
/** Set CSS `font-variant-numeric`. */
|
|
4391
|
+
fontVariantNumeric(value: string): Text;
|
|
4392
|
+
/** Set CSS `font-variant-east-asian`. */
|
|
4393
|
+
fontVariantEastAsian(value: string): Text;
|
|
4329
4394
|
/** Set the text anchor (start, middle, end). */
|
|
4330
4395
|
anchor(value: 'start' | 'middle' | 'end'): Text;
|
|
4331
4396
|
/** Set letter spacing. */
|
|
@@ -4569,8 +4634,18 @@ declare class View extends ShapeBuilder<View> {
|
|
|
4569
4634
|
zoomAndPan(value: 'disable' | 'magnify'): View;
|
|
4570
4635
|
/** SVG `viewTarget` attribute. */
|
|
4571
4636
|
viewTarget(value: string): View;
|
|
4572
|
-
/**
|
|
4573
|
-
|
|
4637
|
+
/**
|
|
4638
|
+
* No-op kept for backwards compatibility with existing call sites.
|
|
4639
|
+
* The "home view" abstraction was retired — the document's framing
|
|
4640
|
+
* is owned by the root `<svg>` element (via the SDK's `Document`
|
|
4641
|
+
* width/height/viewBox), not by a `<view>` element flagged as
|
|
4642
|
+
* "home." `<view>` is reserved for author-authored named viewports
|
|
4643
|
+
* (SVG 2 §16.3.3).
|
|
4644
|
+
*
|
|
4645
|
+
* @deprecated v3 — pass `width`/`height`/`viewBox` to `Document`
|
|
4646
|
+
* instead. This shim will be removed in a future major.
|
|
4647
|
+
*/
|
|
4648
|
+
asHome(_value?: boolean): View;
|
|
4574
4649
|
}
|
|
4575
4650
|
declare class NestedSvg extends ContainerShapeBuilder<NestedSvg> {
|
|
4576
4651
|
constructor(x?: number, y?: number, width?: number, height?: number);
|
|
@@ -5374,4 +5449,38 @@ declare const PUZZLE_DEFAULTS: PuzzleOptions;
|
|
|
5374
5449
|
*/
|
|
5375
5450
|
declare function generatePuzzlePieces(bounds: PuzzleBounds, options?: Partial<PuzzleOptions>): PuzzlePiece[];
|
|
5376
5451
|
|
|
5377
|
-
|
|
5452
|
+
/**
|
|
5453
|
+
* Pure Sudoku generation, solving, and validation.
|
|
5454
|
+
*
|
|
5455
|
+
* The editor plugin imports this module through @svgsketch/core so puzzle
|
|
5456
|
+
* generation stays deterministic and testable outside the DOM.
|
|
5457
|
+
*/
|
|
5458
|
+
type SudokuDifficulty = 'easy' | 'medium' | 'hard' | 'expert';
|
|
5459
|
+
type SudokuGrid = number[][];
|
|
5460
|
+
type SudokuRating = 'singles' | 'hidden-singles' | 'search';
|
|
5461
|
+
interface GenerateSudokuOptions {
|
|
5462
|
+
difficulty: SudokuDifficulty;
|
|
5463
|
+
seed: number;
|
|
5464
|
+
}
|
|
5465
|
+
interface GeneratedSudokuPuzzle {
|
|
5466
|
+
puzzle: SudokuGrid;
|
|
5467
|
+
solution: SudokuGrid;
|
|
5468
|
+
difficulty: SudokuDifficulty;
|
|
5469
|
+
seed: number;
|
|
5470
|
+
givens: number;
|
|
5471
|
+
rating: SudokuRating;
|
|
5472
|
+
}
|
|
5473
|
+
interface SudokuValidationResult {
|
|
5474
|
+
valid: boolean;
|
|
5475
|
+
unique: boolean;
|
|
5476
|
+
solution: SudokuGrid | null;
|
|
5477
|
+
errors: string[];
|
|
5478
|
+
}
|
|
5479
|
+
interface SolveSudokuOptions {
|
|
5480
|
+
maxSolutions?: number;
|
|
5481
|
+
}
|
|
5482
|
+
declare function solveSudoku(grid: SudokuGrid, options?: SolveSudokuOptions): SudokuGrid[];
|
|
5483
|
+
declare function validateSudokuPuzzle(grid: SudokuGrid): SudokuValidationResult;
|
|
5484
|
+
declare function generateSudokuPuzzle(options: GenerateSudokuOptions): GeneratedSudokuPuzzle;
|
|
5485
|
+
|
|
5486
|
+
export { type AnimatablePropertyDescriptor, type AnimationKeyframe, type AnimationTimeline, type AnimationTrack, type AnimationTrigger, type AnimationTriggerType, type AnyNodeProps, type ArcParams$1 as ArcParams, type AriaRole, Arrow, type ArrowNodeProps, Audio, BUILTIN_MARKER_ID_MAP, type BaseFilter, type BaseFilterPrimitive, type BlackAndWhiteFilter, type BlurQuality, type BrightnessFilter, CURRENT_SCHEMA_VERSION, type ChannelPainterFilter, Circle, type CircleNodeProps, Cloud, type CodeFormat, type CodegenOptions, type CommonNodeProps, type ConnectionDirection, type ConnectionPoint, Container, ContainerShapeBuilder, type ContouringDiscreteFilter, type ContouringTableFilter, type ContrastFilter, type CornerShapeValue, type CreateDocumentOptions, type CreateShapeOptions, Cross, type CrossNodeProps, type CrumpledPlasticFilter, type CustomPatternDef, type CycleBehavior, DEFAULT_COORDINATE_PRECISION, type DiffuseLightingFilter, Document, type DocumentMetadata, type DocumentNodeProps, type DocumentOptions, type DocumentScript, type DocumentStyle, type DropShadowFilter, type DuotoneFilter, EASING_CURVES, EVENT_TRIGGER_OPTIONS, EasingType, Ellipse, type EllipseNodeProps, type EmbossFilter, type ExtractedVariables, type FeBlendPrimitive, type FeColorMatrixPrimitive, type FeComponentTransferPrimitive, type FeCompositePrimitive, type FeConvolveMatrixPrimitive, type FeDiffuseLightingPrimitive, type FeDisplacementMapPrimitive, type FeDropShadowPrimitive, type FeFloodPrimitive, type FeGaussianBlurPrimitive, type FeImagePrimitive, type FeMergePrimitive, type FeMorphologyPrimitive, type FeOffsetPrimitive, type FeSpecularLightingPrimitive, type FeTilePrimitive, type FeTurbulencePrimitive, type FillType, type FilmGrainFilter, type FilterBlendMode, type FilterLibraryDef, type FilterLightSource, type FilterPrimitive, type FilterPrimitiveType, type FilterType, type GaussianBlurFilter, Gear, type GearNodeProps, type GenerateSudokuOptions, type GeneratedSudokuPuzzle, type GlowFilter, type GouacheFilter, type GradientDefinition, type GradientSpreadMethod, type GradientStop, type GradientUnits, type GrayscaleFilter, type GroupNodeProps, type Guide, Heart, type HistorySnapshot, type HueRotateFilter, Hyperlink, type ImageAttribution, type ImageNodeProps, ImageShape, type InkBlotFilter, type InnerGlowFilter, type InnerShadowFilter, type InvertFilter, LIBRARY_EMIT_ORDER, type LibraryDef, type LibraryDefBase, type LibraryDefOfKind, type LibraryKind, type LicenseType, type LightSource, Lightning, Line, type LineEndpointValue, type LineNodeProps, type LinearEasingPoint, type LinearGradient, LinearGradientBuilder, type LinearGradientLibraryDef, type LinkTarget, MARKER_HEIGHT, MARKER_VIEWBOX, MARKER_WIDTH, MAX_COORDINATE_PRECISION, MIGRATIONS, type MarkerDescriptor, type MarkerLibraryDef, type Measurement, type Migration, type MorphologyFilter, type MorphologyOperator, type MotionBlurFilter, NGon, type NGonNodeProps, NestedSvg, type NodeTypePropsMap, type NoiseFilter, type OpacityFilter, type OutlineFilter, type OutlinePosition, PUZZLE_DEFAULTS, type ParseOptions, Path, PathCurveType, type PathNodeProps, type PathPoint, PathPointType, PatternBuilder, type PatternElement, type PatternFill, type PatternLibraryDef, type PatternParams, type PatternSvgContentResult, type PatternType, type PixelateFilter, type Point, type PointLightFilter, type PolygonBaseNodeProps, Polyline, type PolylineNodeProps, type PuzzleBounds, type PuzzleOptions, type PuzzlePiece, type PuzzleStyle, type PuzzleTabPattern, type RadialGradient, RadialGradientBuilder, type RadialGradientLibraryDef, type RawSvgFilter, Rectangle, type RectangleNodeProps, type RenderOptions, type RichTextData, type RichTextLine, type RichTextSegment, type RichTextSegmentStyle, type RiddledFilter, Ring, type RingNodeProps, type RoundEdgesFilter, type SaturateFilter, type SegmentCurveType, type SepiaFilter, type SerializedAnimationTimeline, type SerializedClipMaskGroup, type SerializedColorGlyph, type SerializedColorGlyphLibrary, type SerializedGroup, type SerializedMarkerDef, type SerializedShape, type SerializedSymbolDef, type SerializedVariantAxis, type SerializedViewbox, ShapeBuilder, type ShapeFilter, type ShapeMetadata, ShapeReference, type SharpenFilter, type SolveSudokuOptions, type SpecularLightingFilter, SpeechBubble, Spiral, type SpiralNodeProps, type SpotLightFilter, Square, type SquareNodeProps, Star, type StarNodeProps, type StepPosition, type StepsParams, type StringifyOptions, type StrokeType, type SudokuDifficulty, type SudokuGrid, type SudokuRating, type SudokuValidationResult, type SvgPrimitiveChainFilter, Switch, type SymbolInstanceNodeProps, type SymbolLibraryDef, type TemplateVariable, type TemplateVariableMode, type TemplateVariableSource, type TemplateVariableType, Text, type TextNodeProps, Timeline, Track, type TransferFunc, Triangle, type TriangleNodeProps, type ValidationError, type ValidationResult, type VariableMap, Video, View, type Viewbox, type WarpFilter, type WarpType, type WatercolorFilter, type XrayFilter, collectReferencedLibraryIds, computeArrowVertices, computeCloudPath, computeCrossVertices, computeDashArray, computeGearPath, computeGearVertices, computeHeartPath, computeLightningVertices, computePolygonVertices, computeRectanglePath, computeRingPath, computeSpeechBubbleVertices, computeSpiralPath, computeSplinePath, computeStarVertices, createDocument, createShape, createViewbox, defaultVariableMode, escXml, extractVariables, filterAttr, generateCode, generateCssCode, generateD3Code, generateId, generatePatternSvgContent, generatePuzzlePieces, generateReactCode, generateSudokuPuzzle, generateSvgCode, generateVueCode, getBuiltInMarkerDefs, getEasingCubicBezier, getEffectivePrecision, getMarkerDescriptors, getPatternElements, linearGradient, migrateSnapshot, parseDocument, parseVariableArgs, pattern, radialGradient, renderAnimationElements, renderBuiltinMarkerDefs, renderCircle, renderEllipse, renderFilterDefs, renderFilterLibraryDef, renderFilterPrimitive, renderFilterPrimitivesForType, renderImage, renderLibraryDef, renderLibraryDefs, renderLine, renderLinearGradientLibraryDef, renderMarkerLibraryDef, renderPatternLibraryDef, renderPolygonShape, renderPolyline, renderRadialGradientLibraryDef, renderRectangle, renderReferencedLibraryDefs, renderShape, renderSpline, renderSvgPrimitiveChainFilter, renderSymbolLibraryDef, renderText, renderToSvg, roundCoord, roundNumberString, roundSerializedShape, roundSnapshot, solveSudoku, stringifyDocument, substituteString, substituteVariables, validateSnapshot, validateSudokuPuzzle, verticesToPath };
|
package/dist/index.d.ts
CHANGED
|
@@ -607,6 +607,12 @@ interface RichTextSegmentStyle {
|
|
|
607
607
|
fontFamily?: string;
|
|
608
608
|
fontWeight?: string;
|
|
609
609
|
fontStyle?: string;
|
|
610
|
+
fontVariant?: string;
|
|
611
|
+
fontVariantLigatures?: string;
|
|
612
|
+
fontVariantPosition?: string;
|
|
613
|
+
fontVariantCaps?: string;
|
|
614
|
+
fontVariantNumeric?: string;
|
|
615
|
+
fontVariantEastAsian?: string;
|
|
610
616
|
textDecoration?: {
|
|
611
617
|
underline?: boolean;
|
|
612
618
|
strikethrough?: boolean;
|
|
@@ -1562,6 +1568,12 @@ interface SerializedShape {
|
|
|
1562
1568
|
fontFamily?: string;
|
|
1563
1569
|
fontWeight?: string;
|
|
1564
1570
|
fontStyle?: string;
|
|
1571
|
+
fontVariant?: string;
|
|
1572
|
+
fontVariantLigatures?: string;
|
|
1573
|
+
fontVariantPosition?: string;
|
|
1574
|
+
fontVariantCaps?: string;
|
|
1575
|
+
fontVariantNumeric?: string;
|
|
1576
|
+
fontVariantEastAsian?: string;
|
|
1565
1577
|
textDecoration?: {
|
|
1566
1578
|
underline?: boolean;
|
|
1567
1579
|
strikethrough?: boolean;
|
|
@@ -1920,6 +1932,28 @@ interface SerializedShape {
|
|
|
1920
1932
|
* rendering tree.
|
|
1921
1933
|
*/
|
|
1922
1934
|
display?: 'none';
|
|
1935
|
+
/**
|
|
1936
|
+
* Passthrough inline CSS declarations the editor doesn't model as
|
|
1937
|
+
* typed state. Holds CSS Custom Properties (`--foo`, CSS Variables 1
|
|
1938
|
+
* §2 — scoped vars cascading to descendants via `var()` references)
|
|
1939
|
+
* and vendor-prefixed CSS (`-inkscape-*`, `-webkit-*`, …) authored
|
|
1940
|
+
* directly on the source element's `style="…"` attribute.
|
|
1941
|
+
*
|
|
1942
|
+
* Round-trip mechanism (`applyPresentationEntry` / `clearPresentationEntry`
|
|
1943
|
+
* in `apps/editor/src/canvas/import-export/ie-shared.ts`):
|
|
1944
|
+
* - Custom properties live on `el.style` via `setProperty`; browsers
|
|
1945
|
+
* cascade them natively.
|
|
1946
|
+
* - Vendor prefixes live in an editor-internal
|
|
1947
|
+
* `data-svgsketch-vendor-css` attribute (CSSOM `setProperty` drops
|
|
1948
|
+
* unknown vendor names per CSSOM §6.3.6 step 1); export merges
|
|
1949
|
+
* them into the visible `style="…"` attribute on serialize.
|
|
1950
|
+
*
|
|
1951
|
+
* Editor-modeled CSS (`fill`, `stroke`, `font-*`, `mix-blend-mode`,
|
|
1952
|
+
* `mask`, etc.) is captured into the dedicated typed slots above and
|
|
1953
|
+
* does NOT appear in this map — keeps a single source of truth per
|
|
1954
|
+
* declaration and avoids round-trip drift.
|
|
1955
|
+
*/
|
|
1956
|
+
inlineStyle?: Record<string, string>;
|
|
1923
1957
|
metadata?: Partial<ShapeMetadata>;
|
|
1924
1958
|
/**
|
|
1925
1959
|
* Shape-scoped `<script>` elements (SVG 2 §15.9 allows scripts as
|
|
@@ -2471,7 +2505,14 @@ interface SymbolLibraryDef extends LibraryDefBase {
|
|
|
2471
2505
|
*/
|
|
2472
2506
|
interface MarkerLibraryDef extends LibraryDefBase {
|
|
2473
2507
|
kind: 'marker';
|
|
2474
|
-
|
|
2508
|
+
/**
|
|
2509
|
+
* SVG 2 §11.6: when omitted, marker contents render directly in the
|
|
2510
|
+
* viewport coordinate system (scaled by markerUnits) rather than being
|
|
2511
|
+
* mapped from viewBox space to the markerWidth × markerHeight viewport.
|
|
2512
|
+
* Editor-authored markers always set this; imported markers preserve
|
|
2513
|
+
* "no viewBox" when the source `<marker>` had none.
|
|
2514
|
+
*/
|
|
2515
|
+
viewBox?: string;
|
|
2475
2516
|
/** X reference point — where the marker's tip aligns with the host vertex. */
|
|
2476
2517
|
refX: number;
|
|
2477
2518
|
refY: number;
|
|
@@ -2487,6 +2528,12 @@ interface MarkerLibraryDef extends LibraryDefBase {
|
|
|
2487
2528
|
* start marker; a number is a fixed rotation in degrees.
|
|
2488
2529
|
*/
|
|
2489
2530
|
orient: 'auto' | 'auto-start-reverse' | number;
|
|
2531
|
+
/**
|
|
2532
|
+
* SVG 2 §11.6: `'visible'` allows content to render past the
|
|
2533
|
+
* markerWidth × markerHeight viewport (default is `'hidden'`). Captured
|
|
2534
|
+
* from the source `overflow` attr; emitted only when explicitly set.
|
|
2535
|
+
*/
|
|
2536
|
+
overflow?: 'visible' | 'hidden';
|
|
2490
2537
|
/**
|
|
2491
2538
|
* Inner geometry (authoritative for user markers). Built-ins render from
|
|
2492
2539
|
* the descriptor registry and carry `shapes: []`.
|
|
@@ -2667,6 +2714,12 @@ interface TextNodeProps extends CommonNodeProps {
|
|
|
2667
2714
|
fontFamily: string;
|
|
2668
2715
|
fontWeight: string;
|
|
2669
2716
|
fontStyle: string;
|
|
2717
|
+
fontVariant: string;
|
|
2718
|
+
fontVariantLigatures: string;
|
|
2719
|
+
fontVariantPosition: string;
|
|
2720
|
+
fontVariantCaps: string;
|
|
2721
|
+
fontVariantNumeric: string;
|
|
2722
|
+
fontVariantEastAsian: string;
|
|
2670
2723
|
textDecoration: Record<string, boolean>;
|
|
2671
2724
|
textTransform: string;
|
|
2672
2725
|
baselineShift: string;
|
|
@@ -4326,6 +4379,18 @@ declare class Text extends ShapeBuilder<Text> {
|
|
|
4326
4379
|
fontWeight(weight: FontWeight): Text;
|
|
4327
4380
|
/** Set the font style (italic, normal, etc). */
|
|
4328
4381
|
fontStyle(style: FontStyle): Text;
|
|
4382
|
+
/** Set the CSS Fonts 3 `font-variant` shorthand. */
|
|
4383
|
+
fontVariant(value: string): Text;
|
|
4384
|
+
/** Set CSS `font-variant-ligatures`. */
|
|
4385
|
+
fontVariantLigatures(value: string): Text;
|
|
4386
|
+
/** Set CSS `font-variant-position`. */
|
|
4387
|
+
fontVariantPosition(value: string): Text;
|
|
4388
|
+
/** Set CSS `font-variant-caps`. */
|
|
4389
|
+
fontVariantCaps(value: string): Text;
|
|
4390
|
+
/** Set CSS `font-variant-numeric`. */
|
|
4391
|
+
fontVariantNumeric(value: string): Text;
|
|
4392
|
+
/** Set CSS `font-variant-east-asian`. */
|
|
4393
|
+
fontVariantEastAsian(value: string): Text;
|
|
4329
4394
|
/** Set the text anchor (start, middle, end). */
|
|
4330
4395
|
anchor(value: 'start' | 'middle' | 'end'): Text;
|
|
4331
4396
|
/** Set letter spacing. */
|
|
@@ -4569,8 +4634,18 @@ declare class View extends ShapeBuilder<View> {
|
|
|
4569
4634
|
zoomAndPan(value: 'disable' | 'magnify'): View;
|
|
4570
4635
|
/** SVG `viewTarget` attribute. */
|
|
4571
4636
|
viewTarget(value: string): View;
|
|
4572
|
-
/**
|
|
4573
|
-
|
|
4637
|
+
/**
|
|
4638
|
+
* No-op kept for backwards compatibility with existing call sites.
|
|
4639
|
+
* The "home view" abstraction was retired — the document's framing
|
|
4640
|
+
* is owned by the root `<svg>` element (via the SDK's `Document`
|
|
4641
|
+
* width/height/viewBox), not by a `<view>` element flagged as
|
|
4642
|
+
* "home." `<view>` is reserved for author-authored named viewports
|
|
4643
|
+
* (SVG 2 §16.3.3).
|
|
4644
|
+
*
|
|
4645
|
+
* @deprecated v3 — pass `width`/`height`/`viewBox` to `Document`
|
|
4646
|
+
* instead. This shim will be removed in a future major.
|
|
4647
|
+
*/
|
|
4648
|
+
asHome(_value?: boolean): View;
|
|
4574
4649
|
}
|
|
4575
4650
|
declare class NestedSvg extends ContainerShapeBuilder<NestedSvg> {
|
|
4576
4651
|
constructor(x?: number, y?: number, width?: number, height?: number);
|
|
@@ -5374,4 +5449,38 @@ declare const PUZZLE_DEFAULTS: PuzzleOptions;
|
|
|
5374
5449
|
*/
|
|
5375
5450
|
declare function generatePuzzlePieces(bounds: PuzzleBounds, options?: Partial<PuzzleOptions>): PuzzlePiece[];
|
|
5376
5451
|
|
|
5377
|
-
|
|
5452
|
+
/**
|
|
5453
|
+
* Pure Sudoku generation, solving, and validation.
|
|
5454
|
+
*
|
|
5455
|
+
* The editor plugin imports this module through @svgsketch/core so puzzle
|
|
5456
|
+
* generation stays deterministic and testable outside the DOM.
|
|
5457
|
+
*/
|
|
5458
|
+
type SudokuDifficulty = 'easy' | 'medium' | 'hard' | 'expert';
|
|
5459
|
+
type SudokuGrid = number[][];
|
|
5460
|
+
type SudokuRating = 'singles' | 'hidden-singles' | 'search';
|
|
5461
|
+
interface GenerateSudokuOptions {
|
|
5462
|
+
difficulty: SudokuDifficulty;
|
|
5463
|
+
seed: number;
|
|
5464
|
+
}
|
|
5465
|
+
interface GeneratedSudokuPuzzle {
|
|
5466
|
+
puzzle: SudokuGrid;
|
|
5467
|
+
solution: SudokuGrid;
|
|
5468
|
+
difficulty: SudokuDifficulty;
|
|
5469
|
+
seed: number;
|
|
5470
|
+
givens: number;
|
|
5471
|
+
rating: SudokuRating;
|
|
5472
|
+
}
|
|
5473
|
+
interface SudokuValidationResult {
|
|
5474
|
+
valid: boolean;
|
|
5475
|
+
unique: boolean;
|
|
5476
|
+
solution: SudokuGrid | null;
|
|
5477
|
+
errors: string[];
|
|
5478
|
+
}
|
|
5479
|
+
interface SolveSudokuOptions {
|
|
5480
|
+
maxSolutions?: number;
|
|
5481
|
+
}
|
|
5482
|
+
declare function solveSudoku(grid: SudokuGrid, options?: SolveSudokuOptions): SudokuGrid[];
|
|
5483
|
+
declare function validateSudokuPuzzle(grid: SudokuGrid): SudokuValidationResult;
|
|
5484
|
+
declare function generateSudokuPuzzle(options: GenerateSudokuOptions): GeneratedSudokuPuzzle;
|
|
5485
|
+
|
|
5486
|
+
export { type AnimatablePropertyDescriptor, type AnimationKeyframe, type AnimationTimeline, type AnimationTrack, type AnimationTrigger, type AnimationTriggerType, type AnyNodeProps, type ArcParams$1 as ArcParams, type AriaRole, Arrow, type ArrowNodeProps, Audio, BUILTIN_MARKER_ID_MAP, type BaseFilter, type BaseFilterPrimitive, type BlackAndWhiteFilter, type BlurQuality, type BrightnessFilter, CURRENT_SCHEMA_VERSION, type ChannelPainterFilter, Circle, type CircleNodeProps, Cloud, type CodeFormat, type CodegenOptions, type CommonNodeProps, type ConnectionDirection, type ConnectionPoint, Container, ContainerShapeBuilder, type ContouringDiscreteFilter, type ContouringTableFilter, type ContrastFilter, type CornerShapeValue, type CreateDocumentOptions, type CreateShapeOptions, Cross, type CrossNodeProps, type CrumpledPlasticFilter, type CustomPatternDef, type CycleBehavior, DEFAULT_COORDINATE_PRECISION, type DiffuseLightingFilter, Document, type DocumentMetadata, type DocumentNodeProps, type DocumentOptions, type DocumentScript, type DocumentStyle, type DropShadowFilter, type DuotoneFilter, EASING_CURVES, EVENT_TRIGGER_OPTIONS, EasingType, Ellipse, type EllipseNodeProps, type EmbossFilter, type ExtractedVariables, type FeBlendPrimitive, type FeColorMatrixPrimitive, type FeComponentTransferPrimitive, type FeCompositePrimitive, type FeConvolveMatrixPrimitive, type FeDiffuseLightingPrimitive, type FeDisplacementMapPrimitive, type FeDropShadowPrimitive, type FeFloodPrimitive, type FeGaussianBlurPrimitive, type FeImagePrimitive, type FeMergePrimitive, type FeMorphologyPrimitive, type FeOffsetPrimitive, type FeSpecularLightingPrimitive, type FeTilePrimitive, type FeTurbulencePrimitive, type FillType, type FilmGrainFilter, type FilterBlendMode, type FilterLibraryDef, type FilterLightSource, type FilterPrimitive, type FilterPrimitiveType, type FilterType, type GaussianBlurFilter, Gear, type GearNodeProps, type GenerateSudokuOptions, type GeneratedSudokuPuzzle, type GlowFilter, type GouacheFilter, type GradientDefinition, type GradientSpreadMethod, type GradientStop, type GradientUnits, type GrayscaleFilter, type GroupNodeProps, type Guide, Heart, type HistorySnapshot, type HueRotateFilter, Hyperlink, type ImageAttribution, type ImageNodeProps, ImageShape, type InkBlotFilter, type InnerGlowFilter, type InnerShadowFilter, type InvertFilter, LIBRARY_EMIT_ORDER, type LibraryDef, type LibraryDefBase, type LibraryDefOfKind, type LibraryKind, type LicenseType, type LightSource, Lightning, Line, type LineEndpointValue, type LineNodeProps, type LinearEasingPoint, type LinearGradient, LinearGradientBuilder, type LinearGradientLibraryDef, type LinkTarget, MARKER_HEIGHT, MARKER_VIEWBOX, MARKER_WIDTH, MAX_COORDINATE_PRECISION, MIGRATIONS, type MarkerDescriptor, type MarkerLibraryDef, type Measurement, type Migration, type MorphologyFilter, type MorphologyOperator, type MotionBlurFilter, NGon, type NGonNodeProps, NestedSvg, type NodeTypePropsMap, type NoiseFilter, type OpacityFilter, type OutlineFilter, type OutlinePosition, PUZZLE_DEFAULTS, type ParseOptions, Path, PathCurveType, type PathNodeProps, type PathPoint, PathPointType, PatternBuilder, type PatternElement, type PatternFill, type PatternLibraryDef, type PatternParams, type PatternSvgContentResult, type PatternType, type PixelateFilter, type Point, type PointLightFilter, type PolygonBaseNodeProps, Polyline, type PolylineNodeProps, type PuzzleBounds, type PuzzleOptions, type PuzzlePiece, type PuzzleStyle, type PuzzleTabPattern, type RadialGradient, RadialGradientBuilder, type RadialGradientLibraryDef, type RawSvgFilter, Rectangle, type RectangleNodeProps, type RenderOptions, type RichTextData, type RichTextLine, type RichTextSegment, type RichTextSegmentStyle, type RiddledFilter, Ring, type RingNodeProps, type RoundEdgesFilter, type SaturateFilter, type SegmentCurveType, type SepiaFilter, type SerializedAnimationTimeline, type SerializedClipMaskGroup, type SerializedColorGlyph, type SerializedColorGlyphLibrary, type SerializedGroup, type SerializedMarkerDef, type SerializedShape, type SerializedSymbolDef, type SerializedVariantAxis, type SerializedViewbox, ShapeBuilder, type ShapeFilter, type ShapeMetadata, ShapeReference, type SharpenFilter, type SolveSudokuOptions, type SpecularLightingFilter, SpeechBubble, Spiral, type SpiralNodeProps, type SpotLightFilter, Square, type SquareNodeProps, Star, type StarNodeProps, type StepPosition, type StepsParams, type StringifyOptions, type StrokeType, type SudokuDifficulty, type SudokuGrid, type SudokuRating, type SudokuValidationResult, type SvgPrimitiveChainFilter, Switch, type SymbolInstanceNodeProps, type SymbolLibraryDef, type TemplateVariable, type TemplateVariableMode, type TemplateVariableSource, type TemplateVariableType, Text, type TextNodeProps, Timeline, Track, type TransferFunc, Triangle, type TriangleNodeProps, type ValidationError, type ValidationResult, type VariableMap, Video, View, type Viewbox, type WarpFilter, type WarpType, type WatercolorFilter, type XrayFilter, collectReferencedLibraryIds, computeArrowVertices, computeCloudPath, computeCrossVertices, computeDashArray, computeGearPath, computeGearVertices, computeHeartPath, computeLightningVertices, computePolygonVertices, computeRectanglePath, computeRingPath, computeSpeechBubbleVertices, computeSpiralPath, computeSplinePath, computeStarVertices, createDocument, createShape, createViewbox, defaultVariableMode, escXml, extractVariables, filterAttr, generateCode, generateCssCode, generateD3Code, generateId, generatePatternSvgContent, generatePuzzlePieces, generateReactCode, generateSudokuPuzzle, generateSvgCode, generateVueCode, getBuiltInMarkerDefs, getEasingCubicBezier, getEffectivePrecision, getMarkerDescriptors, getPatternElements, linearGradient, migrateSnapshot, parseDocument, parseVariableArgs, pattern, radialGradient, renderAnimationElements, renderBuiltinMarkerDefs, renderCircle, renderEllipse, renderFilterDefs, renderFilterLibraryDef, renderFilterPrimitive, renderFilterPrimitivesForType, renderImage, renderLibraryDef, renderLibraryDefs, renderLine, renderLinearGradientLibraryDef, renderMarkerLibraryDef, renderPatternLibraryDef, renderPolygonShape, renderPolyline, renderRadialGradientLibraryDef, renderRectangle, renderReferencedLibraryDefs, renderShape, renderSpline, renderSvgPrimitiveChainFilter, renderSymbolLibraryDef, renderText, renderToSvg, roundCoord, roundNumberString, roundSerializedShape, roundSnapshot, solveSudoku, stringifyDocument, substituteString, substituteVariables, validateSnapshot, validateSudokuPuzzle, verticesToPath };
|