@diagrammo/dgmo 0.50.1 → 0.50.2

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/advanced.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  renderCountdown,
3
3
  renderCountdownForExport
4
- } from "./chunk-Y4RNXEAO.js";
4
+ } from "./chunk-T5SHNNGP.js";
5
5
  import {
6
6
  formatTime,
7
7
  handAngles,
@@ -10,7 +10,7 @@ import {
10
10
  sunLine,
11
11
  workStatus,
12
12
  zoneParts
13
- } from "./chunk-7PQYTZMA.js";
13
+ } from "./chunk-5WFIYXQ6.js";
14
14
  import {
15
15
  layoutBracket,
16
16
  renderBracket,
@@ -321,7 +321,7 @@ import {
321
321
  renderSlopeChart,
322
322
  renderVenn,
323
323
  renderWordCloud
324
- } from "./chunk-ZAD4HV2G.js";
324
+ } from "./chunk-SVTI362O.js";
325
325
  import {
326
326
  formatDateLabel,
327
327
  renderTimeline
@@ -346,7 +346,7 @@ import {
346
346
  parseDgmo,
347
347
  parseDgmoChartType,
348
348
  parseVisualization
349
- } from "./chunk-VVZRV54S.js";
349
+ } from "./chunk-KQ57MHRO.js";
350
350
  import {
351
351
  parseGoal
352
352
  } from "./chunk-Q4V4XQWV.js";
@@ -385,7 +385,7 @@ import "./chunk-BDXC7MDK.js";
385
385
  import {
386
386
  renderLegendSvg,
387
387
  renderLegendSvgFromConfig
388
- } from "./chunk-4S52SK6G.js";
388
+ } from "./chunk-QJJZSROI.js";
389
389
  import "./chunk-HGN652MU.js";
390
390
  import "./chunk-U6EQI3U6.js";
391
391
  import {
@@ -406,7 +406,7 @@ import {
406
406
  parseChart,
407
407
  parseDataRowValues,
408
408
  parseExtendedChart
409
- } from "./chunk-XDXNDSKO.js";
409
+ } from "./chunk-XEGTMVYY.js";
410
410
  import {
411
411
  parseWireframe
412
412
  } from "./chunk-I2WKW7C7.js";
package/dist/auto.d.ts ADDED
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Shared browser-embed helpers for the `@diagrammo/dgmo` client-side
3
+ * drop-ins (`./auto` script-tag renderer and `./element` custom element).
4
+ *
5
+ * These are the SVG sanitizer, theme resolver, the standard-block DOM
6
+ * assembler (canonical chrome from `src/embed` — BL-114), the error card,
7
+ * aria-label derivation, style injection, and share-URL builder — factored
8
+ * out of `auto/index.ts` so the two entries share one implementation rather
9
+ * than diverging copies. The `auto` entry's public `window.dgmo` surface is
10
+ * unaffected; it imports from here.
11
+ */
12
+ declare const VERSION: string;
13
+
14
+ type ThemePreference = 'auto' | 'light' | 'dark' | 'transparent';
15
+ declare function resolveTheme(theme: ThemePreference | undefined): 'light' | 'dark' | 'transparent';
16
+
17
+ /**
18
+ * `@diagrammo/dgmo/auto` — IIFE-distributed auto-renderer for static HTML.
19
+ *
20
+ * Drop a `<script src="…/auto.js">` on any page; on `DOMContentLoaded`
21
+ * this module scans for `.dgmo, .language-dgmo`, runs `render()`, and
22
+ * replaces each match with the standard DGMO embed block (BL-114,
23
+ * `figure.dgmo.dgmo-rendered`) — the diagram plus a hover-reveal icon
24
+ * toolbar with view-source, Copy, and "Open in editor" actions.
25
+ *
26
+ * Public API: frozen `window.dgmo` and alias `window.diagrammo` with
27
+ * `{ initialize, run, version }`. Configuration is read from the
28
+ * bundle's own `<script data-config='{…}'>` (JSON with strict
29
+ * allowlist) or via `dgmo.initialize(opts)` for `data-auto="false"`
30
+ * embedders.
31
+ */
32
+
33
+ interface AutoConfig {
34
+ theme?: 'auto' | 'light' | 'dark' | 'transparent';
35
+ palette?: string;
36
+ showSource?: boolean;
37
+ showEditorLink?: boolean;
38
+ }
39
+ interface RunOptions {
40
+ nodes?: Element[] | NodeListOf<Element>;
41
+ }
42
+
43
+ declare function findScriptTag(): HTMLScriptElement | null;
44
+ declare function parseConfig(raw: string | null | undefined): Partial<AutoConfig>;
45
+ declare function selectTargets(root?: ParentNode): Element[];
46
+ declare function initialize(opts?: AutoConfig): void;
47
+ declare function run(opts?: RunOptions): Promise<void>;
48
+ declare const api: Readonly<{
49
+ initialize: typeof initialize;
50
+ run: typeof run;
51
+ version: string;
52
+ }>;
53
+
54
+ export { type AutoConfig, type RunOptions, VERSION, api as default, findScriptTag, initialize, parseConfig, resolveTheme, run, selectTargets };