executable-stories-react 0.14.0 → 0.15.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/interactive.cjs +310 -232
- package/dist/interactive.cjs.map +1 -1
- package/dist/interactive.d.cts +4 -0
- package/dist/interactive.d.ts +4 -0
- package/dist/interactive.js +272 -194
- package/dist/interactive.js.map +1 -1
- package/dist/report-island.global.js +43 -42
- package/dist/ssr.cjs +5 -2
- package/dist/ssr.cjs.map +1 -1
- package/dist/ssr.d.cts +4 -0
- package/dist/ssr.d.ts +4 -0
- package/dist/ssr.js +5 -2
- package/dist/ssr.js.map +1 -1
- package/dist/tailwind.css +1 -1
- package/package.json +2 -2
package/dist/ssr.d.cts
CHANGED
|
@@ -87,6 +87,10 @@ interface RenderReportToHtmlOptions {
|
|
|
87
87
|
* static (non-island) output.
|
|
88
88
|
*/
|
|
89
89
|
scenarioHistory?: ScenarioHistoryMap;
|
|
90
|
+
/** Show the Share button in the interactive header (default false). `--html-share` turns it on. */
|
|
91
|
+
share?: boolean;
|
|
92
|
+
/** Command the share dialog hands over, e.g. `npx executable-stories share reports/`. */
|
|
93
|
+
shareCommand?: string;
|
|
90
94
|
}
|
|
91
95
|
/**
|
|
92
96
|
* Render a StoryReport (or a parse Result) to a complete, self-contained HTML
|
package/dist/ssr.d.ts
CHANGED
|
@@ -87,6 +87,10 @@ interface RenderReportToHtmlOptions {
|
|
|
87
87
|
* static (non-island) output.
|
|
88
88
|
*/
|
|
89
89
|
scenarioHistory?: ScenarioHistoryMap;
|
|
90
|
+
/** Show the Share button in the interactive header (default false). `--html-share` turns it on. */
|
|
91
|
+
share?: boolean;
|
|
92
|
+
/** Command the share dialog hands over, e.g. `npx executable-stories share reports/`. */
|
|
93
|
+
shareCommand?: string;
|
|
90
94
|
}
|
|
91
95
|
/**
|
|
92
96
|
* Render a StoryReport (or a parse Result) to a complete, self-contained HTML
|
package/dist/ssr.js
CHANGED
|
@@ -1814,7 +1814,9 @@ function renderReportToHtml(report, options = {}) {
|
|
|
1814
1814
|
mermaid = true,
|
|
1815
1815
|
islandScript = "",
|
|
1816
1816
|
staleAfterDays = 7,
|
|
1817
|
-
scenarioHistory
|
|
1817
|
+
scenarioHistory,
|
|
1818
|
+
share = false,
|
|
1819
|
+
shareCommand = ""
|
|
1818
1820
|
} = options;
|
|
1819
1821
|
const markup = renderToStaticMarkup(
|
|
1820
1822
|
createElement(Report, { report, title })
|
|
@@ -1827,7 +1829,8 @@ function renderReportToHtml(report, options = {}) {
|
|
|
1827
1829
|
const historyScript = interactive && scenarioHistory && Object.keys(scenarioHistory).length > 0 ? `<script type="application/json" id="${HISTORY_ID}">${escapeJsonForScript(JSON.stringify(scenarioHistory))}</script>` : "";
|
|
1828
1830
|
const islandTag = interactive ? `<script>${islandScript}</script>` : "";
|
|
1829
1831
|
const cdnBody = interactive ? "" : cdn.body;
|
|
1830
|
-
const
|
|
1832
|
+
const shareAttrs = share ? ` data-es-share="true"${shareCommand ? ` data-es-share-cmd="${escapeHtml(shareCommand)}"` : ""}` : "";
|
|
1833
|
+
const islandConfigAttrs = interactive ? ` data-es-syntax="${syntaxHighlighting ? "true" : "false"}" data-es-mermaid="${mermaid ? "true" : "false"}" data-es-stale-days="${Number.isFinite(staleAfterDays) && staleAfterDays >= 0 ? staleAfterDays : 7}"${shareAttrs}` : "";
|
|
1831
1834
|
const rootAttrs = interactive ? ` id="${ROOT_ID}" data-title="${escapeHtml(title)}"${islandConfigAttrs}` : "";
|
|
1832
1835
|
return `<!DOCTYPE html>
|
|
1833
1836
|
<html lang="${escapeHtml(lang)}" data-theme="${theme === "dark" ? "dark" : "light"}">
|