@nowline/embed 0.8.6 → 0.10.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.
@@ -1,5 +1,5 @@
1
1
  import { type ParseResult } from '@nowline/browser';
2
- import type { ThemeName } from '@nowline/layout';
2
+ import type { NonWorkingDisplay, ThemeName } from '@nowline/layout';
3
3
  export interface EmbedRenderOptions {
4
4
  theme?: ThemeName;
5
5
  /**
@@ -22,6 +22,13 @@ export interface EmbedRenderOptions {
22
22
  timezone?: string;
23
23
  locale?: string;
24
24
  width?: number;
25
+ /**
26
+ * How a calendar's non-working days appear: `'hide'` collapses them,
27
+ * `'show'` draws them as shaded bands. Wins over the roadmap's own
28
+ * `default roadmap non-working:` key; leave it `undefined` to let the key
29
+ * apply, then `'hide'`.
30
+ */
31
+ nonWorking?: NonWorkingDisplay;
25
32
  /**
26
33
  * Override the deterministic id prefix used for in-SVG `<style>`
27
34
  * scoping. Each block on a page should use a unique prefix so two
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAcA,OAAO,EAMH,KAAK,WAAW,EACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,WAAW,kBAAkB;IAC/B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;;;;;;;;OAUG;IACH,KAAK,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC7B,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;IACxB,8EAA8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,YAAY,CAC9B,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,kBAAuB,GACjC,OAAO,CAAC,MAAM,CAAC,CA0BjB;AAED,qBAAa,gBAAiB,SAAQ,KAAK;aAGnB,OAAO,EAAE,MAAM,EAAE;IAFrC,YACI,OAAO,EAAE,MAAM,EACC,OAAO,EAAE,MAAM,EAAE,EAIpC;CACJ;AAKD,wBAAgB,4BAA4B,IAAI,IAAI,CAGnD"}
package/dist/pipeline.js CHANGED
@@ -33,6 +33,7 @@ export async function renderSource(source, options = {}) {
33
33
  timezone: options.timezone,
34
34
  locale: options.locale,
35
35
  width: options.width,
36
+ nonWorking: options.nonWorking,
36
37
  idPrefix: options.idPrefix,
37
38
  onSkippedInclude: () => {
38
39
  if (!includeWarningEmitted) {
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../src/pipeline.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,uEAAuE;AACvE,oCAAoC;AACpC,EAAE;AACF,iEAAiE;AACjE,0EAA0E;AAC1E,mEAAmE;AACnE,sEAAsE;AACtE,aAAa;AACb,mEAAmE;AACnE,sEAAsE;AACtE,uEAAuE;AACvE,2CAA2C;AAE3C,OAAO,EACH,8BAA8B,EAE9B,WAAW,IAAI,kBAAkB,EACjC,YAAY,IAAI,mBAAmB,GAGtC,MAAM,kBAAkB,CAAC;AAG1B,MAAM,iBAAiB,GAAG,gBAAgB,CAAC;AAuC3C,IAAI,qBAAqB,GAAG,KAAK,CAAC;AAElC,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAAc;IAC5C,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,MAAM,kBAAkB,CAAC,MAAM,EAAE;QAC1D,QAAQ,EAAE,iBAAiB;KAC9B,CAAC,CAAC;IACH,OAAO;QACH,GAAG;QACH,MAAM,EAAE,WAAW;aACd,MAAM,CAAC,CAAC,CAAgB,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,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AAK,CAAC;IAC9B,8BAA8B,EAAE,CAAC;AACrC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nowline/embed",
3
- "version": "0.8.6",
3
+ "version": "0.10.0",
4
4
  "description": "Browser embed bundle for Nowline. Drop a <script> tag and ```nowline``` blocks render in place.",
5
5
  "license": "Apache-2.0",
6
6
  "engines": {
@@ -39,19 +39,19 @@
39
39
  "cdn"
40
40
  ],
41
41
  "dependencies": {
42
- "@nowline/browser": "0.8.6",
43
- "@nowline/core": "0.8.6",
44
- "@nowline/layout": "0.8.6",
45
- "@nowline/renderer": "0.8.6",
46
- "@nowline/share-link": "0.8.6",
42
+ "@nowline/browser": "0.10.0",
43
+ "@nowline/core": "0.10.0",
44
+ "@nowline/layout": "0.10.0",
45
+ "@nowline/renderer": "0.10.0",
46
+ "@nowline/share-link": "0.10.0",
47
47
  "langium": "~4.4.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@types/node": "^26.6.3",
50
+ "@types/node": "^26.6.5",
51
51
  "esbuild": "^0.28.2",
52
- "happy-dom": "^20.14.5",
52
+ "happy-dom": "^21.0.4",
53
53
  "typescript": "^7.0.2",
54
- "vitest": "^5.0.2"
54
+ "vitest": "^5.0.5"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "tsc -b tsconfig.json && node scripts/bundle.mjs",
package/src/auto-scan.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  // with its rendered SVG. Each block gets a unique `idPrefix` so two
4
4
  // roadmaps on the same page never share `<style>` ids.
5
5
 
6
- import type { ThemeName } from '@nowline/layout';
6
+ import type { NonWorkingDisplay, ThemeName } from '@nowline/layout';
7
7
  import { type EmbedRenderOptions, renderSource } from './pipeline.js';
8
8
  import { buildShareLink, type ShareOption } from './share.js';
9
9
 
@@ -12,6 +12,8 @@ export interface AutoScanInputs {
12
12
  theme?: ThemeName;
13
13
  locale?: string;
14
14
  width?: number;
15
+ /** See {@link EmbedRenderOptions.nonWorking}. */
16
+ nonWorking?: NonWorkingDisplay;
15
17
  /** See {@link EmbedRenderOptions.today} — accepts Date, string, null, or undefined. */
16
18
  today?: Date | string | null;
17
19
  /** See {@link EmbedRenderOptions.timezone}. */
@@ -70,6 +72,7 @@ export async function runAutoScan(inputs: AutoScanInputs): Promise<AutoScanResul
70
72
  theme: inputs.theme,
71
73
  locale: inputs.locale,
72
74
  width: inputs.width,
75
+ nonWorking: inputs.nonWorking,
73
76
  today: inputs.today,
74
77
  timezone: inputs.timezone,
75
78
  idPrefix,
package/src/index.ts CHANGED
@@ -12,6 +12,7 @@
12
12
  declare const __NOWLINE_EMBED_VERSION__: string;
13
13
  declare const __NOWLINE_EMBED_SHA__: string;
14
14
 
15
+ import type { NonWorkingDisplay } from '@nowline/layout';
15
16
  import {
16
17
  __resetAutoScanForTests,
17
18
  type AutoScanInputs,
@@ -34,6 +35,7 @@ export {
34
35
  type EmbedParseResult,
35
36
  EmbedRenderError,
36
37
  type EmbedTheme,
38
+ type NonWorkingDisplay,
37
39
  type ShareOption,
38
40
  };
39
41
 
@@ -71,8 +73,15 @@ export interface InitializeOptions {
71
73
  selector?: string;
72
74
  /** BCP-47 locale forwarded to the layout engine for axis labels and the now-pill. */
73
75
  locale?: string;
74
- /** Layout canvas width in pixels. Layout's default is 1280. */
76
+ /** Best-effort maximum canvas width in px. Unset fits the content. */
75
77
  width?: number;
78
+ /**
79
+ * How a calendar's non-working days appear on every block: `'hide'`
80
+ * collapses them, `'show'` draws them as shaded bands. Wins over a
81
+ * roadmap's own `default roadmap non-working:` key. Leave it unset to let
82
+ * each roadmap's key apply, then `'hide'`.
83
+ */
84
+ nonWorking?: NonWorkingDisplay;
76
85
  /**
77
86
  * "Today" override for the now-line. Accepts a `Date`, a YYYY-MM-DD string,
78
87
  * a full ISO 8601 instant (with Z or ±offset), or `null` to suppress the
@@ -109,6 +118,7 @@ interface ResolvedConfig {
109
118
  selector: string;
110
119
  locale?: string;
111
120
  width?: number;
121
+ nonWorking?: NonWorkingDisplay;
112
122
  today?: Date | string | null;
113
123
  timezone?: string;
114
124
  /** System theme captured at init; not reactive to OS theme flips mid-session. */
@@ -137,6 +147,7 @@ export function initialize(options: InitializeOptions = {}): void {
137
147
  selector: options.selector ?? config.selector,
138
148
  locale: options.locale ?? config.locale,
139
149
  width: options.width ?? config.width,
150
+ nonWorking: options.nonWorking ?? config.nonWorking,
140
151
  today: options.today !== undefined ? options.today : config.today,
141
152
  timezone: options.timezone ?? config.timezone,
142
153
  share: options.share ?? config.share,
@@ -155,6 +166,7 @@ function renderOptionsFromConfig(): EmbedRenderOptions {
155
166
  theme: effectiveTheme(config.theme, config.systemTheme),
156
167
  locale: config.locale,
157
168
  width: config.width,
169
+ nonWorking: config.nonWorking,
158
170
  today: config.today,
159
171
  timezone: config.timezone,
160
172
  };
@@ -193,6 +205,7 @@ export async function init(overrides?: Partial<AutoScanInputs>): Promise<AutoSca
193
205
  theme: overrides?.theme ?? renderOptionsFromConfig().theme,
194
206
  locale: overrides?.locale ?? config.locale,
195
207
  width: overrides?.width ?? config.width,
208
+ nonWorking: overrides?.nonWorking ?? config.nonWorking,
196
209
  today: overrides?.today !== undefined ? overrides.today : config.today,
197
210
  timezone: overrides?.timezone ?? config.timezone,
198
211
  share: overrides?.share ?? config.share,
package/src/pipeline.ts CHANGED
@@ -20,7 +20,7 @@ import {
20
20
  type DiagnosticRow,
21
21
  type ParseResult,
22
22
  } from '@nowline/browser';
23
- import type { ThemeName } from '@nowline/layout';
23
+ import type { NonWorkingDisplay, ThemeName } from '@nowline/layout';
24
24
 
25
25
  const EMBED_SOURCE_PATH = '/embed.nowline';
26
26
 
@@ -46,6 +46,13 @@ export interface EmbedRenderOptions {
46
46
  timezone?: string;
47
47
  locale?: string;
48
48
  width?: number;
49
+ /**
50
+ * How a calendar's non-working days appear: `'hide'` collapses them,
51
+ * `'show'` draws them as shaded bands. Wins over the roadmap's own
52
+ * `default roadmap non-working:` key; leave it `undefined` to let the key
53
+ * apply, then `'hide'`.
54
+ */
55
+ nonWorking?: NonWorkingDisplay;
49
56
  /**
50
57
  * Override the deterministic id prefix used for in-SVG `<style>`
51
58
  * scoping. Each block on a page should use a unique prefix so two
@@ -86,6 +93,7 @@ export async function renderSource(
86
93
  timezone: options.timezone,
87
94
  locale: options.locale,
88
95
  width: options.width,
96
+ nonWorking: options.nonWorking,
89
97
  idPrefix: options.idPrefix,
90
98
  onSkippedInclude: () => {
91
99
  if (!includeWarningEmitted) {