@proveanything/smartlinks 2.0.11 → 2.0.13
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/baseline.classes.json +209 -0
- package/dist/baseline.css +194 -0
- package/dist/docs/API_SUMMARY.md +2 -1
- package/dist/docs/app-manifest.md +702 -702
- package/dist/docs/css-baseline.md +133 -0
- package/dist/docs/host-dependency-contract.md +26 -9
- package/dist/docs/overview.md +1 -0
- package/dist/openapi.yaml +2 -0
- package/dist/shared-dependencies.d.ts +3 -3
- package/dist/shared-dependencies.js +15 -7
- package/dist/types/appManifest.d.ts +8 -1
- package/docs/API_SUMMARY.md +2 -1
- package/docs/app-manifest.md +702 -702
- package/docs/css-baseline.md +133 -0
- package/docs/host-dependency-contract.md +26 -9
- package/docs/overview.md +1 -0
- package/openapi.yaml +2 -0
- package/package.json +6 -3
- package/scripts/doctor.mjs +4 -19
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# SmartLinks CSS baseline (`sl-baseline`)
|
|
2
|
+
|
|
3
|
+
> **Status: SHIPPED — `v1`, frozen.** The SDK ships `@proveanything/smartlinks/baseline.css`
|
|
4
|
+
> (+ `baseline.classes.json`); the Portal/Hub serve it and apps opt in via
|
|
5
|
+
> `meta.cssBaseline: "v1"`. `v1` is frozen: an existing `sl-*` rule's meaning never changes;
|
|
6
|
+
> new capability ships as `v2` alongside. Supersedes the earlier "shared Tailwind base" idea —
|
|
7
|
+
> that approach (sharing raw generated Tailwind) was too large and could never safely change;
|
|
8
|
+
> this is the version that survives being frozen for years.
|
|
9
|
+
|
|
10
|
+
A small, **frozen, namespaced** set of structural CSS helpers the platform guarantees are
|
|
11
|
+
present, so any sub-app — and any AI/markdown/dynamic content renderer inside one — can rely
|
|
12
|
+
on them. It is **mechanics, not aesthetics**: layout, spacing, sizing, type scale,
|
|
13
|
+
responsive flow, radius/border/shadow, and a little motion. It never defines colours, fonts,
|
|
14
|
+
or components — those are brand data and per-app.
|
|
15
|
+
|
|
16
|
+
It is the CSS sibling of the JS shared-dependency contract, and like that contract **the SDK
|
|
17
|
+
is the source of truth**: the SDK authors and ships the baseline; hosts and apps consume it.
|
|
18
|
+
|
|
19
|
+
## Why this shape (and not the alternatives)
|
|
20
|
+
|
|
21
|
+
- **Small + frozen** → maintainable for years. A 60–120-rule hand-authored contract can be
|
|
22
|
+
honoured indefinitely; a giant generated Tailwind sheet can't.
|
|
23
|
+
- **Namespaced (`sl-`)** → zero collision with an app's own Tailwind (`flex`, `p-4`) or the
|
|
24
|
+
host. Apps use `sl-*` for the guaranteed floor *and* their own utilities side by side. This
|
|
25
|
+
is what removes the cascade/coexistence fragility.
|
|
26
|
+
- **A stable contract, decoupled from Tailwind underneath** → the SDK may build it with
|
|
27
|
+
Tailwind 4/5/6 internally, but apps target `sl-*`, so Tailwind upgrades are free.
|
|
28
|
+
- **Teachable** → ~100 stable primitives can be put in an AI prompt; the full Tailwind
|
|
29
|
+
surface cannot. Dynamic/AI content gets a guaranteed floor instead of hand-rolling CSS.
|
|
30
|
+
- **A floor, not a ceiling** → opt-in, additive; apps are free to ignore it or write their
|
|
31
|
+
own CSS. It just guarantees a consistent structural baseline when they want it.
|
|
32
|
+
|
|
33
|
+
## Responsive: container-query-backed, breakpoint-named
|
|
34
|
+
|
|
35
|
+
Apps render **both** as containers (in the host document) and as iframes. Plain viewport
|
|
36
|
+
`@media` is inconsistent across those — in an iframe it sees the iframe size (usually right),
|
|
37
|
+
in a container it sees the *host* viewport (wrong for a sub-region). So the responsive
|
|
38
|
+
primitives are **container-query based** (`@container`), exposed with familiar breakpoint
|
|
39
|
+
names so authors/AI still think "phone / tablet / desktop":
|
|
40
|
+
|
|
41
|
+
- The app's mount root is a **container context** (`sl-container`, i.e. `container-type:
|
|
42
|
+
inline-size`) — set by the host on container mounts and by the app root in iframe mode.
|
|
43
|
+
- `sl-md-grid-2` then means "when **my** box is ≥ tablet width", correct in both embed modes.
|
|
44
|
+
- Breakpoints (container widths): `sm` ≥ 480px, `md` ≥ 768px, `lg` ≥ 1024px.
|
|
45
|
+
|
|
46
|
+
This is the "works well on mobile / tablet / desktop" house opinion, done correctly for an
|
|
47
|
+
embed-first platform.
|
|
48
|
+
|
|
49
|
+
## The v1 surface (frozen)
|
|
50
|
+
|
|
51
|
+
All names `sl-`-prefixed. Responsive variants exist only for the layout-flow primitives
|
|
52
|
+
marked ✦ (as `sl-{sm|md|lg}-<name>`), to keep the set teachable and small.
|
|
53
|
+
|
|
54
|
+
**Reset & a11y**
|
|
55
|
+
`sl-reset` (border-box + margin:0 on self/descendants) · `sl-media` (max-width:100%,
|
|
56
|
+
height:auto) · `sl-focus` (keyboard-only focus ring) · `sl-sr-only` · `sl-container`
|
|
57
|
+
(responsive container context)
|
|
58
|
+
|
|
59
|
+
**Display ✦** `sl-block` · `sl-inline-block` · `sl-inline` · `sl-flex` · `sl-inline-flex` ·
|
|
60
|
+
`sl-grid` · `sl-hidden`
|
|
61
|
+
|
|
62
|
+
**Flex ✦(direction)** `sl-flex-row` · `sl-flex-col` · `sl-flex-wrap` · `sl-flex-nowrap` ·
|
|
63
|
+
`sl-items-{start,center,end,stretch,baseline}` · `sl-justify-{start,center,end,between,around}`
|
|
64
|
+
· `sl-flex-1` · `sl-flex-auto` · `sl-grow-0` · `sl-shrink-0`
|
|
65
|
+
|
|
66
|
+
**Grid ✦(columns)** `sl-grid-{2,3,4}` (collapse to 1 col below `sm`) · `sl-grid-auto`
|
|
67
|
+
(auto-fit minmax) · `sl-col-span-full`
|
|
68
|
+
|
|
69
|
+
**Spacing** — curated 8-step scale `0,1,2,3,4,5,6,7` ≈ `0, .25, .5, .75, 1, 1.5, 2, 3 rem`.
|
|
70
|
+
Logical properties (RTL-safe): `sl-gap-{0..7}` · `sl-p-{0..7}` · `sl-px-{0..7}` ·
|
|
71
|
+
`sl-py-{0..7}` · `sl-ps-{0..7}` / `sl-pe-{0..7}` (inline start/end) · `sl-m-{0..7}` ·
|
|
72
|
+
`sl-mx-auto` · `sl-mt-{0..7}` · `sl-mb-{0..7}`
|
|
73
|
+
|
|
74
|
+
**Sizing** `sl-w-full` · `sl-h-full` · `sl-min-w-0` · `sl-max-w-{reading(42rem),prose(65ch),
|
|
75
|
+
page(72rem)}` · `sl-aspect-{square,wide(16/9)}`
|
|
76
|
+
|
|
77
|
+
**Typography** — static rem scale (predictable in any embed; use the responsive `✦` align
|
|
78
|
+
and per-breakpoint sizing where you want type to change). `sl-text-{xs,sm,base,lg,xl,2xl,3xl,
|
|
79
|
+
4xl}` · `sl-font-{normal,medium,semibold,bold}` · `sl-leading-{tight,normal,relaxed}` ·
|
|
80
|
+
`sl-tracking-{tight,normal}` · `sl-text-{left,center,right}` ✦(align) · `sl-truncate` ·
|
|
81
|
+
`sl-line-clamp-{2,3}` · `sl-balance` (text-wrap:balance) · `sl-pretty`
|
|
82
|
+
|
|
83
|
+
**Radius / border / shadow** — neutral mechanics only (no brand colour). `sl-rounded-{sm,md,
|
|
84
|
+
lg,xl,full}` · `sl-border` / `sl-border-0` (colour = `--sl-border`, a subtle
|
|
85
|
+
`color-mix(currentColor 14%, transparent)` default, overridable) · `sl-shadow-{sm,md,lg}`
|
|
86
|
+
(neutral)
|
|
87
|
+
|
|
88
|
+
**Object-fit / overflow** `sl-cover` · `sl-contain` · `sl-overflow-hidden` · `sl-overflow-auto`
|
|
89
|
+
|
|
90
|
+
**Position & layering** `sl-relative` · `sl-absolute` · `sl-sticky` · `sl-inset-0` ·
|
|
91
|
+
`sl-z-{base,raised,overlay}` (named levels — a house layering convention so apps don't fight
|
|
92
|
+
over z-index)
|
|
93
|
+
|
|
94
|
+
**Motion** (small, reduced-motion-safe; keyframes are `sl-`-namespaced) `sl-transition`
|
|
95
|
+
(standard ease/duration) · `sl-reveal` (fade-up on view) · `sl-hover-lift` · all motion is
|
|
96
|
+
**disabled under `prefers-reduced-motion`**. Rich motion vocabularies stay per-app (and may
|
|
97
|
+
become a separate versioned motion contract later if several apps want to share one).
|
|
98
|
+
|
|
99
|
+
### Explicitly NOT in the baseline (non-goals)
|
|
100
|
+
- **No colours** — brand data, delivered via CSS variables / theme params.
|
|
101
|
+
- **No fonts** — per-app; the baseline sets a *scale*, never a family.
|
|
102
|
+
- **No components** — no buttons/cards/nav; those are per-app aesthetics.
|
|
103
|
+
- **No full utility surface** — anything bespoke ships in the app's own scoped CSS.
|
|
104
|
+
|
|
105
|
+
## Delivery — one SDK source, two paths
|
|
106
|
+
|
|
107
|
+
The SDK ships the compiled baseline as `@proveanything/smartlinks/baseline.css` (+ the
|
|
108
|
+
machine-readable class list for the doctor). One authored source; two delivery mechanisms:
|
|
109
|
+
|
|
110
|
+
| Embed mode | How the app gets it |
|
|
111
|
+
|---|---|
|
|
112
|
+
| **Container (ESM/UMD)** — same document as host | Host has already loaded `baseline.css`; the app **ships nothing** and just uses `sl-*`. Declares `meta.cssBaseline: "v1"`. |
|
|
113
|
+
| **Iframe** — its own document | The app **imports the SDK's `baseline.css`** into its own document (it inherits nothing, exactly like it must carry its own modules). Byte-identical to the host copy. |
|
|
114
|
+
|
|
115
|
+
Cascade: baseline loads first; app CSS after → app rules win ties. `sl-*` never collides with
|
|
116
|
+
app utilities regardless.
|
|
117
|
+
|
|
118
|
+
## SDK / build support (kept minimal — no CSS surgery)
|
|
119
|
+
- The SDK **exports `baseline.css`** (and `baseline.classes.json`), built in the SDK's own
|
|
120
|
+
build so the file and the class list can't drift.
|
|
121
|
+
- Manifest field **`meta.cssBaseline: "v1"`** — declares reliance so the host can guarantee
|
|
122
|
+
it's present.
|
|
123
|
+
- `smartlinks-doctor`: warn if an app declares `cssBaseline` but uses an `sl-*` class outside
|
|
124
|
+
the declared version (the useful invariant — spirit of the JS import check). No subtraction
|
|
125
|
+
tooling needed: `sl-*` is a fixed vocabulary apps just use.
|
|
126
|
+
|
|
127
|
+
## Versioning & freeze
|
|
128
|
+
- `v1` is **frozen**: an existing `sl-*` class's meaning/output never changes in place.
|
|
129
|
+
- New capability ships as `v2` **alongside** `v1` (both served), never a silent mutation.
|
|
130
|
+
- Tailwind (or whatever builds it) may be upgraded underneath as long as the `sl-*` contract
|
|
131
|
+
keeps its meaning.
|
|
132
|
+
- Governance: additions to the surface go through review (it's a decades-long contract);
|
|
133
|
+
err toward *stable and generous* over minimal, since the AI builders target it.
|
|
@@ -32,7 +32,8 @@ export default defineConfig({
|
|
|
32
32
|
'react', 'react-dom', 'react/jsx-runtime',
|
|
33
33
|
'@proveanything/smartlinks',
|
|
34
34
|
'react-router-dom', '@tanstack/react-query',
|
|
35
|
-
'lucide-react', 'date-fns', 'liquidjs', 'marked', '
|
|
35
|
+
'lucide-react', 'date-fns', 'liquidjs', 'marked', 'dompurify', 'clsx', 'tailwind-merge',
|
|
36
|
+
'class-variance-authority',
|
|
36
37
|
'@radix-ui/react-slot', '@radix-ui/react-dialog', '@radix-ui/react-popover',
|
|
37
38
|
'@radix-ui/react-tooltip', '@radix-ui/react-tabs', '@radix-ui/react-accordion',
|
|
38
39
|
'@radix-ui/react-select', '@radix-ui/react-scroll-area', '@radix-ui/react-label',
|
|
@@ -44,7 +45,8 @@ export default defineConfig({
|
|
|
44
45
|
'@proveanything/smartlinks': 'SL',
|
|
45
46
|
'react-router-dom': 'ReactRouterDOM', '@tanstack/react-query': 'ReactQuery',
|
|
46
47
|
'lucide-react': 'LucideReact', 'date-fns': 'dateFns', 'liquidjs': 'LiquidJS',
|
|
47
|
-
'marked': 'marked', '
|
|
48
|
+
'marked': 'marked', 'dompurify': 'DOMPurify', 'clsx': 'clsx',
|
|
49
|
+
'tailwind-merge': 'tailwindMerge', 'class-variance-authority': 'CVA',
|
|
48
50
|
'@radix-ui/react-slot': 'RadixSlot', '@radix-ui/react-dialog': 'RadixDialog',
|
|
49
51
|
'@radix-ui/react-popover': 'RadixPopover', '@radix-ui/react-tooltip': 'RadixTooltip',
|
|
50
52
|
'@radix-ui/react-tabs': 'RadixTabs', '@radix-ui/react-accordion': 'RadixAccordion',
|
|
@@ -72,6 +74,9 @@ export default defineConfig({
|
|
|
72
74
|
| `date-fns` | `dateFns` | 4.4 |
|
|
73
75
|
| `liquidjs` | `LiquidJS` | 10.27+ |
|
|
74
76
|
| `marked` | `marked` | 12+ |
|
|
77
|
+
| `dompurify` | `DOMPurify` | 3+ |
|
|
78
|
+
| `clsx` | `clsx` | 2+ |
|
|
79
|
+
| `tailwind-merge` | `tailwindMerge` | 3+ |
|
|
75
80
|
| `class-variance-authority` | `CVA` | 0.7 |
|
|
76
81
|
| `@radix-ui/react-slot` | `RadixSlot` | 1.2.4 |
|
|
77
82
|
| `@radix-ui/react-dialog` | `RadixDialog` | 1.1.23 |
|
|
@@ -86,10 +91,15 @@ export default defineConfig({
|
|
|
86
91
|
| `@radix-ui/react-progress` | `RadixProgress` | 1.1.8 |
|
|
87
92
|
| `@radix-ui/react-avatar` | `RadixAvatar` | 1.1.11 |
|
|
88
93
|
|
|
89
|
-
`liquidjs` and `
|
|
90
|
-
(frequently missed). `marked`
|
|
91
|
-
|
|
92
|
-
|
|
94
|
+
`liquidjs`, `marked`, `dompurify`, `clsx` and `tailwind-merge` are **host-provided** — externalise
|
|
95
|
+
them, don't ship a second copy (frequently missed). `marked` arrived in **v6**; `dompurify`, `clsx`
|
|
96
|
+
and `tailwind-merge` in **v7**. The portal and hub render markdown in the container, so use the
|
|
97
|
+
host's `marked` rather than bundling your own. `marked` does not sanitise HTML — pair it with the
|
|
98
|
+
shared `dompurify`: `el.innerHTML = DOMPurify.sanitize(marked.parse(md))`. `window.DOMPurify` is the
|
|
99
|
+
**configured instance** (callable, `.sanitize()`), so `import DOMPurify from 'dompurify'` behaves
|
|
100
|
+
exactly like a bundled default import. `clsx` + `tailwind-merge` are the standard `cn()` pair
|
|
101
|
+
(`import { clsx } from 'clsx'; import { twMerge } from 'tailwind-merge'`) — keep your local `cn()`
|
|
102
|
+
helper if you like, it just stops paying the bundle cost.
|
|
93
103
|
|
|
94
104
|
## Backwards compatibility
|
|
95
105
|
|
|
@@ -111,11 +121,18 @@ Bundles ship their own compiled CSS, so the host's Tailwind version is irrelevan
|
|
|
111
121
|
micro-app can stay on **Tailwind 3 indefinitely**, or adopt Tailwind 4 — its choice. (The starter
|
|
112
122
|
app ships the Tailwind 4 CSS-first layout as the default; see its README.)
|
|
113
123
|
|
|
124
|
+
> **CSS baseline (`sl-baseline` v1):** the CSS sibling of this JS contract, but deliberately
|
|
125
|
+
> **not** a shared Tailwind dump. It's a small, frozen, `sl-`-namespaced set of structural
|
|
126
|
+
> helpers (layout, spacing, responsive flow, type scale, motion — no colours, fonts, or
|
|
127
|
+
> components) the SDK ships (`@proveanything/smartlinks/baseline.css`) and the host serves.
|
|
128
|
+
> Opt-in via `meta.cssBaseline: "v1"`. See [css-baseline.md](css-baseline.md).
|
|
129
|
+
|
|
114
130
|
## The R5 host stack (reference)
|
|
115
131
|
|
|
116
132
|
React **19.3** · Vite **8.3** · react-router-dom **7.18** · Tailwind **4.3** (CSS-first) ·
|
|
117
133
|
TypeScript **6.0** · ESLint **10.11** · `@proveanything/smartlinks` **2.0.5** ·
|
|
118
|
-
`@proveanything/smartlinks-utils-ui` **1.16.4** · liquidjs **10.29** · marked **12
|
|
134
|
+
`@proveanything/smartlinks-utils-ui` **1.16.4** · liquidjs **10.29** · marked **12+** ·
|
|
135
|
+
dompurify **3+** · clsx **2+** · tailwind-merge **3+**.
|
|
119
136
|
|
|
120
137
|
> **TypeScript 7** (the native/Go compiler) is **deliberately deferred** — tooling hasn't settled.
|
|
121
138
|
> Target **TS 6** for R5; it compiles existing code with no source changes.
|
|
@@ -142,8 +159,8 @@ never drift:
|
|
|
142
159
|
|
|
143
160
|
```ts
|
|
144
161
|
import {
|
|
145
|
-
SHARED_DEPENDENCY_CONTRACT_VERSION, // '
|
|
146
|
-
SHARED_DEPENDENCIES, // [{ specifier, globalName, minVersion, importMapPath }, …] (
|
|
162
|
+
SHARED_DEPENDENCY_CONTRACT_VERSION, // 'v7'
|
|
163
|
+
SHARED_DEPENDENCIES, // [{ specifier, globalName, minVersion, importMapPath }, …] (29)
|
|
147
164
|
SHARED_DEPENDENCY_SPECIFIERS, // bare specifiers — drop straight into a bundler `external` list
|
|
148
165
|
getHostSharedDependencies, // what the live host advertises at runtime, or null
|
|
149
166
|
} from '@proveanything/smartlinks'
|
package/dist/docs/overview.md
CHANGED
|
@@ -63,6 +63,7 @@ The SmartLinks SDK (`@proveanything/smartlinks`) includes comprehensive document
|
|
|
63
63
|
| **Agent Tools** | `docs/agent-tools.md` | Exposing your app's actions to the SmartLinks agent — an MCP facade over server functions; **opt-in per app, additive, no migration**; complements `app.admin.json` (functions serve/adapt it, don't replace it); live loop staged |
|
|
64
64
|
| **Deploying & Registering** | `docs/deploying-apps.md` | Getting your app into the platform: fast dev publish, channels, deploy keys, registering releases |
|
|
65
65
|
| **Host Dependency Contract (R5)** | `docs/host-dependency-contract.md` | The libraries the host provides (React 19, Router 7, Radix, liquidjs, …), the externalise-don't-bundle rule + Vite config, and React-18 backwards-compat |
|
|
66
|
+
| **CSS Baseline** (`sl-baseline` v1) | `docs/css-baseline.md` | A small, frozen, `sl-`-namespaced set of structural helpers (layout, spacing, responsive flow, type scale, motion) the SDK ships (`@proveanything/smartlinks/baseline.css`) and the host guarantees — a teachable floor for apps + AI content. No colours/fonts/components. Opt-in via `meta.cssBaseline` |
|
|
66
67
|
| **Deep Linking** | `docs/deep-link-discovery.md` | URL state management, navigable states, portal menus, AI nav |
|
|
67
68
|
| **Portal Back Button** | `docs/portal-back-button.md` | Hierarchy-aware "up" navigation inside embedded apps |
|
|
68
69
|
| **Portal Request Action** | `docs/portal-request-action.md` | Triggering portal built-in actions (__qrScanner, __share, __logout, etc.) from sub-apps |
|
package/dist/openapi.yaml
CHANGED
|
@@ -17957,6 +17957,8 @@ components:
|
|
|
17957
17957
|
- dual
|
|
17958
17958
|
sharedDependencies:
|
|
17959
17959
|
type: string
|
|
17960
|
+
cssBaseline:
|
|
17961
|
+
type: string
|
|
17960
17962
|
globals:
|
|
17961
17963
|
type: object
|
|
17962
17964
|
additionalProperties:
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Current contract revision. Bumped when the entry list or host versions change. */
|
|
2
|
-
export declare const SHARED_DEPENDENCY_CONTRACT_VERSION: "
|
|
2
|
+
export declare const SHARED_DEPENDENCY_CONTRACT_VERSION: "v7";
|
|
3
3
|
export interface SharedDependency {
|
|
4
4
|
/** Bare import specifier the app writes, e.g. `react-dom/client`. */
|
|
5
5
|
specifier: string;
|
|
@@ -13,8 +13,8 @@ export interface SharedDependency {
|
|
|
13
13
|
/**
|
|
14
14
|
* Canonical import-map path for a specifier: drop the leading `@` scope marker and
|
|
15
15
|
* turn every `/` into `-`.
|
|
16
|
-
* 'react-dom/client' -> '/sl-shared/
|
|
17
|
-
* '@radix-ui/react-slot' -> '/sl-shared/
|
|
16
|
+
* 'react-dom/client' -> '/sl-shared/v7/react-dom-client.js'
|
|
17
|
+
* '@radix-ui/react-slot' -> '/sl-shared/v7/radix-ui-react-slot.js'
|
|
18
18
|
* Hosts MUST serve shims at these paths so the map the SDK advertises resolves.
|
|
19
19
|
*/
|
|
20
20
|
export declare function importMapPathFor(specifier: string, version?: string): string;
|
|
@@ -11,22 +11,24 @@
|
|
|
11
11
|
//
|
|
12
12
|
// See docs/host-dependency-contract.md.
|
|
13
13
|
/** Current contract revision. Bumped when the entry list or host versions change. */
|
|
14
|
-
export const SHARED_DEPENDENCY_CONTRACT_VERSION = '
|
|
14
|
+
export const SHARED_DEPENDENCY_CONTRACT_VERSION = 'v7';
|
|
15
15
|
/**
|
|
16
16
|
* Canonical import-map path for a specifier: drop the leading `@` scope marker and
|
|
17
17
|
* turn every `/` into `-`.
|
|
18
|
-
* 'react-dom/client' -> '/sl-shared/
|
|
19
|
-
* '@radix-ui/react-slot' -> '/sl-shared/
|
|
18
|
+
* 'react-dom/client' -> '/sl-shared/v7/react-dom-client.js'
|
|
19
|
+
* '@radix-ui/react-slot' -> '/sl-shared/v7/radix-ui-react-slot.js'
|
|
20
20
|
* Hosts MUST serve shims at these paths so the map the SDK advertises resolves.
|
|
21
21
|
*/
|
|
22
22
|
export function importMapPathFor(specifier, version = SHARED_DEPENDENCY_CONTRACT_VERSION) {
|
|
23
23
|
const slug = specifier.replace(/^@/, '').replace(/\//g, '-');
|
|
24
24
|
return `/sl-shared/${version}/${slug}.js`;
|
|
25
25
|
}
|
|
26
|
-
// The
|
|
27
|
-
//
|
|
28
|
-
// the
|
|
29
|
-
//
|
|
26
|
+
// The 29-entry v7 contract: the v6 set plus `dompurify` (HTML sanitizer — pairs with
|
|
27
|
+
// the shared `marked` so output apps sanitize instead of each bundling their own),
|
|
28
|
+
// `clsx` + `tailwind-merge` (the standard `cn()` pair the portal/hub already ship, now
|
|
29
|
+
// exposed to apps). All small, version-stable, ubiquitous — apps stop bundling copies.
|
|
30
|
+
// minVersion follows the R5 host baseline (React 19, Router 7.18.4 security floor,
|
|
31
|
+
// LiquidJS 10.27+, current Radix majors).
|
|
30
32
|
const CONTRACT = [
|
|
31
33
|
{ specifier: 'react', globalName: 'React', minVersion: '19.0.0' },
|
|
32
34
|
{ specifier: 'react-dom', globalName: 'ReactDOM', minVersion: '19.0.0' },
|
|
@@ -41,6 +43,12 @@ const CONTRACT = [
|
|
|
41
43
|
{ specifier: 'date-fns', globalName: 'dateFns', minVersion: '4.0.0' },
|
|
42
44
|
{ specifier: 'liquidjs', globalName: 'LiquidJS', minVersion: '10.27.0' },
|
|
43
45
|
{ specifier: 'marked', globalName: 'marked', minVersion: '12.0.0' },
|
|
46
|
+
// `window.DOMPurify` is the CONFIGURED instance (callable, `.sanitize()`), exactly as
|
|
47
|
+
// dompurify's own UMD build exposes it — so `import DOMPurify from 'dompurify'`
|
|
48
|
+
// resolves to the same instance a bundled default import would.
|
|
49
|
+
{ specifier: 'dompurify', globalName: 'DOMPurify', minVersion: '3.0.0' },
|
|
50
|
+
{ specifier: 'clsx', globalName: 'clsx', minVersion: '2.0.0' },
|
|
51
|
+
{ specifier: 'tailwind-merge', globalName: 'tailwindMerge', minVersion: '3.0.0' },
|
|
44
52
|
{ specifier: 'class-variance-authority', globalName: 'CVA', minVersion: '0.7.0' },
|
|
45
53
|
{ specifier: '@radix-ui/react-slot', globalName: 'RadixSlot', minVersion: '1.2.0' },
|
|
46
54
|
{ specifier: '@radix-ui/react-dialog', globalName: 'RadixDialog', minVersion: '1.1.0' },
|
|
@@ -417,11 +417,18 @@ export interface AppManifest {
|
|
|
417
417
|
*/
|
|
418
418
|
moduleFormat?: 'umd' | 'esm' | 'dual';
|
|
419
419
|
/**
|
|
420
|
-
* Shared-dependency contract version this bundle was built against, e.g. `"
|
|
420
|
+
* Shared-dependency contract version this bundle was built against, e.g. `"v7"`
|
|
421
421
|
* (see `SHARED_DEPENDENCY_CONTRACT_VERSION`). The host uses it to select a
|
|
422
422
|
* compatible import map for the ESM load path.
|
|
423
423
|
*/
|
|
424
424
|
sharedDependencies?: string;
|
|
425
|
+
/**
|
|
426
|
+
* The SmartLinks CSS baseline this bundle relies on, e.g. `"v1"`. A small, frozen,
|
|
427
|
+
* `sl-`-namespaced set of structural helpers the SDK ships and the host guarantees
|
|
428
|
+
* present. Container apps declare it and ship nothing; iframe apps import
|
|
429
|
+
* `@proveanything/smartlinks/baseline.css`. Opt-in and additive. See docs/css-baseline.md.
|
|
430
|
+
*/
|
|
431
|
+
cssBaseline?: string;
|
|
425
432
|
/**
|
|
426
433
|
* Per-app namespaced UMD globals (R4.7+), e.g. `{ widgets: "MyAppWidgets" }`.
|
|
427
434
|
* UMD-only: ESM bundles expose their exports through the module namespace and
|
package/docs/API_SUMMARY.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Smartlinks API Summary
|
|
2
2
|
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.13 | Generated: 2026-09-22T11:06:35.662Z
|
|
4
4
|
|
|
5
5
|
This is a concise summary of all available API functions and types.
|
|
6
6
|
|
|
@@ -2182,6 +2182,7 @@ interface AppManifest {
|
|
|
2182
2182
|
appId: string;
|
|
2183
2183
|
moduleFormat?: 'umd' | 'esm' | 'dual';
|
|
2184
2184
|
sharedDependencies?: string;
|
|
2185
|
+
cssBaseline?: string;
|
|
2185
2186
|
globals?: Record<string, string>;
|
|
2186
2187
|
seo?: {
|
|
2187
2188
|
strategy?: 'executor' | string;
|