@svgsketch/core 1.4.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 CHANGED
@@ -1932,6 +1932,28 @@ interface SerializedShape {
1932
1932
  * rendering tree.
1933
1933
  */
1934
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>;
1935
1957
  metadata?: Partial<ShapeMetadata>;
1936
1958
  /**
1937
1959
  * Shape-scoped `<script>` elements (SVG 2 §15.9 allows scripts as
@@ -2483,7 +2505,14 @@ interface SymbolLibraryDef extends LibraryDefBase {
2483
2505
  */
2484
2506
  interface MarkerLibraryDef extends LibraryDefBase {
2485
2507
  kind: 'marker';
2486
- viewBox: string;
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;
2487
2516
  /** X reference point — where the marker's tip aligns with the host vertex. */
2488
2517
  refX: number;
2489
2518
  refY: number;
@@ -2499,6 +2528,12 @@ interface MarkerLibraryDef extends LibraryDefBase {
2499
2528
  * start marker; a number is a fixed rotation in degrees.
2500
2529
  */
2501
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';
2502
2537
  /**
2503
2538
  * Inner geometry (authoritative for user markers). Built-ins render from
2504
2539
  * the descriptor registry and carry `shapes: []`.
@@ -4599,8 +4634,18 @@ declare class View extends ShapeBuilder<View> {
4599
4634
  zoomAndPan(value: 'disable' | 'magnify'): View;
4600
4635
  /** SVG `viewTarget` attribute. */
4601
4636
  viewTarget(value: string): View;
4602
- /** Mark this view as the canonical "home" view of the document. */
4603
- asHome(value?: boolean): View;
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;
4604
4649
  }
4605
4650
  declare class NestedSvg extends ContainerShapeBuilder<NestedSvg> {
4606
4651
  constructor(x?: number, y?: number, width?: number, height?: number);
package/dist/index.d.ts CHANGED
@@ -1932,6 +1932,28 @@ interface SerializedShape {
1932
1932
  * rendering tree.
1933
1933
  */
1934
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>;
1935
1957
  metadata?: Partial<ShapeMetadata>;
1936
1958
  /**
1937
1959
  * Shape-scoped `<script>` elements (SVG 2 §15.9 allows scripts as
@@ -2483,7 +2505,14 @@ interface SymbolLibraryDef extends LibraryDefBase {
2483
2505
  */
2484
2506
  interface MarkerLibraryDef extends LibraryDefBase {
2485
2507
  kind: 'marker';
2486
- viewBox: string;
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;
2487
2516
  /** X reference point — where the marker's tip aligns with the host vertex. */
2488
2517
  refX: number;
2489
2518
  refY: number;
@@ -2499,6 +2528,12 @@ interface MarkerLibraryDef extends LibraryDefBase {
2499
2528
  * start marker; a number is a fixed rotation in degrees.
2500
2529
  */
2501
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';
2502
2537
  /**
2503
2538
  * Inner geometry (authoritative for user markers). Built-ins render from
2504
2539
  * the descriptor registry and carry `shapes: []`.
@@ -4599,8 +4634,18 @@ declare class View extends ShapeBuilder<View> {
4599
4634
  zoomAndPan(value: 'disable' | 'magnify'): View;
4600
4635
  /** SVG `viewTarget` attribute. */
4601
4636
  viewTarget(value: string): View;
4602
- /** Mark this view as the canonical "home" view of the document. */
4603
- asHome(value?: boolean): View;
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;
4604
4649
  }
4605
4650
  declare class NestedSvg extends ContainerShapeBuilder<NestedSvg> {
4606
4651
  constructor(x?: number, y?: number, width?: number, height?: number);