create-heresay 0.2.49 → 0.2.50
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 +1 -1
- package/release/VERSION +1 -1
- package/release/functions/lib/core/version.js +1 -1
- package/release/public/dashboard.css +0 -3
- package/release/public/dashboard.js +52 -61
- package/release/public/demo.html +1 -1
- package/release/public/docs.html +20 -24
- package/release/public/guides/customize-apple.md +83 -89
- package/release/public/guides/customize-web.md +101 -98
- package/release/public/guides/index.json +3 -3
- package/release/public/guides/install-apple.md +17 -23
- package/release/public/guides/install-web.md +60 -44
- package/release/public/guides/start.md +29 -43
- package/release/public/llms.txt +1 -1
- package/release/public/sdk.js +629 -389
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-heresay",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.50",
|
|
4
4
|
"description": "Set up your own Heresay: in-app feedback that every report gets a hearing. Creates a Firebase project in your Google account and deploys the dashboard, API and SDK to it.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/release/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.2.
|
|
1
|
+
0.2.50
|
|
@@ -362,9 +362,6 @@ a.platform:hover { border-color:var(--acc); box-shadow:0 0 0 3px var(--mist); }
|
|
|
362
362
|
.am-seg span.on { background:var(--card); box-shadow:0 1px 2px rgb(0 0 0 / .12); font-weight:600; }
|
|
363
363
|
.am-body { flex:1; overflow:hidden; padding:10px 16px; border-top:1px solid var(--line); }
|
|
364
364
|
.am-lab { margin:4px 0 6px; color:var(--mute); font-weight:600; font-size:12px; }
|
|
365
|
-
.am-types { display:grid; gap:6px; margin-bottom:10px; } .am-types.grid { grid-template-columns:1fr 1fr; }
|
|
366
|
-
.am-type { display:flex; gap:8px; align-items:flex-start; padding:8px; border-radius:10px; background:var(--fill); border:1px solid var(--line); }
|
|
367
|
-
.am-type b { display:block; font-size:12.5px; } .am-type i { font-style:normal; color:var(--mute); font-size:11px; }
|
|
368
365
|
.am-ti { flex:none; width:24px; height:24px; border-radius:50%; display:grid; place-items:center; font-size:12px; font-weight:700; }
|
|
369
366
|
.am-text { min-height:48px; padding:8px; border-radius:10px; background:var(--fill); border:1px solid var(--line); color:var(--mute); }
|
|
370
367
|
.am-powered { display:flex; justify-content:center; align-items:center; gap:5px; padding:6px; color:var(--mute); font-size:11px; font-weight:500; }
|
|
@@ -563,8 +563,12 @@
|
|
|
563
563
|
* what differs from the recommendation goes in the tag. The full list: public/guides/customize-web.md.
|
|
564
564
|
*/
|
|
565
565
|
var DESIGN = [
|
|
566
|
+
{ group: 'Layout', items: [
|
|
567
|
+
{ a: 'layout', label: 'How it looks to the reporter', c: [['', 'Composer: type pills and a text box'], ['steps', 'Steps: pick what it is, then say it'], ['bar', 'Bar: a compact box beside the button']],
|
|
568
|
+
hint: 'Composer suits most apps. Steps guides people who don’t know what to write. Bar stays small where a panel would cover their work.' },
|
|
569
|
+
]},
|
|
566
570
|
{ group: 'The button', items: [
|
|
567
|
-
{ a: 'position', label: 'Where it sits', c: [['', 'Bottom right'], ['left', 'Bottom left'], ['top-right', 'Top right'], ['top-left', 'Top left'], ['center', 'Bottom centre']] },
|
|
571
|
+
{ a: 'position', label: 'Where it sits', c: [['', 'Bottom right'], ['bottom-left', 'Bottom left'], ['top-right', 'Top right'], ['top-left', 'Top left'], ['bottom-center', 'Bottom centre']] },
|
|
568
572
|
{ a: 'offset', label: 'Distance from the edge', c: [['', '20px'], ['40', '40px'], ['96', '96px, above a chat bubble']], text: 'or x,y like 24,96', pattern: /^\d{1,3}(\s*,\s*\d{1,3})?$/ },
|
|
569
573
|
{ a: 'button', label: 'When it shows', c: [['', 'Always'], ['none', 'Never: my app has its own menu item'], ['desktop', 'Not on phones'], ['scroll', 'After the first scroll']] },
|
|
570
574
|
{ a: 'label', label: 'Text', c: [['', 'Report'], ['Feedback', 'Feedback'], ['Help us improve', 'Help us improve'], ['Found a bug?', 'Found a bug?']], text: 'or your own words', max: 40 },
|
|
@@ -582,15 +586,15 @@
|
|
|
582
586
|
]},
|
|
583
587
|
{ group: 'Words', items: [
|
|
584
588
|
{ a: 'lang', label: 'Language', c: [['', 'My page’s language'], ['auto', 'The browser’s'], ['en', 'English'], ['fr', 'Français'], ['ta', 'தமிழ்'], ['hi', 'हिन्दी']], hint: 'English, French, Tamil and Hindi today; any other language shows English.' },
|
|
585
|
-
{ a: 'placeholder', label: 'Question in the text box', c: [['', 'What
|
|
589
|
+
{ a: 'placeholder', label: 'Question in the text box', c: [['', 'Follows the type: What went wrong?, What would you like?…']], text: 'or your own words', max: 120 },
|
|
586
590
|
{ a: 'types', label: 'Report types', c: [['', 'All four'], ['broken,confusing,improvement', 'No “Idea”'], ['broken,confusing', 'Only Broken and Confusing']], hint: 'Their names can’t change: the type sets the priority.' },
|
|
587
591
|
{ a: 'thanks', label: 'Thank-you line after sending', c: [['', 'None']], text: 'e.g. Thanks! We read every one.', max: 160 },
|
|
588
592
|
]},
|
|
589
593
|
{ group: 'The panel', items: [
|
|
590
|
-
{ a: 'panel', label: 'Where it opens', c: [['', 'Next to the button'], ['sheet', 'Side sheet'], ['center', 'Middle of the screen']] },
|
|
594
|
+
{ a: 'panel', label: 'Where it opens', c: [['', 'Next to the button'], ['sheet', 'Side sheet'], ['center', 'Middle of the screen']], hint: 'The bar layout ignores this; its Your reports view opens next to the button.' },
|
|
591
595
|
{ a: 'width', label: 'Width', c: [['', 'Regular'], ['narrow', 'Narrow'], ['wide', 'Wide']] },
|
|
592
596
|
{ a: 'backdrop', label: 'Behind it', c: [['', 'Dim the page'], ['clear', 'Leave the page clear'], ['blur', 'Blur']] },
|
|
593
|
-
{ a: 'preferences', label: '
|
|
597
|
+
{ a: 'preferences', label: 'Name and email row', c: [['', 'Show'], ['hide', 'Hide']], hint: 'Hide it if your app calls identify() and asks nothing else.' },
|
|
594
598
|
{ a: 'intro', label: 'Introduce the button', c: [['', 'When my app calls introduce()'], ['auto', '3 seconds after the first visit']] },
|
|
595
599
|
]},
|
|
596
600
|
];
|
|
@@ -600,7 +604,13 @@
|
|
|
600
604
|
|
|
601
605
|
/** The data- attributes a design adds to the tag, in the order the list shows them. */
|
|
602
606
|
function designAttrs(cfg) {
|
|
603
|
-
|
|
607
|
+
var c = Object.assign({}, cfg);
|
|
608
|
+
// One attribute says where the button goes: the tab and "no button" cases fold into data-position.
|
|
609
|
+
if (c.button === 'none') { c.position = 'none'; c.button = ''; c.style = ''; }
|
|
610
|
+
else if (c.style === 'tab' && (!c.position || /^bottom-(left|right|center)$/.test(c.position))) {
|
|
611
|
+
c.position = c.position === 'bottom-left' ? 'left-tab' : 'right-tab'; c.style = '';
|
|
612
|
+
}
|
|
613
|
+
return DESIGN_ITEMS.filter(function (it) { return c[it.a]; }).map(function (it) { return ['data-' + it.a, c[it.a]]; });
|
|
604
614
|
}
|
|
605
615
|
|
|
606
616
|
function designTag(p, cfg) {
|
|
@@ -618,7 +628,7 @@
|
|
|
618
628
|
panel: 'H.open();',
|
|
619
629
|
intro: 'if(!H.introduce())document.getElementById("note").hidden=false;',
|
|
620
630
|
sent: 'H.open({type:"broken",text:"The export button does nothing."});' +
|
|
621
|
-
'document.querySelector("[data-feedback-sdk]").shadowRoot.querySelector(".send").click();',
|
|
631
|
+
'document.querySelector("[data-feedback-sdk]").shadowRoot.querySelector(".send,.bsend").click();',
|
|
622
632
|
}[show] || '';
|
|
623
633
|
return '<!doctype html><html lang="en"><head><meta charset="utf-8"><style>' +
|
|
624
634
|
'body{margin:0;min-height:1400px;font:15px/1.6 Georgia,serif;background:' + (dark ? '#111317;color:#e6e8eb' : '#fff;color:#1d2127') + '}' +
|
|
@@ -657,13 +667,13 @@
|
|
|
657
667
|
var a = designAttrs(cfg);
|
|
658
668
|
return 'Update the Heresay script tag in this app (the one with data-key="' + p.key + '") so it looks like this. ' +
|
|
659
669
|
'Keep it where it is and keep the framework\'s own way of writing it (for example next/script in Next.js). ' +
|
|
660
|
-
'Remove any other design attributes it has (data-position, data-offset, data-button, data-label, data-style, data-size, data-fill, data-shadow, data-hide-on, data-accent, data-mark, data-theme, data-font, data-lang, data-placeholder, data-types, data-thanks, data-panel, data-width, data-backdrop, data-preferences, data-intro); keep data-key, data-version and anything about the signed-in user.\n\n' +
|
|
670
|
+
'Remove any other design attributes it has (data-layout, data-position, data-offset, data-button, data-label, data-style, data-size, data-fill, data-shadow, data-hide-on, data-accent, data-mark, data-theme, data-font, data-lang, data-placeholder, data-types, data-thanks, data-panel, data-width, data-backdrop, data-preferences, data-intro); keep data-key, data-version and anything about the signed-in user.\n\n' +
|
|
661
671
|
designTag(p, cfg) + '\n' +
|
|
662
672
|
(cfg.button === 'none' ? '\nThere is no floating button now, so add a "Send feedback" item to the app\'s own help or account menu that calls window.Heresay?.open().\n' : '') +
|
|
663
673
|
(a.some(function (x) { return x[0] === 'data-intro'; }) ? '' : '\nIf the app doesn\'t call window.Heresay?.introduce() yet, call it once the main screen appears.\n') +
|
|
664
674
|
'\nFor what each option does, read the Heresay guide customize-web (heresay_guide, or npx -y heresay@latest guide customize-web).';
|
|
665
675
|
},
|
|
666
|
-
fixed: 'Always there, whatever you choose: the Heresay mark on the button,
|
|
676
|
+
fixed: 'Always there, whatever you choose: the Heresay mark on the button, “Your reports” (people read why a report was declined), and “Powered by Heresay”, so people can tell your app uses an outside tool.',
|
|
667
677
|
};
|
|
668
678
|
}
|
|
669
679
|
|
|
@@ -790,14 +800,14 @@
|
|
|
790
800
|
]},
|
|
791
801
|
{ group: 'Words', items: [
|
|
792
802
|
{ a: 'language', label: 'Language', c: [['', 'My app’s language'], ['en', 'English'], ['fr', 'Français'], ['ta', 'தமிழ்'], ['hi', 'हिन्दी']], hint: 'English, French, Tamil and Hindi today; any other language shows English.' },
|
|
793
|
-
{ a: 'placeholder', label: 'Question in the text box', c: [['', 'What
|
|
803
|
+
{ a: 'placeholder', label: 'Question in the text box', c: [['', 'Follows the type: What went wrong?, What would you like?…']], text: 'or your own words', max: 120 },
|
|
794
804
|
{ a: 'types', label: 'Report types', c: [['', 'All four'], ['broken,confusing,improvement', 'No “Idea”'], ['broken,confusing', 'Only Broken and Confusing']], hint: 'Their names can’t change: the type sets the priority.' },
|
|
795
805
|
{ a: 'thanks', label: 'Thank-you line after sending', c: [['', 'None']], text: 'e.g. Thanks! We read every one.', max: 160 },
|
|
796
806
|
]},
|
|
797
807
|
{ group: 'The sheet', items: [
|
|
798
808
|
{ a: 'sheet', label: 'Size', c: mac ? [['', 'Regular'], ['compact', 'Narrow'], ['large', 'Wide']]
|
|
799
809
|
: [['', 'Full height'], ['compact', 'Half height, pull up for more'], ['large', 'Full screen']] },
|
|
800
|
-
{ a: 'showsPreferences', label: '
|
|
810
|
+
{ a: 'showsPreferences', label: 'Name and email row', c: [['', 'Show'], ['false', 'Hide']], hint: 'At the bottom of Your reports. Hide it if your app calls identify() and asks nothing else.' },
|
|
801
811
|
]},
|
|
802
812
|
];
|
|
803
813
|
}
|
|
@@ -871,44 +881,28 @@
|
|
|
871
881
|
'\nIf the app doesn\'t call Heresay.introduce() yet, call it once the main screen appears.' +
|
|
872
882
|
'\nFor what each option does, read the Heresay guide customize-apple (heresay_guide, or npx -y heresay@latest guide customize-apple).';
|
|
873
883
|
},
|
|
874
|
-
fixed: 'Always there, whatever you choose: the Heresay mark,
|
|
884
|
+
fixed: 'Always there, whatever you choose: the Heresay mark, “Your reports” (people read why a report was declined), and “Powered by Heresay” in the sheet and the introduction, so people can tell your app uses an outside tool.',
|
|
875
885
|
};
|
|
876
886
|
}
|
|
877
887
|
|
|
878
888
|
/** The words the preview shows, from Words.swift. Only a likeness needs these few. */
|
|
879
889
|
var APPLE_WORDS = {
|
|
880
|
-
en: { report: 'Report', send: 'Send',
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
ta: { report: 'தெரிவி', send: 'அனுப்பு', sendFeedback: 'கருத்து அனுப்பு', straight: 'நேராக {app} குழுவுக்கு', tabs: ['தெரிவி', 'உங்கள் புகார்கள்', 'விருப்பங்கள்'],
|
|
897
|
-
what: 'இது என்ன வகை?', happened: 'என்ன நடந்தது?', ph: 'என்ன நடந்தது, அல்லது எதை மாற்ற விரும்புகிறீர்கள்?', attached: 'இந்தத் திரை மற்றும் ஆப் பதிப்புடன் அனுப்பப்படும்.',
|
|
898
|
-
types: [['வேலை செய்யவில்லை', 'ஏதோ ஒன்று சரியாக இயங்கவில்லை'], ['குழப்பமாக உள்ளது', 'எப்படிச் செய்வது என்று புரியவில்லை'], ['இன்னும் சிறப்பாக்கலாம்', 'வேலை செய்கிறது, ஆனால் மேம்படுத்தலாம்'], ['யோசனை', 'இன்னும் இல்லாத ஒன்று']],
|
|
899
|
-
powered: 'Heresay மூலம் இயங்குகிறது', introTitle: 'இந்த ஆப்பை இன்னும் சிறப்பாக்க உதவுங்கள்',
|
|
900
|
-
introBody: 'ஒரு யோசனையைப் பகிர அல்லது நீங்கள் எதை மாற்ற விரும்புகிறீர்கள் என்று குழுவிடம் சொல்ல, {reach}. ஒவ்வொரு கருத்தையும் ஒருவர் படிக்கிறார்; உங்களுடையதற்கு என்ன ஆனது என்பதைப் பார்க்கலாம்.',
|
|
901
|
-
reachTap: 'எப்போது வேண்டுமானாலும் மூலையில் உள்ள {label} ஐத் தட்டுங்கள்', reachClick: 'எப்போது வேண்டுமானாலும் {label} ஐக் கிளிக் செய்யுங்கள்', reachMenu: 'எப்போது வேண்டுமானாலும் Help › சிக்கலைத் தெரிவி… (⌥⌘R) என்பதைத் தேர்ந்தெடுங்கள்', reachUse: 'எப்போது வேண்டுமானாலும் {label} ஐப் பயன்படுத்துங்கள்',
|
|
902
|
-
tryIt: 'முயன்று பாருங்கள்', gotIt: 'சரி', cancel: 'ரத்துசெய்', sentTitle: 'அனுப்பப்பட்டது. நன்றி.', sentBody: 'குழுவில் ஒருவர் ஒவ்வொரு புகாரையும் படிக்கிறார். அதற்கு என்ன ஆனது என்பதை “உங்கள் புகார்கள்” பகுதியில் பார்க்கலாம்.',
|
|
903
|
-
another: 'இன்னொன்று அனுப்பு', see: 'உங்கள் புகார்களைப் பார்', menu: 'சிக்கலைத் தெரிவி…' },
|
|
904
|
-
hi: { report: 'रिपोर्ट करें', send: 'भेजें', sendFeedback: 'फ़ीडबैक भेजें', straight: 'सीधे {app} टीम को', tabs: ['रिपोर्ट', 'आपकी रिपोर्ट', 'प्राथमिकताएँ'],
|
|
905
|
-
what: 'यह क्या है?', happened: 'क्या हुआ?', ph: 'क्या हुआ, या आप क्या बदलना चाहेंगे?', attached: 'इस स्क्रीन और ऐप के वर्शन के साथ भेजा जाता है।',
|
|
906
|
-
types: [['टूटा हुआ', 'कुछ काम नहीं कर रहा'], ['उलझन भरा', 'समझ नहीं आया कि कैसे करें'], ['बेहतर हो सकता है', 'काम करता है, पर बेहतर हो सकता है'], ['सुझाव', 'कुछ ऐसा जो अभी नहीं है']],
|
|
907
|
-
powered: 'Heresay द्वारा संचालित', introTitle: 'इस ऐप को और बेहतर बनाने में मदद करें',
|
|
908
|
-
introBody: 'कोई आइडिया बताने या टीम को यह बताने के लिए कि आप क्या बदलना चाहेंगे, {reach}। हर रिपोर्ट कोई इंसान पढ़ता है, और आपकी रिपोर्ट का क्या हुआ, यह आप देखेंगे।',
|
|
909
|
-
reachTap: 'कभी भी कोने में {label} पर टैप करें', reachClick: 'कभी भी {label} पर क्लिक करें', reachMenu: 'कभी भी Help › समस्या की रिपोर्ट करें… (⌥⌘R) चुनें', reachUse: 'कभी भी {label} का इस्तेमाल करें',
|
|
910
|
-
tryIt: 'आज़माएँ', gotIt: 'ठीक है', cancel: 'रद्द करें', sentTitle: 'भेज दिया गया। धन्यवाद।', sentBody: 'टीम का कोई व्यक्ति हर रिपोर्ट पढ़ता है। इसका क्या हुआ, यह आप “आपकी रिपोर्ट” में देखेंगे।',
|
|
911
|
-
another: 'एक और भेजें', see: 'अपनी रिपोर्ट देखें', menu: 'समस्या की रिपोर्ट करें…' },
|
|
890
|
+
en: { report: 'Report', send: 'Send', mine: 'Your reports', ph: 'What’s on your mind?', sentTo: 'Sent to this app’s team',
|
|
891
|
+
types: ['Broken', 'Confusing', 'Could be better', 'Idea'],
|
|
892
|
+
powered: 'Powered by Heresay', introTitle: 'Spotted something off?', introBody: 'Tell the team here.', introMenu: 'Tell the team here, or any time from Help › Report a Problem…',
|
|
893
|
+
gotIt: 'Got it', done: 'Done', sentLine: 'Sent. You’ll see the reply under Your reports.', menu: 'Report a Problem…' },
|
|
894
|
+
fr: { report: 'Signaler', send: 'Envoyer', mine: 'Vos signalements', ph: 'Qu’avez-vous en tête ?', sentTo: 'Envoyé à l’équipe de cette app',
|
|
895
|
+
types: ['Cassé', 'Déroutant', 'Pourrait être mieux', 'Idée'],
|
|
896
|
+
powered: 'Propulsé par Heresay', introTitle: 'Quelque chose cloche ?', introBody: 'Dites-le à l’équipe ici.', introMenu: 'Dites-le à l’équipe ici, ou à tout moment depuis Aide › Signaler un problème…',
|
|
897
|
+
gotIt: 'Compris', done: 'OK', sentLine: 'Envoyé. Vous verrez la réponse dans Vos signalements.', menu: 'Signaler un problème…' },
|
|
898
|
+
ta: { report: 'தெரிவி', send: 'அனுப்பு', mine: 'உங்கள் புகார்கள்', ph: 'உங்கள் மனதில் என்ன இருக்கிறது?', sentTo: 'இந்த ஆப்பின் குழுவுக்கு அனுப்பப்படும்',
|
|
899
|
+
types: ['வேலை செய்யவில்லை', 'குழப்பமாக உள்ளது', 'இன்னும் சிறப்பாக்கலாம்', 'யோசனை'],
|
|
900
|
+
powered: 'Heresay மூலம் இயங்குகிறது', introTitle: 'ஏதாவது சரியில்லையா?', introBody: 'குழுவிடம் இங்கே சொல்லுங்கள்.', introMenu: 'குழுவிடம் இங்கே சொல்லுங்கள், அல்லது எப்போது வேண்டுமானாலும் Help › சிக்கலைத் தெரிவி… மூலம்.',
|
|
901
|
+
gotIt: 'சரி', done: 'முடிந்தது', sentLine: 'அனுப்பப்பட்டது. பதிலை “உங்கள் புகார்கள்” பகுதியில் பார்க்கலாம்.', menu: 'சிக்கலைத் தெரிவி…' },
|
|
902
|
+
hi: { report: 'रिपोर्ट करें', send: 'भेजें', mine: 'आपकी रिपोर्ट', ph: 'आपके मन में क्या है?', sentTo: 'इस ऐप की टीम को भेजा जाता है',
|
|
903
|
+
types: ['टूटा हुआ', 'उलझन भरा', 'बेहतर हो सकता है', 'सुझाव'],
|
|
904
|
+
powered: 'Heresay द्वारा संचालित', introTitle: 'कुछ गड़बड़ दिखी?', introBody: 'टीम को यहीं बताएँ।', introMenu: 'टीम को यहीं बताएँ, या कभी भी Help › समस्या की रिपोर्ट करें… से।',
|
|
905
|
+
gotIt: 'ठीक है', done: 'हो गया', sentLine: 'भेज दिया गया। जवाब आप “आपकी रिपोर्ट” में देखेंगे।', menu: 'समस्या की रिपोर्ट करें…' },
|
|
912
906
|
};
|
|
913
907
|
var TYPE_IDS = ['broken', 'confusing', 'improvement', 'idea'];
|
|
914
908
|
var TYPE_ICON = { broken: '⚠︎', confusing: '?', improvement: '✦', idea: '💡' };
|
|
@@ -940,32 +934,29 @@
|
|
|
940
934
|
mark(neutral ? markC : '#fff', sz[3]) + (icon ? '' : '<b>' + esc(label) + '</b>') + '</div>' : '';
|
|
941
935
|
|
|
942
936
|
var types = (cfg.types || TYPE_IDS.join(',')).split(',');
|
|
943
|
-
var
|
|
944
|
-
|
|
945
|
-
return '<div class="am-type"><span class="am-ti" style="color:' + acc + ';background:' + acc + '1f">' + TYPE_ICON[t] + '</span><span><b>' + esc(tw[0]) + '</b><i>' + esc(tw[1]) + '</i></span></div>';
|
|
937
|
+
var pills = types.map(function (t) {
|
|
938
|
+
return '<span class="am-pill" style="padding:5px 10px;border-radius:999px;background:rgba(127,127,127,.12);border:1px solid rgba(127,127,127,.2);font-size:11.5px;font-weight:500;white-space:nowrap">' + esc(w.types[TYPE_IDS.indexOf(t)]) + '</span>';
|
|
946
939
|
}).join('');
|
|
947
|
-
var
|
|
948
|
-
var
|
|
949
|
-
var
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
'<
|
|
954
|
-
|
|
955
|
-
'<p class="mute">' + esc(w.sentBody) + '</p><div><u>' + esc(w.another) + '</u><strong style="background:' + acc + '">' + esc(w.see) + '</strong></div></div>' + powered;
|
|
940
|
+
var foot = '<div class="am-powered">' + esc(w.sentTo) + ' · ' + mark(markC, 14) + esc(w.powered) + '</div>';
|
|
941
|
+
var head = '<div class="am-head">' + mark(markC, 24) + '<div><b>' + esc(w.report) + '</b></div><span style="white-space:nowrap">' + esc(w.mine) + '</span><em>✕</em></div>';
|
|
942
|
+
var sendBtn = '<strong style="display:block;text-align:center;color:#fff;padding:9px;border-radius:' + (mac ? '8px' : '999px') + ';background:' + acc + (mac ? ';width:max-content;margin-left:auto;padding:6px 16px' : '') + ';opacity:.45">' + esc(w.send) + '</strong>';
|
|
943
|
+
var form = '<div class="am-body"><div style="display:flex;gap:6px;margin-bottom:10px;overflow:hidden">' + pills + '</div>' +
|
|
944
|
+
'<div class="am-text" style="min-height:90px">' + esc(cfg.placeholder || w.ph) + '</div><div style="margin-top:10px">' + sendBtn + '</div></div>' + foot;
|
|
945
|
+
var sent = '<div class="am-body am-sent"><svg viewBox="0 0 24 24" width="56" height="56" fill="none" stroke="' + acc + '" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M7.5 12.5l3 3 6-7"/></svg>' +
|
|
946
|
+
'<b style="font-size:15px">' + esc(w.sentLine) + '</b>' + (cfg.thanks ? '<p>' + esc(cfg.thanks) + '</p>' : '') +
|
|
947
|
+
'<div><strong style="background:' + acc + '">' + esc(w.done) + '</strong></div></div>' + foot;
|
|
956
948
|
var sheetSize = cfg.sheet || '';
|
|
957
949
|
var sheet = show === 'panel' || show === 'sent'
|
|
958
|
-
? '<div class="am-dim"></div><div class="am-sheet ' + (mac ? 'mac ' : '') + (sheetSize || 'regular') + '">' + head + (show === 'sent' ? sent : form) + '</div>' : '';
|
|
959
|
-
var
|
|
960
|
-
: fmt(hasButton ? w.reachTap : w.reachUse, { label: cfg.label ? '“' + cfg.label + '”' : w.report });
|
|
950
|
+
? '<div class="am-dim"></div><div class="am-sheet ' + (mac ? 'mac ' : '') + (sheetSize || 'regular') + '">' + (show === 'sent' ? head.replace(/<span[^>]*>.*?<\/span>/, '') : head) + (show === 'sent' ? sent : form) + '</div>' : '';
|
|
951
|
+
var intro = mac && cfg.entry !== 'none' ? w.introMenu : w.introBody;
|
|
961
952
|
// The introduction: a welcome sheet on iPhone, its own small window on the Mac.
|
|
962
953
|
var badge = '<span class="am-badge" style="background:' + markC + '24">' + mark(markC, 32) + '</span>';
|
|
963
|
-
var introText = badge + '<b>' + esc(w.introTitle) + '</b><p>' + esc(
|
|
954
|
+
var introText = badge + '<b>' + esc(w.introTitle) + '</b><p>' + esc(intro) + '</p>';
|
|
964
955
|
var alert = show !== 'intro' ? '' : mac
|
|
965
956
|
? '<div class="am-intro mac"><div class="am-intro-bar"><i></i></div><div class="am-intro-text">' + introText + '</div>' +
|
|
966
|
-
'<div class="am-intro-foot"
|
|
957
|
+
'<div class="am-intro-foot"><strong style="background:' + acc + '">' + esc(w.gotIt) + '</strong></div>' + foot + '</div>'
|
|
967
958
|
: '<div class="am-dim"></div><div class="am-intro"><div class="am-intro-text">' + introText + '</div>' +
|
|
968
|
-
'<strong style="background:' + acc + '">' + esc(w.
|
|
959
|
+
'<strong style="background:' + acc + '">' + esc(w.gotIt) + '</strong>' + foot + '</div>';
|
|
969
960
|
var menu = mac && cfg.entry !== 'none' && show === 'button'
|
|
970
961
|
? '<div class="am-menu"><span>' + esc(w.menu) + '</span><kbd>⌥⌘R</kbd></div>' : '';
|
|
971
962
|
var rows = ['Groceries', 'Trip to Ooty', 'Quarterly plan', 'Book list'].map(function (r) { return '<li>' + r + '</li>'; }).join('');
|
package/release/public/demo.html
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
s.dataset.version = '0.0.1-demo';
|
|
26
26
|
// The design options, so a look can be tried here before it goes in the app's code.
|
|
27
27
|
['accent', 'position', 'offset', 'button', 'label', 'style', 'size', 'fill', 'shadow', 'mark', 'theme',
|
|
28
|
-
'font', 'lang', 'placeholder', 'types', 'thanks', 'panel', 'width', 'backdrop', 'preferences', 'intro', 'trail', 'nudge']
|
|
28
|
+
'layout', 'font', 'lang', 'placeholder', 'types', 'thanks', 'panel', 'width', 'backdrop', 'preferences', 'intro', 'trail', 'nudge']
|
|
29
29
|
.forEach(function (k) { if (q.get(k) != null) s.setAttribute('data-' + k, q.get(k)); });
|
|
30
30
|
if (q.has('preview')) s.setAttribute('data-preview', '');
|
|
31
31
|
document.body.appendChild(s);
|
package/release/public/docs.html
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
<p class="note">That's the whole setup. Everything below is optional.</p>
|
|
45
45
|
|
|
46
46
|
<h2 id="what-users-see">What your users see</h2>
|
|
47
|
-
<p>A small Report button in the corner. Tapping it opens a panel
|
|
47
|
+
<p>A small Report button in the corner. Tapping it opens a small panel:</p>
|
|
48
48
|
<ul>
|
|
49
49
|
<li><b>Report:</b> pick what it is (Broken, Confusing, Could be better, Idea), write a sentence, and send. The current page and app version are attached automatically.</li>
|
|
50
50
|
<li><b>Your reports:</b> everything they've sent from this device and what happened to it. When you answer, a dot appears on the button until they've seen it.</li>
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
<tr><td><code>data-user-label</code></td><td><code>Asha K.</code></td><td>A name to show in your dashboard.</td></tr>
|
|
70
70
|
<tr><td><code>data-user-email</code></td><td><code>asha@example.com</code></td><td>Their email, so you can reply. Or use <code>identify</code> below.</td></tr>
|
|
71
71
|
<tr><td><code>data-accent</code></td><td><code>#6d28d9</code></td><td>Your brand colour for the Send button, selected states and the logo. Hex only. Text on it switches to white or black automatically.</td></tr>
|
|
72
|
-
<tr><td><code>data-position</code></td><td><code>left</code></td><td>Put the button in the bottom-left corner instead of the right. More in <a href="#design">Look and placement</a>.</td></tr>
|
|
72
|
+
<tr><td><code>data-position</code></td><td><code>bottom-left</code></td><td>Put the button in the bottom-left corner instead of the right. More in <a href="#design">Look and placement</a>.</td></tr>
|
|
73
73
|
<tr><td><code>data-api</code></td><td><code>https://…/v1</code></td><td>Rarely needed. Where your Heresay API lives, if it is not at the same address as <code>sdk.js</code>.</td></tr></table>
|
|
74
74
|
<pre><code><span class="k"><script</span> src="ORIGIN/sdk/v1.js"
|
|
75
75
|
data-key="pk_your_key"
|
|
@@ -80,30 +80,26 @@
|
|
|
80
80
|
<h2 id="design">Look and placement</h2>
|
|
81
81
|
<p>The defaults are what we recommend: change only what your app needs. The easiest way is the dashboard: open an app and choose <b>Design</b> to try each option on the real widget and copy the tag. The first value is the default.</p>
|
|
82
82
|
<table><tr><th>Attribute</th><th>Values</th></tr>
|
|
83
|
-
<tr><td><code>data-
|
|
84
|
-
<tr><td><code>data-
|
|
85
|
-
<tr><td><code>data-
|
|
86
|
-
<tr><td><code>data-label</code></td><td><code>Report</code>, or your own words up to 40 characters</td></tr>
|
|
87
|
-
<tr><td><code>data-style</code></td><td><code>pill</code> · <code>icon</code> · <code>tab</code> (on the side edge)</td></tr>
|
|
88
|
-
<tr><td><code>data-size</code></td><td><code>regular</code> · <code>small</code> · <code>large</code></td></tr>
|
|
89
|
-
<tr><td><code>data-fill</code></td><td><code>neutral</code> · <code>accent</code> (filled with your colour)</td></tr>
|
|
90
|
-
<tr><td><code>data-shadow</code></td><td><code>soft</code> · <code>none</code> · <code>strong</code></td></tr>
|
|
83
|
+
<tr><td><code>data-layout</code></td><td><code>composer</code> (default: type pills and a text box) · <code>steps</code> (pick what it is, then say it) · <code>bar</code> (a compact box beside the button). See <a href="#layouts">Layouts</a>.</td></tr>
|
|
84
|
+
<tr><td><code>data-position</code></td><td><code>bottom-right</code> · <code>bottom-left</code> · <code>top-right</code> · <code>top-left</code> · <code>bottom-center</code> · <code>left-tab</code> · <code>right-tab</code> (a tab on the side edge) · <code>none</code> (no button: your own feedback or help menu item calls <code>Heresay.open()</code>)</td></tr>
|
|
85
|
+
<tr><td><code>data-offset</code></td><td><code>20</code> px from the edges, or <code>x,y</code> like <code>24,96</code> (at most 400), to sit above a chat bubble, cookie banner or tab bar</td></tr>
|
|
91
86
|
<tr><td><code>data-hide-on</code></td><td>paths where the button stays hidden, like <code>/checkout,/login</code></td></tr>
|
|
92
|
-
<tr><td><code>data-
|
|
87
|
+
<tr><td><code>data-label</code></td><td><code>Report</code>, or your own words up to 40 characters</td></tr>
|
|
88
|
+
<tr><td><code>data-accent</code></td><td>your brand colour as hex; the logo follows it</td></tr>
|
|
93
89
|
<tr><td><code>data-theme</code></td><td><code>auto</code> (follows the device) · <code>light</code> · <code>dark</code></td></tr>
|
|
94
|
-
<tr><td><code>data-font</code></td><td><code>system</code> · <code>inherit</code> (your page's font)</td></tr>
|
|
95
90
|
<tr><td><code>data-lang</code></td><td>your page's <code><html lang></code> · <code>auto</code> (the browser's) · <code>en</code> · <code>fr</code> · <code>ta</code> (Tamil) · <code>hi</code> (Hindi)</td></tr>
|
|
96
|
-
<tr><td><code>data-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
<
|
|
101
|
-
<
|
|
102
|
-
<
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
<p>
|
|
91
|
+
<tr><td><code>data-intro</code></td><td><code>auto</code>: the one-time introduction bubble, a few seconds after the first visit</td></tr></table>
|
|
92
|
+
<h3 id="layouts">Layouts</h3>
|
|
93
|
+
<p><code>data-layout</code> chooses how the report form looks. All three need a type and some text before Send, work with every position (including <code>none</code>) and offset, and share the same Your reports view and the same four languages.</p>
|
|
94
|
+
<ul>
|
|
95
|
+
<li><b><code>composer</code></b> (default, right for most apps): a panel beside the button with four type pills, a text box and Send. On phones it is a bottom sheet.</li>
|
|
96
|
+
<li><b><code>steps</code></b> (consumer or mobile-first apps, people who don't know what to write): "What's going on?" with four large rows, then a second screen with a text box for the one they picked. Fewer rows if you set <code>data-types</code>.</li>
|
|
97
|
+
<li><b><code>bar</code></b> (dashboards, editors and other dense tools where a panel would cover the work): a compact floating bar with a Type menu, a one-line text input that grows, and a send arrow. The page behind stays usable. On phones it docks to the bottom edge above the keyboard.</li>
|
|
98
|
+
</ul>
|
|
99
|
+
<pre><code><span class="k"><script</span> src="…" data-key="pk_your_key" data-layout="steps" defer<span class="k">></script></span></code></pre>
|
|
100
|
+
<p>With each report the widget attaches what happened in the app in the last few minutes (pages, clicks, failed requests, errors), never what anyone typed. It is collected without being shown to the reporter; you control it with <code>data-trail</code> (<code>off</code>, or the parts to keep) and <code>data-heresay-private</code> on elements whose labels are personal data.</p>
|
|
101
|
+
<p>Older attributes (<code>data-button</code>, <code>data-style</code>, <code>data-size</code>, <code>data-fill</code>, <code>data-shadow</code>, <code>data-mark</code>, <code>data-font</code>, <code>data-panel</code>, <code>data-width</code>, <code>data-backdrop</code>, <code>data-preferences</code>, <code>data-placeholder</code>, <code>data-types</code>, <code>data-thanks</code>, <code>data-trail</code>, <code>data-nudge</code>) still work.</p>
|
|
102
|
+
<p>Always there, whatever you choose: the Heresay mark on the button, the <b>Your reports</b> link (people read why a report was declined), and <b>Powered by Heresay</b> in the panel and the introduction, so people can tell your app uses an outside tool. The widget lives in a shadow root, so your CSS can't restyle it.</p>
|
|
107
103
|
|
|
108
104
|
<h2 id="api">JavaScript API</h2>
|
|
109
105
|
<p>The script creates <code>window.Heresay</code> (also available as <code>window.Feedback</code>). Call these any time after it loads.</p>
|
|
@@ -115,7 +111,7 @@
|
|
|
115
111
|
<tr><td><code>Heresay.on("sent", fn)</code></td><td>Calls <code>fn({ id, type })</code> after each report is sent, to thank people or count it in your analytics. Returns a function that stops it.</td></tr>
|
|
116
112
|
<tr><td><code>Heresay.introduce({ title, body })</code></td><td>Once per device, a small bubble over the button says what it's for, so people know it exists. Call it when your main screen is up (after sign-in or onboarding), or add <code>data-intro="auto"</code> to the tag. Later calls do nothing. <code>title</code> and <code>body</code> are optional, to use your own words.</td></tr>
|
|
117
113
|
<tr><td><code>Heresay.nudge()</code></td><td>Your app saw trouble itself, such as an error screen or a retry that failed: a small note by the button offers to report it. <code>nudge({ stuck: true })</code> for someone who seems unsure. Works without <code>data-nudge</code>; the same limits apply. Returns whether it showed.</td></tr>
|
|
118
|
-
<tr><td><code>Heresay.openPreferences()</code></td><td>Open
|
|
114
|
+
<tr><td><code>Heresay.openPreferences()</code></td><td>Open Your reports with “Your name and email” expanded. People who aren't signed in can add a name and an email for replies. Both are optional and saved on their device.</td></tr>
|
|
119
115
|
<tr><td><code>Heresay.close()</code></td><td>Close the panel.</td></tr></table>
|
|
120
116
|
<p>Each report also carries the page it came from: its title, its address without the query string, and the window size.</p>
|
|
121
117
|
<pre><code><span class="k">// after your user signs in</span>
|