enarratio-emdash 0.4.4 → 0.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/CHANGELOG.md CHANGED
@@ -7,6 +7,22 @@ the saved block's fields; every such change is listed here.
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.5.0] - 2026-11-08
11
+
12
+ ### Added
13
+
14
+ - A "Language" field on the Chart block (`lang`, optional): the language of the chart's text as a BCP 47 tag, so screen readers switch voice when it differs from the page's. Blocks saved earlier have no value and are unchanged.
15
+
16
+ ### Changed
17
+
18
+ - Draws with enarratio-astro 0.5.0 and Enarratio 0.10.0.
19
+
20
+ ## [0.4.5] - 2026-11-07
21
+
22
+ ### Changed
23
+
24
+ - Draws with enarratio-astro 0.4.5 and Enarratio 0.9.2. No block field changes.
25
+
10
26
  ## [0.4.4] - 2026-11-07
11
27
 
12
28
  ### Changed
package/README.md CHANGED
@@ -67,6 +67,7 @@ it only reads the block an editor saved and draws it.
67
67
  | Bar: several series, direction | bar | Stacked or side by side; vertical or horizontal. |
68
68
  | y scale | line, scatter | Linear or logarithmic. |
69
69
  | Regression | scatter | Least-squares line with its 95% confidence band. |
70
+ | Language | all | Optional. The language of the chart's text as a BCP 47 tag, such as `de`, so screen readers switch voice. Leave it blank for the page's language. |
70
71
  | Data table | all | Behind a "Data table" toggle (default) or hidden for screen readers only. Every chart has one. |
71
72
  | Interactive | all | Adds Enarratio's enhancement script to the page. Off by default, so pages stay script-free. |
72
73
 
package/dist/block.d.ts CHANGED
@@ -28,6 +28,7 @@ export interface ChartNode {
28
28
  readonly scale?: string;
29
29
  readonly regression?: boolean;
30
30
  readonly dataTable?: string;
31
+ readonly lang?: string;
31
32
  readonly interactive?: boolean;
32
33
  }
33
34
  /**
package/dist/block.js CHANGED
@@ -101,6 +101,11 @@ export const chartBlock = {
101
101
  initial_value: "linear",
102
102
  },
103
103
  { type: "toggle", action_id: "regression", label: "Scatter: regression line with 95% band" },
104
+ {
105
+ type: "text_input",
106
+ action_id: "lang",
107
+ label: "Language of the chart text, such as de (optional; leave blank for the page's language)",
108
+ },
104
109
  {
105
110
  type: "select",
106
111
  action_id: "dataTable",
package/dist/index.d.ts CHANGED
@@ -10,7 +10,7 @@
10
10
  import type { PluginDescriptor, ResolvedPlugin } from "emdash";
11
11
  export { BLOCK_TYPE, type ChartNode, chartBlock } from "./block.js";
12
12
  /** Kept equal to package.json's version, which a test checks. */
13
- export declare const VERSION = "0.4.4";
13
+ export declare const VERSION = "0.5.0";
14
14
  /** Options for {@link enarratioPlugin}. */
15
15
  export interface EnarratioPluginOptions {
16
16
  /**
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { definePlugin } from "emdash";
2
2
  import { chartBlock } from "./block.js";
3
3
  export { BLOCK_TYPE, chartBlock } from "./block.js";
4
4
  /** Kept equal to package.json's version, which a test checks. */
5
- export const VERSION = "0.4.4";
5
+ export const VERSION = "0.5.0";
6
6
  const ID = "enarratio";
7
7
  const COMPONENTS = {
8
8
  theme: "enarratio-emdash/astro",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "enarratio-emdash",
3
- "version": "0.4.4",
3
+ "version": "0.5.0",
4
4
  "description": "EmDash plugin: a Chart block for the Portable Text editor, drawn on the server by Enarratio as accessible HTML and SVG",
5
5
  "keywords": [
6
6
  "accessibility",
@@ -50,7 +50,7 @@
50
50
  "prepare": "npm run build"
51
51
  },
52
52
  "dependencies": {
53
- "enarratio-astro": "0.4.4"
53
+ "enarratio-astro": "0.5.0"
54
54
  },
55
55
  "peerDependencies": {
56
56
  "astro": ">=6",
@@ -40,6 +40,7 @@ const { node, ...style } = Astro.props;
40
40
  scale={node.scale}
41
41
  regression={node.regression}
42
42
  dataTable={node.dataTable}
43
+ lang={node.lang}
43
44
  id={node._key ? `chart-${node._key}` : undefined}
44
45
  interactive={node.interactive === true}
45
46
  {...style}
package/src/block.ts CHANGED
@@ -30,6 +30,7 @@ export interface ChartNode {
30
30
  readonly scale?: string;
31
31
  readonly regression?: boolean;
32
32
  readonly dataTable?: string;
33
+ readonly lang?: string;
33
34
  readonly interactive?: boolean;
34
35
  }
35
36
 
@@ -135,6 +136,12 @@ export const chartBlock: PortableTextBlockConfig = {
135
136
  initial_value: "linear",
136
137
  },
137
138
  { type: "toggle", action_id: "regression", label: "Scatter: regression line with 95% band" },
139
+ {
140
+ type: "text_input",
141
+ action_id: "lang",
142
+ label:
143
+ "Language of the chart text, such as de (optional; leave blank for the page's language)",
144
+ },
138
145
  {
139
146
  type: "select",
140
147
  action_id: "dataTable",
package/src/index.ts CHANGED
@@ -14,7 +14,7 @@ import { chartBlock } from "./block.js";
14
14
  export { BLOCK_TYPE, type ChartNode, chartBlock } from "./block.js";
15
15
 
16
16
  /** Kept equal to package.json's version, which a test checks. */
17
- export const VERSION = "0.4.4";
17
+ export const VERSION = "0.5.0";
18
18
  const ID = "enarratio";
19
19
 
20
20
  /** Options for {@link enarratioPlugin}. */