sdocs 0.0.54 → 0.0.55

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/CHANGELOG.md CHANGED
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.0.55] - 2026-07-05
11
+
12
+ ### Changed
13
+
14
+ - **Renamed the stage alignment attributes** `align`/`alignY` (added in
15
+ 0.0.54) to **`contentX`**/**`contentY`** — for horizontal/vertical content
16
+ alignment on `[preview]`/`[example]` and their `content.docs` and `[DOCS]`
17
+ defaults. Values and direction-aware behavior are unchanged.
18
+
10
19
  ## [0.0.54] - 2026-07-05
11
20
 
12
21
  ### Added
@@ -14,9 +14,9 @@ export interface Sizing {
14
14
  /** gap of preview/example stages */
15
15
  gap: string | null;
16
16
  /** horizontal alignment of preview/example stage contents */
17
- align: string | null;
17
+ contentX: string | null;
18
18
  /** vertical alignment of preview/example stage contents */
19
- alignY: string | null;
19
+ contentY: string | null;
20
20
  /** table-of-contents visibility (PAGE) */
21
21
  toc: boolean | null;
22
22
  }
@@ -50,8 +50,8 @@ const SIZING_ATTR_RULES = {
50
50
  const STAGE_LAYOUT_ATTR_RULES = {
51
51
  direction: { required: false, kind: 'string', hint: 'direction="column"' },
52
52
  gap: { required: false, kind: 'string', hint: 'gap="16px"' },
53
- align: { required: false, kind: 'string', hint: 'align="center"' },
54
- alignY: { required: false, kind: 'string', hint: 'alignY="middle"' },
53
+ contentX: { required: false, kind: 'string', hint: 'contentX="center"' },
54
+ contentY: { required: false, kind: 'string', hint: 'contentY="middle"' },
55
55
  };
56
56
  function sizingOf(attrs) {
57
57
  const toc = stringAttr(attrs, 'toc');
@@ -60,8 +60,8 @@ function sizingOf(attrs) {
60
60
  padding: stringAttr(attrs, 'padding'),
61
61
  direction: stringAttr(attrs, 'direction'),
62
62
  gap: stringAttr(attrs, 'gap'),
63
- align: stringAttr(attrs, 'align'),
64
- alignY: stringAttr(attrs, 'alignY'),
63
+ contentX: stringAttr(attrs, 'contentX'),
64
+ contentY: stringAttr(attrs, 'contentY'),
65
65
  toc: toc === null ? null : toc === 'true',
66
66
  };
67
67
  }
@@ -20,8 +20,8 @@ const DEFAULTS = {
20
20
  padding: '16px',
21
21
  direction: 'row',
22
22
  gap: '16px',
23
- align: 'left',
24
- alignY: 'top',
23
+ contentX: 'left',
24
+ contentY: 'top',
25
25
  },
26
26
  layout: { maxWidth: '100%', padding: '0px' },
27
27
  },
@@ -28,8 +28,8 @@ export declare function generateIframeComponent(scriptPrelude: string, snippetBo
28
28
  padding: string;
29
29
  direction?: string;
30
30
  gap?: string;
31
- align?: string;
32
- alignY?: string;
31
+ contentX?: string;
32
+ contentY?: string;
33
33
  }): string;
34
34
  /** The JS that boots a preview page: mount the wrapper + parent-frame messaging. */
35
35
  export declare function generateMountScript(iframeComponentId: string): string;
