create-heresay 0.2.9 → 0.2.11
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/package.json +26 -3
- package/release/VERSION +1 -1
- package/release/functions/lib/core/version.js +1 -1
- package/release/public/dashboard.css +80 -0
- package/release/public/dashboard.js +423 -0
- package/release/public/demo.html +5 -1
- package/release/public/docs.html +32 -6
- package/release/public/guides/changes.json +18 -0
- package/release/public/guides/customize-apple.md +74 -0
- package/release/public/guides/customize-web.md +95 -0
- package/release/public/guides/index.json +3 -1
- package/release/public/guides/install-apple.md +4 -2
- package/release/public/guides/install-web.md +6 -2
- package/release/public/guides/start.md +3 -0
- package/release/public/llms.txt +2 -0
- package/release/public/sdk.js +429 -97
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"about": "Features added to Heresay since apps were first installed. An agent in a connected repo checks these with whats_new, tells the person what's new, and asks before adding any. `detect` is what the code contains once a feature is in; `platforms` limits it to those apps; `sign_in` limits it to apps that answered that.",
|
|
3
3
|
"changes": [
|
|
4
|
+
{
|
|
5
|
+
"id": "design-apple",
|
|
6
|
+
"since": "0.2.11",
|
|
7
|
+
"title": "Make Heresay fit the app",
|
|
8
|
+
"summary": "The Swift package takes a HeresayStyle: another corner or clear a tab bar, say “Feedback” instead of “Report”, a quieter button, the app's light or dark theme, French, Tamil or Hindi, a half-height or full-screen sheet, or only some report types. The dashboard's Design page shows each choice and gives the Swift.",
|
|
9
|
+
"platforms": ["ios", "macos"],
|
|
10
|
+
"detect": ["HeresayStyle("],
|
|
11
|
+
"how": { "ios": "guide customize-apple", "macos": "guide customize-apple" }
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"id": "design-web",
|
|
15
|
+
"since": "0.2.11",
|
|
16
|
+
"title": "Make the Report button fit the app",
|
|
17
|
+
"summary": "The web widget can take the app's colour (the logo follows it), sit in another corner or clear a chat bubble, say “Feedback” instead of “Report”, follow the app's light or dark theme, speak French, Tamil or Hindi, or have no floating button when the app has its own feedback menu item. The dashboard's Design page shows each choice on the real widget.",
|
|
18
|
+
"platforms": ["web"],
|
|
19
|
+
"detect": ["data-accent", "data-hide-on", "data-backdrop", "data-preferences"],
|
|
20
|
+
"how": { "web": "guide customize-web" }
|
|
21
|
+
},
|
|
4
22
|
{
|
|
5
23
|
"id": "introduce",
|
|
6
24
|
"since": "0.2.7",
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# Change how Heresay looks in an iOS or macOS app
|
|
2
|
+
|
|
3
|
+
Goal: Heresay fits the app, with the fewest changes. **The defaults are the recommended
|
|
4
|
+
setup.** Change something only when the person asks, or when the app clearly needs it (see
|
|
5
|
+
"When to change what"). Everything is one `HeresayStyle`, passed to `Heresay.configure`, plus
|
|
6
|
+
the accent colour. Needs the Swift package 0.2.11 or later.
|
|
7
|
+
|
|
8
|
+
The easiest way to choose is the dashboard: open the app, then **Design**. It shows a likeness
|
|
9
|
+
of the button and sheet with the choices applied and gives the exact Swift, plus a prompt for
|
|
10
|
+
you. If the person pasted that prompt, do what it says and nothing more.
|
|
11
|
+
|
|
12
|
+
```swift
|
|
13
|
+
Heresay.configure(
|
|
14
|
+
key: "KEY",
|
|
15
|
+
url: URL(string: "HERESAY_URL")!,
|
|
16
|
+
accent: Color(red: 0.486, green: 0.227, blue: 0.929),
|
|
17
|
+
style: HeresayStyle(position: .bottomLeading, label: "Feedback")
|
|
18
|
+
)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## When to change what
|
|
22
|
+
|
|
23
|
+
| The app has... | Do this |
|
|
24
|
+
| --- | --- |
|
|
25
|
+
| Its own feedback or help button | `.heresay()` instead of `.heresayReportButton()`, and that button calls `Heresay.present()` |
|
|
26
|
+
| A macOS app | keep the default: `.heresay()` plus `.commands { HeresayCommands() }` (Help › Report a Problem…, ⌥⌘R) |
|
|
27
|
+
| A tab bar or toolbar in the bottom right | `position: .bottomLeading`, or `offset: 80` to sit above it |
|
|
28
|
+
| A brand colour | `accent:` on `configure` (the mark follows it) |
|
|
29
|
+
| Only a dark theme, or only a light one | `theme: .dark` or `.light`; otherwise leave it following the app |
|
|
30
|
+
| French, Tamil or Hindi users | nothing, if the app is localised into `fr`, `ta` or `hi`; otherwise `language:` with that code |
|
|
31
|
+
| An error screen | a button there that calls `Heresay.present(type: .broken, text: "<what failed>")` |
|
|
32
|
+
| Screens where a corner button gets in the way (checkout, sign-in) | `hiddenOnScreens: ["Checkout"]`, and those screens call `Heresay.setScreen("Checkout")` |
|
|
33
|
+
|
|
34
|
+
## Every option
|
|
35
|
+
|
|
36
|
+
`HeresayStyle(...)` takes these in this order (Swift needs the order); leave out any you don't
|
|
37
|
+
change. The first value is the default.
|
|
38
|
+
|
|
39
|
+
| Parameter | Values |
|
|
40
|
+
| --- | --- |
|
|
41
|
+
| `position` | `.bottomTrailing` · `.bottomLeading` · `.topTrailing` · `.topLeading` · `.bottom` |
|
|
42
|
+
| `offset` | `16` points from the edges (at most 200) |
|
|
43
|
+
| `label` | `nil` ("Report", in the sheet's language) · any text up to 40 characters |
|
|
44
|
+
| `button` | `.pill` · `.icon` (the label stays as its accessibility label) |
|
|
45
|
+
| `size` | `.regular` · `.small` · `.large` |
|
|
46
|
+
| `fill` | `.accent` (filled with the accent, white text) · `.neutral` (system material, the mark in the accent) |
|
|
47
|
+
| `shadow` | `.soft` · `.none` · `.strong` |
|
|
48
|
+
| `hiddenOnScreens` | `[]` · screen names as set with `Heresay.setScreen` |
|
|
49
|
+
| `markFollowsAccent` | `true` · `false` (keep the Heresay teal) |
|
|
50
|
+
| `theme` | `.system` · `.light` · `.dark` |
|
|
51
|
+
| `typeface` | `.system` · `.rounded` · `.serif` |
|
|
52
|
+
| `language` | `nil` (the app's language) · `"en"` · `"fr"` · `"ta"` (Tamil) · `"hi"` (Hindi). Others show English. |
|
|
53
|
+
| `placeholder` | `nil` · the question in the text box, up to 120 characters |
|
|
54
|
+
| `types` | all four · some of `[.broken, .confusing, .improvement, .idea]`. Their names can't change: the type sets the priority. |
|
|
55
|
+
| `thanks` | `nil` · a line after "Sent. Thank you.", up to 160 characters. Don't promise a fix. |
|
|
56
|
+
| `sheet` | `.regular` · `.compact` (half height on iPhone; narrower on Mac) · `.large` (full screen on iPhone and iPad; wider on Mac) |
|
|
57
|
+
| `showsPreferences` | `true` · `false` (hide it when the app calls `identify` and wants nothing else asked) |
|
|
58
|
+
|
|
59
|
+
`Heresay.setStyle(_:)` changes it later, for example when the app's own theme setting changes.
|
|
60
|
+
|
|
61
|
+
**Calls**
|
|
62
|
+
|
|
63
|
+
- `Heresay.present(type:text:)`: opens the sheet, filled in. The person still reviews and sends it.
|
|
64
|
+
- `Heresay.onSent { event in ... }`: after each report is sent, with `event.id` and `event.type`, never the text.
|
|
65
|
+
- `Heresay.introduce(title:message:)`: the one-time introduction in your own words. Leave the
|
|
66
|
+
words out unless asked; the default says where to find it.
|
|
67
|
+
|
|
68
|
+
## Can't be changed
|
|
69
|
+
|
|
70
|
+
The Heresay mark, the report types' names, the Your reports tab (people must be able to read why
|
|
71
|
+
a report was declined), and "Powered by Heresay" in the sheet and the introduction. People
|
|
72
|
+
should be able to tell the app uses an outside tool. Don't cover or remove them.
|
|
73
|
+
|
|
74
|
+
After changing it, run the app and look at the button, the open sheet and the introduction.
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Change how Heresay looks in a web app
|
|
2
|
+
|
|
3
|
+
Goal: the Report button fits the app, with the fewest changes. **The defaults are the
|
|
4
|
+
recommended setup.** Change something only when the person asks, or when the app clearly needs
|
|
5
|
+
it (see "When to change what"). Every option is a `data-` attribute on the same script tag;
|
|
6
|
+
nothing needs CSS, and the app's CSS can't reach the widget anyway.
|
|
7
|
+
|
|
8
|
+
The easiest way to choose is the dashboard: open the app, then **Design**. It shows the real
|
|
9
|
+
widget with the choices applied and gives the exact tag, plus a prompt for you. If the person
|
|
10
|
+
pasted that prompt, do what it says and nothing more.
|
|
11
|
+
|
|
12
|
+
## When to change what
|
|
13
|
+
|
|
14
|
+
| The app has... | Do this |
|
|
15
|
+
| --- | --- |
|
|
16
|
+
| Its own "Send feedback" or help menu | `data-button="none"`, and make that menu item call `window.Heresay?.open()` |
|
|
17
|
+
| A chat bubble or cookie banner in the bottom right | `data-position="left"`, or `data-offset="20,96"` to sit above it |
|
|
18
|
+
| A brand colour | `data-accent="#rrggbb"` (the logo follows it) |
|
|
19
|
+
| Only a dark theme, or only a light one | `data-theme="dark"` or `"light"`; otherwise leave it following the device |
|
|
20
|
+
| French, Tamil or Hindi users | nothing, if `<html lang>` is set (`fr`, `ta`, `hi`); otherwise `data-lang` with that code, or `"auto"` |
|
|
21
|
+
| An error screen or "Something went wrong" page | a button there that calls `window.Heresay?.open({ type: 'broken', text: '<what failed>' })` |
|
|
22
|
+
| Pages where a floating button gets in the way (checkout, login) | `data-hide-on="/checkout,/login"` |
|
|
23
|
+
|
|
24
|
+
## Every option
|
|
25
|
+
|
|
26
|
+
The first value is the default.
|
|
27
|
+
|
|
28
|
+
**The button**
|
|
29
|
+
|
|
30
|
+
| Attribute | Values |
|
|
31
|
+
| --- | --- |
|
|
32
|
+
| `data-position` | `right` · `left` · `top-right` · `top-left` · `center` (bottom centre) |
|
|
33
|
+
| `data-offset` | `20` · any number of px, or `x,y` like `24,96` (at most 400) |
|
|
34
|
+
| `data-button` | `always` · `none` (no button; open it yourself) · `desktop` (not on phones) · `scroll` (after the first scroll; after 10 s on a page that doesn't scroll) |
|
|
35
|
+
| `data-label` | `Report` · any text up to 40 characters, e.g. `Feedback` |
|
|
36
|
+
| `data-style` | `pill` · `icon` (icon only; the label stays as its accessible name) · `tab` (on the side edge) |
|
|
37
|
+
| `data-size` | `regular` · `small` · `large` |
|
|
38
|
+
| `data-fill` | `neutral` · `accent` (filled with the accent colour) |
|
|
39
|
+
| `data-shadow` | `soft` · `none` · `strong` |
|
|
40
|
+
| `data-hide-on` | comma-separated paths; each hides the button on that path and everything under it |
|
|
41
|
+
|
|
42
|
+
**Look**
|
|
43
|
+
|
|
44
|
+
| Attribute | Values |
|
|
45
|
+
| --- | --- |
|
|
46
|
+
| `data-accent` | Heresay peacock · any hex colour, `#rgb` or `#rrggbb`. Anything else is ignored. |
|
|
47
|
+
| `data-mark` | `accent` (the logo follows the accent) · `heresay` (keep the Heresay teal) |
|
|
48
|
+
| `data-theme` | `auto` (follows the device) · `light` · `dark` |
|
|
49
|
+
| `data-font` | `system` · `inherit` (the page's font) |
|
|
50
|
+
|
|
51
|
+
**Words**
|
|
52
|
+
|
|
53
|
+
| Attribute | Values |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `data-lang` | the page's `<html lang>` · `auto` (the browser's) · `en` · `fr` · `ta` (Tamil) · `hi` (Hindi). Other languages show English. |
|
|
56
|
+
| `data-placeholder` | the question in the text box, up to 120 characters |
|
|
57
|
+
| `data-types` | all four · a comma list of `broken`, `confusing`, `improvement`, `idea`. Their names can't change: the type sets the priority. |
|
|
58
|
+
| `data-thanks` | none · a line shown after sending, up to 160 characters. Don't promise a fix. |
|
|
59
|
+
|
|
60
|
+
Intro wording: `window.Heresay?.introduce({ title, body })`. Leave it out unless asked; the
|
|
61
|
+
default says what matters.
|
|
62
|
+
|
|
63
|
+
**The panel**
|
|
64
|
+
|
|
65
|
+
| Attribute | Values |
|
|
66
|
+
| --- | --- |
|
|
67
|
+
| `data-panel` | `corner` (next to the button) · `sheet` (full height on that side) · `center` |
|
|
68
|
+
| `data-width` | `regular` · `narrow` · `wide` |
|
|
69
|
+
| `data-backdrop` | `dim` · `clear` · `blur` |
|
|
70
|
+
| `data-preferences` | `show` · `hide` (hide it when the app calls `identify()` and wants nothing else asked) |
|
|
71
|
+
| `data-intro` | not set (the app calls `introduce()`) · `auto` (3 s after the first visit) |
|
|
72
|
+
|
|
73
|
+
**Calls**
|
|
74
|
+
|
|
75
|
+
- `window.Heresay?.open({ type, text })`: opens the form, filled in. The person still reviews and sends it.
|
|
76
|
+
- `window.Heresay?.on('sent', ({ id, type }) => ...)`: after each report is sent, for example to thank them or count it in the app's analytics. It returns a function that stops listening. It never gets the report text.
|
|
77
|
+
|
|
78
|
+
## Can't be changed
|
|
79
|
+
|
|
80
|
+
The Heresay mark on the button, the report types' names, the "Your reports" tab (people must
|
|
81
|
+
be able to read why a report was declined), and the "Powered by Heresay" line in the panel and
|
|
82
|
+
the introduction. People should be able to tell the app uses an outside tool. Don't hide these
|
|
83
|
+
with CSS, `::part` or scripts.
|
|
84
|
+
|
|
85
|
+
## Example
|
|
86
|
+
|
|
87
|
+
```html
|
|
88
|
+
<script src="SDK_URL" data-key="KEY"
|
|
89
|
+
data-position="left" data-accent="#7c3aed" data-label="Feedback"
|
|
90
|
+
defer></script>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
In Next.js, Nuxt and the rest, add the same attributes to the tag's existing form (for example
|
|
94
|
+
`<Script ... data-position="left" />`). After changing it, run the app and look at the button,
|
|
95
|
+
the open panel and the introduction.
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"skill_version":
|
|
2
|
+
"skill_version": 5,
|
|
3
3
|
"topics": {
|
|
4
4
|
"start": "What Heresay is, the rules, and which topic to read next",
|
|
5
5
|
"install-web": "Add the Heresay web SDK to an app, for any framework, and prove it works",
|
|
6
|
+
"customize-web": "Change how the web widget looks and where it sits: every option, the recommended defaults, and when to change them",
|
|
6
7
|
"install-apple": "Add the Heresay Swift package to an iOS or macOS app",
|
|
8
|
+
"customize-apple": "Change how Heresay looks in an iOS or macOS app: HeresayStyle, the recommended defaults, and when to change them",
|
|
7
9
|
"fix-brief": "Fix an accepted report: find, claim, fix, hand off, mark fixed",
|
|
8
10
|
"write-note": "Write the note the reporter reads when a report is fixed",
|
|
9
11
|
"uninstall": "Remove Heresay from an app, and disconnect the repo",
|
|
@@ -71,9 +71,11 @@ build a custom dialog for this; `introduce()` is the one.
|
|
|
71
71
|
|
|
72
72
|
- Screens: `Heresay.setScreen("Checkout")` in `.onAppear` of the main screens.
|
|
73
73
|
- The app version is read from the bundle (`CFBundleShortVersionString` and build).
|
|
74
|
-
- A brand colour: `Heresay.configure(key:url:accent: .purple)`.
|
|
74
|
+
- A brand colour: `Heresay.configure(key:url:accent: .purple)`. The mark follows it.
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
Everything else about the look (corner, text, size, theme, language, sheet size) is optional and
|
|
77
|
+
has a recommended default: leave it unless the person asks. Guide `customize-apple` lists every
|
|
78
|
+
option; the dashboard's **Design** page shows them. Change nothing else in the app.
|
|
77
79
|
|
|
78
80
|
## 7. Prove it
|
|
79
81
|
|
|
@@ -61,9 +61,13 @@ Don't build a custom dialog for this; `introduce()` is the one.
|
|
|
61
61
|
|
|
62
62
|
- A version: add `data-version="<version>"` to the tag (from package.json, a build env var, ...).
|
|
63
63
|
- Screens that change without the URL changing: `window.Heresay?.setScreen("<name>")` on each change.
|
|
64
|
-
- A brand colour: `data-accent="#rrggbb"` (hex only).
|
|
64
|
+
- A brand colour: `data-accent="#rrggbb"` (hex only). The logo follows it.
|
|
65
|
+
- The app has its own feedback or help menu item: `data-button="none"`, and make that item call
|
|
66
|
+
`window.Heresay?.open()`.
|
|
65
67
|
|
|
66
|
-
|
|
68
|
+
Everything else about the look is optional and has a recommended default: leave it unless the
|
|
69
|
+
person asks. Guide `customize-web` lists every option; the dashboard's **Design** page shows
|
|
70
|
+
them on the real widget. Change nothing else in the app.
|
|
67
71
|
|
|
68
72
|
## 6. Prove it
|
|
69
73
|
|
|
@@ -31,6 +31,9 @@ yes; on a no, `skip_update` so nobody asks again.
|
|
|
31
31
|
## Which topic next
|
|
32
32
|
|
|
33
33
|
- Adding Heresay to an app: `install-web` for web apps, `install-apple` for iOS and macOS.
|
|
34
|
+
- Making the web widget fit the app (colour, corner, text, language, no floating button):
|
|
35
|
+
`customize-web`; for iOS and macOS, `customize-apple`. The defaults are the recommended setup;
|
|
36
|
+
change them only when asked.
|
|
34
37
|
- Fixing reports: `fix-brief`, then `write-note`.
|
|
35
38
|
- Removing Heresay from an app: `uninstall`.
|
|
36
39
|
- New features for an app that already has Heresay: `whats-new`.
|
package/release/public/llms.txt
CHANGED
|
@@ -8,7 +8,9 @@ This site is one team's own Heresay. Its guides for coding agents are plain Mark
|
|
|
8
8
|
|
|
9
9
|
- [Start here](/guides/start.md): what Heresay is and the rules
|
|
10
10
|
- [Install on the web](/guides/install-web.md): where the script tag goes, per framework
|
|
11
|
+
- [Change how it looks on the web](/guides/customize-web.md): every option, and the recommended defaults
|
|
11
12
|
- [Install on iOS and macOS](/guides/install-apple.md): the Swift package and one line of setup
|
|
13
|
+
- [Change how it looks on iOS and macOS](/guides/customize-apple.md): HeresayStyle, and the recommended defaults
|
|
12
14
|
- [Fix a brief](/guides/fix-brief.md): claim, fix, hand off, mark fixed
|
|
13
15
|
- [Write the fix note](/guides/write-note.md): the note the reporter reads
|
|
14
16
|
- [Docs](/docs.html): script tag options, JavaScript API, limits
|