@smarter.sh/ui-widgets 0.0.0-stage → 0.35.4-alpha.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/README.md CHANGED
@@ -1,3 +1,87 @@
1
- # Temporary Holding Version
1
+ # @smarter.sh/ui-widgets
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ React widgets from the [Smarter](https://smarter.sh) web console's dashboard: the ones that show
4
+ no account data. The web console's dashboard uses them, and so does [smarter.sh](https://smarter.sh),
5
+ so that the two look the same.
6
+
7
+ | Widget | What it shows |
8
+ | ---------- | ------------------------------------------------------------------------------- |
9
+ | `SelfHost` | The path from a laptop to production: Docker Compose, the Helm chart, Terraform |
10
+ | `Sdk` | The Smarter SDKs, with their install commands, and links to the API reference |
11
+
12
+ ## Install
13
+
14
+ ```console
15
+ npm install @smarter.sh/ui-widgets
16
+ ```
17
+
18
+ React 19 is a peer dependency. Prereleases are published with the `alpha` and `beta` dist-tags,
19
+ e.g. `npm install @smarter.sh/ui-widgets@alpha`.
20
+
21
+ ## Use
22
+
23
+ ```jsx
24
+ import { SelfHost, Sdk } from "@smarter.sh/ui-widgets";
25
+
26
+ <div className="keen">
27
+ <div className="row g-5 g-xl-10">
28
+ <div className="col-xl-8">
29
+ <SelfHost />
30
+ </div>
31
+ <Sdk openapiUrl="https://platform.smarter.sh/docs/openapi/" />
32
+ </div>
33
+ </div>;
34
+ ```
35
+
36
+ The library imports its own stylesheet, so a bundler such as Vite or webpack loads it along with
37
+ the widgets. A page without a bundler links `@smarter.sh/ui-widgets/style.css`.
38
+
39
+ ### What the page provides
40
+
41
+ The widgets are styled for the [Keen](https://keenthemes.com/) Bootstrap theme, as the web console
42
+ is. This package doesn't include the theme. A page provides:
43
+
44
+ - **The Keen stylesheet.** The web console loads it on every page. A page with a design of its own,
45
+ such as smarter.sh, can scope it to the elements that hold the widgets, as smarter.sh does with
46
+ its `.keen` wrapper.
47
+ - **The Keen theme's images**, at their `/static/assets/` paths: the Sdk widget's illustration
48
+ (`media/illustrations/dozzy-1/4.png`) and its React and Python logos
49
+ (`media/svg/brand-logos/react.svg`, `python-5.svg`).
50
+
51
+ The widgets' other logos are [Simple Icons](https://simpleicons.org/) (CC0), and are inlined in
52
+ the library.
53
+
54
+ ### Text and translations
55
+
56
+ The widgets' text is English. In the web console, which defines Django's JavaScript catalog
57
+ (`window.django`), it is translated into the user's language.
58
+
59
+ ## Props
60
+
61
+ | Widget | Prop | Default | Purpose |
62
+ | ------ | ------------ | ---------------- | -------------------------------------------------------------------------------- |
63
+ | `Sdk` | `openapiUrl` | `/docs/openapi/` | The API reference button's url. Outside a web console, a platform's absolute url |
64
+ | `Sdk` | `className` | `col-xl-4` | The card's grid column classes |
65
+
66
+ `SelfHost` has no props.
67
+
68
+ ## Development
69
+
70
+ The package is part of the Smarter web console's npm workspace, in
71
+ [smarter/react/packages/smarter-widgets](https://github.com/smarter-sh/smarter/tree/main/smarter/react/packages/smarter-widgets).
72
+
73
+ ```console
74
+ cd smarter/react
75
+ npx vitest run --project smarter-widgets # tests, including every story
76
+ npm run build:lib -w @smarter.sh/ui-widgets # dist/
77
+ npm run check:dist -w @smarter.sh/ui-widgets # checks dist/ before it is published
78
+ make react-storybook APP=smarter-widgets # Storybook, from the repository's root
79
+ ```
80
+
81
+ Each Smarter release publishes the package, at the platform's version:
82
+ `.github/workflows/uiWidgetsRelease.yml`. In the workspace, its version stays at the one that the
83
+ web console's dashboard depends on.
84
+
85
+ ## License
86
+
87
+ AGPL-3.0-or-later
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Sdk dashboard widget.
3
+ *
4
+ * This component renders a promotional card for the Smarter developer SDKs:
5
+ * the smarter-chat NPM package (@smarter.sh/ui-chat), the Node.js SDK
6
+ * (@smarter.sh/api), the Python PyPI library (smarter-api) and the Go module
7
+ * (github.com/smarter-sh/smarter-golang). Each SDK shows its logo, links to its
8
+ * package registry, and shows its install command, followed by links to the
9
+ * APIs and SDKs documentation and to a platform's OpenAPI document.
10
+ *
11
+ * :param openapiUrl: The OpenAPI document that the API reference button opens. Defaults to this
12
+ * platform's, which every web console serves. A page outside the web console, such as
13
+ * smarter.sh, passes a platform's absolute url.
14
+ * :type openapiUrl: str
15
+ * :param className: The card's grid column classes, so that the page can set its width.
16
+ * :type className: str
17
+ * :returns: A JSX fragment containing the SDK call-to-action widget.
18
+ * :rtype: JSX.Element
19
+ *
20
+ * :example:
21
+ *
22
+ * <Sdk />
23
+ * <Sdk openapiUrl="https://platform.smarter.sh/docs/openapi/" className="col-12" />
24
+ */
25
+ import "./styles.css";
26
+ export interface SdkProps {
27
+ /** The OpenAPI document that the API reference button opens. */
28
+ openapiUrl?: string;
29
+ /** The card's grid column classes, so that the page can set its width. */
30
+ className?: string;
31
+ }
32
+ declare function Sdk({ openapiUrl, className }: SdkProps): import("react").JSX.Element;
33
+ export default Sdk;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * SelfHost dashboard widget.
3
+ *
4
+ * This component renders a promotional card for self-hosting Smarter, as a
5
+ * three-step path from a laptop to production: the Docker Compose Quick Start
6
+ * (smarter-deploy), the official Helm chart for Kubernetes, and the official
7
+ * Terraform modules for AWS (smarter-infrastructure). Each step links to its
8
+ * resource, followed by a link to the installation guide.
9
+ *
10
+ * :returns: A JSX fragment containing the self-host call-to-action widget.
11
+ * :rtype: JSX.Element
12
+ *
13
+ * :example:
14
+ *
15
+ * <SelfHost />
16
+ */
17
+ import "./styles.css";
18
+ declare function SelfHost(): import("react").JSX.Element;
19
+ export default SelfHost;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @smarter.sh/ui-widgets: the Smarter web console's dashboard widgets that show no account data,
3
+ * for the web console's dashboard (@smarter/dashboard) and for smarter.sh.
4
+ *
5
+ * The widgets are styled for the Keen Bootstrap theme, which the page provides. The library imports
6
+ * the widgets' own stylesheet, so a page's bundler loads it along with them.
7
+ */
8
+ export { default as Sdk } from "./components/Sdk/Component";
9
+ export type { SdkProps } from "./components/Sdk/Component";
10
+ export { default as SelfHost } from "./components/SelfHost/Component";
@@ -0,0 +1,2 @@
1
+ .sdk-card{background:linear-gradient(135deg,#e6f4ff 0%,#fff1e6 100%);overflow:hidden}.sdk-lede{max-width:65%}.sdk-list{flex-direction:column;gap:.75rem;margin-bottom:0;padding-left:0;list-style:none;display:flex}.sdk-item{align-items:center;gap:.85rem;display:flex}.sdk-logo{background-color:#fff;border-radius:.75rem;flex-shrink:0;justify-content:center;align-items:center;width:44px;height:44px;display:flex;box-shadow:0 .4rem 1rem #1c325e26}.sdk-logo img{width:24px;height:24px}.sdk-text{flex-direction:column;min-width:0;display:flex}.sdk-name{color:#1c325e;font-weight:600}.sdk-name:hover{color:#f1416c}.sdk-install{color:#a6e3a1;max-width:100%;font-family:var(--bs-font-monospace,monospace);text-overflow:ellipsis;white-space:nowrap;-webkit-user-select:all;user-select:all;background-color:#1e1e2e;border-radius:.4rem;align-self:flex-start;margin-top:.2rem;padding:.1rem .45rem;font-size:.75rem;overflow:hidden}.selfhost-card{background:radial-gradient(circle at 15% 110%,#2496ed59 0%,#2496ed00 50%),radial-gradient(circle at 95% 0,#844fba59 0%,#844fba00 45%),linear-gradient(135deg,#0b1d3a 0%,#1c325e 100%);overflow:hidden}.selfhost-eyebrow{color:#7cc4ff;letter-spacing:.08em;text-transform:uppercase;background-color:#2496ed33;border-radius:999px;align-self:flex-start;padding:.25rem .7rem;font-size:.7rem;font-weight:700}.selfhost-underline{opacity:.8;border-color:#2496ed!important}.selfhost-lede{color:#ffffffbf;max-width:70%}.selfhost-steps{grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;margin:0;padding:0;list-style:none;display:grid;position:relative}.selfhost-steps:before{content:"";border-top:2px dashed #ffffff4d;position:absolute;top:28px;left:16.66%;right:16.66%}.selfhost-step-link{text-align:center;flex-direction:column;align-items:center;height:100%;padding:0 .25rem;text-decoration:none;display:flex;position:relative}.selfhost-logo{background-color:#fff;border-radius:1rem;justify-content:center;align-items:center;width:56px;height:56px;margin-bottom:.75rem;display:flex;position:relative;box-shadow:0 .5rem 1.25rem #00000059}.selfhost-logo img{width:30px;height:30px}.selfhost-number{color:#fff;background-color:#2496ed;border:2px solid #1c325e;border-radius:50%;justify-content:center;align-items:center;width:1.4rem;height:1.4rem;font-size:.7rem;font-weight:700;display:flex;position:absolute;top:-.5rem;right:-.5rem}.selfhost-where{color:#7cc4ff;letter-spacing:.06em;text-transform:uppercase;font-size:.7rem;font-weight:700}.selfhost-name{color:#fff;font-size:1.05rem;font-weight:700}.selfhost-description{color:#ffffffa6;font-size:.8rem;line-height:1.3}.selfhost-step-link:hover .selfhost-name{color:#7cc4ff}.selfhost-btn{color:#fff;background-color:#2496ed}.selfhost-btn:hover{color:#fff;background-color:#1a7bc7}.selfhost-license{color:#ffffff8c;font-size:.8rem}@media (width<=575.98px){.selfhost-lede{max-width:none}.selfhost-steps{grid-template-columns:1fr}.selfhost-steps:before{display:none}}
2
+ /*$vite$:1*/
@@ -0,0 +1,279 @@
1
+ import "./ui-widgets.css";
2
+ import { Fragment as e, jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import { Fragment as r } from "react";
4
+ //#region ../smarter-common/dist/lib/i18n.js
5
+ var i = /%\(([A-Za-z_][A-Za-z0-9_]*)\)s/g, a = () => typeof window > "u" ? void 0 : window.django;
6
+ function o(e) {
7
+ let t = a();
8
+ return t?.gettext ? t.gettext(e) : e;
9
+ }
10
+ function s(n, a) {
11
+ let o = [], s = 0;
12
+ for (let e of n.matchAll(i)) {
13
+ let [t, r] = e, i = e.index ?? 0;
14
+ i > s && o.push(n.slice(s, i)), o.push(r in a ? a[r] : t), s = i + t.length;
15
+ }
16
+ return s < n.length && o.push(n.slice(s)), t(e, { children: o.map((e, n) => t(r, { children: e }, n)) });
17
+ }
18
+ var c = {
19
+ name: "@smarter/common",
20
+ private: !1,
21
+ version: "0.2.0",
22
+ type: "module",
23
+ main: "./dist/index.js",
24
+ types: "./dist/index.d.ts",
25
+ exports: { ".": {
26
+ import: "./dist/index.js",
27
+ require: "./dist/index.js",
28
+ types: "./dist/index.d.ts"
29
+ } },
30
+ files: ["dist"],
31
+ scripts: {
32
+ clean: "rm -rf dist",
33
+ build: "npm run clean && tsc -p tsconfig.build.json && rsync -a --prune-empty-dirs --include='/' --include='.css' --exclude='*' src/ dist/",
34
+ "build:dist-manifest": "node --input-type=module -e \"import fs from 'node:fs'; const pkg = JSON.parse(fs.readFileSync('package.json','utf8')); const out = { name: pkg.name, version: pkg.version, type: pkg.type, main: './index.js', types: './index.d.ts', peerDependencies: pkg.peerDependencies ?? {}, dependencies: pkg.dependencies ?? {} }; fs.writeFileSync('dist/package.json', JSON.stringify(out, null, 2) + '\\n');\"",
35
+ "pack:tgz": "npm pack --ignore-scripts",
36
+ lint: "eslint .",
37
+ storybook: "storybook dev -p 6006",
38
+ "build-storybook": "storybook build",
39
+ typecheck: "tsc -b",
40
+ test: "vitest run",
41
+ "test:watch": "vitest"
42
+ },
43
+ peerDependencies: {
44
+ react: "^19",
45
+ "react-dom": "^19"
46
+ },
47
+ dependencies: { "date-fns": "^4.4.0" },
48
+ devDependencies: {
49
+ "@eslint/js": "^10.0.1",
50
+ "@storybook/addon-a11y": "^10.6.1",
51
+ "@storybook/addon-docs": "^10.6.1",
52
+ "@storybook/react-vite": "^10.6.1",
53
+ "@types/node": "^26.6.3",
54
+ "@types/react": "^19.3.0",
55
+ "@types/react-dom": "^19.3.0",
56
+ eslint: "^10.11.0",
57
+ "eslint-plugin-react-hooks": "^7.1.1",
58
+ "eslint-plugin-storybook": "^10.6.1",
59
+ globals: "^17.13.0",
60
+ react: "^19.3.0",
61
+ "react-dom": "^19.3.0",
62
+ storybook: "^10.6.1",
63
+ typescript: "~6.0.2",
64
+ "typescript-eslint": "^8.71.0",
65
+ vitest: "^5.0.3"
66
+ }
67
+ }, l = c.name, u = c.version;
68
+ `${l}${u}`, `${l}${u}`, `${l}${u}`;
69
+ //#endregion
70
+ //#region src/assets/go.svg
71
+ var d = "data:image/svg+xml,%3csvg%20fill='%2300ADD8'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGo%3c/title%3e%3cpath%20d='M1.811%2010.231c-.047%200-.058-.023-.035-.059l.246-.315c.023-.035.081-.058.128-.058h4.172c.046%200%20.058.035.035.07l-.199.303c-.023.036-.082.07-.117.07zM.047%2011.306c-.047%200-.059-.023-.035-.058l.245-.316c.023-.035.082-.058.129-.058h5.328c.047%200%20.07.035.058.07l-.093.28c-.012.047-.058.07-.105.07zm2.828%201.075c-.047%200-.059-.035-.035-.07l.163-.292c.023-.035.07-.07.117-.07h2.337c.047%200%20.07.035.07.082l-.023.28c0%20.047-.047.082-.082.082zm12.129-2.36c-.736.187-1.239.327-1.963.514-.176.046-.187.058-.34-.117-.174-.199-.303-.327-.548-.444-.737-.362-1.45-.257-2.115.175-.795.514-1.204%201.274-1.192%202.22.011.935.654%201.706%201.577%201.835.795.105%201.46-.175%201.987-.77.105-.13.198-.27.315-.434H10.47c-.245%200-.304-.152-.222-.35.152-.362.432-.97.596-1.274a.315.315%200%2001.292-.187h4.253c-.023.316-.023.631-.07.947a4.983%204.983%200%2001-.958%202.29c-.841%201.11-1.94%201.8-3.33%201.986-1.145.152-2.209-.07-3.143-.77-.865-.655-1.356-1.52-1.484-2.595-.152-1.274.222-2.419.993-3.424.83-1.086%201.928-1.776%203.272-2.02%201.098-.2%202.15-.07%203.096.571.62.41%201.063.97%201.356%201.648.07.105.023.164-.117.2m3.868%206.461c-1.064-.024-2.034-.328-2.852-1.029a3.665%203.665%200%2001-1.262-2.255c-.21-1.32.152-2.489.947-3.529.853-1.122%201.881-1.706%203.272-1.95%201.192-.21%202.314-.095%203.33.595.923.63%201.496%201.484%201.648%202.605.198%201.578-.257%202.863-1.344%203.962-.771.783-1.718%201.273-2.805%201.495-.315.06-.63.07-.934.106zm2.78-4.72c-.011-.153-.011-.27-.034-.387-.21-1.157-1.274-1.81-2.384-1.554-1.087.245-1.788.935-2.045%202.033-.21.912.234%201.835%201.075%202.21.643.28%201.285.244%201.905-.07.923-.48%201.425-1.228%201.484-2.233z'/%3e%3c/svg%3e", f = "data:image/svg+xml,%3csvg%20fill='%235FA04E'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eNode.js%3c/title%3e%3cpath%20d='M11.998,24c-0.321,0-0.641-0.084-0.922-0.247l-2.936-1.737c-0.438-0.245-0.224-0.332-0.08-0.383%20c0.585-0.203,0.703-0.25,1.328-0.604c0.065-0.037,0.151-0.023,0.218,0.017l2.256,1.339c0.082,0.045,0.197,0.045,0.272,0l8.795-5.076%20c0.082-0.047,0.134-0.141,0.134-0.238V6.921c0-0.099-0.053-0.192-0.137-0.242l-8.791-5.072c-0.081-0.047-0.189-0.047-0.271,0%20L3.075,6.68C2.99,6.729,2.936,6.825,2.936,6.921v10.15c0,0.097,0.054,0.189,0.139,0.235l2.409,1.392%20c1.307,0.654,2.108-0.116,2.108-0.89V7.787c0-0.142,0.114-0.253,0.256-0.253h1.115c0.139,0,0.255,0.112,0.255,0.253v10.021%20c0,1.745-0.95,2.745-2.604,2.745c-0.508,0-0.909,0-2.026-0.551L2.28,18.675c-0.57-0.329-0.922-0.945-0.922-1.604V6.921%20c0-0.659,0.353-1.275,0.922-1.603l8.795-5.082c0.557-0.315,1.296-0.315,1.848,0l8.794,5.082c0.57,0.329,0.924,0.944,0.924,1.603%20v10.15c0,0.659-0.354,1.273-0.924,1.604l-8.794,5.078C12.643,23.916,12.324,24,11.998,24z%20M19.099,13.993%20c0-1.9-1.284-2.406-3.987-2.763c-2.731-0.361-3.009-0.548-3.009-1.187c0-0.528,0.235-1.233,2.258-1.233%20c1.807,0,2.473,0.389,2.747,1.607c0.024,0.115,0.129,0.199,0.247,0.199h1.141c0.071,0,0.138-0.031,0.186-0.081%20c0.048-0.054,0.074-0.123,0.067-0.196c-0.177-2.098-1.571-3.076-4.388-3.076c-2.508,0-4.004,1.058-4.004,2.833%20c0,1.925,1.488,2.457,3.895,2.695c2.88,0.282,3.103,0.703,3.103,1.269c0,0.983-0.789,1.402-2.642,1.402%20c-2.327,0-2.839-0.584-3.011-1.742c-0.02-0.124-0.126-0.215-0.253-0.215h-1.137c-0.141,0-0.254,0.112-0.254,0.253%20c0,1.482,0.806,3.248,4.655,3.248C17.501,17.007,19.099,15.91,19.099,13.993z'/%3e%3c/svg%3e", p = "/docs/openapi/", m = [
72
+ {
73
+ name: "smarter-chat NPM Package",
74
+ href: "https://www.npmjs.com/package/@smarter.sh/ui-chat",
75
+ logo: "/static/assets/media/svg/brand-logos/react.svg",
76
+ install: "npm install @smarter.sh/ui-chat"
77
+ },
78
+ {
79
+ name: "Node.js SDK",
80
+ href: "https://www.npmjs.com/package/@smarter.sh/api",
81
+ logo: f,
82
+ install: "npm install @smarter.sh/api"
83
+ },
84
+ {
85
+ name: "Python PyPi Library",
86
+ href: "https://pypi.org/project/smarter-api/",
87
+ logo: "/static/assets/media/svg/brand-logos/python-5.svg",
88
+ install: "pip install smarter-api"
89
+ },
90
+ {
91
+ name: "Go SDK",
92
+ href: "https://pkg.go.dev/github.com/smarter-sh/smarter-golang",
93
+ logo: d,
94
+ install: "go get github.com/smarter-sh/smarter-golang"
95
+ }
96
+ ];
97
+ function h({ openapiUrl: r = p, className: i = "col-xl-4" }) {
98
+ return /* @__PURE__ */ t(e, { children: /* @__PURE__ */ t("section", {
99
+ id: "sdk",
100
+ "aria-label": o("SDK"),
101
+ className: `${i} mb-5 mb-xl-10`,
102
+ children: /* @__PURE__ */ t("div", {
103
+ className: "card border-transparent h-100 sdk-card",
104
+ "data-bs-theme": "light",
105
+ children: /* @__PURE__ */ n("div", {
106
+ className: "card-body d-flex flex-column ps-xl-15 h-100 position-relative",
107
+ children: [
108
+ /* @__PURE__ */ t("img", {
109
+ src: "/static/assets/media/illustrations/dozzy-1/4.png",
110
+ className: "position-absolute top-0 end-0 h-100px me-1 mt-1",
111
+ alt: ""
112
+ }),
113
+ /* @__PURE__ */ t("div", {
114
+ className: "position-relative fs-2x fw-bold text-gray-900 mb-2 z-index-2",
115
+ children: s(o("Build with the %(span)s"), { span: /* @__PURE__ */ t("span", {
116
+ className: "position-relative d-inline-block",
117
+ children: s(o("SDKs%(span)s"), { span: /* @__PURE__ */ t("span", { className: "position-absolute opacity-50 bottom-0 start-0 border-4 border-danger border-bottom w-100" }) })
118
+ }) })
119
+ }),
120
+ /* @__PURE__ */ t("p", {
121
+ className: "text-gray-700 fs-6 mb-7 z-index-2 sdk-lede",
122
+ children: o("Typed access to your Smarter resources, in the language you already use.")
123
+ }),
124
+ /* @__PURE__ */ t("ul", {
125
+ className: "sdk-list z-index-2",
126
+ children: m.map((e) => /* @__PURE__ */ n("li", {
127
+ className: "sdk-item",
128
+ children: [/* @__PURE__ */ t("span", {
129
+ className: "sdk-logo",
130
+ children: /* @__PURE__ */ t("img", {
131
+ src: e.logo,
132
+ alt: ""
133
+ })
134
+ }), /* @__PURE__ */ n("span", {
135
+ className: "sdk-text",
136
+ children: [/* @__PURE__ */ t("a", {
137
+ href: e.href,
138
+ target: "_blank",
139
+ className: "sdk-name",
140
+ children: e.name
141
+ }), /* @__PURE__ */ t("span", {
142
+ className: "sdk-install",
143
+ children: e.install
144
+ })]
145
+ })]
146
+ }, e.name))
147
+ }),
148
+ /* @__PURE__ */ n("div", {
149
+ className: "d-flex flex-wrap gap-2 mt-auto pt-7 z-index-2",
150
+ children: [
151
+ /* @__PURE__ */ t("a", {
152
+ href: "https://docs.smarter.sh/en/latest/smarter-framework/apis-and-sdks.html",
153
+ target: "_blank",
154
+ className: "btn btn-sm btn-danger fw-semibold",
155
+ children: o("Documentation")
156
+ }),
157
+ /* @__PURE__ */ t("a", {
158
+ href: r,
159
+ className: "btn btn-sm btn-light-danger fw-semibold",
160
+ children: o("API reference")
161
+ }),
162
+ /* @__PURE__ */ t("a", {
163
+ href: "https://github.com/smarter-sh",
164
+ target: "_blank",
165
+ className: "btn btn-sm btn-dark fw-semibold",
166
+ "aria-label": o("SDK source code"),
167
+ children: o("GitHub")
168
+ })
169
+ ]
170
+ })
171
+ ]
172
+ })
173
+ })
174
+ }) });
175
+ }
176
+ //#endregion
177
+ //#region src/components/SelfHost/Component.tsx
178
+ var g = [
179
+ {
180
+ name: "Docker",
181
+ where: o("Your laptop"),
182
+ description: o("Quick Start with Docker Compose"),
183
+ logo: "data:image/svg+xml,%3csvg%20fill='%232496ED'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDocker%3c/title%3e%3cpath%20d='M13.983%2011.078h2.119a.186.186%200%2000.186-.185V9.006a.186.186%200%2000-.186-.186h-2.119a.185.185%200%2000-.185.185v1.888c0%20.102.083.185.185.185m-2.954-5.43h2.118a.186.186%200%2000.186-.186V3.574a.186.186%200%2000-.186-.185h-2.118a.185.185%200%2000-.185.185v1.888c0%20.102.082.185.185.185m0%202.716h2.118a.187.187%200%2000.186-.186V6.29a.186.186%200%2000-.186-.185h-2.118a.185.185%200%2000-.185.185v1.887c0%20.102.082.185.185.186m-2.93%200h2.12a.186.186%200%2000.184-.186V6.29a.185.185%200%2000-.185-.185H8.1a.185.185%200%2000-.185.185v1.887c0%20.102.083.185.185.186m-2.964%200h2.119a.186.186%200%2000.185-.186V6.29a.185.185%200%2000-.185-.185H5.136a.186.186%200%2000-.186.185v1.887c0%20.102.084.185.186.186m5.893%202.715h2.118a.186.186%200%2000.186-.185V9.006a.186.186%200%2000-.186-.186h-2.118a.185.185%200%2000-.185.185v1.888c0%20.102.082.185.185.185m-2.93%200h2.12a.185.185%200%2000.184-.185V9.006a.185.185%200%2000-.184-.186h-2.12a.185.185%200%2000-.184.185v1.888c0%20.102.083.185.185.185m-2.964%200h2.119a.185.185%200%2000.185-.185V9.006a.185.185%200%2000-.184-.186h-2.12a.186.186%200%2000-.186.186v1.887c0%20.102.084.185.186.185m-2.92%200h2.12a.185.185%200%2000.184-.185V9.006a.185.185%200%2000-.184-.186h-2.12a.185.185%200%2000-.184.185v1.888c0%20.102.082.185.185.185M23.763%209.89c-.065-.051-.672-.51-1.954-.51-.338.001-.676.03-1.01.087-.248-1.7-1.653-2.53-1.716-2.566l-.344-.199-.226.327c-.284.438-.49.922-.612%201.43-.23.97-.09%201.882.403%202.661-.595.332-1.55.413-1.744.42H.751a.751.751%200%2000-.75.748%2011.376%2011.376%200%2000.692%204.062c.545%201.428%201.355%202.48%202.41%203.124%201.18.723%203.1%201.137%205.275%201.137.983.003%201.963-.086%202.93-.266a12.248%2012.248%200%20003.823-1.389c.98-.567%201.86-1.288%202.61-2.136%201.252-1.418%201.998-2.997%202.553-4.4h.221c1.372%200%202.215-.549%202.68-1.009.309-.293.55-.65.707-1.046l.098-.288Z'/%3e%3c/svg%3e",
184
+ href: "https://github.com/smarter-sh/smarter-deploy"
185
+ },
186
+ {
187
+ name: "Kubernetes",
188
+ where: o("Your cluster"),
189
+ description: o("The official Helm chart"),
190
+ logo: "data:image/svg+xml,%3csvg%20fill='%23326CE5'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eKubernetes%3c/title%3e%3cpath%20d='M10.204%2014.35l.007.01-.999%202.413a5.171%205.171%200%200%201-2.075-2.597l2.578-.437.004.005a.44.44%200%200%201%20.484.606zm-.833-2.129a.44.44%200%200%200%20.173-.756l.002-.011L7.585%209.7a5.143%205.143%200%200%200-.73%203.255l2.514-.725.002-.009zm1.145-1.98a.44.44%200%200%200%20.699-.337l.01-.005.15-2.62a5.144%205.144%200%200%200-3.01%201.442l2.147%201.523.004-.002zm.76%202.75l.723.349.722-.347.18-.78-.5-.623h-.804l-.5.623.179.779zm1.5-3.095a.44.44%200%200%200%20.7.336l.008.003%202.134-1.513a5.188%205.188%200%200%200-2.992-1.442l.148%202.615.002.001zm10.876%205.97l-5.773%207.181a1.6%201.6%200%200%201-1.248.594l-9.261.003a1.6%201.6%200%200%201-1.247-.596l-5.776-7.18a1.583%201.583%200%200%201-.307-1.34L2.1%205.573c.108-.47.425-.864.863-1.073L11.305.513a1.606%201.606%200%200%201%201.385%200l8.345%203.985c.438.209.755.604.863%201.073l2.062%208.955c.108.47-.005.963-.308%201.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45%206.45%200%200%200-.105-2.332%206.465%206.465%200%200%200-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-.52.123-.736-.172-.216-.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545%206.545%200%200%200-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142%200-.306-.224-.555-.5-.555-.275%200-.499.249-.499.555l.001.014c0%20.041-.002.092%200%20.128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545%200%200%201-.162.258l-.012.211a6.424%206.424%200%200%200-4.166%202.003%208.373%208.373%200%200%201-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594%200%200%200-.348-.132.481.481%200%200%200-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462%206.462%200%200%200-1.02%204.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5%206.5%200%200%200%202.88%203.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453%206.453%200%200%200%204.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499%206.499%200%200%200%202.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-.537-.423-.608zM16.4%209.701l-1.95%201.746v.005a.44.44%200%200%200%20.173.757l.003.01%202.526.728a5.199%205.199%200%200%200-.108-1.674A5.208%205.208%200%200%200%2016.4%209.7zm-4.013%205.325a.437.437%200%200%200-.404-.232.44.44%200%200%200-.372.233h-.002l-1.268%202.292a5.164%205.164%200%200%200%203.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44%200%200%200-.27.036.44.44%200%200%200-.214.572l-.003.004%201.01%202.438a5.15%205.15%200%200%200%202.081-2.615l-2.6-.44-.004.005z'/%3e%3c/svg%3e",
191
+ href: "https://artifacthub.io/packages/helm/project-smarter/smarter"
192
+ },
193
+ {
194
+ name: "Terraform",
195
+ where: o("Your AWS cloud"),
196
+ description: o("The official Terraform modules"),
197
+ logo: "data:image/svg+xml,%3csvg%20fill='%23844FBA'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eTerraform%3c/title%3e%3cpath%20d='M1.44%200v7.575l6.561%203.79V3.787zm21.12%204.227l-6.561%203.791v7.574l6.56-3.787zM8.72%204.23v7.575l6.561%203.787V8.018zm0%208.405v7.575L15.28%2024v-7.578z'/%3e%3c/svg%3e",
198
+ href: "https://github.com/smarter-sh/smarter-infrastructure"
199
+ }
200
+ ];
201
+ function _() {
202
+ return /* @__PURE__ */ t(e, { children: /* @__PURE__ */ t("section", {
203
+ id: "self-host",
204
+ "aria-label": o("Self Host"),
205
+ className: "card border-transparent h-100 selfhost-card",
206
+ "data-bs-theme": "light",
207
+ children: /* @__PURE__ */ n("div", {
208
+ className: "card-body d-flex flex-column ps-xl-15 h-100",
209
+ children: [
210
+ /* @__PURE__ */ t("span", {
211
+ className: "selfhost-eyebrow",
212
+ children: o("Self-host Smarter")
213
+ }),
214
+ /* @__PURE__ */ t("div", {
215
+ className: "fs-2x fw-bold text-white mt-3 mb-2",
216
+ children: s(o("Run it %(span)s"), { span: /* @__PURE__ */ t("span", {
217
+ className: "position-relative d-inline-block",
218
+ children: s(o("anywhere%(span)s"), { span: /* @__PURE__ */ t("span", { className: "position-absolute bottom-0 start-0 border-4 border-bottom w-100 selfhost-underline" }) })
219
+ }) })
220
+ }),
221
+ /* @__PURE__ */ t("p", {
222
+ className: "fs-6 mb-7 selfhost-lede",
223
+ children: o("The same open source platform, from your laptop to production. No license fees, no seat counts.")
224
+ }),
225
+ /* @__PURE__ */ t("ol", {
226
+ className: "selfhost-steps",
227
+ children: g.map((e, r) => /* @__PURE__ */ t("li", {
228
+ className: "selfhost-step",
229
+ children: /* @__PURE__ */ n("a", {
230
+ href: e.href,
231
+ target: "_blank",
232
+ className: "selfhost-step-link hover-elevate-up",
233
+ children: [
234
+ /* @__PURE__ */ n("span", {
235
+ className: "selfhost-logo",
236
+ children: [/* @__PURE__ */ t("img", {
237
+ src: e.logo,
238
+ alt: ""
239
+ }), /* @__PURE__ */ t("span", {
240
+ className: "selfhost-number",
241
+ children: r + 1
242
+ })]
243
+ }),
244
+ /* @__PURE__ */ t("span", {
245
+ className: "selfhost-where",
246
+ children: e.where
247
+ }),
248
+ /* @__PURE__ */ t("span", {
249
+ className: "selfhost-name",
250
+ children: e.name
251
+ }),
252
+ /* @__PURE__ */ t("span", {
253
+ className: "selfhost-description",
254
+ children: e.description
255
+ })
256
+ ]
257
+ })
258
+ }, e.name))
259
+ }),
260
+ /* @__PURE__ */ n("div", {
261
+ className: "d-flex flex-wrap align-items-center gap-3 mt-auto pt-7",
262
+ children: [/* @__PURE__ */ t("a", {
263
+ href: "https://docs.smarter.sh/en/latest/smarter-platform/installation.html",
264
+ target: "_blank",
265
+ className: "btn btn-sm fw-semibold selfhost-btn",
266
+ children: o("Installation Guide")
267
+ }), /* @__PURE__ */ t("span", {
268
+ className: "selfhost-license",
269
+ children: o("Open source · AGPL-3.0")
270
+ })]
271
+ })
272
+ ]
273
+ })
274
+ }) });
275
+ }
276
+ //#endregion
277
+ export { h as Sdk, _ as SelfHost };
278
+
279
+ //# sourceMappingURL=ui-widgets.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-widgets.es.js","names":["_jsx","_Fragment","Fragment","packageJson","nodedotjsLogo","goLogo","_Fragment","dockerLogo","kubernetesLogo","terraformLogo","_Fragment","Fragment$1","PLACEHOLDER","catalog","gettext","django","msgid","interpolateNodes","parts","last","match","message","placeholder","name","index","values","jsx","Fragment","part","package_default","\"private\"","\"import\"","\"require\"","\"types\"","\"clean\"","\"build\"","\"lint\"","\"storybook\"","\"typecheck\"","\"test\"","\"react\"","\"eslint\"","\"globals\"","\"typescript\"","\"vitest\"","packageName","packageVersion","go_default","nodedotjs_default","OPENAPI_URL","SDKS","Sdk","className","sdk","openapiUrl","STEPS","SelfHost","step"],"sources":["../../smarter-common/dist/lib/i18n.js","../../smarter-common/package.json","../../smarter-common/dist/lib/const.js","../../smarter-common/dist/components/TabbedListView/cookie.js","../../smarter-common/dist/lib/cache.js","../src/assets/go.svg","../src/assets/nodedotjs.svg","../src/components/Sdk/Component.tsx","../src/assets/docker.svg","../src/assets/kubernetes.svg","../src/assets/terraform.svg","../src/components/SelfHost/Component.tsx"],"sourcesContent":["import { jsx as _jsx, Fragment as _Fragment } from \"react/jsx-runtime\";\n/**\n * Translation functions for the web console's React apps.\n *\n * The web console is translated with gettext. Django renders each page in the\n * user's language, and dashboard/base.html loads that language's message\n * catalog for the React apps from Django's JavaScriptCatalog view (the djangojs\n * domain), which defines window.django.gettext() and friends. These functions\n * call it, and fall back to the English source text when no catalog is loaded,\n * e.g. in tests and Storybook.\n *\n * Every message is English source text, and must be a string literal, so that\n * `npm run i18n:extract` can find it. Interpolate values afterwards, with\n * Python-style named placeholders, so that a translator can move them:\n *\n * @example\n * gettext(\"Secrets\");\n * interpolate(gettext(\"Rename secret %(name)s.\"), { name: secret.name });\n * ngettext(\"%(count)s secret\", \"%(count)s secrets\", n);\n * pgettext(\"verb\", \"Clone\");\n * // a React element inside a sentence:\n * interpolateNodes(gettext(\"Delete secret %(name)s?\"), { name: <strong>{secret.name}</strong> });\n *\n * A comment that begins with \"Translators:\" on the line before a call is copied\n * into the message catalog for the translator.\n */\nimport { Fragment } from \"react\";\nconst PLACEHOLDER = /%\\(([A-Za-z_][A-Za-z0-9_]*)\\)s/g;\nconst catalog = () => (typeof window === \"undefined\" ? undefined : window.django);\n/** Translates a message. */\nexport function gettext(msgid) {\n const django = catalog();\n return django?.gettext ? django.gettext(msgid) : msgid;\n}\n/** Translates a message that has a singular and a plural form, chosen by count. */\nexport function ngettext(singular, plural, count) {\n const django = catalog();\n if (django?.ngettext)\n return django.ngettext(singular, plural, count);\n return count === 1 ? singular : plural;\n}\n/** Translates a message in a context, which tells apart two messages with the same English text. */\nexport function pgettext(context, msgid) {\n const django = catalog();\n return django?.pgettext ? django.pgettext(context, msgid) : msgid;\n}\n/** ngettext() in a context. */\nexport function npgettext(context, singular, plural, count) {\n const django = catalog();\n if (django?.npgettext)\n return django.npgettext(context, singular, plural, count);\n return count === 1 ? singular : plural;\n}\n/**\n * Replaces each %(name)s placeholder in a translated message with values[name].\n * A placeholder with no value is left as it is, so that the mistake shows.\n */\nexport function interpolate(message, values) {\n return message.replace(PLACEHOLDER, (placeholder, name) => {\n const value = values[name];\n return value === undefined || value === null ? placeholder : String(value);\n });\n}\n/**\n * interpolate() for values that are React nodes, e.g. a name in <strong> inside a\n * sentence. Returns a fragment of the message's text and the values, in the order\n * that the (translated) message puts them.\n */\nexport function interpolateNodes(message, values) {\n const parts = [];\n let last = 0;\n for (const match of message.matchAll(PLACEHOLDER)) {\n const [placeholder, name] = match;\n const index = match.index ?? 0;\n if (index > last)\n parts.push(message.slice(last, index));\n parts.push(name in values ? values[name] : placeholder);\n last = index + placeholder.length;\n }\n if (last < message.length)\n parts.push(message.slice(last));\n return (_jsx(_Fragment, { children: parts.map((part, index) => (_jsx(Fragment, { children: part }, index))) }));\n}\n/** The language of the page, from the lang attribute that Django renders on <html>, e.g. \"en\". */\nexport function currentLanguage() {\n if (typeof document === \"undefined\")\n return \"en\";\n return document.documentElement.lang || \"en\";\n}\n//# sourceMappingURL=i18n.js.map","{\n \"name\": \"@smarter/common\",\n \"private\": false,\n \"version\": \"0.2.0\",\n \"type\": \"module\",\n \"main\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"import\": \"./dist/index.js\",\n \"require\": \"./dist/index.js\",\n \"types\": \"./dist/index.d.ts\"\n }\n },\n \"files\": [\n \"dist\"\n ],\n \"scripts\": {\n \"clean\": \"rm -rf dist\",\n \"build\": \"npm run clean && tsc -p tsconfig.build.json && rsync -a --prune-empty-dirs --include='/' --include='.css' --exclude='*' src/ dist/\",\n \"build:dist-manifest\": \"node --input-type=module -e \\\"import fs from 'node:fs'; const pkg = JSON.parse(fs.readFileSync('package.json','utf8')); const out = { name: pkg.name, version: pkg.version, type: pkg.type, main: './index.js', types: './index.d.ts', peerDependencies: pkg.peerDependencies ?? {}, dependencies: pkg.dependencies ?? {} }; fs.writeFileSync('dist/package.json', JSON.stringify(out, null, 2) + '\\\\n');\\\"\",\n \"pack:tgz\": \"npm pack --ignore-scripts\",\n \"lint\": \"eslint .\",\n \"storybook\": \"storybook dev -p 6006\",\n \"build-storybook\": \"storybook build\",\n \"typecheck\": \"tsc -b\",\n \"test\": \"vitest run\",\n \"test:watch\": \"vitest\"\n },\n \"peerDependencies\": {\n \"react\": \"^19\",\n \"react-dom\": \"^19\"\n },\n \"dependencies\": {\n \"date-fns\": \"^4.4.0\"\n },\n \"devDependencies\": {\n \"@eslint/js\": \"^10.0.1\",\n \"@storybook/addon-a11y\": \"^10.6.1\",\n \"@storybook/addon-docs\": \"^10.6.1\",\n \"@storybook/react-vite\": \"^10.6.1\",\n \"@types/node\": \"^26.6.3\",\n \"@types/react\": \"^19.3.0\",\n \"@types/react-dom\": \"^19.3.0\",\n \"eslint\": \"^10.11.0\",\n \"eslint-plugin-react-hooks\": \"^7.1.1\",\n \"eslint-plugin-storybook\": \"^10.6.1\",\n \"globals\": \"^17.13.0\",\n \"react\": \"^19.3.0\",\n \"react-dom\": \"^19.3.0\",\n \"storybook\": \"^10.6.1\",\n \"typescript\": \"~6.0.2\",\n \"typescript-eslint\": \"^8.71.0\",\n \"vitest\": \"^5.0.3\"\n }\n}\n","import packageJson from \"../../package.json\" with { type: \"json\" };\nexport const packageName = packageJson.name;\nexport const packageVersion = packageJson.version;\nexport const loggerPrefix = `[Smarter ${packageName} v${packageVersion}]`;\n//# sourceMappingURL=const.js.map","import { loggerPrefix } from \"../../lib/const\";\nimport { packageName, packageVersion } from \"../../lib/const\";\nconst COOKIE_NAME_PREFIX = `${packageName}_v${packageVersion}`;\nconst getUrlOrigin = () => {\n if (typeof window !== \"undefined\" && typeof window.location?.origin === \"string\") {\n return window.location.origin;\n }\n return \"http://localhost\";\n};\nexport const getUrlPath = (url) => {\n console.debug(loggerPrefix, `getUrlPath(): Extracting path from URL: ${url}`);\n return new URL(url, getUrlOrigin()).pathname;\n};\n/**\n * Sets a cookie to store the llmclient count for a given URL.\n *\n * @param url - The unique identifier for the llmclient group.\n * @param llmclientCount - The number of llmclients to store.\n * @param days - Number of days until the cookie expires.\n */\nexport const setCookieForUrl = (url, llmclientCount, days) => {\n const MS_PER_DAY = 24 * 60 * 60 * 1000;\n const expires = new Date(Date.now() + days * MS_PER_DAY).toUTCString();\n const cookieName = `${COOKIE_NAME_PREFIX}_${getUrlPath(url)}`;\n const cookieValue = `${cookieName}=${llmclientCount}; path=/; expires=${expires};`;\n try {\n document.cookie = cookieValue;\n console.debug(loggerPrefix, `setCookieForUrl(): ${cookieValue}`);\n }\n catch (e) {\n console.warn(loggerPrefix, \"setCookieForUrl(): Unable to set llmclient count cookie\", e);\n }\n};\n/**\n * Retrieves the llmclient count stored in a cookie for a given URL.\n *\n * @param url - The unique identifier for the llmclient group.\n * @returns The number of llmclients stored in the cookie, or undefined if not found or invalid.\n */\nexport const getCookieForUrl = (url) => {\n const cookieName = `${COOKIE_NAME_PREFIX}_${getUrlPath(url)}`;\n const cookies = document.cookie.split(\";\").map((c) => c.trim());\n for (const cookie of cookies) {\n if (cookie.startsWith(cookieName + \"=\")) {\n const strVal = cookie.substring(cookieName.length + 1);\n const numVal = parseInt(strVal, 10);\n const retVal = isNaN(numVal) ? undefined : numVal;\n console.debug(loggerPrefix, `getCookieForUrl(): Retrieved cookie for ${cookieName}:`, retVal);\n return retVal;\n }\n }\n console.warn(loggerPrefix, `getCookieForUrl(): Cookie for ${cookieName} not found. If you are not under /, it may not be visible due to cookie path restrictions.`);\n return undefined;\n};\n//# sourceMappingURL=cookie.js.map","/**\n * Tabbed list cache utilities.\n *\n * Stores plugin objects in sessionStorage using a key scoped by API URL and slug,\n * with a one-week TTL and automatic cleanup of expired entries.\n */\nimport { loggerPrefix } from \"./const\";\nimport { packageName, packageVersion } from \"./const\";\nconst CACHE_PREFIX = `${packageName}_v${packageVersion}_objects_v1`;\nconst CACHE_TTL_MS = 7 * 24 * 60 * 60 * 1000; // 1 week\n/**\n * Builds a stable sessionStorage key for a specific API endpoint and tab slug.\n *\n * @param apiUrl Base API URL used to scope cache entries by backend.\n * @param slug Tab or list identifier to isolate cached objects per view.\n * @returns A deterministic sessionStorage key.\n * @throws This function does not throw under normal operation.\n */\nexport const makeCacheKey = (apiUrl, slug) => {\n return `${CACHE_PREFIX}:${apiUrl}${slug}`;\n};\n/**\n * Reads and validates cached llmclient objects.\n *\n * Returns null for missing, invalid, or expired entries and removes expired\n * data to keep storage clean.\n *\n * @param key Fully qualified sessionStorage cache key.\n * @returns The cached llmclient array when present and valid; otherwise `null`.\n * @throws No exceptions are propagated. JSON parse errors, sessionStorage access\n * failures, and other runtime errors are caught and treated as a cache miss.\n */\nexport const readCache = (key) => {\n try {\n const raw = sessionStorage.getItem(key);\n if (!raw) {\n console.debug(`${loggerPrefix} readCache() cache miss for`, key);\n return null;\n }\n const parsed = JSON.parse(raw);\n if (!parsed || typeof parsed.ts !== \"number\" || !Array.isArray(parsed.objects)) {\n console.debug(`${loggerPrefix} readCache() cache invalid for`, key);\n return null;\n }\n if (Date.now() - parsed.ts > CACHE_TTL_MS) {\n console.debug(`${loggerPrefix} readCache() cache expired for`, key);\n sessionStorage.removeItem(key);\n return null;\n }\n console.debug(`${loggerPrefix} readCache() cache hit for`, key, \"with\", parsed.objects);\n return parsed.objects;\n }\n catch {\n return null;\n }\n};\n/**\n * Persists llmclient objects to sessionStorage with a write timestamp.\n *\n * @param key Fully qualified sessionStorage cache key.\n * @param objects LLMClient objects to cache for subsequent reads.\n * @returns `void`.\n * @throws No exceptions are propagated. sessionStorage write failures (for\n * example quota exceeded or private mode restrictions) are caught and ignored.\n */\nexport const writeCache = (key, objects) => {\n try {\n console.debug(`${loggerPrefix} writeCache() writing sessionStorage cache for`, key, \"with\", objects.length, \"objects\");\n const payload = { ts: Date.now(), objects };\n sessionStorage.setItem(key, JSON.stringify(payload));\n }\n catch {\n // ignore quota/private-mode errors\n }\n};\n//# sourceMappingURL=cache.js.map","export default \"data:image/svg+xml,%3csvg%20fill='%2300ADD8'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eGo%3c/title%3e%3cpath%20d='M1.811%2010.231c-.047%200-.058-.023-.035-.059l.246-.315c.023-.035.081-.058.128-.058h4.172c.046%200%20.058.035.035.07l-.199.303c-.023.036-.082.07-.117.07zM.047%2011.306c-.047%200-.059-.023-.035-.058l.245-.316c.023-.035.082-.058.129-.058h5.328c.047%200%20.07.035.058.07l-.093.28c-.012.047-.058.07-.105.07zm2.828%201.075c-.047%200-.059-.035-.035-.07l.163-.292c.023-.035.07-.07.117-.07h2.337c.047%200%20.07.035.07.082l-.023.28c0%20.047-.047.082-.082.082zm12.129-2.36c-.736.187-1.239.327-1.963.514-.176.046-.187.058-.34-.117-.174-.199-.303-.327-.548-.444-.737-.362-1.45-.257-2.115.175-.795.514-1.204%201.274-1.192%202.22.011.935.654%201.706%201.577%201.835.795.105%201.46-.175%201.987-.77.105-.13.198-.27.315-.434H10.47c-.245%200-.304-.152-.222-.35.152-.362.432-.97.596-1.274a.315.315%200%2001.292-.187h4.253c-.023.316-.023.631-.07.947a4.983%204.983%200%2001-.958%202.29c-.841%201.11-1.94%201.8-3.33%201.986-1.145.152-2.209-.07-3.143-.77-.865-.655-1.356-1.52-1.484-2.595-.152-1.274.222-2.419.993-3.424.83-1.086%201.928-1.776%203.272-2.02%201.098-.2%202.15-.07%203.096.571.62.41%201.063.97%201.356%201.648.07.105.023.164-.117.2m3.868%206.461c-1.064-.024-2.034-.328-2.852-1.029a3.665%203.665%200%2001-1.262-2.255c-.21-1.32.152-2.489.947-3.529.853-1.122%201.881-1.706%203.272-1.95%201.192-.21%202.314-.095%203.33.595.923.63%201.496%201.484%201.648%202.605.198%201.578-.257%202.863-1.344%203.962-.771.783-1.718%201.273-2.805%201.495-.315.06-.63.07-.934.106zm2.78-4.72c-.011-.153-.011-.27-.034-.387-.21-1.157-1.274-1.81-2.384-1.554-1.087.245-1.788.935-2.045%202.033-.21.912.234%201.835%201.075%202.21.643.28%201.285.244%201.905-.07.923-.48%201.425-1.228%201.484-2.233z'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20fill='%235FA04E'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eNode.js%3c/title%3e%3cpath%20d='M11.998,24c-0.321,0-0.641-0.084-0.922-0.247l-2.936-1.737c-0.438-0.245-0.224-0.332-0.08-0.383%20c0.585-0.203,0.703-0.25,1.328-0.604c0.065-0.037,0.151-0.023,0.218,0.017l2.256,1.339c0.082,0.045,0.197,0.045,0.272,0l8.795-5.076%20c0.082-0.047,0.134-0.141,0.134-0.238V6.921c0-0.099-0.053-0.192-0.137-0.242l-8.791-5.072c-0.081-0.047-0.189-0.047-0.271,0%20L3.075,6.68C2.99,6.729,2.936,6.825,2.936,6.921v10.15c0,0.097,0.054,0.189,0.139,0.235l2.409,1.392%20c1.307,0.654,2.108-0.116,2.108-0.89V7.787c0-0.142,0.114-0.253,0.256-0.253h1.115c0.139,0,0.255,0.112,0.255,0.253v10.021%20c0,1.745-0.95,2.745-2.604,2.745c-0.508,0-0.909,0-2.026-0.551L2.28,18.675c-0.57-0.329-0.922-0.945-0.922-1.604V6.921%20c0-0.659,0.353-1.275,0.922-1.603l8.795-5.082c0.557-0.315,1.296-0.315,1.848,0l8.794,5.082c0.57,0.329,0.924,0.944,0.924,1.603%20v10.15c0,0.659-0.354,1.273-0.924,1.604l-8.794,5.078C12.643,23.916,12.324,24,11.998,24z%20M19.099,13.993%20c0-1.9-1.284-2.406-3.987-2.763c-2.731-0.361-3.009-0.548-3.009-1.187c0-0.528,0.235-1.233,2.258-1.233%20c1.807,0,2.473,0.389,2.747,1.607c0.024,0.115,0.129,0.199,0.247,0.199h1.141c0.071,0,0.138-0.031,0.186-0.081%20c0.048-0.054,0.074-0.123,0.067-0.196c-0.177-2.098-1.571-3.076-4.388-3.076c-2.508,0-4.004,1.058-4.004,2.833%20c0,1.925,1.488,2.457,3.895,2.695c2.88,0.282,3.103,0.703,3.103,1.269c0,0.983-0.789,1.402-2.642,1.402%20c-2.327,0-2.839-0.584-3.011-1.742c-0.02-0.124-0.126-0.215-0.253-0.215h-1.137c-0.141,0-0.254,0.112-0.254,0.253%20c0,1.482,0.806,3.248,4.655,3.248C17.501,17.007,19.099,15.91,19.099,13.993z'/%3e%3c/svg%3e\"","/**\n * Sdk dashboard widget.\n *\n * This component renders a promotional card for the Smarter developer SDKs:\n * the smarter-chat NPM package (@smarter.sh/ui-chat), the Node.js SDK\n * (@smarter.sh/api), the Python PyPI library (smarter-api) and the Go module\n * (github.com/smarter-sh/smarter-golang). Each SDK shows its logo, links to its\n * package registry, and shows its install command, followed by links to the\n * APIs and SDKs documentation and to a platform's OpenAPI document.\n *\n * :param openapiUrl: The OpenAPI document that the API reference button opens. Defaults to this\n * platform's, which every web console serves. A page outside the web console, such as\n * smarter.sh, passes a platform's absolute url.\n * :type openapiUrl: str\n * :param className: The card's grid column classes, so that the page can set its width.\n * :type className: str\n * :returns: A JSX fragment containing the SDK call-to-action widget.\n * :rtype: JSX.Element\n *\n * :example:\n *\n * <Sdk />\n * <Sdk openapiUrl=\"https://platform.smarter.sh/docs/openapi/\" className=\"col-12\" />\n */\nimport \"./styles.css\";\nimport { gettext, interpolateNodes } from \"@smarter/common\";\nimport goLogo from \"../../assets/go.svg\";\nimport nodedotjsLogo from \"../../assets/nodedotjs.svg\";\n\n/** This platform's OpenAPI document, which every platform serves in its web console. */\nconst OPENAPI_URL = \"/docs/openapi/\";\n\nexport interface SdkProps {\n /** The OpenAPI document that the API reference button opens. */\n openapiUrl?: string;\n /** The card's grid column classes, so that the page can set its width. */\n className?: string;\n}\n\n// The React and Python logos, and the illustration below, are the Keen theme's. They stay at their\n// /static/assets/ paths, which the page serves along with the Keen stylesheet.\nconst SDKS = [\n {\n name: \"smarter-chat NPM Package\",\n href: \"https://www.npmjs.com/package/@smarter.sh/ui-chat\",\n logo: \"/static/assets/media/svg/brand-logos/react.svg\",\n install: \"npm install @smarter.sh/ui-chat\",\n },\n {\n name: \"Node.js SDK\",\n href: \"https://www.npmjs.com/package/@smarter.sh/api\",\n logo: nodedotjsLogo,\n install: \"npm install @smarter.sh/api\",\n },\n {\n name: \"Python PyPi Library\",\n href: \"https://pypi.org/project/smarter-api/\",\n logo: \"/static/assets/media/svg/brand-logos/python-5.svg\",\n install: \"pip install smarter-api\",\n },\n {\n name: \"Go SDK\",\n href: \"https://pkg.go.dev/github.com/smarter-sh/smarter-golang\",\n logo: goLogo,\n install: \"go get github.com/smarter-sh/smarter-golang\",\n },\n];\n\nfunction Sdk({ openapiUrl = OPENAPI_URL, className = \"col-xl-4\" }: SdkProps) {\n return (\n <>\n <section id=\"sdk\" aria-label={gettext(\"SDK\")} className={`${className} mb-5 mb-xl-10`}>\n {/* begin::SDKs widget */}\n <div className=\"card border-transparent h-100 sdk-card\" data-bs-theme=\"light\">\n {/* begin::Body */}\n <div className=\"card-body d-flex flex-column ps-xl-15 h-100 position-relative\">\n {/* begin::Illustration */}\n <img\n src=\"/static/assets/media/illustrations/dozzy-1/4.png\"\n className=\"position-absolute top-0 end-0 h-100px me-1 mt-1\"\n alt=\"\"\n />\n {/* end::Illustration */}\n {/* begin::Title */}\n <div className=\"position-relative fs-2x fw-bold text-gray-900 mb-2 z-index-2\">\n {/* Translators: a headline. %(span)s is its highlighted last words, translated separately. */}\n {interpolateNodes(gettext(\"Build with the %(span)s\"), {\n span: (\n <span className=\"position-relative d-inline-block\">\n {/* Translators: the highlighted words of a headline. %(span)s is their decorative underline, and stays at the end. */}\n {interpolateNodes(gettext(\"SDKs%(span)s\"), {\n span: (\n <span className=\"position-absolute opacity-50 bottom-0 start-0 border-4 border-danger border-bottom w-100\"></span>\n ),\n })}\n </span>\n ),\n })}\n </div>\n <p className=\"text-gray-700 fs-6 mb-7 z-index-2 sdk-lede\">\n {gettext(\"Typed access to your Smarter resources, in the language you already use.\")}\n </p>\n {/* end::Title */}\n {/* begin::SDKs */}\n <ul className=\"sdk-list z-index-2\">\n {SDKS.map((sdk) => (\n <li key={sdk.name} className=\"sdk-item\">\n <span className=\"sdk-logo\">\n <img src={sdk.logo} alt=\"\" />\n </span>\n <span className=\"sdk-text\">\n <a href={sdk.href} target=\"_blank\" className=\"sdk-name\">\n {sdk.name}\n </a>\n <span className=\"sdk-install\">{sdk.install}</span>\n </span>\n </li>\n ))}\n </ul>\n {/* end::SDKs */}\n {/* begin::Action */}\n <div className=\"d-flex flex-wrap gap-2 mt-auto pt-7 z-index-2\">\n <a\n href=\"https://docs.smarter.sh/en/latest/smarter-framework/apis-and-sdks.html\"\n target=\"_blank\"\n className=\"btn btn-sm btn-danger fw-semibold\"\n >\n {gettext(\"Documentation\")}\n </a>\n <a href={openapiUrl} className=\"btn btn-sm btn-light-danger fw-semibold\">\n {gettext(\"API reference\")}\n </a>\n <a\n href=\"https://github.com/smarter-sh\"\n target=\"_blank\"\n className=\"btn btn-sm btn-dark fw-semibold\"\n aria-label={gettext(\"SDK source code\")}\n >\n {gettext(\"GitHub\")}\n </a>\n </div>\n {/* end::Action */}\n </div>\n {/* end::Body */}\n </div>\n {/* end::SDKs widget */}\n </section>\n </>\n );\n}\n\nexport default Sdk;\n","export default \"data:image/svg+xml,%3csvg%20fill='%232496ED'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eDocker%3c/title%3e%3cpath%20d='M13.983%2011.078h2.119a.186.186%200%2000.186-.185V9.006a.186.186%200%2000-.186-.186h-2.119a.185.185%200%2000-.185.185v1.888c0%20.102.083.185.185.185m-2.954-5.43h2.118a.186.186%200%2000.186-.186V3.574a.186.186%200%2000-.186-.185h-2.118a.185.185%200%2000-.185.185v1.888c0%20.102.082.185.185.185m0%202.716h2.118a.187.187%200%2000.186-.186V6.29a.186.186%200%2000-.186-.185h-2.118a.185.185%200%2000-.185.185v1.887c0%20.102.082.185.185.186m-2.93%200h2.12a.186.186%200%2000.184-.186V6.29a.185.185%200%2000-.185-.185H8.1a.185.185%200%2000-.185.185v1.887c0%20.102.083.185.185.186m-2.964%200h2.119a.186.186%200%2000.185-.186V6.29a.185.185%200%2000-.185-.185H5.136a.186.186%200%2000-.186.185v1.887c0%20.102.084.185.186.186m5.893%202.715h2.118a.186.186%200%2000.186-.185V9.006a.186.186%200%2000-.186-.186h-2.118a.185.185%200%2000-.185.185v1.888c0%20.102.082.185.185.185m-2.93%200h2.12a.185.185%200%2000.184-.185V9.006a.185.185%200%2000-.184-.186h-2.12a.185.185%200%2000-.184.185v1.888c0%20.102.083.185.185.185m-2.964%200h2.119a.185.185%200%2000.185-.185V9.006a.185.185%200%2000-.184-.186h-2.12a.186.186%200%2000-.186.186v1.887c0%20.102.084.185.186.185m-2.92%200h2.12a.185.185%200%2000.184-.185V9.006a.185.185%200%2000-.184-.186h-2.12a.185.185%200%2000-.184.185v1.888c0%20.102.082.185.185.185M23.763%209.89c-.065-.051-.672-.51-1.954-.51-.338.001-.676.03-1.01.087-.248-1.7-1.653-2.53-1.716-2.566l-.344-.199-.226.327c-.284.438-.49.922-.612%201.43-.23.97-.09%201.882.403%202.661-.595.332-1.55.413-1.744.42H.751a.751.751%200%2000-.75.748%2011.376%2011.376%200%2000.692%204.062c.545%201.428%201.355%202.48%202.41%203.124%201.18.723%203.1%201.137%205.275%201.137.983.003%201.963-.086%202.93-.266a12.248%2012.248%200%20003.823-1.389c.98-.567%201.86-1.288%202.61-2.136%201.252-1.418%201.998-2.997%202.553-4.4h.221c1.372%200%202.215-.549%202.68-1.009.309-.293.55-.65.707-1.046l.098-.288Z'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20fill='%23326CE5'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eKubernetes%3c/title%3e%3cpath%20d='M10.204%2014.35l.007.01-.999%202.413a5.171%205.171%200%200%201-2.075-2.597l2.578-.437.004.005a.44.44%200%200%201%20.484.606zm-.833-2.129a.44.44%200%200%200%20.173-.756l.002-.011L7.585%209.7a5.143%205.143%200%200%200-.73%203.255l2.514-.725.002-.009zm1.145-1.98a.44.44%200%200%200%20.699-.337l.01-.005.15-2.62a5.144%205.144%200%200%200-3.01%201.442l2.147%201.523.004-.002zm.76%202.75l.723.349.722-.347.18-.78-.5-.623h-.804l-.5.623.179.779zm1.5-3.095a.44.44%200%200%200%20.7.336l.008.003%202.134-1.513a5.188%205.188%200%200%200-2.992-1.442l.148%202.615.002.001zm10.876%205.97l-5.773%207.181a1.6%201.6%200%200%201-1.248.594l-9.261.003a1.6%201.6%200%200%201-1.247-.596l-5.776-7.18a1.583%201.583%200%200%201-.307-1.34L2.1%205.573c.108-.47.425-.864.863-1.073L11.305.513a1.606%201.606%200%200%201%201.385%200l8.345%203.985c.438.209.755.604.863%201.073l2.062%208.955c.108.47-.005.963-.308%201.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45%206.45%200%200%200-.105-2.332%206.465%206.465%200%200%200-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-.52.123-.736-.172-.216-.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545%206.545%200%200%200-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142%200-.306-.224-.555-.5-.555-.275%200-.499.249-.499.555l.001.014c0%20.041-.002.092%200%20.128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545%200%200%201-.162.258l-.012.211a6.424%206.424%200%200%200-4.166%202.003%208.373%208.373%200%200%201-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594%200%200%200-.348-.132.481.481%200%200%200-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462%206.462%200%200%200-1.02%204.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5%206.5%200%200%200%202.88%203.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453%206.453%200%200%200%204.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499%206.499%200%200%200%202.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-.537-.423-.608zM16.4%209.701l-1.95%201.746v.005a.44.44%200%200%200%20.173.757l.003.01%202.526.728a5.199%205.199%200%200%200-.108-1.674A5.208%205.208%200%200%200%2016.4%209.7zm-4.013%205.325a.437.437%200%200%200-.404-.232.44.44%200%200%200-.372.233h-.002l-1.268%202.292a5.164%205.164%200%200%200%203.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44%200%200%200-.27.036.44.44%200%200%200-.214.572l-.003.004%201.01%202.438a5.15%205.15%200%200%200%202.081-2.615l-2.6-.44-.004.005z'/%3e%3c/svg%3e\"","export default \"data:image/svg+xml,%3csvg%20fill='%23844FBA'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eTerraform%3c/title%3e%3cpath%20d='M1.44%200v7.575l6.561%203.79V3.787zm21.12%204.227l-6.561%203.791v7.574l6.56-3.787zM8.72%204.23v7.575l6.561%203.787V8.018zm0%208.405v7.575L15.28%2024v-7.578z'/%3e%3c/svg%3e\"","/**\n * SelfHost dashboard widget.\n *\n * This component renders a promotional card for self-hosting Smarter, as a\n * three-step path from a laptop to production: the Docker Compose Quick Start\n * (smarter-deploy), the official Helm chart for Kubernetes, and the official\n * Terraform modules for AWS (smarter-infrastructure). Each step links to its\n * resource, followed by a link to the installation guide.\n *\n * :returns: A JSX fragment containing the self-host call-to-action widget.\n * :rtype: JSX.Element\n *\n * :example:\n *\n * <SelfHost />\n */\nimport \"./styles.css\";\nimport { gettext, interpolateNodes } from \"@smarter/common\";\nimport dockerLogo from \"../../assets/docker.svg\";\nimport kubernetesLogo from \"../../assets/kubernetes.svg\";\nimport terraformLogo from \"../../assets/terraform.svg\";\n\nconst STEPS = [\n {\n name: \"Docker\",\n where: gettext(\"Your laptop\"),\n description: gettext(\"Quick Start with Docker Compose\"),\n logo: dockerLogo,\n href: \"https://github.com/smarter-sh/smarter-deploy\",\n },\n {\n name: \"Kubernetes\",\n where: gettext(\"Your cluster\"),\n description: gettext(\"The official Helm chart\"),\n logo: kubernetesLogo,\n href: \"https://artifacthub.io/packages/helm/project-smarter/smarter\",\n },\n {\n name: \"Terraform\",\n where: gettext(\"Your AWS cloud\"),\n description: gettext(\"The official Terraform modules\"),\n logo: terraformLogo,\n href: \"https://github.com/smarter-sh/smarter-infrastructure\",\n },\n];\n\nfunction SelfHost() {\n return (\n <>\n {/* begin::Engage widget 4 */}\n <section\n id=\"self-host\"\n aria-label={gettext(\"Self Host\")}\n className=\"card border-transparent h-100 selfhost-card\"\n data-bs-theme=\"light\"\n >\n {/* begin::Body */}\n <div className=\"card-body d-flex flex-column ps-xl-15 h-100\">\n {/* begin::Title */}\n <span className=\"selfhost-eyebrow\">{gettext(\"Self-host Smarter\")}</span>\n <div className=\"fs-2x fw-bold text-white mt-3 mb-2\">\n {/* Translators: a headline. %(span)s is its highlighted last words, translated separately. */}\n {interpolateNodes(gettext(\"Run it %(span)s\"), {\n span: (\n <span className=\"position-relative d-inline-block\">\n {/* Translators: the highlighted words of a headline. %(span)s is their decorative underline, and stays at the end. */}\n {interpolateNodes(gettext(\"anywhere%(span)s\"), {\n span: (\n <span className=\"position-absolute bottom-0 start-0 border-4 border-bottom w-100 selfhost-underline\"></span>\n ),\n })}\n </span>\n ),\n })}\n </div>\n <p className=\"fs-6 mb-7 selfhost-lede\">\n {gettext(\"The same open source platform, from your laptop to production. No license fees, no seat counts.\")}\n </p>\n {/* end::Title */}\n {/* begin::Steps */}\n <ol className=\"selfhost-steps\">\n {STEPS.map((step, index) => (\n <li key={step.name} className=\"selfhost-step\">\n <a href={step.href} target=\"_blank\" className=\"selfhost-step-link hover-elevate-up\">\n <span className=\"selfhost-logo\">\n <img src={step.logo} alt=\"\" />\n <span className=\"selfhost-number\">{index + 1}</span>\n </span>\n <span className=\"selfhost-where\">{step.where}</span>\n <span className=\"selfhost-name\">{step.name}</span>\n <span className=\"selfhost-description\">{step.description}</span>\n </a>\n </li>\n ))}\n </ol>\n {/* end::Steps */}\n {/* begin::Action */}\n <div className=\"d-flex flex-wrap align-items-center gap-3 mt-auto pt-7\">\n <a\n href=\"https://docs.smarter.sh/en/latest/smarter-platform/installation.html\"\n target=\"_blank\"\n className=\"btn btn-sm fw-semibold selfhost-btn\"\n >\n {gettext(\"Installation Guide\")}\n </a>\n <span className=\"selfhost-license\">{gettext(\"Open source · AGPL-3.0\")}</span>\n </div>\n {/* end::Action */}\n </div>\n {/* end::Body */}\n </section>\n {/* end::Engage widget 4 */}\n </>\n );\n}\n\nexport default SelfHost;\n"],"mappings":"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"}
package/package.json CHANGED
@@ -1,6 +1,78 @@
1
1
  {
2
2
  "name": "@smarter.sh/ui-widgets",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "description": "Smarter web console dashboard widgets, for the web console and smarter.sh. They are styled for the Keen Bootstrap theme, which the page provides.",
4
+ "version": "0.35.4-alpha.2",
5
+ "homepage": "https://smarter.sh",
6
+ "type": "module",
7
+ "main": "./dist/ui-widgets.es.js",
8
+ "module": "./dist/ui-widgets.es.js",
9
+ "types": "./dist/types/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/types/index.d.ts",
13
+ "import": "./dist/ui-widgets.es.js"
14
+ },
15
+ "./style.css": "./dist/ui-widgets.css"
16
+ },
17
+ "files": [
18
+ "dist"
19
+ ],
20
+ "sideEffects": [
21
+ "*.css",
22
+ "./dist/ui-widgets.es.js"
23
+ ],
24
+ "keywords": [
25
+ "react",
26
+ "component",
27
+ "dashboard",
28
+ "smarter"
29
+ ],
30
+ "author": "Lawrence McDaniel <lpm0073@gmail.com>, (https://lawrencemcdaniel.com/)",
31
+ "license": "AGPL-3.0-or-later",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/smarter-sh/smarter.git",
35
+ "directory": "smarter/react/packages/smarter-widgets"
36
+ },
37
+ "bugs": {
38
+ "url": "https://github.com/smarter-sh/smarter/issues"
39
+ },
40
+ "scripts": {
41
+ "build:lib": "vite build --mode lib && tsc -p tsconfig.lib.json",
42
+ "check:dist": "node scripts/check-dist.mjs",
43
+ "lint": "eslint .",
44
+ "storybook": "storybook dev -p 6006",
45
+ "build-storybook": "storybook build",
46
+ "typecheck": "tsc -b",
47
+ "test": "vitest run",
48
+ "test:watch": "vitest"
49
+ },
50
+ "peerDependencies": {
51
+ "react": "^19",
52
+ "react-dom": "^19"
53
+ },
54
+ "devDependencies": {
55
+ "@eslint/js": "^10.0.1",
56
+ "@smarter/common": "^0.2.0",
57
+ "@storybook/addon-a11y": "^10.6.1",
58
+ "@storybook/addon-docs": "^10.6.1",
59
+ "@storybook/react-vite": "^10.6.1",
60
+ "@types/node": "^26.6.3",
61
+ "@types/react": "^19.3.0",
62
+ "@types/react-dom": "^19.3.0",
63
+ "@vitejs/plugin-react": "^6.1.1",
64
+ "@vitest/coverage-v8": "^5.0.3",
65
+ "eslint": "^10.11.0",
66
+ "eslint-plugin-react-hooks": "^7.1.1",
67
+ "eslint-plugin-react-refresh": "^0.5.7",
68
+ "eslint-plugin-storybook": "^10.6.1",
69
+ "globals": "^17.13.0",
70
+ "react": "^19.3.0",
71
+ "react-dom": "^19.3.0",
72
+ "storybook": "^10.6.1",
73
+ "typescript": "~6.0.2",
74
+ "typescript-eslint": "^8.71.0",
75
+ "vite": "^8.3.2",
76
+ "vitest": "^5.0.3"
77
+ }
78
+ }