@@ -88,8 +88,8 @@ export function generateIframeComponent(scriptPrelude, snippetBody, stateNames =
88
88
  // layout stages are flow-root blocks. Both contain child margins, so the
89
89
  // height reported for iframe auto-sizing is exact.
90
90
  //
91
- // align/alignY are *physical* (horizontal/vertical); which flex property
92
- // each drives depends on direction. The flow axis (main) takes
91
+ // contentX/contentY are *physical* (horizontal/vertical); which flex
92
+ // property each drives depends on direction. The flow axis (main) takes
93
93
  // justify-content, the other (cross) takes align-items — and align-items
94
94
  // has no distribution value, so a 'justify' that lands on the cross axis
95
95
  // falls back to stretch.
@@ -106,8 +106,8 @@ export function generateIframeComponent(scriptPrelude, snippetBody, stateNames =
106
106
  justify: 'space-between',
107
107
  };
108
108
  const flexStage = () => {
109
- const h = H[stage.align ?? 'left'] ?? 'flex-start';
110
- const v = V[stage.alignY ?? 'top'] ?? 'flex-start';
109
+ const h = H[stage.contentX ?? 'left'] ?? 'flex-start';
110
+ const v = V[stage.contentY ?? 'top'] ?? 'flex-start';
111
111
  const isColumn = String(stage.direction).startsWith('column');
112
112
  const justify = isColumn ? v : h;
113
113
  let alignItems = isColumn ? h : v;
package/dist/types.d.ts CHANGED
@@ -35,9 +35,9 @@ export interface SdocsConfig {
35
35
  /** Stage gap. Default: '16px' */
36
36
  gap?: string;
37
37
  /** Horizontal alignment of stage contents: 'left'|'center'|'right'|'justify'. Default: 'left' */
38
- align?: string;
38
+ contentX?: string;
39
39
  /** Vertical alignment of stage contents: 'top'|'middle'|'bottom'. Default: 'top' */
40
- alignY?: string;
40
+ contentY?: string;
41
41
  };
42
42
  /** [LAYOUT] stages. Defaults: maxWidth '100%', padding '0px'. */
43
43
  layout?: ContentSizing;
@@ -52,13 +52,13 @@ export interface ContentSizing {
52
52
  export interface StageLayout {
53
53
  maxWidth: string;
54
54
  padding: string;
55
- /** flex-direction + gap + align; set for preview/example stages only */
55
+ /** flex-direction + gap + contentX; set for preview/example stages only */
56
56
  direction?: string;
57
57
  gap?: string;
58
58
  /** horizontal ('left'|'center'|'right'|'justify') — mapped by direction */
59
- align?: string;
59
+ contentX?: string;
60
60
  /** vertical ('top'|'middle'|'bottom') — mapped by direction */
61
- alignY?: string;
61
+ contentY?: string;
62
62
  }
63
63
  /** Resolved config with all defaults applied */
64
64
  export interface ResolvedSdocsConfig {
@@ -79,8 +79,8 @@ export interface ResolvedSdocsConfig {
79
79
  docs: Required<ContentSizing> & {
80
80
  direction: string;
81
81
  gap: string;
82
- align: string;
83
- alignY: string;
82
+ contentX: string;
83
+ contentY: string;
84
84
  };
85
85
  layout: Required<ContentSizing>;
86
86
  };
package/dist/vite.js CHANGED
@@ -308,13 +308,13 @@ export function sdocsPlugin(userConfig) {
308
308
  maxWidth: block?.maxWidth ??
309
309
  (entity.kind === 'LAYOUT' ? (entity.sizing.maxWidth ?? kindDefaults.maxWidth) : '100%'),
310
310
  padding: block?.padding ?? entity.sizing.padding ?? kindDefaults.padding,
311
- // direction/gap/align flex the preview/example stages only
311
+ // direction/gap/contentX flex the preview/example stages only
312
312
  ...(entity.kind === 'DOCS' && block
313
313
  ? {
314
314
  direction: block.direction ?? entity.sizing.direction ?? config.content.docs.direction,
315
315
  gap: block.gap ?? entity.sizing.gap ?? config.content.docs.gap,
316
- align: block.align ?? entity.sizing.align ?? config.content.docs.align,
317
- alignY: block.alignY ?? entity.sizing.alignY ?? config.content.docs.alignY,
316
+ contentX: block.contentX ?? entity.sizing.contentX ?? config.content.docs.contentX,
317
+ contentY: block.contentY ?? entity.sizing.contentY ?? config.content.docs.contentY,
318
318
  }
319
319
  : {}),
320
320
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdocs",
3
- "version": "0.0.54",
3
+ "version": "0.0.55",
4
4
  "description": "A lightweight documentation tool for Svelte 5 components",
5
5
  "type": "module",
6
6
  "license": "MIT",