@squadbase/vantage 0.6.2-dev1.b332e5a → 0.6.2-dev1.b40ce36
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/add-4GHF2TX2.js +6 -0
- package/dist/add-4GHF2TX2.js.map +1 -0
- package/dist/{build-TVKFIVFQ.js → build-A23M4GCH.js} +9 -9
- package/dist/{build-TVKFIVFQ.js.map → build-A23M4GCH.js.map} +1 -1
- package/dist/{check-3KHZXZMQ.js → check-FBHT6W6J.js} +7 -7
- package/dist/{check-3KHZXZMQ.js.map → check-FBHT6W6J.js.map} +1 -1
- package/dist/chunk-2IAPIOPS.js +152 -0
- package/dist/chunk-2IAPIOPS.js.map +1 -0
- package/dist/{chunk-5ZOP4SQR.js → chunk-2N72FKLB.js} +12 -7
- package/dist/chunk-2N72FKLB.js.map +1 -0
- package/dist/chunk-57GHR5LN.js +163 -0
- package/dist/chunk-57GHR5LN.js.map +1 -0
- package/dist/{chunk-P7W4LR3Z.js → chunk-5C2SEDPH.js} +22 -5
- package/dist/chunk-5C2SEDPH.js.map +1 -0
- package/dist/chunk-6OTTGAPO.js +44 -0
- package/dist/chunk-6OTTGAPO.js.map +1 -0
- package/dist/{chunk-RPZAALCX.js → chunk-7S52M2SL.js} +256 -165
- package/dist/chunk-7S52M2SL.js.map +1 -0
- package/dist/{chunk-U2M6HGKQ.js → chunk-AABMKHEU.js} +4 -4
- package/dist/{chunk-U2M6HGKQ.js.map → chunk-AABMKHEU.js.map} +1 -1
- package/dist/{chunk-PVTHHV7X.js → chunk-ANZLVSEP.js} +28 -7
- package/dist/chunk-ANZLVSEP.js.map +1 -0
- package/dist/chunk-CKWPK4RO.js +50 -0
- package/dist/chunk-CKWPK4RO.js.map +1 -0
- package/dist/{chunk-QI3XQKHS.js → chunk-GNXCX4WE.js} +10 -3
- package/dist/chunk-GNXCX4WE.js.map +1 -0
- package/dist/chunk-JXFCSF3K.js +673 -0
- package/dist/chunk-JXFCSF3K.js.map +1 -0
- package/dist/{chunk-PXRX5PEC.js → chunk-PDOBHMUQ.js} +3 -3
- package/dist/chunk-PDOBHMUQ.js.map +1 -0
- package/dist/chunk-QOXXOFGL.js +7051 -0
- package/dist/chunk-QOXXOFGL.js.map +1 -0
- package/dist/{chunk-ZVANIULZ.js → chunk-RNTDBX6S.js} +4 -4
- package/dist/{chunk-ZVANIULZ.js.map → chunk-RNTDBX6S.js.map} +1 -1
- package/dist/{chunk-CEXAQQ5W.js → chunk-S5MDTHH7.js} +180 -18
- package/dist/chunk-S5MDTHH7.js.map +1 -0
- package/dist/chunk-SDJTTMLK.js +1877 -0
- package/dist/chunk-SDJTTMLK.js.map +1 -0
- package/dist/{chunk-LMUACBMA.js → chunk-SHZM3EXB.js} +68 -12
- package/dist/chunk-SHZM3EXB.js.map +1 -0
- package/dist/{chunk-A2UUGASH.js → chunk-U736PVHY.js} +2 -2
- package/dist/chunk-U736PVHY.js.map +1 -0
- package/dist/{chunk-JKLLFVEU.js → chunk-UWSQUHX6.js} +4 -99
- package/dist/chunk-UWSQUHX6.js.map +1 -0
- package/dist/cli.js +12 -11
- package/dist/cli.js.map +1 -1
- package/dist/client/index.d.ts +34 -3
- package/dist/client/index.js +211 -12
- package/dist/client/index.js.map +1 -1
- package/dist/components/index.d.ts +1740 -29
- package/dist/components/index.js +7 -4
- package/dist/delta-text-CvwBGJ95.d.ts +15 -0
- package/dist/{dev-GDKATCC7.js → dev-H4I2JL63.js} +10 -10
- package/dist/dev-H4I2JL63.js.map +1 -0
- package/dist/doc/index.d.ts +215 -2
- package/dist/doc/index.js +309 -5
- package/dist/doc/index.js.map +1 -1
- package/dist/{docs-EJJ3BECT.js → docs-JVP4RPKT.js} +3 -3
- package/dist/{docs-EJJ3BECT.js.map → docs-JVP4RPKT.js.map} +1 -1
- package/dist/{doctor-WQXPXP6K.js → doctor-B2O3GJDU.js} +7 -7
- package/dist/{doctor-WQXPXP6K.js.map → doctor-B2O3GJDU.js.map} +1 -1
- package/dist/format-U0cQl069.d.ts +243 -0
- package/dist/markdown/index.js +1 -1
- package/dist/markdown/index.js.map +1 -1
- package/dist/{preview-OGMCNQUO.js → preview-T6CLSQVX.js} +3 -3
- package/dist/{preview-OGMCNQUO.js.map → preview-T6CLSQVX.js.map} +1 -1
- package/dist/query/index.d.ts +0 -11
- package/dist/query/index.js +2 -2
- package/dist/{routes-MWBWWOJ2.js → routes-PVKNT777.js} +6 -6
- package/dist/{routes-MWBWWOJ2.js.map → routes-PVKNT777.js.map} +1 -1
- package/dist/{search-6Y422SV6.js → search-5LC4XPB5.js} +3 -3
- package/dist/{search-6Y422SV6.js.map → search-5LC4XPB5.js.map} +1 -1
- package/dist/slide/index.d.ts +272 -1
- package/dist/slide/index.js +974 -4
- package/dist/slide/index.js.map +1 -1
- package/dist/table/index.js +14 -10
- package/dist/table/index.js.map +1 -1
- package/dist/ui/index.d.ts +148 -12
- package/dist/ui/index.js +1340 -88
- package/dist/ui/index.js.map +1 -1
- package/dist/{upgrade-HCANX4GQ.js → upgrade-6DT7ADRP.js} +7 -7
- package/dist/{upgrade-HCANX4GQ.js.map → upgrade-6DT7ADRP.js.map} +1 -1
- package/dist/vite/index.d.ts +10 -0
- package/dist/vite/index.js +4 -4
- package/docs/en/changelog.md +2 -0
- package/docs/en/components.md +42 -17
- package/docs/en/doc/delta-text.md +40 -0
- package/docs/en/doc/doc-action-items.md +49 -0
- package/docs/en/doc/doc-callout.md +38 -0
- package/docs/en/doc/doc-data-table.md +60 -0
- package/docs/en/doc/doc-executive-summary.md +64 -0
- package/docs/en/doc/doc-figure.md +56 -0
- package/docs/en/doc/doc-key-findings.md +61 -0
- package/docs/en/doc/doc-kpi-scorecard.md +80 -0
- package/docs/en/doc/doc-notes-and-sources.md +43 -0
- package/docs/en/doc/doc-report-header.md +46 -0
- package/docs/en/pages-and-metadata.md +15 -0
- package/docs/en/parts/area-chart.md +99 -0
- package/docs/en/parts/bar-chart.md +91 -0
- package/docs/en/parts/bar-list.md +50 -0
- package/docs/en/parts/category-bar.md +37 -0
- package/docs/en/parts/chart-frame.md +39 -0
- package/docs/en/parts/data-table.md +22 -0
- package/docs/en/parts/delta.md +51 -0
- package/docs/en/parts/donut-chart.md +72 -0
- package/docs/en/parts/format.md +43 -0
- package/docs/en/parts/funnel-steps.md +2 -1
- package/docs/en/parts/heatmap.md +53 -0
- package/docs/en/parts/kpi-card.md +58 -0
- package/docs/en/parts/legend.md +35 -0
- package/docs/en/parts/line-chart.md +94 -0
- package/docs/en/parts/metric-value.md +3 -2
- package/docs/en/parts/progress-circle.md +33 -0
- package/docs/en/parts/sample-data.md +39 -0
- package/docs/en/parts/scatter-chart.md +56 -0
- package/docs/en/parts/sparkline.md +1 -1
- package/docs/en/parts/tracker.md +36 -0
- package/docs/en/parts/trend-indicator.md +17 -1
- package/docs/en/parts/updated-at.md +30 -0
- package/docs/en/parts/waterfall-chart.md +56 -0
- package/docs/en/slide/slide-chart-full.md +48 -0
- package/docs/en/slide/slide-chart-insight.md +52 -0
- package/docs/en/slide/slide-columns.md +46 -0
- package/docs/en/slide/slide-comparison.md +68 -0
- package/docs/en/slide/slide-cover.md +39 -0
- package/docs/en/slide/slide-exec-summary.md +47 -0
- package/docs/en/slide/slide-heading.md +38 -0
- package/docs/en/slide/slide-kpi-grid.md +55 -0
- package/docs/en/slide/slide-kpi-hero.md +58 -0
- package/docs/en/slide/slide-next-actions.md +49 -0
- package/docs/en/slide/slide-scorecard-table.md +54 -0
- package/docs/en/slide/slide-section.md +44 -0
- package/docs/en/slide/slide-source-line.md +34 -0
- package/docs/en/ui/alert-dialog.md +42 -0
- package/docs/en/ui/avatar.md +31 -0
- package/docs/en/ui/combobox.md +74 -0
- package/docs/en/ui/drawer.md +41 -0
- package/docs/en/ui/empty.md +1 -1
- package/docs/en/ui/error-state.md +4 -3
- package/docs/en/ui/field.md +42 -0
- package/docs/en/ui/hover-card.md +21 -0
- package/docs/en/ui/kbd.md +17 -0
- package/docs/en/ui/loading.md +1 -1
- package/docs/en/ui/pagination.md +36 -0
- package/docs/en/ui/radio-group.md +21 -0
- package/docs/en/ui/toast.md +44 -0
- package/docs/en/ui/toggle-group.md +4 -3
- package/docs/en/ui-and-theming.md +1 -1
- package/docs/index.json +1184 -114
- package/docs/ja/changelog.md +33 -0
- package/docs/ja/components.md +68 -101
- package/docs/ja/doc/delta-text.md +40 -0
- package/docs/ja/doc/doc-action-items.md +49 -0
- package/docs/ja/doc/doc-callout.md +38 -0
- package/docs/ja/doc/doc-data-table.md +60 -0
- package/docs/ja/doc/doc-executive-summary.md +64 -0
- package/docs/ja/doc/doc-figure.md +56 -0
- package/docs/ja/doc/doc-key-findings.md +61 -0
- package/docs/ja/doc/doc-kpi-scorecard.md +80 -0
- package/docs/ja/doc/doc-notes-and-sources.md +43 -0
- package/docs/ja/doc/doc-report-header.md +46 -0
- package/docs/ja/page-types/csv.md +83 -0
- package/docs/ja/page-types/doc.md +83 -0
- package/docs/ja/page-types/excel.md +82 -0
- package/docs/ja/page-types/slide.md +133 -0
- package/docs/ja/page-types.md +47 -0
- package/docs/ja/pages-and-metadata.md +15 -0
- package/docs/ja/parts/area-chart.md +85 -0
- package/docs/ja/parts/bar-chart.md +95 -0
- package/docs/ja/parts/bar-list.md +58 -0
- package/docs/ja/parts/category-bar.md +36 -0
- package/docs/ja/parts/chart-frame.md +36 -0
- package/docs/ja/parts/data-table.md +22 -0
- package/docs/ja/parts/delta.md +51 -0
- package/docs/ja/parts/donut-chart.md +66 -0
- package/docs/ja/parts/echart.md +3 -0
- package/docs/ja/parts/format.md +44 -0
- package/docs/ja/parts/funnel-steps.md +27 -8
- package/docs/ja/parts/heatmap.md +45 -0
- package/docs/ja/parts/kpi-card.md +56 -0
- package/docs/ja/parts/legend.md +36 -0
- package/docs/ja/parts/line-chart.md +84 -0
- package/docs/ja/parts/metric-value.md +3 -2
- package/docs/ja/parts/progress-circle.md +34 -0
- package/docs/ja/parts/sample-data.md +61 -0
- package/docs/ja/parts/scatter-chart.md +69 -0
- package/docs/ja/parts/sparkline.md +2 -2
- package/docs/ja/parts/tracker.md +32 -0
- package/docs/ja/parts/trend-indicator.md +17 -1
- package/docs/ja/parts/updated-at.md +27 -0
- package/docs/ja/parts/waterfall-chart.md +61 -0
- package/docs/ja/routing.md +8 -86
- package/docs/ja/slide/slide-chart-full.md +48 -0
- package/docs/ja/slide/slide-chart-insight.md +52 -0
- package/docs/ja/slide/slide-columns.md +46 -0
- package/docs/ja/slide/slide-comparison.md +68 -0
- package/docs/ja/slide/slide-cover.md +39 -0
- package/docs/ja/slide/slide-exec-summary.md +47 -0
- package/docs/ja/slide/slide-heading.md +38 -0
- package/docs/ja/slide/slide-kpi-grid.md +55 -0
- package/docs/ja/slide/slide-kpi-hero.md +58 -0
- package/docs/ja/slide/slide-next-actions.md +49 -0
- package/docs/ja/slide/slide-scorecard-table.md +54 -0
- package/docs/ja/slide/slide-section.md +44 -0
- package/docs/ja/slide/slide-source-line.md +34 -0
- package/docs/ja/ui/alert-dialog.md +41 -0
- package/docs/ja/ui/avatar.md +31 -0
- package/docs/ja/ui/combobox.md +74 -0
- package/docs/ja/ui/drawer.md +41 -0
- package/docs/ja/ui/empty.md +1 -1
- package/docs/ja/ui/error-state.md +4 -3
- package/docs/ja/ui/field.md +42 -0
- package/docs/ja/ui/hover-card.md +21 -0
- package/docs/ja/ui/kbd.md +16 -0
- package/docs/ja/ui/loading.md +1 -1
- package/docs/ja/ui/pagination.md +36 -0
- package/docs/ja/ui/radio-group.md +21 -0
- package/docs/ja/ui/toast.md +46 -0
- package/docs/ja/ui/toggle-group.md +4 -3
- package/docs/ja/ui-and-theming.md +14 -7
- package/package.json +33 -23
- package/registry/ui/accordion.tsx +76 -0
- package/registry/ui/alert-dialog.tsx +189 -0
- package/registry/ui/alert.tsx +80 -0
- package/registry/ui/app-shell.tsx +287 -0
- package/registry/ui/area-chart.tsx +3701 -0
- package/registry/ui/attention-list.tsx +303 -0
- package/registry/ui/avatar.tsx +110 -0
- package/registry/ui/badge.tsx +56 -0
- package/registry/ui/bar-chart.tsx +3698 -0
- package/registry/ui/bar-list.tsx +3743 -0
- package/registry/ui/box-plot-chart.tsx +3906 -0
- package/registry/ui/breadcrumb.tsx +128 -0
- package/registry/ui/button.tsx +62 -0
- package/registry/ui/calendar.tsx +223 -0
- package/registry/ui/card.tsx +107 -0
- package/registry/ui/category-bar.tsx +1290 -0
- package/registry/ui/chart-frame.tsx +1393 -0
- package/registry/ui/checkbox.tsx +30 -0
- package/registry/ui/collapsible.tsx +23 -0
- package/registry/ui/combobox.tsx +310 -0
- package/registry/ui/command.tsx +198 -0
- package/registry/ui/dashboard-card.tsx +217 -0
- package/registry/ui/data-table.tsx +693 -146
- package/registry/ui/date-range-picker.tsx +390 -0
- package/registry/ui/delta.tsx +191 -0
- package/registry/ui/dialog.tsx +161 -0
- package/registry/ui/donut-chart.tsx +3751 -0
- package/registry/ui/drawer.tsx +229 -0
- package/registry/ui/dropdown-menu.tsx +274 -0
- package/registry/ui/echart.tsx +1040 -0
- package/registry/ui/field.tsx +240 -0
- package/registry/ui/filter-bar.tsx +392 -0
- package/registry/ui/funnel-steps.tsx +3569 -0
- package/registry/ui/heatmap.tsx +1786 -0
- package/registry/ui/histogram-chart.tsx +3986 -0
- package/registry/ui/hover-card.tsx +52 -0
- package/registry/ui/input-group.tsx +160 -0
- package/registry/ui/input.tsx +24 -0
- package/registry/ui/kbd.tsx +30 -0
- package/registry/ui/kpi-card.tsx +704 -0
- package/registry/ui/label.tsx +22 -0
- package/registry/ui/legend.tsx +3563 -0
- package/registry/ui/line-chart.tsx +3699 -0
- package/registry/ui/metric-value.tsx +62 -0
- package/registry/ui/multi-select.tsx +232 -0
- package/registry/ui/page-shell.tsx +282 -0
- package/registry/ui/pagination.tsx +140 -0
- package/registry/ui/paired-chart.tsx +3827 -0
- package/registry/ui/placeholder.tsx +36 -0
- package/registry/ui/popover.tsx +92 -0
- package/registry/ui/progress-circle.tsx +867 -0
- package/registry/ui/progress.tsx +85 -0
- package/registry/ui/radio-group.tsx +39 -0
- package/registry/ui/sample-data.tsx +86 -0
- package/registry/ui/scatter-chart.tsx +4212 -0
- package/registry/ui/scroll-area.tsx +56 -0
- package/registry/ui/searchable-select.tsx +214 -0
- package/registry/ui/section-header.tsx +43 -0
- package/registry/ui/segmented-control.tsx +76 -0
- package/registry/ui/select.tsx +255 -0
- package/registry/ui/separator.tsx +27 -0
- package/registry/ui/sheet.tsx +139 -0
- package/registry/ui/sidebar.tsx +725 -0
- package/registry/ui/skeleton.tsx +17 -0
- package/registry/ui/slider.tsx +56 -0
- package/registry/ui/sparkline.tsx +230 -0
- package/registry/ui/spinner.tsx +14 -0
- package/registry/ui/states.tsx +90 -0
- package/registry/ui/status-badge.tsx +121 -0
- package/registry/ui/switch.tsx +34 -0
- package/registry/ui/table.tsx +118 -0
- package/registry/ui/tabs.tsx +84 -0
- package/registry/ui/textarea.tsx +22 -0
- package/registry/ui/toast.tsx +250 -0
- package/registry/ui/toggle-group.tsx +91 -0
- package/registry/ui/toggle.tsx +47 -0
- package/registry/ui/tooltip.tsx +72 -0
- package/registry/ui/tracker.tsx +849 -0
- package/registry/ui/trend-indicator.tsx +74 -0
- package/registry/ui/updated-at.tsx +122 -0
- package/registry/ui/waterfall-chart.tsx +4248 -0
- package/skills/vantage-add-feature/SKILL.md +9 -7
- package/skills/vantage-design/SKILL.md +34 -24
- package/skills/vantage-design/references/extract.md +16 -14
- package/skills/vantage-design/references/format.md +6 -5
- package/skills/vantage-design/references/presets.md +60 -110
- package/skills/vantage-pitfalls/SKILL.md +10 -1
- package/skills/vantage-slide/SKILL.md +54 -36
- package/templates/AGENTS.md +26 -3
- package/templates/agents/csv.md +2 -1
- package/templates/agents/doc.md +52 -3
- package/templates/agents/page.md +52 -7
- package/templates/agents/slide.md +70 -2
- package/templates/agents/xlsx.md +2 -1
- package/theme.css +247 -138
- package/dist/add-DY4AXANK.js +0 -6
- package/dist/add-DY4AXANK.js.map +0 -1
- package/dist/chunk-5ZOP4SQR.js.map +0 -1
- package/dist/chunk-A2UUGASH.js.map +0 -1
- package/dist/chunk-CEXAQQ5W.js.map +0 -1
- package/dist/chunk-DTDVSFRY.js +0 -29
- package/dist/chunk-DTDVSFRY.js.map +0 -1
- package/dist/chunk-JKLLFVEU.js.map +0 -1
- package/dist/chunk-LMUACBMA.js.map +0 -1
- package/dist/chunk-NKFBFDRZ.js +0 -2241
- package/dist/chunk-NKFBFDRZ.js.map +0 -1
- package/dist/chunk-P7W4LR3Z.js.map +0 -1
- package/dist/chunk-PVTHHV7X.js.map +0 -1
- package/dist/chunk-PXRX5PEC.js.map +0 -1
- package/dist/chunk-QI3XQKHS.js.map +0 -1
- package/dist/chunk-RPZAALCX.js.map +0 -1
- package/dist/chunk-VA776YE5.js +0 -316
- package/dist/chunk-VA776YE5.js.map +0 -1
- package/dist/dev-GDKATCC7.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/preview.ts"],"names":[],"mappings":";;;;;;;AAYA,eAAsB,OAAA,CAAQ,MAAc,IAAA,EAAmC;AAC7E,EAAA,MAAM,YAAA,GAAe,IAAA,CAAK,IAAA,CAAK,IAAA,EAAM,QAAQ,uBAAuB,CAAA;AACpE,EAAA,IAAI,CAAC,EAAA,CAAG,UAAA,CAAW,YAAY,CAAA,EAAG;AAChC,IAAA,GAAA,CAAI,MAAM,4CAA4C,CAAA;AACtD,IAAA,OAAO,CAAA;AAAA,EACT;AACA,EAAA,MAAM,WAAW,IAAA,CAAK,KAAA,CAAM,GAAG,YAAA,CAAa,YAAA,EAAc,MAAM,CAAC,CAAA;AACjE,EAAA,MAAM,KAAA,GAAQ,kBAAA,CAAmB,IAAA,CAAK,KAAA,EAAO,IAAI,CAAA;AACjD,EAAA,IAAI,CAAC,MAAM,EAAA,EAAI;AACb,IAAA,GAAA,CAAI,KAAA,CAAM,MAAM,KAAK,CAAA;AACrB,IAAA,OAAO,CAAA;AAAA,EACT;AACA,EAAA,MAAM,EAAE,IA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s from \"node:fs\"\nimport path from \"node:path\"\nimport { spawn } from \"node:child_process\"\nimport {\n log,\n reportPortInUse,\n resolveHostOptions,\n resolvePortOptions,\n type ParsedArgs,\n} from \"./util\"\n\n/** `vantage preview` — run the production build locally. */\nexport async function preview(root: string, args: ParsedArgs): Promise<number> {\n const manifestPath = path.join(root, \"dist\", \"vantage-manifest.json\")\n if (!fs.existsSync(manifestPath)) {\n log.error(\"No build found. Run `vantage build` first.\")\n return 1\n }\n const manifest = JSON.parse(fs.readFileSync(manifestPath, \"utf8\")) as { mode: string }\n const ports = resolvePortOptions(args.flags, 4173)\n if (!ports.ok) {\n log.error(ports.error)\n return 1\n }\n const { port, strictPort } = ports\n const hosts = resolveHostOptions(args.flags)\n if (!hosts.ok) {\n log.error(hosts.error)\n return 1\n }\n\n if (manifest.mode === \"fullstack\") {\n const serverPath = path.join(root, \"dist\", \"server\", \"index.mjs\")\n if (!fs.existsSync(serverPath)) {\n log.error(\"Server bundle missing. Re-run `vantage build`.\")\n return 1\n }\n // The production Node server binds exactly one port and exits on EADDRINUSE,\n // so a fullstack preview is always strict — there is no walk to opt out of.\n if (!strictPort) log.info(\" --no-strict-port has no effect on a fullstack preview\")\n // The Node server listens on every interface and does no Host check, so\n // there is nothing for these to configure there.\n if (Object.keys(hosts.options).length) {\n log.info(\" --host / --allowed-hosts have no effect on a fullstack preview\")\n }\n log.brand(`preview (fullstack) → http://localhost:${port}`)\n const child = spawn(process.execPath, [serverPath], {\n stdio: \"inherit\",\n env: { ...process.env, PORT: String(port) },\n })\n return new Promise<number>((resolve) => {\n child.on(\"exit\", (code) => resolve(code ?? 0))\n const stop = () => child.kill(\"SIGINT\")\n process.on(\"SIGINT\", stop)\n process.on(\"SIGTERM\", stop)\n })\n }\n\n // SPA-only preview via Vite's static preview server.\n const { preview: vitePreview } = await import(\"vite\")\n let server: Awaited<ReturnType<typeof vitePreview>>\n try {\n server = await vitePreview({\n configFile: false,\n root,\n build: { outDir: path.join(root, \"dist\", \"client\") },\n preview: { port, strictPort, ...hosts.options },\n })\n } catch (err) {\n if (reportPortInUse(err, port, strictPort)) return 1\n throw err\n }\n log.brand(\"preview (spa)\")\n server.printUrls()\n return new Promise<number>(() => {})\n}\n"]}
|
package/dist/query/index.d.ts
CHANGED
|
@@ -8,17 +8,6 @@ export { QueryClient, QueryKey, UseInfiniteQueryOptions, UseMutationOptions, Use
|
|
|
8
8
|
*/
|
|
9
9
|
declare function createQueryClient(): QueryClient;
|
|
10
10
|
|
|
11
|
-
/**
|
|
12
|
-
* The one seam for calling the API from client code. All `/api/*` requests go
|
|
13
|
-
* through here so a split deployment (client on S3/CloudFront, server on Lambda)
|
|
14
|
-
* can point the client at a different origin without touching page code.
|
|
15
|
-
*
|
|
16
|
-
* The base is read from `import.meta.env.PUBLIC_API_BASE_URL` — a `PUBLIC_`
|
|
17
|
-
* prefixed var so it is inlined into the client bundle (see envPrefix in the
|
|
18
|
-
* Vite plugin). It can be set in `.env` or injected at build time via
|
|
19
|
-
* `vantage build --api-base-url <url>`. When unset it is empty, so requests stay
|
|
20
|
-
* same-origin relative paths — identical to hand-written `fetch("/api/...")`.
|
|
21
|
-
*/
|
|
22
11
|
/** The configured API base URL (no trailing slash), or "" for same-origin. */
|
|
23
12
|
declare function apiBaseUrl(): string;
|
|
24
13
|
/**
|
package/dist/query/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ApiError, QueryClient, apiBaseUrl, apiFetch, apiJson, apiPath, apiUrl, keepPreviousData, useApiMutation, useApiQuery, useInfiniteQuery, useIsFetching, useIsMutating, useMutation, useQueries, useQuery, useQueryClient } from '../chunk-
|
|
2
|
-
export { createQueryClient } from '../chunk-
|
|
1
|
+
export { ApiError, QueryClient, apiBaseUrl, apiFetch, apiJson, apiPath, apiUrl, keepPreviousData, useApiMutation, useApiQuery, useInfiniteQuery, useIsFetching, useIsMutating, useMutation, useQueries, useQuery, useQueryClient } from '../chunk-ANZLVSEP.js';
|
|
2
|
+
export { createQueryClient } from '../chunk-CKWPK4RO.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { extractPageSpec, extractApiSpec } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import { scanProject } from './chunk-
|
|
4
|
-
import { printJson } from './chunk-
|
|
1
|
+
import { extractPageSpec, extractApiSpec } from './chunk-UWSQUHX6.js';
|
|
2
|
+
import './chunk-S5MDTHH7.js';
|
|
3
|
+
import { scanProject } from './chunk-RNTDBX6S.js';
|
|
4
|
+
import { printJson } from './chunk-GNXCX4WE.js';
|
|
5
5
|
import './chunk-C2CX6GLX.js';
|
|
6
6
|
import pc from 'picocolors';
|
|
7
7
|
|
|
@@ -124,5 +124,5 @@ async function routes(root, args) {
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
export { routes };
|
|
127
|
-
//# sourceMappingURL=routes-
|
|
128
|
-
//# sourceMappingURL=routes-
|
|
127
|
+
//# sourceMappingURL=routes-PVKNT777.js.map
|
|
128
|
+
//# sourceMappingURL=routes-PVKNT777.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/routes.ts"],"names":[],"mappings":";;;;;;;;AAYA,IAAM,YAAA,GAAe,EAAA;AACrB,IAAM,YAAA,GAAe,CAAA;AAGrB,SAAS,UAAA,CAAW,MAAA,EAAgB,KAAA,EAAe,KAAA,EAAqB;AACtE,EAAA,OAAA,CAAQ,GAAA,CAAI,CAAA,EAAG,MAAM,CAAA,EAAG,EAAA,CAAG,GAAA,CAAI,KAAA,CAAM,MAAA,CAAO,YAAY,CAAC,CAAC,CAAA,EAAG,KAAK,CAAA,CAAE,CAAA;AACtE;AAGA,SAAS,aAAa,MAAA,EAA8B;AAClD,EAAA,OAAO,OAAO,GAAA,CAAI,CAAC,CAAA,KAAO,CAAA,CAAE,SAAS,UAAA,GAAa,CAAA,CAAA,EAAI,C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CAAQ,KAAA,GAAQ,MAAM,KAAA,CAAM,GAAA,CAAI,CAAC,CAAA,KAAM,QAAA,CAAS,CAAA,EAAG,MAAM,CAAC,CAAA;AAC1D,MAAA,OAAA,CAAQ,UAAU,KAAA,CAAM,OAAA,CAAQ,GAAA,CAAI,CAAC,OAAO,EAAE,GAAA,EAAK,CAAA,CAAE,GAAA,KAAQ,KAAK,GAAA,GAAM,CAAA,CAAE,KAAK,IAAA,EAAM,CAAA,CAAE,MAAK,CAAE,CAAA;AAC9F,MAAA,OAAA,CAAQ,WAAW,KAAA,CAAM,QAAA;AACzB,MAAA,OAAA,CAAQ,QAAQ,KAAA,CAAM,KAAA;AAGtB,MAAA,OAAA,CAAQ,WAAW,KAAA,CAAM,QAAA;AAAA,IAC3B;AACA,IAAA,IAAI,QAAA,EAAU;AACZ,MAAA,OAAA,CAAQ,IAAA,GAAO,MAAM,IAAA,CAAK,GAAA,CAAI,CAAC,CAAA,KAAM,OAAA,CAAQ,CAAA,EAAG,MAAM,CAAC,CAAA;AACvD,MAAA,OAAA,CAAQ,YAAY,KAAA,CAAM,SAAA;AAAA,IAC5B;AACA,IAAA,SAAA,CAAU,OAAO,CAAA;AACjB,IAAA,OAAO,CAAA;AAAA,EACT;AAEA,EAAA,IAAI,SAAA,EAAW,UAAA,CAAW,KAAA,EAAO,MAAM,CAAA;AAEvC,EAAA,IAAI,aAAa,KAAA,CAAM,SAAA,IAAa,QAAA,CAAA,EAAW,SAAA,CAAU,OAAO,MAAM,CAAA;AACtE,EAAA,OAAA,CAAQ,IAAI,EAAE,CAAA;AACd,EAAA,OAAO,CAAA;AACT","file":"routes-MWBWWOJ2.js","sourcesContent":["import pc from \"picocolors\"\nimport {\n extractApiSpec,\n extractPageSpec,\n type ApiMethodSpec,\n type PageSpec,\n type RouteParam,\n} from \"../core/route-spec\"\nimport { scanProject } from \"../core/scan\"\nimport type { ApiRoute, PageRoute, RouteModel } from \"../core/types\"\nimport { printJson, type ParsedArgs } from \"./util\"\n\nconst ROUTE_COLUMN = 28\nconst LABEL_COLUMN = 9\n\n/** Print an indented `label value` line under a route. */\nfunction detailLine(indent: string, label: string, value: string): void {\n console.log(`${indent}${pc.dim(label.padEnd(LABEL_COLUMN))}${value}`)\n}\n\n/** Render params as `:id`, `*rest`. */\nfunction formatParams(params: RouteParam[]): string {\n return params.map((p) => (p.kind === \"catchall\" ? `*${p.name}` : `:${p.name}`)).join(\", \")\n}\n\nfunction formatKeys(keys: string[] | undefined): string {\n return keys?.length ? ` { ${keys.join(\", \")} }` : \"\"\n}\n\nfunction printPageSpec(spec: PageSpec): void {\n const indent = \" \"\n if (spec.title) detailLine(indent, \"title\", spec.title)\n if (spec.navLabel) detailLine(indent, \"nav\", spec.navLabel)\n if (spec.description) detailLine(indent, \"desc\", spec.description)\n if (spec.params.length) detailLine(indent, \"params\", formatParams(spec.params))\n}\n\nfunction printApiMethodSpec(method: ApiMethodSpec, params: RouteParam[]): void {\n const indent = \" \"\n console.log(` ${pc.bold(method.method)}`)\n if (params.length) detailLine(indent, \"path\", formatParams(params))\n if (method.query.length) detailLine(indent, \"query\", method.query.join(\", \"))\n if (method.body) detailLine(indent, \"body\", method.body.format + formatKeys(method.body.keys))\n for (const res of method.responses) {\n const parts = [String(res.status), res.contentType].filter(Boolean).join(\" \")\n detailLine(indent, \"response\", parts + formatKeys(res.keys))\n }\n for (const err of method.errors) {\n detailLine(indent, \"error\", `${err.status}${err.message ? ` \"${err.message}\"` : \"\"}`)\n }\n}\n\n/**\n * How a page is rendered, when it is not the plain case. Without this a\n * `.slide.tsx` and a `.tsx` that resolve to the same URL look identical here,\n * and the whole point of `routes` is to show what the scan understood.\n */\nfunction pageBadge(page: PageRoute): string {\n if (page.kind === \"file\") return pc.magenta(` (${(page.fileExt ?? \"\").slice(1)})`)\n if (page.variant) return pc.magenta(` (${page.variant})`)\n return \"\"\n}\n\nfunction printPages(model: RouteModel, detail: boolean): void {\n console.log(pc.bold(\"\\nPages\"))\n if (model.pages.length === 0) console.log(pc.dim(\" (none)\"))\n for (const p of model.pages) {\n console.log(` ${pc.green(p.routePath.padEnd(ROUTE_COLUMN))} ${pc.dim(p.file)}${pageBadge(p)}`)\n if (detail) printPageSpec(extractPageSpec(p))\n }\n\n if (model.layouts.length || model.notFound || model.error) {\n console.log(pc.bold(\"\\nSpecial\"))\n for (const l of model.layouts) {\n const label = \"layout \" + (l.dir === \"\" ? \"/\" : \"/\" + l.dir)\n console.log(` ${pc.cyan(label.padEnd(ROUTE_COLUMN))} ${pc.dim(l.file)}`)\n }\n if (model.notFound) console.log(` ${pc.cyan(\"404\".padEnd(ROUTE_COLUMN))} ${pc.dim(model.notFound)}`)\n if (model.error) console.log(` ${pc.cyan(\"error\".padEnd(ROUTE_COLUMN))} ${pc.dim(model.error)}`)\n }\n}\n\nfunction printApis(model: RouteModel, detail: boolean): void {\n console.log(pc.bold(\"\\nAPI\"))\n if (!model.hasServer) {\n console.log(pc.dim(\" (none — this project has no server/ directory)\"))\n return\n }\n if (model.apis.length === 0) console.log(pc.dim(\" (none)\"))\n for (const a of model.apis) {\n console.log(` ${pc.yellow(a.routePath.padEnd(ROUTE_COLUMN))} ${pc.dim(a.file)}`)\n if (!detail) continue\n const spec = extractApiSpec(a)\n if (spec.methods.length === 0) console.log(` ${pc.dim(\"(no HTTP method handler exported)\")}`)\n for (const method of spec.methods) printApiMethodSpec(method, spec.params)\n }\n}\n\nfunction pageJson(p: PageRoute, detail: boolean) {\n return {\n route: p.routePath,\n file: p.file,\n dynamic: p.dynamic,\n kind: p.kind,\n ...(p.fileExt ? { fileExt: p.fileExt } : {}),\n ...(p.variant ? { variant: p.variant } : {}),\n ...(detail ? { spec: extractPageSpec(p) } : {}),\n }\n}\n\nfunction apiJson(a: ApiRoute, detail: boolean) {\n return {\n route: a.routePath,\n file: a.file,\n params: a.params,\n ...(detail ? { spec: extractApiSpec(a) } : {}),\n }\n}\n\n/**\n * `vantage routes` — show the page and API URL map.\n * `--pages` / `--apis` narrow the map to one side; `--detail` adds the static\n * spec of each route (page path params + definePage meta, API methods with\n * their request input and response shape).\n */\nexport async function routes(root: string, args: ParsedArgs): Promise<number> {\n const model = scanProject(root)\n const onlyPages = Boolean(args.flags.pages)\n const onlyApis = Boolean(args.flags.apis)\n // Neither flag (or both) means \"everything\", so the two are never exclusive.\n const showPages = onlyPages || !onlyApis\n const showApis = onlyApis || !onlyPages\n const detail = Boolean(args.flags.detail)\n\n if (args.flags.json) {\n const payload: Record<string, unknown> = {}\n if (showPages) {\n payload.pages = model.pages.map((p) => pageJson(p, detail))\n payload.layouts = model.layouts.map((l) => ({ dir: l.dir === \"\" ? \"/\" : l.dir, file: l.file }))\n payload.notFound = model.notFound\n payload.error = model.error\n // Files the scan skipped. `check` explains them; listing them here means\n // an agent reading `routes --json` sees them without a second command.\n payload.unrouted = model.unrouted\n }\n if (showApis) {\n payload.apis = model.apis.map((a) => apiJson(a, detail))\n payload.hasServer = model.hasServer\n }\n printJson(payload)\n return 0\n }\n\n if (showPages) printPages(model, detail)\n // Without --apis, an API-less project stays silent (nothing to say about it).\n if (showApis && (model.hasServer || onlyApis)) printApis(model, detail)\n console.log(\"\")\n return 0\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/cli/routes.ts"],"names":[],"mappings":";;;;;;;;AAYA,IAAM,YAAA,GAAe,EAAA;AACrB,IAAM,YAAA,GAAe,CAAA;AAGrB,SAAS,UAAA,CAAW,MAAA,EAAgB,KAAA,EAAe,KAAA,EAAqB;AACtE,EAAA,OAAA,CAAQ,GAAA,CAAI,CAAA,EAAG,MAAM,CAAA,EAAG,EAAA,CAAG,GAAA,CAAI,KAAA,CAAM,MAAA,CAAO,YAAY,CAAC,CAAC,CAAA,EAAG,KAAK,CAAA,CAAE,CAAA;AACtE;AAGA,SAAS,aAAa,MAAA,EAA8B;AAClD,EAAA,OAAO,OAAO,GAAA,CAAI,CAAC,CAAA,KAAO,CAAA,CAAE,SAAS,UAAA,GAAa,CAAA,CAAA,EAAI,CAAA,CAAE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AA,GAAQ,MAAM,KAAA,CAAM,GAAA,CAAI,CAAC,CAAA,KAAM,QAAA,CAAS,CAAA,EAAG,MAAM,CAAC,CAAA;AAC1D,MAAA,OAAA,CAAQ,UAAU,KAAA,CAAM,OAAA,CAAQ,GAAA,CAAI,CAAC,OAAO,EAAE,GAAA,EAAK,CAAA,CAAE,GAAA,KAAQ,KAAK,GAAA,GAAM,CAAA,CAAE,KAAK,IAAA,EAAM,CAAA,CAAE,MAAK,CAAE,CAAA;AAC9F,MAAA,OAAA,CAAQ,WAAW,KAAA,CAAM,QAAA;AACzB,MAAA,OAAA,CAAQ,QAAQ,KAAA,CAAM,KAAA;AAGtB,MAAA,OAAA,CAAQ,WAAW,KAAA,CAAM,QAAA;AAAA,IAC3B;AACA,IAAA,IAAI,QAAA,EAAU;AACZ,MAAA,OAAA,CAAQ,IAAA,GAAO,MAAM,IAAA,CAAK,GAAA,CAAI,CAAC,CAAA,KAAM,OAAA,CAAQ,CAAA,EAAG,MAAM,CAAC,CAAA;AACvD,MAAA,OAAA,CAAQ,YAAY,KAAA,CAAM,SAAA;AAAA,IAC5B;AACA,IAAA,SAAA,CAAU,OAAO,CAAA;AACjB,IAAA,OAAO,CAAA;AAAA,EACT;AAEA,EAAA,IAAI,SAAA,EAAW,UAAA,CAAW,KAAA,EAAO,MAAM,CAAA;AAEvC,EAAA,IAAI,aAAa,KAAA,CAAM,SAAA,IAAa,QAAA,CAAA,EAAW,SAAA,CAAU,OAAO,MAAM,CAAA;AACtE,EAAA,OAAA,CAAQ,IAAI,EAAE,CAAA;AACd,EAAA,OAAO,CAAA;AACT","file":"routes-PVKNT777.js","sourcesContent":["import pc from \"picocolors\"\nimport {\n extractApiSpec,\n extractPageSpec,\n type ApiMethodSpec,\n type PageSpec,\n type RouteParam,\n} from \"../core/route-spec\"\nimport { scanProject } from \"../core/scan\"\nimport type { ApiRoute, PageRoute, RouteModel } from \"../core/types\"\nimport { printJson, type ParsedArgs } from \"./util\"\n\nconst ROUTE_COLUMN = 28\nconst LABEL_COLUMN = 9\n\n/** Print an indented `label value` line under a route. */\nfunction detailLine(indent: string, label: string, value: string): void {\n console.log(`${indent}${pc.dim(label.padEnd(LABEL_COLUMN))}${value}`)\n}\n\n/** Render params as `:id`, `*rest`. */\nfunction formatParams(params: RouteParam[]): string {\n return params.map((p) => (p.kind === \"catchall\" ? `*${p.name}` : `:${p.name}`)).join(\", \")\n}\n\nfunction formatKeys(keys: string[] | undefined): string {\n return keys?.length ? ` { ${keys.join(\", \")} }` : \"\"\n}\n\nfunction printPageSpec(spec: PageSpec): void {\n const indent = \" \"\n if (spec.title) detailLine(indent, \"title\", spec.title)\n if (spec.navLabel) detailLine(indent, \"nav\", spec.navLabel)\n if (spec.description) detailLine(indent, \"desc\", spec.description)\n if (spec.params.length) detailLine(indent, \"params\", formatParams(spec.params))\n}\n\nfunction printApiMethodSpec(method: ApiMethodSpec, params: RouteParam[]): void {\n const indent = \" \"\n console.log(` ${pc.bold(method.method)}`)\n if (params.length) detailLine(indent, \"path\", formatParams(params))\n if (method.query.length) detailLine(indent, \"query\", method.query.join(\", \"))\n if (method.body) detailLine(indent, \"body\", method.body.format + formatKeys(method.body.keys))\n for (const res of method.responses) {\n const parts = [String(res.status), res.contentType].filter(Boolean).join(\" \")\n detailLine(indent, \"response\", parts + formatKeys(res.keys))\n }\n for (const err of method.errors) {\n detailLine(indent, \"error\", `${err.status}${err.message ? ` \"${err.message}\"` : \"\"}`)\n }\n}\n\n/**\n * How a page is rendered, when it is not the plain case. Without this a\n * `.slide.tsx` and a `.tsx` that resolve to the same URL look identical here,\n * and the whole point of `routes` is to show what the scan understood.\n */\nfunction pageBadge(page: PageRoute): string {\n if (page.kind === \"file\") return pc.magenta(` (${(page.fileExt ?? \"\").slice(1)})`)\n if (page.variant) return pc.magenta(` (${page.variant})`)\n return \"\"\n}\n\nfunction printPages(model: RouteModel, detail: boolean): void {\n console.log(pc.bold(\"\\nPages\"))\n if (model.pages.length === 0) console.log(pc.dim(\" (none)\"))\n for (const p of model.pages) {\n console.log(` ${pc.green(p.routePath.padEnd(ROUTE_COLUMN))} ${pc.dim(p.file)}${pageBadge(p)}`)\n if (detail) printPageSpec(extractPageSpec(p))\n }\n\n if (model.layouts.length || model.notFound || model.error) {\n console.log(pc.bold(\"\\nSpecial\"))\n for (const l of model.layouts) {\n const label = \"layout \" + (l.dir === \"\" ? \"/\" : \"/\" + l.dir)\n console.log(` ${pc.cyan(label.padEnd(ROUTE_COLUMN))} ${pc.dim(l.file)}`)\n }\n if (model.notFound) console.log(` ${pc.cyan(\"404\".padEnd(ROUTE_COLUMN))} ${pc.dim(model.notFound)}`)\n if (model.error) console.log(` ${pc.cyan(\"error\".padEnd(ROUTE_COLUMN))} ${pc.dim(model.error)}`)\n }\n}\n\nfunction printApis(model: RouteModel, detail: boolean): void {\n console.log(pc.bold(\"\\nAPI\"))\n if (!model.hasServer) {\n console.log(pc.dim(\" (none — this project has no server/ directory)\"))\n return\n }\n if (model.apis.length === 0) console.log(pc.dim(\" (none)\"))\n for (const a of model.apis) {\n console.log(` ${pc.yellow(a.routePath.padEnd(ROUTE_COLUMN))} ${pc.dim(a.file)}`)\n if (!detail) continue\n const spec = extractApiSpec(a)\n if (spec.methods.length === 0) console.log(` ${pc.dim(\"(no HTTP method handler exported)\")}`)\n for (const method of spec.methods) printApiMethodSpec(method, spec.params)\n }\n}\n\nfunction pageJson(p: PageRoute, detail: boolean) {\n return {\n route: p.routePath,\n file: p.file,\n dynamic: p.dynamic,\n kind: p.kind,\n ...(p.fileExt ? { fileExt: p.fileExt } : {}),\n ...(p.variant ? { variant: p.variant } : {}),\n ...(detail ? { spec: extractPageSpec(p) } : {}),\n }\n}\n\nfunction apiJson(a: ApiRoute, detail: boolean) {\n return {\n route: a.routePath,\n file: a.file,\n params: a.params,\n ...(detail ? { spec: extractApiSpec(a) } : {}),\n }\n}\n\n/**\n * `vantage routes` — show the page and API URL map.\n * `--pages` / `--apis` narrow the map to one side; `--detail` adds the static\n * spec of each route (page path params + definePage meta, API methods with\n * their request input and response shape).\n */\nexport async function routes(root: string, args: ParsedArgs): Promise<number> {\n const model = scanProject(root)\n const onlyPages = Boolean(args.flags.pages)\n const onlyApis = Boolean(args.flags.apis)\n // Neither flag (or both) means \"everything\", so the two are never exclusive.\n const showPages = onlyPages || !onlyApis\n const showApis = onlyApis || !onlyPages\n const detail = Boolean(args.flags.detail)\n\n if (args.flags.json) {\n const payload: Record<string, unknown> = {}\n if (showPages) {\n payload.pages = model.pages.map((p) => pageJson(p, detail))\n payload.layouts = model.layouts.map((l) => ({ dir: l.dir === \"\" ? \"/\" : l.dir, file: l.file }))\n payload.notFound = model.notFound\n payload.error = model.error\n // Files the scan skipped. `check` explains them; listing them here means\n // an agent reading `routes --json` sees them without a second command.\n payload.unrouted = model.unrouted\n }\n if (showApis) {\n payload.apis = model.apis.map((a) => apiJson(a, detail))\n payload.hasServer = model.hasServer\n }\n printJson(payload)\n return 0\n }\n\n if (showPages) printPages(model, detail)\n // Without --apis, an API-less project stays silent (nothing to say about it).\n if (showApis && (model.hasServer || onlyApis)) printApis(model, detail)\n console.log(\"\")\n return 0\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { loadCatalog, isDocLang, DOC_LANGS, DEFAULT_DOC_LANG, docsForLang, readDoc } from './chunk-2KRCGXBY.js';
|
|
2
|
-
import { log, printJson } from './chunk-
|
|
2
|
+
import { log, printJson } from './chunk-GNXCX4WE.js';
|
|
3
3
|
import './chunk-C2CX6GLX.js';
|
|
4
4
|
import pc from 'picocolors';
|
|
5
5
|
|
|
@@ -321,5 +321,5 @@ async function search(_root, args) {
|
|
|
321
321
|
}
|
|
322
322
|
|
|
323
323
|
export { search };
|
|
324
|
-
//# sourceMappingURL=search-
|
|
325
|
-
//# sourceMappingURL=search-
|
|
324
|
+
//# sourceMappingURL=search-5LC4XPB5.js.map
|
|
325
|
+
//# sourceMappingURL=search-5LC4XPB5.js.map
|
|
@@ -1 +1 @@
|
|
|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,CAAA;AAAA,EACT;AACA,EAAA,MAAM,IAAA,GAAgB,SAAA,CAAU,QAAQ,CAAA,GAAI,QAAA,GAAW,gBAAA;AAEvD,EAAA,MAAM,OAAA,GAAU,WAAA,CAAY,OAAA,EAAS,IAAI,CAAA;AACzC,EAAA,IAAI,OAAA,CAAQ,WAAW,CAAA,EAAG;AACxB,IAAA,GAAA,CAAI,KAAA,CAAM,CAAA,8BAAA,EAAiC,IAAI,CAAA,EAAA,CAAI,CAAA;AACnD,IAAA,OAAO,CAAA;AAAA,EACT;AAIA,EAAA,MAAM,aAAa,OAAA,CAAQ,MAAA,CAAO,CAAC,KAAA,KAAU,KAAA,CAAM,eAAe,KAAK,CAAA;AAEvE,EAAA,MAAM,KAAA,GAAQ,UAAA,CAAW,IAAA,CAAK,KAAA,CAAM,OAAO,aAAa,CAAA;AACxD,EAAA,MAAM,IAAA,GAAO,OAAA,CAAQ,IAAA,CAAK,KAAA,CAAM,IAAI,CAAA;AACpC,EAAA,OAAO,IAAA,CAAK,KAAA,CAAM,KAAA,GACd,QAAA,CAAS,YAAY,KAAA,EAAO,IAAA,EAAM,KAAA,EAAO,IAAI,IAC7C,SAAA,CAAU,UAAA,EAAY,KAAA,EAAO,IAAA,EAAM,OAAO,IAAI,CAAA;AACpD","file":"search-6Y422SV6.js","sourcesContent":["import { readDoc, type DocEntry } from \"./docs-catalog\"\n\n/**\n * A tiny BM25F ranker over the bundled documentation. The corpus is the catalog\n * `docs-catalog.ts` exposes — the same one `vantage docs` prints, so search never\n * creates a second source of truth.\n *\n * The index is built at run time: 65 pages per language (~300 KB) tokenize in a\n * few milliseconds, which is cheaper than shipping and version-locking a\n * prebuilt index alongside the docs bundle.\n */\n\n/**\n * Field weights. A name or a title match says far more about relevance than one\n * more occurrence in a long body, and BM25F models that as a weighted term\n * frequency (and a matching weighted document length).\n */\nconst FIELD_WEIGHTS = { slug: 3, title: 3, description: 2, body: 1 } as const\n\n/** Standard BM25 constants: term-frequency saturation and length normalization. */\nconst K1 = 1.2\nconst B = 0.75\n\n/**\n * Latin/digit runs, or runs of Japanese script (kana + CJK ideographs). CJK\n * punctuation (U+3000–U+303F, 。and 、) is deliberately outside the ranges, so\n * runs break at sentence boundaries.\n */\nconst TOKEN_RE = /[a-z0-9]+|[-ヿ㐀-䶿一-鿿]+/g\nconst LATIN_RE = /^[a-z0-9]+$/\n/** `TOKEN_RE`, but before lowercasing — for text that is not being indexed. */\nconst TOKEN_RE_ANYCASE = /[a-zA-Z0-9]+|[-ヿ㐀-䶿一-鿿]+/g\nconst CJK_RE = /[-ヿ㐀-䶿一-鿿]/\n\n/**\n * One run of a single script: hiragana (U+3041–U+309F), katakana (U+30A0–U+30FF,\n * so ー stays inside テーブル), or kanji. Japanese writes content words in\n * katakana and kanji and the grammatical glue between them in hiragana, so\n * cutting at every script change segments 「テーブルにページングを付けたい」into\n * テーブル · に · ページング · を · 付 · けたい without a morphological analyser.\n */\nconst SCRIPT_RE = /[ぁ-ゟ]+|[゠-ヿ]+|[㐀-䶿一-鿿]+/g\nconst HIRAGANA_RE = /^[ぁ-ゟ]$/\n\n/** Plural forms, so `colors` finds `color` and `queries` finds `query`. */\nfunction singular(word: string): string {\n if (word.length >= 5 && word.endsWith(\"ies\")) return `${word.slice(0, -3)}y`\n if (word.length >= 4 && word.endsWith(\"s\") && !/(ss|us|is)$/.test(word)) return word.slice(0, -1)\n return word\n}\n\n/**\n * Split text into index terms. Latin runs become words (`DataTable` splits into\n * `data` + `table`, so a two-word query finds it). Japanese runs are segmented\n * by script change; each segment is indexed whole *and* as character bigrams,\n * so an exact word scores high while a near miss (ページング / ページネーション)\n * still shares enough terms to be found.\n */\nexport function tokenize(text: string): string[] {\n const normalized = text\n .normalize(\"NFKC\")\n .replace(/([a-z0-9])([A-Z])/g, \"$1 $2\")\n .toLowerCase()\n const tokens: string[] = []\n for (const match of normalized.matchAll(TOKEN_RE)) {\n const run = match[0]!\n if (LATIN_RE.test(run)) {\n tokens.push(singular(run))\n continue\n }\n for (const segment of run.match(SCRIPT_RE) ?? []) {\n // A lone hiragana is a particle (を, に, が …): it appears in every page\n // and would make every page a match.\n if (segment.length === 1 && HIRAGANA_RE.test(segment)) continue\n // A 2-character segment is its own only bigram — pushing both would\n // double-count it.\n if (segment.length <= 2) {\n tokens.push(segment)\n continue\n }\n tokens.push(segment)\n for (let i = 0; i < segment.length - 1; i++) tokens.push(segment.slice(i, i + 2))\n }\n }\n return tokens\n}\n\n/**\n * The words a snippet should highlight: whole words and whole Japanese\n * segments as the user typed them, without the derived bigrams (highlighting\n * those would paint most of a Japanese line yellow) and without the singular\n * rewrite (which no longer appears verbatim in the text).\n */\nexport function queryPhrases(query: string): string[] {\n const phrases: string[] = []\n for (const match of query.normalize(\"NFKC\").matchAll(TOKEN_RE_ANYCASE)) {\n const run = match[0]!\n if (!CJK_RE.test(run)) {\n phrases.push(run)\n continue\n }\n for (const segment of run.match(SCRIPT_RE) ?? []) {\n if (segment.length === 1 && HIRAGANA_RE.test(segment)) continue\n phrases.push(segment)\n }\n }\n return [...new Set(phrases)]\n}\n\n/** One ranked document, with the body kept for snippet extraction. */\nexport interface SearchHit {\n entry: DocEntry\n score: number\n /** Query terms that were looked up — the input for `snippet()`. */\n terms: string[]\n body: string\n}\n\ninterface IndexedDoc {\n entry: DocEntry\n body: string\n /** Weighted term frequency across all fields. */\n tf: Map<string, number>\n /** Weighted document length. */\n length: number\n}\n\nexport interface SearchIndex {\n /** Every document with a non-zero score, best first. */\n search(query: string): SearchHit[]\n}\n\n/** Build the index for one language's catalog entries. */\nexport function buildIndex(entries: DocEntry[]): SearchIndex {\n const docs: IndexedDoc[] = entries.map((entry) => {\n const body = readDoc(entry)\n const tf = new Map<string, number>()\n let length = 0\n const add = (text: string, weight: number) => {\n for (const token of tokenize(text)) {\n tf.set(token, (tf.get(token) ?? 0) + weight)\n length += weight\n }\n }\n add(entry.slug, FIELD_WEIGHTS.slug)\n add(entry.title, FIELD_WEIGHTS.title)\n add(entry.description, FIELD_WEIGHTS.description)\n add(body, FIELD_WEIGHTS.body)\n return { entry, body, tf, length }\n })\n\n const df = new Map<string, number>()\n for (const doc of docs) {\n for (const term of doc.tf.keys()) df.set(term, (df.get(term) ?? 0) + 1)\n }\n const total = docs.length\n const avgLength = total ? docs.reduce((sum, doc) => sum + doc.length, 0) / total : 1\n\n return {\n search(query: string): SearchHit[] {\n const terms = [...new Set(tokenize(query))]\n if (terms.length === 0) return []\n\n const hits: SearchHit[] = []\n for (const doc of docs) {\n let score = 0\n for (const term of terms) {\n const tf = doc.tf.get(term)\n if (!tf) continue\n const n = df.get(term) ?? 0\n const idf = Math.log(1 + (total - n + 0.5) / (n + 0.5))\n const norm = 1 - B + (B * doc.length) / avgLength\n score += idf * ((tf * (K1 + 1)) / (tf + K1 * norm))\n }\n if (score > 0) hits.push({ entry: doc.entry, score, terms, body: doc.body })\n }\n hits.sort((a, b) => b.score - a.score || a.entry.slug.localeCompare(b.entry.slug))\n return hits\n },\n }\n}\n\n/** How much of a line to show around the first matched term. */\nconst SNIPPET_LENGTH = 150\n\n/**\n * Pick the passage that best covers the query terms. Lines are compared\n * lowercased only (no NFKC, no camelCase splitting) so offsets stay aligned\n * with the text that is printed.\n */\nexport function snippet(body: string, terms: string[], length = SNIPPET_LENGTH): string {\n let best = \"\"\n let bestHits = 0\n let bestIndex = 0\n let bestIsHeading = true\n\n // The first line is the page's own `# Title`, which the caller already shows.\n for (const raw of body.split(\"\\n\").slice(1)) {\n const line = raw.replace(/^\\s*[-*]\\s+/, \"\").replace(/\\s+/g, \" \").trim()\n if (!line || /^(```|~~~|\\|\\s*-{2,})/.test(line)) continue\n const haystack = line.toLowerCase()\n const heading = line.startsWith(\"#\")\n let hits = 0\n let first = -1\n for (const term of terms) {\n const at = haystack.indexOf(term)\n if (at === -1) continue\n hits++\n if (first === -1 || at < first) first = at\n }\n // Equal coverage: prose says more than a heading does.\n if (hits > bestHits || (hits === bestHits && hits > 0 && bestIsHeading && !heading)) {\n best = line\n bestHits = hits\n bestIndex = first\n bestIsHeading = heading\n }\n }\n\n if (!bestHits) return \"\"\n if (best.length <= length) return best\n\n const start = Math.max(0, bestIndex - Math.floor(length / 4))\n const text = best.slice(start, start + length).trim()\n return `${start > 0 ? \"…\" : \"\"}${text}${start + length < best.length ? \"…\" : \"\"}`\n}\n","import pc from \"picocolors\"\nimport {\n DEFAULT_DOC_LANG,\n DOC_LANGS,\n docsForLang,\n isDocLang,\n loadCatalog,\n readDoc,\n type DocEntry,\n type DocLang,\n} from \"./docs-catalog\"\nimport { buildIndex, queryPhrases, snippet, type SearchHit } from \"./search-index\"\nimport { log, printJson, type ParsedArgs } from \"./util\"\n\n/** Results shown when `--limit` is absent. */\nconst DEFAULT_LIMIT = 10\n\n/** Matching lines printed per page in regex mode (the count is always exact). */\nconst MAX_REGEX_LINES = 3\n\n/** Parse `--limit`, falling back silently — an off result list is not a failure. */\nfunction parseLimit(value: string | boolean | undefined, fallback: number): number {\n if (typeof value === \"string\") {\n const n = Number(value)\n if (Number.isInteger(n) && n > 0) return n\n }\n return fallback\n}\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")\n}\n\n/** Dim a line, with every match of `re` picked out. Piped output stays plain. */\nfunction paintMatches(text: string, re: RegExp): string {\n if (!process.stdout.isTTY) return text\n let out = \"\"\n let last = 0\n for (const match of text.matchAll(re)) {\n const at = match.index ?? 0\n if (!match[0]) continue // zero-length match: nothing to highlight\n out += pc.dim(text.slice(last, at)) + pc.yellow(match[0])\n last = at + match[0].length\n }\n return out + pc.dim(text.slice(last))\n}\n\n/** Same, for the words of a natural-language query. */\nfunction paintTerms(text: string, words: string[]): string {\n if (!process.stdout.isTTY) return text\n if (words.length === 0) return pc.dim(text)\n return paintMatches(text, new RegExp(words.map(escapeRegExp).join(\"|\"), \"gi\"))\n}\n\nfunction header(count: number, query: string, lang: DocLang, mode: string): void {\n const label = `${count} result${count === 1 ? \"\" : \"s\"} for \"${query}\"`\n console.log(\"\")\n console.log(pc.bold(label) + pc.dim(` ${lang} · ${mode}`))\n console.log(\"\")\n}\n\nfunction footer(total: number, shown: number, lines: string[]): void {\n if (total > shown) {\n console.log(\"\")\n console.log(pc.dim(` ${total - shown} more — raise --limit to see them`))\n }\n console.log(\"\")\n for (const line of lines) console.log(pc.dim(line))\n}\n\nfunction noResults(query: string): void {\n log.warn(`Nothing matches \"${query}\".`)\n console.log(pc.dim(\" Try fewer or more general words, or run `vantage docs --list` to browse every page.\"))\n}\n\nfunction meta(entry: DocEntry) {\n return {\n slug: entry.slug,\n title: entry.title,\n description: entry.description,\n section: entry.section,\n sectionTitle: entry.sectionTitle,\n command: `vantage docs ${entry.slug}`,\n }\n}\n\n/** Default mode: rank the corpus with BM25 and show the best passage of each hit. */\nfunction runRanked(entries: DocEntry[], query: string, lang: DocLang, limit: number, json: boolean): number {\n const hits = buildIndex(entries).search(query)\n const shown = hits.slice(0, limit)\n const passage = (hit: SearchHit) => snippet(hit.body, hit.terms)\n\n if (json) {\n printJson({\n query,\n mode: \"bm25\",\n lang,\n count: hits.length,\n results: shown.map((hit) => ({\n ...meta(hit.entry),\n score: Math.round(hit.score * 1000) / 1000,\n snippet: passage(hit),\n })),\n })\n return 0\n }\n\n if (hits.length === 0) {\n noResults(query)\n return 0\n }\n\n const words = queryPhrases(query)\n const width = Math.max(...shown.map((hit) => hit.entry.slug.length))\n header(hits.length, query, lang, \"bm25\")\n for (const hit of shown) {\n const title = `${hit.entry.title}${pc.dim(` · ${hit.entry.sectionTitle}`)}`\n console.log(` ${pc.cyan(hit.entry.slug.padEnd(width))} ${title}`)\n const text = passage(hit)\n if (text) console.log(` ${\" \".repeat(width)} ${paintTerms(text, words)}`)\n }\n footer(hits.length, shown.length, [\n \"vantage docs <name> open one result --regex treat the query as a regular expression\",\n \"vantage search --json machine-readable --limit max results (default 10)\",\n ])\n return 0\n}\n\n/** `--regex` mode: scan names, titles and bodies for a regular expression. */\nfunction runRegex(entries: DocEntry[], query: string, lang: DocLang, limit: number, json: boolean): number {\n let scan: RegExp\n let probe: RegExp\n try {\n scan = new RegExp(query, \"gi\")\n probe = new RegExp(query, \"i\")\n } catch (err) {\n log.error(err instanceof Error ? err.message : `Invalid regular expression: ${String(err)}`)\n return 1\n }\n\n const results: { entry: DocEntry; matchCount: number; matches: { line: number; text: string }[] }[] = []\n for (const entry of entries) {\n const lines = readDoc(entry).split(\"\\n\")\n const matches: { line: number; text: string }[] = []\n let matchCount = 0\n for (let i = 0; i < lines.length; i++) {\n const found = [...lines[i]!.matchAll(scan)]\n if (found.length === 0) continue\n matchCount += found.length\n if (matches.length < MAX_REGEX_LINES) {\n matches.push({ line: i + 1, text: lines[i]!.replace(/\\s+/g, \" \").trim() })\n }\n }\n const inMeta = probe.test(entry.slug) || probe.test(entry.title) || probe.test(entry.description)\n if (matchCount === 0 && !inMeta) continue\n results.push({ entry, matchCount, matches })\n }\n // Stable sort: pages with more matches first, catalog order within ties.\n results.sort((a, b) => b.matchCount - a.matchCount)\n const shown = results.slice(0, limit)\n\n if (json) {\n printJson({\n query,\n mode: \"regex\",\n lang,\n count: results.length,\n results: shown.map((result) => ({\n ...meta(result.entry),\n matchCount: result.matchCount,\n matches: result.matches,\n })),\n })\n return 0\n }\n\n if (results.length === 0) {\n noResults(query)\n return 0\n }\n\n header(results.length, query, lang, \"regex\")\n for (const result of shown) {\n // A page can match on its name, title or description alone — with no body line to show.\n const count = pc.dim(\n result.matchCount ? ` ${result.matchCount} match${result.matchCount === 1 ? \"\" : \"es\"}` : \" name match\",\n )\n console.log(` ${pc.cyan(result.entry.slug)} ${result.entry.title}${count}`)\n for (const match of result.matches) {\n console.log(` ${pc.dim(String(match.line).padStart(4))} ${paintMatches(match.text, scan)}`)\n }\n }\n footer(results.length, shown.length, [\n \"vantage docs <name> open one result --limit max results (default 10)\",\n \"vantage search --json machine-readable --lang ja | en\",\n ])\n return 0\n}\n\n/** `vantage search <query> [--regex] [--limit n] [--json] [--lang ja|en]` */\nexport async function search(_root: string, args: ParsedArgs): Promise<number> {\n const query = args.positionals.slice(1).join(\" \").trim()\n if (!query) {\n log.error(\"Usage: vantage search <query> [--regex] [--limit <n>] [--lang ja|en] [--json]\")\n return 1\n }\n\n const catalog = loadCatalog()\n if (!catalog) {\n log.error(\"The bundled documentation is missing. Reinstall @squadbase/vantage, or run `pnpm build` in the framework repo.\")\n return 1\n }\n\n const langFlag = args.flags.lang\n if (langFlag !== undefined && !isDocLang(langFlag)) {\n log.error(`Unknown --lang \"${String(langFlag)}\". Available: ${DOC_LANGS.join(\", \")}`)\n return 1\n }\n const lang: DocLang = isDocLang(langFlag) ? langFlag : DEFAULT_DOC_LANG\n\n const entries = docsForLang(catalog, lang)\n if (entries.length === 0) {\n log.error(`No documentation bundled for \"${lang}\".`)\n return 1\n }\n\n // Pages that opted out with `search: false` (e.g. the changelog) are still\n // reachable via `vantage docs` but never surface here.\n const searchable = entries.filter((entry) => entry.searchable !== false)\n\n const limit = parseLimit(args.flags.limit, DEFAULT_LIMIT)\n const json = Boolean(args.flags.json)\n return args.flags.regex\n ? runRegex(searchable, query, lang, limit, json)\n : runRanked(searchable, query, lang, limit, json)\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/cli/search-index.ts","../src/cli/search.ts"],"names":[],"mappings":";;;;;;;;AAiBA,IAAM,aAAA,GAAgB,EAAE,IAAA,EAAM,CAAA,EAAG,OAAO,CAAA,EAAG,WAAA,EAAa,CAAA,EAAG,IAAA,EAAM,CAAA,EAAE;AAGnE,IAAM,EAAA,GAAK,GAAA;AACX,IAAM,CAAA,GAAI,IAAA;AAOV,IAAM,QAAA,GAAW,yBAAA;AACjB,IAAM,QAAA,GAAW,aAAA;AAEjB,IAAM,gBAAA,GAAmB,4BAAA;AACzB,IAAM,MAAA,GAAS,aAAA;AASf,IAAM,SAAA,GAAY,0BAAA;AAClB,IAAM,WAAA,GAAc,SAAA;AAGpB,SAAS,SAAS,IAAA,EAAsB;AACtC,EAAA,IAAI,IAAA,CA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,OAAO,aAAa,CAAA;AACxD,EAAA,MAAM,IAAA,GAAO,OAAA,CAAQ,IAAA,CAAK,KAAA,CAAM,IAAI,CAAA;AACpC,EAAA,OAAO,IAAA,CAAK,KAAA,CAAM,KAAA,GACd,QAAA,CAAS,YAAY,KAAA,EAAO,IAAA,EAAM,KAAA,EAAO,IAAI,IAC7C,SAAA,CAAU,UAAA,EAAY,KAAA,EAAO,IAAA,EAAM,OAAO,IAAI,CAAA;AACpD","file":"search-5LC4XPB5.js","sourcesContent":["import { readDoc, type DocEntry } from \"./docs-catalog\"\n\n/**\n * A tiny BM25F ranker over the bundled documentation. The corpus is the catalog\n * `docs-catalog.ts` exposes — the same one `vantage docs` prints, so search never\n * creates a second source of truth.\n *\n * The index is built at run time: 65 pages per language (~300 KB) tokenize in a\n * few milliseconds, which is cheaper than shipping and version-locking a\n * prebuilt index alongside the docs bundle.\n */\n\n/**\n * Field weights. A name or a title match says far more about relevance than one\n * more occurrence in a long body, and BM25F models that as a weighted term\n * frequency (and a matching weighted document length).\n */\nconst FIELD_WEIGHTS = { slug: 3, title: 3, description: 2, body: 1 } as const\n\n/** Standard BM25 constants: term-frequency saturation and length normalization. */\nconst K1 = 1.2\nconst B = 0.75\n\n/**\n * Latin/digit runs, or runs of Japanese script (kana + CJK ideographs). CJK\n * punctuation (U+3000–U+303F, 。and 、) is deliberately outside the ranges, so\n * runs break at sentence boundaries.\n */\nconst TOKEN_RE = /[a-z0-9]+|[-ヿ㐀-䶿一-鿿]+/g\nconst LATIN_RE = /^[a-z0-9]+$/\n/** `TOKEN_RE`, but before lowercasing — for text that is not being indexed. */\nconst TOKEN_RE_ANYCASE = /[a-zA-Z0-9]+|[-ヿ㐀-䶿一-鿿]+/g\nconst CJK_RE = /[-ヿ㐀-䶿一-鿿]/\n\n/**\n * One run of a single script: hiragana (U+3041–U+309F), katakana (U+30A0–U+30FF,\n * so ー stays inside テーブル), or kanji. Japanese writes content words in\n * katakana and kanji and the grammatical glue between them in hiragana, so\n * cutting at every script change segments 「テーブルにページングを付けたい」into\n * テーブル · に · ページング · を · 付 · けたい without a morphological analyser.\n */\nconst SCRIPT_RE = /[ぁ-ゟ]+|[゠-ヿ]+|[㐀-䶿一-鿿]+/g\nconst HIRAGANA_RE = /^[ぁ-ゟ]$/\n\n/** Plural forms, so `colors` finds `color` and `queries` finds `query`. */\nfunction singular(word: string): string {\n if (word.length >= 5 && word.endsWith(\"ies\")) return `${word.slice(0, -3)}y`\n if (word.length >= 4 && word.endsWith(\"s\") && !/(ss|us|is)$/.test(word)) return word.slice(0, -1)\n return word\n}\n\n/**\n * Split text into index terms. Latin runs become words (`DataTable` splits into\n * `data` + `table`, so a two-word query finds it). Japanese runs are segmented\n * by script change; each segment is indexed whole *and* as character bigrams,\n * so an exact word scores high while a near miss (ページング / ページネーション)\n * still shares enough terms to be found.\n */\nexport function tokenize(text: string): string[] {\n const normalized = text\n .normalize(\"NFKC\")\n .replace(/([a-z0-9])([A-Z])/g, \"$1 $2\")\n .toLowerCase()\n const tokens: string[] = []\n for (const match of normalized.matchAll(TOKEN_RE)) {\n const run = match[0]!\n if (LATIN_RE.test(run)) {\n tokens.push(singular(run))\n continue\n }\n for (const segment of run.match(SCRIPT_RE) ?? []) {\n // A lone hiragana is a particle (を, に, が …): it appears in every page\n // and would make every page a match.\n if (segment.length === 1 && HIRAGANA_RE.test(segment)) continue\n // A 2-character segment is its own only bigram — pushing both would\n // double-count it.\n if (segment.length <= 2) {\n tokens.push(segment)\n continue\n }\n tokens.push(segment)\n for (let i = 0; i < segment.length - 1; i++) tokens.push(segment.slice(i, i + 2))\n }\n }\n return tokens\n}\n\n/**\n * The words a snippet should highlight: whole words and whole Japanese\n * segments as the user typed them, without the derived bigrams (highlighting\n * those would paint most of a Japanese line yellow) and without the singular\n * rewrite (which no longer appears verbatim in the text).\n */\nexport function queryPhrases(query: string): string[] {\n const phrases: string[] = []\n for (const match of query.normalize(\"NFKC\").matchAll(TOKEN_RE_ANYCASE)) {\n const run = match[0]!\n if (!CJK_RE.test(run)) {\n phrases.push(run)\n continue\n }\n for (const segment of run.match(SCRIPT_RE) ?? []) {\n if (segment.length === 1 && HIRAGANA_RE.test(segment)) continue\n phrases.push(segment)\n }\n }\n return [...new Set(phrases)]\n}\n\n/** One ranked document, with the body kept for snippet extraction. */\nexport interface SearchHit {\n entry: DocEntry\n score: number\n /** Query terms that were looked up — the input for `snippet()`. */\n terms: string[]\n body: string\n}\n\ninterface IndexedDoc {\n entry: DocEntry\n body: string\n /** Weighted term frequency across all fields. */\n tf: Map<string, number>\n /** Weighted document length. */\n length: number\n}\n\nexport interface SearchIndex {\n /** Every document with a non-zero score, best first. */\n search(query: string): SearchHit[]\n}\n\n/** Build the index for one language's catalog entries. */\nexport function buildIndex(entries: DocEntry[]): SearchIndex {\n const docs: IndexedDoc[] = entries.map((entry) => {\n const body = readDoc(entry)\n const tf = new Map<string, number>()\n let length = 0\n const add = (text: string, weight: number) => {\n for (const token of tokenize(text)) {\n tf.set(token, (tf.get(token) ?? 0) + weight)\n length += weight\n }\n }\n add(entry.slug, FIELD_WEIGHTS.slug)\n add(entry.title, FIELD_WEIGHTS.title)\n add(entry.description, FIELD_WEIGHTS.description)\n add(body, FIELD_WEIGHTS.body)\n return { entry, body, tf, length }\n })\n\n const df = new Map<string, number>()\n for (const doc of docs) {\n for (const term of doc.tf.keys()) df.set(term, (df.get(term) ?? 0) + 1)\n }\n const total = docs.length\n const avgLength = total ? docs.reduce((sum, doc) => sum + doc.length, 0) / total : 1\n\n return {\n search(query: string): SearchHit[] {\n const terms = [...new Set(tokenize(query))]\n if (terms.length === 0) return []\n\n const hits: SearchHit[] = []\n for (const doc of docs) {\n let score = 0\n for (const term of terms) {\n const tf = doc.tf.get(term)\n if (!tf) continue\n const n = df.get(term) ?? 0\n const idf = Math.log(1 + (total - n + 0.5) / (n + 0.5))\n const norm = 1 - B + (B * doc.length) / avgLength\n score += idf * ((tf * (K1 + 1)) / (tf + K1 * norm))\n }\n if (score > 0) hits.push({ entry: doc.entry, score, terms, body: doc.body })\n }\n hits.sort((a, b) => b.score - a.score || a.entry.slug.localeCompare(b.entry.slug))\n return hits\n },\n }\n}\n\n/** How much of a line to show around the first matched term. */\nconst SNIPPET_LENGTH = 150\n\n/**\n * Pick the passage that best covers the query terms. Lines are compared\n * lowercased only (no NFKC, no camelCase splitting) so offsets stay aligned\n * with the text that is printed.\n */\nexport function snippet(body: string, terms: string[], length = SNIPPET_LENGTH): string {\n let best = \"\"\n let bestHits = 0\n let bestIndex = 0\n let bestIsHeading = true\n\n // The first line is the page's own `# Title`, which the caller already shows.\n for (const raw of body.split(\"\\n\").slice(1)) {\n const line = raw.replace(/^\\s*[-*]\\s+/, \"\").replace(/\\s+/g, \" \").trim()\n if (!line || /^(```|~~~|\\|\\s*-{2,})/.test(line)) continue\n const haystack = line.toLowerCase()\n const heading = line.startsWith(\"#\")\n let hits = 0\n let first = -1\n for (const term of terms) {\n const at = haystack.indexOf(term)\n if (at === -1) continue\n hits++\n if (first === -1 || at < first) first = at\n }\n // Equal coverage: prose says more than a heading does.\n if (hits > bestHits || (hits === bestHits && hits > 0 && bestIsHeading && !heading)) {\n best = line\n bestHits = hits\n bestIndex = first\n bestIsHeading = heading\n }\n }\n\n if (!bestHits) return \"\"\n if (best.length <= length) return best\n\n const start = Math.max(0, bestIndex - Math.floor(length / 4))\n const text = best.slice(start, start + length).trim()\n return `${start > 0 ? \"…\" : \"\"}${text}${start + length < best.length ? \"…\" : \"\"}`\n}\n","import pc from \"picocolors\"\nimport {\n DEFAULT_DOC_LANG,\n DOC_LANGS,\n docsForLang,\n isDocLang,\n loadCatalog,\n readDoc,\n type DocEntry,\n type DocLang,\n} from \"./docs-catalog\"\nimport { buildIndex, queryPhrases, snippet, type SearchHit } from \"./search-index\"\nimport { log, printJson, type ParsedArgs } from \"./util\"\n\n/** Results shown when `--limit` is absent. */\nconst DEFAULT_LIMIT = 10\n\n/** Matching lines printed per page in regex mode (the count is always exact). */\nconst MAX_REGEX_LINES = 3\n\n/** Parse `--limit`, falling back silently — an off result list is not a failure. */\nfunction parseLimit(value: string | boolean | undefined, fallback: number): number {\n if (typeof value === \"string\") {\n const n = Number(value)\n if (Number.isInteger(n) && n > 0) return n\n }\n return fallback\n}\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")\n}\n\n/** Dim a line, with every match of `re` picked out. Piped output stays plain. */\nfunction paintMatches(text: string, re: RegExp): string {\n if (!process.stdout.isTTY) return text\n let out = \"\"\n let last = 0\n for (const match of text.matchAll(re)) {\n const at = match.index ?? 0\n if (!match[0]) continue // zero-length match: nothing to highlight\n out += pc.dim(text.slice(last, at)) + pc.yellow(match[0])\n last = at + match[0].length\n }\n return out + pc.dim(text.slice(last))\n}\n\n/** Same, for the words of a natural-language query. */\nfunction paintTerms(text: string, words: string[]): string {\n if (!process.stdout.isTTY) return text\n if (words.length === 0) return pc.dim(text)\n return paintMatches(text, new RegExp(words.map(escapeRegExp).join(\"|\"), \"gi\"))\n}\n\nfunction header(count: number, query: string, lang: DocLang, mode: string): void {\n const label = `${count} result${count === 1 ? \"\" : \"s\"} for \"${query}\"`\n console.log(\"\")\n console.log(pc.bold(label) + pc.dim(` ${lang} · ${mode}`))\n console.log(\"\")\n}\n\nfunction footer(total: number, shown: number, lines: string[]): void {\n if (total > shown) {\n console.log(\"\")\n console.log(pc.dim(` ${total - shown} more — raise --limit to see them`))\n }\n console.log(\"\")\n for (const line of lines) console.log(pc.dim(line))\n}\n\nfunction noResults(query: string): void {\n log.warn(`Nothing matches \"${query}\".`)\n console.log(pc.dim(\" Try fewer or more general words, or run `vantage docs --list` to browse every page.\"))\n}\n\nfunction meta(entry: DocEntry) {\n return {\n slug: entry.slug,\n title: entry.title,\n description: entry.description,\n section: entry.section,\n sectionTitle: entry.sectionTitle,\n command: `vantage docs ${entry.slug}`,\n }\n}\n\n/** Default mode: rank the corpus with BM25 and show the best passage of each hit. */\nfunction runRanked(entries: DocEntry[], query: string, lang: DocLang, limit: number, json: boolean): number {\n const hits = buildIndex(entries).search(query)\n const shown = hits.slice(0, limit)\n const passage = (hit: SearchHit) => snippet(hit.body, hit.terms)\n\n if (json) {\n printJson({\n query,\n mode: \"bm25\",\n lang,\n count: hits.length,\n results: shown.map((hit) => ({\n ...meta(hit.entry),\n score: Math.round(hit.score * 1000) / 1000,\n snippet: passage(hit),\n })),\n })\n return 0\n }\n\n if (hits.length === 0) {\n noResults(query)\n return 0\n }\n\n const words = queryPhrases(query)\n const width = Math.max(...shown.map((hit) => hit.entry.slug.length))\n header(hits.length, query, lang, \"bm25\")\n for (const hit of shown) {\n const title = `${hit.entry.title}${pc.dim(` · ${hit.entry.sectionTitle}`)}`\n console.log(` ${pc.cyan(hit.entry.slug.padEnd(width))} ${title}`)\n const text = passage(hit)\n if (text) console.log(` ${\" \".repeat(width)} ${paintTerms(text, words)}`)\n }\n footer(hits.length, shown.length, [\n \"vantage docs <name> open one result --regex treat the query as a regular expression\",\n \"vantage search --json machine-readable --limit max results (default 10)\",\n ])\n return 0\n}\n\n/** `--regex` mode: scan names, titles and bodies for a regular expression. */\nfunction runRegex(entries: DocEntry[], query: string, lang: DocLang, limit: number, json: boolean): number {\n let scan: RegExp\n let probe: RegExp\n try {\n scan = new RegExp(query, \"gi\")\n probe = new RegExp(query, \"i\")\n } catch (err) {\n log.error(err instanceof Error ? err.message : `Invalid regular expression: ${String(err)}`)\n return 1\n }\n\n const results: { entry: DocEntry; matchCount: number; matches: { line: number; text: string }[] }[] = []\n for (const entry of entries) {\n const lines = readDoc(entry).split(\"\\n\")\n const matches: { line: number; text: string }[] = []\n let matchCount = 0\n for (let i = 0; i < lines.length; i++) {\n const found = [...lines[i]!.matchAll(scan)]\n if (found.length === 0) continue\n matchCount += found.length\n if (matches.length < MAX_REGEX_LINES) {\n matches.push({ line: i + 1, text: lines[i]!.replace(/\\s+/g, \" \").trim() })\n }\n }\n const inMeta = probe.test(entry.slug) || probe.test(entry.title) || probe.test(entry.description)\n if (matchCount === 0 && !inMeta) continue\n results.push({ entry, matchCount, matches })\n }\n // Stable sort: pages with more matches first, catalog order within ties.\n results.sort((a, b) => b.matchCount - a.matchCount)\n const shown = results.slice(0, limit)\n\n if (json) {\n printJson({\n query,\n mode: \"regex\",\n lang,\n count: results.length,\n results: shown.map((result) => ({\n ...meta(result.entry),\n matchCount: result.matchCount,\n matches: result.matches,\n })),\n })\n return 0\n }\n\n if (results.length === 0) {\n noResults(query)\n return 0\n }\n\n header(results.length, query, lang, \"regex\")\n for (const result of shown) {\n // A page can match on its name, title or description alone — with no body line to show.\n const count = pc.dim(\n result.matchCount ? ` ${result.matchCount} match${result.matchCount === 1 ? \"\" : \"es\"}` : \" name match\",\n )\n console.log(` ${pc.cyan(result.entry.slug)} ${result.entry.title}${count}`)\n for (const match of result.matches) {\n console.log(` ${pc.dim(String(match.line).padStart(4))} ${paintMatches(match.text, scan)}`)\n }\n }\n footer(results.length, shown.length, [\n \"vantage docs <name> open one result --limit max results (default 10)\",\n \"vantage search --json machine-readable --lang ja | en\",\n ])\n return 0\n}\n\n/** `vantage search <query> [--regex] [--limit n] [--json] [--lang ja|en]` */\nexport async function search(_root: string, args: ParsedArgs): Promise<number> {\n const query = args.positionals.slice(1).join(\" \").trim()\n if (!query) {\n log.error(\"Usage: vantage search <query> [--regex] [--limit <n>] [--lang ja|en] [--json]\")\n return 1\n }\n\n const catalog = loadCatalog()\n if (!catalog) {\n log.error(\"The bundled documentation is missing. Reinstall @squadbase/vantage, or run `pnpm build` in the framework repo.\")\n return 1\n }\n\n const langFlag = args.flags.lang\n if (langFlag !== undefined && !isDocLang(langFlag)) {\n log.error(`Unknown --lang \"${String(langFlag)}\". Available: ${DOC_LANGS.join(\", \")}`)\n return 1\n }\n const lang: DocLang = isDocLang(langFlag) ? langFlag : DEFAULT_DOC_LANG\n\n const entries = docsForLang(catalog, lang)\n if (entries.length === 0) {\n log.error(`No documentation bundled for \"${lang}\".`)\n return 1\n }\n\n // Pages that opted out with `search: false` (e.g. the changelog) are still\n // reachable via `vantage docs` but never surface here.\n const searchable = entries.filter((entry) => entry.searchable !== false)\n\n const limit = parseLimit(args.flags.limit, DEFAULT_LIMIT)\n const json = Boolean(args.flags.json)\n return args.flags.regex\n ? runRegex(searchable, query, lang, limit, json)\n : runRanked(searchable, query, lang, limit, json)\n}\n"]}
|
package/dist/slide/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { ReactNode, PropsWithChildren, CSSProperties, ReactElement } from 'react';
|
|
3
|
+
import { V as ValueFormat } from '../format-U0cQl069.js';
|
|
4
|
+
export { D as DeltaText, a as DeltaTextProps } from '../delta-text-CvwBGJ95.js';
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
7
|
* Ported from open-slide (MIT) — https://github.com/1weiho/open-slide
|
|
@@ -227,4 +229,273 @@ declare function exportDeckAsPptx({ slides, fileName, theme, onProgress, }: Expo
|
|
|
227
229
|
declare const CANVAS_WIDTH = 1920;
|
|
228
230
|
declare const CANVAS_HEIGHT = 1080;
|
|
229
231
|
|
|
230
|
-
|
|
232
|
+
interface SlideChartInsightChart {
|
|
233
|
+
type: "line" | "bar" | "area";
|
|
234
|
+
/** The x-axis labels, one per value of each series. */
|
|
235
|
+
categories: string[];
|
|
236
|
+
series: {
|
|
237
|
+
name: string;
|
|
238
|
+
data: number[];
|
|
239
|
+
}[];
|
|
240
|
+
}
|
|
241
|
+
interface SlideChartInsightProps {
|
|
242
|
+
/** The conclusion as a sentence (an action title). */
|
|
243
|
+
title: string;
|
|
244
|
+
chart: SlideChartInsightChart;
|
|
245
|
+
/** 2–3 points that read the chart. */
|
|
246
|
+
insights: string[];
|
|
247
|
+
/** Which side the chart takes. Default `"left"`. */
|
|
248
|
+
chartSide?: "left" | "right";
|
|
249
|
+
/** The date the numbers were taken, date only, e.g. `"2026-10-01"`. Shown as「2026-10-01 時点」(the block adds「時点」once). */
|
|
250
|
+
asOf?: string;
|
|
251
|
+
/** Where the numbers come from, e.g.「社内 BI」. Shown as「出典: 社内 BI」. */
|
|
252
|
+
source?: string;
|
|
253
|
+
}
|
|
254
|
+
declare function SlideChartInsight({ title, chart, insights, chartSide, asOf, source }: SlideChartInsightProps): React.JSX.Element;
|
|
255
|
+
|
|
256
|
+
interface SlideCoverProps {
|
|
257
|
+
/** The name of the deck. */
|
|
258
|
+
title: string;
|
|
259
|
+
subtitle?: string;
|
|
260
|
+
/** The period the deck covers, e.g.「2026 年 7 月〜9 月」. */
|
|
261
|
+
period?: string;
|
|
262
|
+
author?: string;
|
|
263
|
+
/** The date the numbers were taken, date only, e.g. `"2026-10-20"`. Shown as「2026-10-20 時点」(the block adds「時点」once). */
|
|
264
|
+
asOf?: string;
|
|
265
|
+
/** Where the numbers come from, e.g.「社内 BI」. Shown as「出典: 社内 BI」. */
|
|
266
|
+
source?: string;
|
|
267
|
+
}
|
|
268
|
+
declare function SlideCover({ title, subtitle, period, author, asOf, source }: SlideCoverProps): React.JSX.Element;
|
|
269
|
+
|
|
270
|
+
interface SlideExecSummaryPoint {
|
|
271
|
+
/** The point in one line. */
|
|
272
|
+
headline: string;
|
|
273
|
+
/** One supporting line (a number, a cause). */
|
|
274
|
+
detail?: string;
|
|
275
|
+
}
|
|
276
|
+
interface SlideExecSummaryProps {
|
|
277
|
+
/** The conclusion as a sentence (an action title), not a topic. */
|
|
278
|
+
title: string;
|
|
279
|
+
/** 3–5 points. */
|
|
280
|
+
points: SlideExecSummaryPoint[];
|
|
281
|
+
layout?: "rows" | "columns";
|
|
282
|
+
/** The date the numbers were taken, date only, e.g. `"2026-10-01"`. Shown as「2026-10-01 時点」(the block adds「時点」once). */
|
|
283
|
+
asOf?: string;
|
|
284
|
+
/** Where the numbers come from, e.g.「社内 BI」. Shown as「出典: 社内 BI」. */
|
|
285
|
+
source?: string;
|
|
286
|
+
}
|
|
287
|
+
declare function SlideExecSummary({ title, points, layout, asOf, source }: SlideExecSummaryProps): React.JSX.Element;
|
|
288
|
+
|
|
289
|
+
/** A change: its size in the metric's units, signed. The direction is read from the sign. */
|
|
290
|
+
interface SlideKpiGridDelta {
|
|
291
|
+
/** e.g. `0.074` with `format: "percent"` →「+7.4%」. */
|
|
292
|
+
value: number;
|
|
293
|
+
/** Default: the item's `format`. */
|
|
294
|
+
format?: ValueFormat;
|
|
295
|
+
}
|
|
296
|
+
interface SlideKpiGridItem {
|
|
297
|
+
label: string;
|
|
298
|
+
/** The number; `null` shows「—」. */
|
|
299
|
+
value: number | null;
|
|
300
|
+
format?: ValueFormat;
|
|
301
|
+
/** Replaces the shown text only (the number behind it stays `value`). */
|
|
302
|
+
display?: string;
|
|
303
|
+
delta?: SlideKpiGridDelta;
|
|
304
|
+
/** Which direction of `delta` is good. Default `"up"`. */
|
|
305
|
+
betterWhen?: "up" | "down";
|
|
306
|
+
/** What `delta` is against, e.g.「前月比」. */
|
|
307
|
+
comparisonLabel?: string;
|
|
308
|
+
/** The target, in the same `format` as `value`. The attainment rate is worked out here. */
|
|
309
|
+
target?: number;
|
|
310
|
+
}
|
|
311
|
+
interface SlideKpiGridProps {
|
|
312
|
+
/** The conclusion as a sentence (an action title). */
|
|
313
|
+
title: string;
|
|
314
|
+
/** 2–4 KPIs. */
|
|
315
|
+
items: SlideKpiGridItem[];
|
|
316
|
+
/** The date the numbers were taken, date only, e.g. `"2026-10-01"`. Shown as「2026-10-01 時点」(the block adds「時点」once). */
|
|
317
|
+
asOf?: string;
|
|
318
|
+
/** Where the numbers come from, e.g.「社内 BI」. Shown as「出典: 社内 BI」. */
|
|
319
|
+
source?: string;
|
|
320
|
+
}
|
|
321
|
+
declare function SlideKpiGrid({ title, items, asOf, source }: SlideKpiGridProps): React.JSX.Element;
|
|
322
|
+
|
|
323
|
+
/** A change: its size in the metric's units, signed. The direction is read from the sign. */
|
|
324
|
+
interface SlideKpiHeroDelta {
|
|
325
|
+
/** e.g. `0.074` with `format: "percent"` →「+7.4%」. */
|
|
326
|
+
value: number;
|
|
327
|
+
/** Default: the metric's `format`. */
|
|
328
|
+
format?: ValueFormat;
|
|
329
|
+
}
|
|
330
|
+
interface SlideKpiHeroProps {
|
|
331
|
+
/** The conclusion as a sentence (an action title). */
|
|
332
|
+
title: string;
|
|
333
|
+
/** What the number is, e.g.「月次売上」. */
|
|
334
|
+
label: string;
|
|
335
|
+
/** The number; `null` shows「—」. */
|
|
336
|
+
value: number | null;
|
|
337
|
+
format?: ValueFormat;
|
|
338
|
+
/** Replaces the shown text only (the number behind it stays `value`). */
|
|
339
|
+
display?: string;
|
|
340
|
+
delta?: SlideKpiHeroDelta;
|
|
341
|
+
/** Which direction of `delta` is good. Default `"up"`. */
|
|
342
|
+
betterWhen?: "up" | "down";
|
|
343
|
+
/** What `delta` is against, e.g.「前月比」. */
|
|
344
|
+
comparisonLabel?: string;
|
|
345
|
+
/** Points of the line on the right; leave out for a number alone. */
|
|
346
|
+
trend?: {
|
|
347
|
+
x: string;
|
|
348
|
+
y: number;
|
|
349
|
+
}[];
|
|
350
|
+
/** The date the numbers were taken, date only, e.g. `"2026-10-01"`. Shown as「2026-10-01 時点」(the block adds「時点」once). */
|
|
351
|
+
asOf?: string;
|
|
352
|
+
/** Where the numbers come from, e.g.「社内 BI」. Shown as「出典: 社内 BI」. */
|
|
353
|
+
source?: string;
|
|
354
|
+
}
|
|
355
|
+
declare function SlideKpiHero({ title, label, value, format, display, delta, betterWhen, comparisonLabel, trend, asOf, source }: SlideKpiHeroProps): React.JSX.Element;
|
|
356
|
+
|
|
357
|
+
interface SlideNextActionsItem {
|
|
358
|
+
/** What to do, as one sentence starting from the verb's object. */
|
|
359
|
+
action: string;
|
|
360
|
+
owner?: string;
|
|
361
|
+
/** As written, e.g. `"10/31"`. */
|
|
362
|
+
due?: string;
|
|
363
|
+
/** What to look at to know it worked. */
|
|
364
|
+
metric?: string;
|
|
365
|
+
}
|
|
366
|
+
interface SlideNextActionsProps {
|
|
367
|
+
/** The decision or the plan as a sentence (an action title). */
|
|
368
|
+
title: string;
|
|
369
|
+
/** 3–5 actions. */
|
|
370
|
+
items: SlideNextActionsItem[];
|
|
371
|
+
/** The date the numbers were taken, date only, e.g. `"2026-10-01"`. Shown as「2026-10-01 時点」(the block adds「時点」once). */
|
|
372
|
+
asOf?: string;
|
|
373
|
+
/** Where the numbers come from, e.g.「社内 BI」. Shown as「出典: 社内 BI」. */
|
|
374
|
+
source?: string;
|
|
375
|
+
}
|
|
376
|
+
declare function SlideNextActions({ title, items, asOf, source }: SlideNextActionsProps): React.JSX.Element;
|
|
377
|
+
|
|
378
|
+
type SlideScorecardStatus = "on" | "risk" | "off";
|
|
379
|
+
interface SlideScorecardRow {
|
|
380
|
+
metric: string;
|
|
381
|
+
/** The actual; `null` shows「—」. */
|
|
382
|
+
value: number | null;
|
|
383
|
+
format?: ValueFormat;
|
|
384
|
+
/** Replaces the shown actual only (the number behind it stays `value`). */
|
|
385
|
+
display?: string;
|
|
386
|
+
/** The target, in the same `format` as `value`. */
|
|
387
|
+
target?: number;
|
|
388
|
+
/** Which direction is good. Default `"up"`; it flips the attainment rate. */
|
|
389
|
+
betterWhen?: "up" | "down";
|
|
390
|
+
/** `on` = on track, `risk` = at risk, `off` = off track. */
|
|
391
|
+
status: SlideScorecardStatus;
|
|
392
|
+
}
|
|
393
|
+
interface SlideScorecardTableProps {
|
|
394
|
+
/** The conclusion as a sentence (an action title). */
|
|
395
|
+
title: string;
|
|
396
|
+
/** Up to 8 rows. */
|
|
397
|
+
rows: SlideScorecardRow[];
|
|
398
|
+
/** Header words; leave out what you do not rename. */
|
|
399
|
+
columns?: Partial<Record<"metric" | "target" | "actual" | "attainment" | "status", string>>;
|
|
400
|
+
/** The date the numbers were taken, date only, e.g. `"2026-10-01"`. Shown as「2026-10-01 時点」(the block adds「時点」once). */
|
|
401
|
+
asOf?: string;
|
|
402
|
+
/** Where the numbers come from, e.g.「社内 BI」. Shown as「出典: 社内 BI」. */
|
|
403
|
+
source?: string;
|
|
404
|
+
}
|
|
405
|
+
declare function SlideScorecardTable({ title, rows, columns, asOf, source }: SlideScorecardTableProps): React.JSX.Element;
|
|
406
|
+
|
|
407
|
+
interface SlideChartFullProps {
|
|
408
|
+
/** The conclusion as a sentence (an action title). */
|
|
409
|
+
title: string;
|
|
410
|
+
chart: SlideChartInsightChart;
|
|
411
|
+
/** One line under the chart. */
|
|
412
|
+
note?: string;
|
|
413
|
+
/** The date the numbers were taken, date only, e.g. `"2026-10-01"`. Shown as「2026-10-01 時点」(the block adds「時点」once). */
|
|
414
|
+
asOf?: string;
|
|
415
|
+
/** Where the numbers come from, e.g.「社内 BI」. Shown as「出典: 社内 BI」. */
|
|
416
|
+
source?: string;
|
|
417
|
+
}
|
|
418
|
+
declare function SlideChartFull({ title, chart, note, asOf, source }: SlideChartFullProps): React.JSX.Element;
|
|
419
|
+
|
|
420
|
+
interface SlideComparisonColumn {
|
|
421
|
+
/** What this column is, e.g.「旧プラン」「施策前」. */
|
|
422
|
+
heading: string;
|
|
423
|
+
/** The main number. `null` shows「—」. */
|
|
424
|
+
value?: number | null;
|
|
425
|
+
format?: ValueFormat;
|
|
426
|
+
/** The main number as a string you already formatted; wins over `value`. */
|
|
427
|
+
display?: string;
|
|
428
|
+
/** The change of the main number against the other side or the previous period. `format` falls back to the column's `format`. */
|
|
429
|
+
delta?: {
|
|
430
|
+
value: number | null;
|
|
431
|
+
format?: ValueFormat;
|
|
432
|
+
};
|
|
433
|
+
/** Name of what `delta` is measured against, e.g.「前月比」「旧プラン比」. Printed before the change. */
|
|
434
|
+
comparisonLabel?: string;
|
|
435
|
+
/** Which way is good for the main number. Default `"up"`. */
|
|
436
|
+
betterWhen?: "up" | "down";
|
|
437
|
+
/** 1–3 short points about this column. */
|
|
438
|
+
points: string[];
|
|
439
|
+
}
|
|
440
|
+
interface SlideComparisonProps {
|
|
441
|
+
/** The conclusion as a sentence (an action title). */
|
|
442
|
+
title: string;
|
|
443
|
+
/** 2–3 columns. */
|
|
444
|
+
columns: SlideComparisonColumn[];
|
|
445
|
+
/** One line that says which side wins or what follows. */
|
|
446
|
+
verdict?: string;
|
|
447
|
+
/** The date the numbers were taken, date only, e.g. `"2026-10-01"`. Shown as「2026-10-01 時点」(the block adds「時点」once). */
|
|
448
|
+
asOf?: string;
|
|
449
|
+
/** Where the numbers come from, e.g.「社内 BI」. Shown as「出典: 社内 BI」. */
|
|
450
|
+
source?: string;
|
|
451
|
+
}
|
|
452
|
+
declare function SlideComparison({ title, columns, verdict, asOf, source }: SlideComparisonProps): React.JSX.Element;
|
|
453
|
+
|
|
454
|
+
interface SlideSectionProps {
|
|
455
|
+
/** The chapter number, shown as「02」above the title. */
|
|
456
|
+
index?: number;
|
|
457
|
+
title: string;
|
|
458
|
+
/** One line under the title saying what the chapter answers. */
|
|
459
|
+
lead?: string;
|
|
460
|
+
/** The chapters of the deck, shown as a numbered agenda at the right. */
|
|
461
|
+
items?: string[];
|
|
462
|
+
/** The chapter in `items` to emphasise, 1-based. */
|
|
463
|
+
current?: number;
|
|
464
|
+
}
|
|
465
|
+
declare function SlideSection({ index, title, lead, items, current }: SlideSectionProps): React.JSX.Element;
|
|
466
|
+
|
|
467
|
+
interface SlideHeadingProps {
|
|
468
|
+
/** The conclusion as a sentence (an action title). Clamped to 2 lines. */
|
|
469
|
+
title: string;
|
|
470
|
+
/** A short label above the title, e.g.「第 2 章 解約」. */
|
|
471
|
+
eyebrow?: string;
|
|
472
|
+
}
|
|
473
|
+
declare function SlideHeading({ title, eyebrow }: SlideHeadingProps): React.JSX.Element;
|
|
474
|
+
|
|
475
|
+
interface SlideSourceLineProps {
|
|
476
|
+
/** The date the numbers were taken, date only, e.g. `"2026-10-01"`. Shown as「2026-10-01 時点」(this part adds「時点」once). */
|
|
477
|
+
asOf?: string;
|
|
478
|
+
/** Where the numbers come from, e.g.「社内 BI」. Shown as「出典: 社内 BI」. */
|
|
479
|
+
source?: string;
|
|
480
|
+
/** The page number, shown at the right as「3 / 12」. */
|
|
481
|
+
page?: {
|
|
482
|
+
current: number;
|
|
483
|
+
total: number;
|
|
484
|
+
};
|
|
485
|
+
}
|
|
486
|
+
declare function SlideSourceLine({ asOf, source, page }: SlideSourceLineProps): React.JSX.Element | null;
|
|
487
|
+
|
|
488
|
+
interface SlideColumnsProps {
|
|
489
|
+
children: ReactNode;
|
|
490
|
+
/** Vertical alignment of the columns in the row. Default `"stretch"`. */
|
|
491
|
+
align?: "start" | "center" | "stretch";
|
|
492
|
+
}
|
|
493
|
+
declare function SlideColumns({ children, align }: SlideColumnsProps): React.JSX.Element;
|
|
494
|
+
interface SlideColumnProps {
|
|
495
|
+
/** How many of the 12 columns it takes, 1–12. */
|
|
496
|
+
span: number;
|
|
497
|
+
children: ReactNode;
|
|
498
|
+
}
|
|
499
|
+
declare function SlideColumn({ span, children }: SlideColumnProps): React.JSX.Element;
|
|
500
|
+
|
|
501
|
+
export { CANVAS_HEIGHT, CANVAS_WIDTH, type EntryDirection, type ExportDeckOptions, MorphElement, type MorphElementProps, type MorphTransition, type PptxExportProgress, Slide, SlideCanvas, type SlideCanvasProps, SlideChartFull, type SlideChartFullProps, SlideChartInsight, type SlideChartInsightChart, type SlideChartInsightProps, SlideColumn, type SlideColumnProps, SlideColumns, type SlideColumnsProps, SlideComparison, type SlideComparisonColumn, type SlideComparisonProps, SlideCover, type SlideCoverProps, SlideDeck, type SlideDeckProps, SlideExecSummary, type SlideExecSummaryPoint, type SlideExecSummaryProps, SlideHeading, type SlideHeadingProps, SlideKpiGrid, type SlideKpiGridDelta, type SlideKpiGridItem, type SlideKpiGridProps, SlideKpiHero, type SlideKpiHeroDelta, type SlideKpiHeroProps, SlideNextActions, type SlideNextActionsItem, type SlideNextActionsProps, type SlideProps, type SlideScorecardRow, type SlideScorecardStatus, SlideScorecardTable, type SlideScorecardTableProps, SlideSection, type SlideSectionProps, SlideSourceLine, type SlideSourceLineProps, type SlideTheme, type SlideTransition, Step, type StepController, type StepProps, Steps, type TransitionPhase, exportDeckAsPptx, useIsActiveSlide, useSlideNumber };
|