@superwall/studio 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +105 -0
- package/README.md +78 -0
- package/dist/assets/index-CVKGrx00.js +11 -0
- package/dist/assets/index-D4RIpSbg.css +1 -0
- package/dist/icon.svg +5 -0
- package/dist/index.html +23 -0
- package/package.json +66 -0
- package/src/StudioApp.tsx +78 -0
- package/src/components/ActionMenu.tsx +174 -0
- package/src/components/CompareMenu.tsx +147 -0
- package/src/components/DeviceChrome.tsx +124 -0
- package/src/components/DeviceFrame.tsx +210 -0
- package/src/components/MissingProducts.tsx +46 -0
- package/src/components/OpenInApp.tsx +68 -0
- package/src/components/PaywallToasts.tsx +208 -0
- package/src/components/SidePanel.tsx +36 -0
- package/src/components/SurfaceCard.tsx +93 -0
- package/src/components/Toolbar.tsx +16 -0
- package/src/components/TopBar.tsx +41 -0
- package/src/components/VariablesPanel.tsx +200 -0
- package/src/components/controls.tsx +70 -0
- package/src/components/icons.tsx +139 -0
- package/src/index.ts +20 -0
- package/src/lib/actions.ts +79 -0
- package/src/lib/devices.ts +109 -0
- package/src/lib/events.ts +77 -0
- package/src/lib/preview.ts +39 -0
- package/src/lib/project.ts +64 -0
- package/src/lib/time.ts +21 -0
- package/src/lib/types.ts +85 -0
- package/src/main.tsx +49 -0
- package/src/screens/SurfaceEditor.tsx +498 -0
- package/src/screens/SurfaceList.tsx +156 -0
- package/src/styles.css +221 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
2
|
+
|
|
3
|
+
## Abbreviation
|
|
4
|
+
|
|
5
|
+
FSL-1.1-ALv2
|
|
6
|
+
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 Superwall, Inc.
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
+
will apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# `@superwall/studio`
|
|
2
|
+
|
|
3
|
+
The Superwall studio: a standalone vite + React + Tailwind app that is also
|
|
4
|
+
a component library. One codebase, two hosts:
|
|
5
|
+
|
|
6
|
+
- **`superwall dev`** serves the BUILT app (`dist/`, assets under
|
|
7
|
+
`/__studio/`) plus the data endpoint and preview mounts — the local studio.
|
|
8
|
+
- **The hosted dashboard** either embeds the built app (the way it embeds the
|
|
9
|
+
editor) or imports the components directly over platform data.
|
|
10
|
+
|
|
11
|
+
## App structure
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
packages/studio/
|
|
15
|
+
├── index.html the app shell (fonts, favicon)
|
|
16
|
+
├── vite.config.ts vite + react + tailwind; /__studio/ base for builds
|
|
17
|
+
├── src/
|
|
18
|
+
│ ├── main.tsx entry: fetch /__studio/project.json → <StudioApp/>
|
|
19
|
+
│ ├── index.ts the component-library barrel a hosted studio imports
|
|
20
|
+
│ ├── StudioApp.tsx URL-driven router (list ⇄ editor)
|
|
21
|
+
│ ├── screens/ SurfaceList, SurfaceEditor
|
|
22
|
+
│ ├── components/ TopBar, Toolbar, DeviceFrame, VariablesPanel,
|
|
23
|
+
│ │ ActionMenu, CompareMenu, SidePanel, controls, icons, …
|
|
24
|
+
│ ├── lib/ project.ts (wire-format parser, untrusted JSON,
|
|
25
|
+
│ │ cast-free), preview.ts (preview URL builder),
|
|
26
|
+
│ │ devices.ts (viewport + mock-device catalog),
|
|
27
|
+
│ │ actions.ts, events.ts, time.ts, types.ts
|
|
28
|
+
│ └── styles.css tailwind @theme tokens + stateful primitives
|
|
29
|
+
└── dist/ built by the workspace postinstall
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Working on the studio: `bun dev` here (port 6200) proxies `/preview` and
|
|
33
|
+
`/__studio/project.json` to a running `superwall dev` (port 6100) in any
|
|
34
|
+
project — edit studio code with HMR against real paywalls.
|
|
35
|
+
|
|
36
|
+
## Data seam
|
|
37
|
+
|
|
38
|
+
Everything renders from a `StudioSource` — `{ title, surfaces, diagnostics?,
|
|
39
|
+
samples?, previewUrl, capabilities? }`. Locally that's
|
|
40
|
+
`/__studio/project.json` (the dev server evaluates configs server-side and
|
|
41
|
+
ships sample device/user/params/product data alongside). A hosted studio
|
|
42
|
+
swaps the fetch, nothing else. `previewUrl(surface, overrides)` decides what
|
|
43
|
+
the preview iframes load: `/preview/<kind>/<id>` mounts locally, published
|
|
44
|
+
snapshot URLs in the dashboard. Overrides travel as query params (`theme`,
|
|
45
|
+
`locale`, `sw_device`, `sw_user`, `sw_params`, `sw_products`, `sw_trial`) —
|
|
46
|
+
the same channel published snapshots accept, so preview behavior is
|
|
47
|
+
identical in both hosts.
|
|
48
|
+
|
|
49
|
+
## Screens
|
|
50
|
+
|
|
51
|
+
- **SurfaceList** — every paywall and funnel as a card with a live,
|
|
52
|
+
non-interactive miniature (a real preview at 393×852, scaled).
|
|
53
|
+
- **SurfaceEditor** — the paywall alone on an ink stage in one plain device
|
|
54
|
+
frame, with a single bottom toolbar: device switching (`STUDIO_DEVICES`:
|
|
55
|
+
nine devices, iPhone SE to iPad Pro to Pixel to Desktop — each switch also
|
|
56
|
+
flips the mock SDK's platform/model/OS), light/dark simulation, locale
|
|
57
|
+
switching, and a **Variables** button that slides in a right-hand panel of
|
|
58
|
+
controls for the User, Device, Params and Products groups the SDK reports.
|
|
59
|
+
Override changes hot-swap: the next frame loads hidden and crossfades, so
|
|
60
|
+
nothing ever flashes white. Shipping happens here too: an action menu runs
|
|
61
|
+
Push, Publish and Promote, and a Compare menu diffs the preview against
|
|
62
|
+
the live paywall.
|
|
63
|
+
|
|
64
|
+
## Design
|
|
65
|
+
|
|
66
|
+
The Application register of the Superwall design system
|
|
67
|
+
(superwall.com/design.md): ink-dark chrome always (the _preview_ carries
|
|
68
|
+
light/dark, not the studio), hairline seams, mono chips, Manrope 500/400/600
|
|
69
|
+
with Roboto Mono micro-labels, teal accent, and paper-flat square geometry —
|
|
70
|
+
switches are the only carved-out rounded shape, device frames are plain
|
|
71
|
+
rectangles.
|
|
72
|
+
|
|
73
|
+
Tailwind v4 (`src/styles.css`): design tokens as `@theme` variables (so
|
|
74
|
+
`bg-ink`, `text-cream/55`, `border-cream/10` are utilities), layout inline in
|
|
75
|
+
components, and only stateful primitives (`.sw-btn`, `.sw-chip`,
|
|
76
|
+
`.sw-select`, `.sw-segmented`, `.sw-switch`, `.sw-input`) as component
|
|
77
|
+
classes. Runtime dependencies are React (a peer) and `sonner` for toasts —
|
|
78
|
+
icons are inlined Lucide-geometry SVGs.
|