create-heresay 0.2.48 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-heresay",
3
- "version": "0.2.48",
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.48
1
+ 0.2.50
@@ -1,3 +1,3 @@
1
1
  /** The Heresay release. Bumped by the release script; the CLI and /v1/health report it. */
2
- export const VERSION = '0.2.48';
2
+ export const VERSION = '0.2.50';
3
3
  //# sourceMappingURL=version.js.map
@@ -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 happened, or what would you change?']], text: 'or your own words', max: 120 },
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: 'Preferences tab', c: [['', 'Show'], ['hide', 'Hide']], hint: 'Hide it if your app calls identify() and asks nothing else.' },
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
- return DESIGN_ITEMS.filter(function (it) { return cfg[it.a]; }).map(function (it) { return ['data-' + it.a, cfg[it.a]]; });
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, the “Your reports” tab (people read why a report was declined), and “Powered by Heresay”, so people can tell your app uses an outside tool.',
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 happened, or what would you change?']], text: 'or your own words', max: 120 },
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: 'Preferences tab', c: [['', 'Show'], ['false', 'Hide']], hint: 'Hide it if your app calls identify() and asks nothing else.' },
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, the “Your reports” tab (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.',
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', sendFeedback: 'Send feedback', straight: 'Straight to the {app} team', tabs: ['Report', 'Your reports', 'Preferences'],
881
- what: 'What is it?', happened: 'What happened?', ph: 'What happened, or what would you change?', attached: 'Sent with this screen and the app version.',
882
- types: [['Broken', 'Something doesn’t work'], ['Confusing', 'I couldn’t tell how'], ['Could be better', 'It works, and could be better'], ['Idea', 'Something that isn’t there yet']],
883
- powered: 'Powered by Heresay', introTitle: 'Help make this app better',
884
- introBody: '{reach} to share an idea or tell the team what you’d change. A real person reads every report, and you’ll see what happens to yours.',
885
- reachTap: 'Tap {label} in the corner any time', reachClick: 'Click {label} any time', reachMenu: 'Choose Help › Report a Problem… (⌥⌘R) any time', reachUse: 'Use {label} any time',
886
- tryIt: 'Try it', gotIt: 'Got it', cancel: 'Cancel', sentTitle: 'Sent. Thank you.', sentBody: 'A person on the team reads every report. You’ll see what happens to it under Your reports.',
887
- another: 'Send another', see: 'See your reports', menu: 'Report a Problem…' },
888
- fr: { report: 'Signaler', send: 'Envoyer', sendFeedback: 'Envoyer un retour', straight: 'Directement à l’équipe {app}', tabs: ['Signaler', 'Vos signalements', 'Préférences'],
889
- what: 'De quoi s’agit-il ?', happened: 'Que s’est-il passé ?', ph: 'Que s’est-il passé, ou que changeriez-vous ?', attached: 'Envoyé avec cet écran et la version de l’app.',
890
- types: [['Cassé', 'Quelque chose ne marche pas'], ['Déroutant', 'Je ne voyais pas comment faire'], ['Pourrait être mieux', 'Ça marche, mais ça pourrait être mieux'], ['Idée', 'Quelque chose qui n’existe pas encore']],
891
- powered: 'Propulsé par Heresay', introTitle: 'Aidez à améliorer cette app',
892
- introBody: '{reach} pour partager une idée ou dire à l’équipe ce que vous changeriez. Une vraie personne lit chaque signalement, et vous verrez ce qu’il devient.',
893
- reachTap: 'Touchez {label} dans le coin à tout moment', reachClick: 'Cliquez sur {label} à tout moment', reachMenu: 'Choisissez Aide › Signaler un problème… (⌥⌘R) à tout moment', reachUse: 'Utilisez {label} à tout moment',
894
- tryIt: 'Essayer', gotIt: 'Compris', cancel: 'Annuler', sentTitle: 'Envoyé. Merci.', sentBody: 'Une personne de l’équipe lit chaque signalement. Vous verrez ce qu’il devient dans Vos signalements.',
895
- another: 'En envoyer un autre', see: 'Voir vos signalements', menu: 'Signaler un problème…' },
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 typeCards = types.map(function (t) {
944
- var tw = w.types[TYPE_IDS.indexOf(t)];
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 tabs = [w.tabs[0], w.tabs[1]].concat(cfg.showsPreferences === 'false' ? [] : [w.tabs[2]]);
948
- var powered = '<div class="am-powered">' + mark(markC, 14) + esc(w.powered) + '</div>';
949
- var head = '<div class="am-head">' + mark(markC, 28) + '<div><b>' + esc(w.sendFeedback) + '</b><span>' + esc(fmt(w.straight, { app: productName(p) })) + '</span></div>' + (mac ? '' : '<em>✕</em>') + '</div>' +
950
- '<div class="am-seg">' + tabs.map(function (t, i) { return '<span' + (i === 0 ? ' class="on"' : '') + '>' + esc(t) + '</span>'; }).join('') + '</div>';
951
- var form = '<div class="am-body"><p class="am-lab">' + esc(w.what) + '</p><div class="am-types' + (mac ? ' grid' : '') + '">' + typeCards + '</div>' +
952
- '<p class="am-lab">' + esc(w.happened) + '</p><div class="am-text">' + esc(cfg.placeholder || w.ph) + '</div></div>' + powered +
953
- '<div class="am-foot"><span>' + esc(w.attached) + '</span>' + (mac ? '<u>' + esc(w.cancel) + '</u>' : '') + '<strong style="background:' + acc + '">' + esc(w.send) + '</strong></div>';
954
- var sent = '<div class="am-body am-sent">' + mark(markC, 56) + '<b>' + esc(w.sentTitle) + '</b>' + (cfg.thanks ? '<p>' + esc(cfg.thanks) + '</p>' : '') +
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 reach = mac ? (cfg.entry !== 'none' ? w.reachMenu : fmt(hasButton ? w.reachClick : w.reachUse, { label: cfg.label ? '“' + cfg.label + '”' : w.report }))
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(fmt(w.introBody, { reach: reach })) + '</p>';
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">' + powered + '<u>' + esc(w.gotIt) + '</u><strong style="background:' + acc + '">' + esc(w.tryIt) + '</strong></div></div>'
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.tryIt) + '</strong><u style="color:' + acc + '">' + esc(w.gotIt) + '</u>' + powered + '</div>';
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('');
@@ -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);
@@ -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 with two tabs:</p>
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">&lt;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-position</code></td><td><code>right</code> · <code>left</code> · <code>top-right</code> · <code>top-left</code> · <code>center</code></td></tr>
84
- <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> to clear a chat bubble</td></tr>
85
- <tr><td><code>data-button</code></td><td><code>always</code> · <code>none</code> (open it from your own menu with <code>Heresay.open()</code>) · <code>desktop</code> (not on phones) · <code>scroll</code> (after the first scroll)</td></tr>
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-mark</code></td><td><code>accent</code> (the logo follows your colour) · <code>heresay</code> (keep the Heresay teal)</td></tr>
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>&lt;html lang&gt;</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-placeholder</code></td><td>the question in the text box</td></tr>
97
- <tr><td><code>data-types</code></td><td>all four, or some of <code>broken,confusing,improvement,idea</code>. Their names don't change: the type sets the priority.</td></tr>
98
- <tr><td><code>data-thanks</code></td><td>a line shown after sending</td></tr>
99
- <tr><td><code>data-panel</code></td><td><code>corner</code> · <code>sheet</code> (full height on that side) · <code>center</code></td></tr>
100
- <tr><td><code>data-width</code></td><td><code>regular</code> · <code>narrow</code> · <code>wide</code></td></tr>
101
- <tr><td><code>data-backdrop</code></td><td><code>dim</code> · <code>clear</code> · <code>blur</code></td></tr>
102
- <tr><td><code>data-preferences</code></td><td><code>show</code> · <code>hide</code></td></tr>
103
- <tr><td><code>data-trail</code></td><td>on · <code>off</code> · the parts to keep, like <code>pages errors requests</code>. What happened before a report: pages, clicks, failed requests, errors. The reporter sees it and can take it off. Never what anyone typed.</td></tr>
104
- <tr><td><code>data-heresay-private</code></td><td>on any element of your app: clicks on it are recorded without its text</td></tr>
105
- <tr><td><code>data-nudge</code></td><td>off · <code>on</code> · the signals to watch, like <code>clicks errors</code>. When something failed (a button pressed again and again with nothing happening, an error right after a click, requests failing), a small note by the button asks “Something not working?”. When someone seems unsure (<code>stalled</code>: typing that stopped; <code>circles</code>: the same few pages over and over; <code>refused</code>: a field refused 3 times), it asks “Stuck on something?” and opens as Confusing. Watched on the device, never sent. Once per tab.</td></tr></table>
106
- <p>Always there, whatever you choose: the Heresay mark on the button, the <b>Your reports</b> tab (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>
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">&lt;script</span> src="…" data-key="pk_your_key" data-layout="steps" defer<span class="k">&gt;&lt;/script&gt;</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 the Preferences tab: a note about their setup, sent with every report. People who aren't signed in can also add a name and an email for replies. It's all optional and saved on their device. Where the button sits is yours to choose, with <code>data-position</code>.</td></tr>
114
+ <tr><td><code>Heresay.openPreferences()</code></td><td>Open Your reports with &ldquo;Your name and email&rdquo; 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>