create-heresay 0.2.49 → 0.2.51

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.49",
3
+ "version": "0.2.51",
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.49
1
+ 0.2.51
@@ -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.49';
2
+ export const VERSION = '0.2.51';
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,20 @@
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.',
595
+ when: function (c) { return c.button !== 'none'; } },
596
+ // Only for an app's own button. Not a tag attribute of its own: "beside" becomes data-panel="beside".
597
+ { a: 'opens', virtual: true, label: 'Opens', c: [['', 'Centred (recommended)'], ['beside', 'Next to your button']],
598
+ hint: 'From your own button the panel opens as a centred window with the page dimmed (the bar layout docks at the bottom centre). Next to your button puts it beside the button that was clicked.',
599
+ when: function (c) { return c.button === 'none'; } },
591
600
  { a: 'width', label: 'Width', c: [['', 'Regular'], ['narrow', 'Narrow'], ['wide', 'Wide']] },
592
601
  { 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.' },
602
+ { a: 'preferences', label: 'Name and email row', c: [['', 'Show'], ['hide', 'Hide']], hint: 'Hide it if your app calls identify() and asks nothing else.' },
594
603
  { a: 'intro', label: 'Introduce the button', c: [['', 'When my app calls introduce()'], ['auto', '3 seconds after the first visit']] },
595
604
  ]},
596
605
  ];
@@ -600,7 +609,13 @@
600
609
 
601
610
  /** The data- attributes a design adds to the tag, in the order the list shows them. */
602
611
  function designAttrs(cfg) {
603
- return DESIGN_ITEMS.filter(function (it) { return cfg[it.a]; }).map(function (it) { return ['data-' + it.a, cfg[it.a]]; });
612
+ var c = Object.assign({}, cfg);
613
+ // One attribute says where the button goes: the tab and "no button" cases fold into data-position.
614
+ if (c.button === 'none') { c.position = 'none'; c.button = ''; c.style = ''; c.panel = c.opens === 'beside' ? 'beside' : ''; }
615
+ else if (c.style === 'tab' && (!c.position || /^bottom-(left|right|center)$/.test(c.position))) {
616
+ c.position = c.position === 'bottom-left' ? 'left-tab' : 'right-tab'; c.style = '';
617
+ }
618
+ return DESIGN_ITEMS.filter(function (it) { return !it.virtual && c[it.a]; }).map(function (it) { return ['data-' + it.a, c[it.a]]; });
604
619
  }
605
620
 
606
621
  function designTag(p, cfg) {
@@ -618,7 +633,7 @@
618
633
  panel: 'H.open();',
619
634
  intro: 'if(!H.introduce())document.getElementById("note").hidden=false;',
620
635
  sent: 'H.open({type:"broken",text:"The export button does nothing."});' +
621
- 'document.querySelector("[data-feedback-sdk]").shadowRoot.querySelector(".send").click();',
636
+ 'document.querySelector("[data-feedback-sdk]").shadowRoot.querySelector(".send,.bsend").click();',
622
637
  }[show] || '';
623
638
  return '<!doctype html><html lang="en"><head><meta charset="utf-8"><style>' +
624
639
  'body{margin:0;min-height:1400px;font:15px/1.6 Georgia,serif;background:' + (dark ? '#111317;color:#e6e8eb' : '#fff;color:#1d2127') + '}' +
@@ -650,6 +665,8 @@
650
665
  if (cfg.button === 'none') {
651
666
  out.push(el('p', { class: 'hint', text: 'Then open it from your own menu item:' }));
652
667
  out.push(codeBlock('window.Heresay?.open();'));
668
+ out.push(el('p', { class: 'hint', text: 'Add our mark to your button, so people recognise it from app to app:' }));
669
+ out.push(codeBlock('<button data-heresay-open><span data-heresay-mark></span> Report a problem</button>'));
653
670
  }
654
671
  return out;
655
672
  },
@@ -657,13 +674,16 @@
657
674
  var a = designAttrs(cfg);
658
675
  return 'Update the Heresay script tag in this app (the one with data-key="' + p.key + '") so it looks like this. ' +
659
676
  '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' +
677
+ '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
678
  designTag(p, cfg) + '\n' +
662
- (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' : '') +
679
+ (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(). ' +
680
+ (cfg.opens === 'beside'
681
+ ? 'It opens next to that item (data-panel="beside").'
682
+ : 'It opens as a centred window with the page dimmed; that is the default, so there is no data-panel attribute. Add data-panel="beside" only if it should open next to the item.') + '\n' : '') +
663
683
  (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
684
  '\nFor what each option does, read the Heresay guide customize-web (heresay_guide, or npx -y heresay@latest guide customize-web).';
665
685
  },
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.',
686
+ 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
687
  };
668
688
  }
669
689
 
@@ -690,8 +710,10 @@
690
710
  var changed = el('span', { class: 'hint' });
691
711
 
692
712
  function save() { try { localStorage.setItem(KEY, JSON.stringify(cfg)); } catch (e) { /* private mode */ } }
713
+ var whens = [];
693
714
  function redraw() {
694
715
  save();
716
+ whens.forEach(function (f) { f(); });
695
717
  preview.draw(cfg, show, dark);
696
718
  var n = kit.changes(cfg);
697
719
  changed.textContent = n ? n + ' change' + (n === 1 ? '' : 's') + ' from the recommended setup' : 'The recommended setup';
@@ -730,7 +752,9 @@
730
752
  };
731
753
  chips.appendChild(input);
732
754
  }
733
- controls.appendChild(el('div', { class: 'design-item' }, [el('b', { text: it.label }), chips, it.hint ? el('p', { class: 'hint', text: it.hint }) : null]));
755
+ var item = el('div', { class: 'design-item' }, [el('b', { text: it.label }), chips, it.hint ? el('p', { class: 'hint', text: it.hint }) : null]);
756
+ controls.appendChild(item);
757
+ if (it.when) whens.push(function () { item.hidden = !it.when(cfg); });
734
758
  sync();
735
759
  });
736
760
  });
@@ -790,14 +814,14 @@
790
814
  ]},
791
815
  { group: 'Words', items: [
792
816
  { 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 },
817
+ { 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
818
  { 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
819
  { a: 'thanks', label: 'Thank-you line after sending', c: [['', 'None']], text: 'e.g. Thanks! We read every one.', max: 160 },
796
820
  ]},
797
821
  { group: 'The sheet', items: [
798
822
  { a: 'sheet', label: 'Size', c: mac ? [['', 'Regular'], ['compact', 'Narrow'], ['large', 'Wide']]
799
823
  : [['', '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.' },
824
+ { 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
825
  ]},
802
826
  ];
803
827
  }
@@ -859,8 +883,13 @@
859
883
  return { el: box, draw: function (cfg, show, dark) { box.innerHTML = appleMock(p, cfg, show, dark); fit(); } };
860
884
  },
861
885
  code: function (cfg) {
862
- return [el('p', { class: 'hint', text: 'In your App’s init():' }), codeBlock(swiftConfigure(p, cfg)),
886
+ var out = [el('p', { class: 'hint', text: 'In your App’s init():' }), codeBlock(swiftConfigure(p, cfg)),
863
887
  el('p', { class: 'hint', text: 'And on the root view:' }), codeBlock(swiftAttach(p, cfg))];
888
+ if (cfg.entry === 'none') {
889
+ out.push(el('p', { class: 'hint', text: 'Add our mark to your button, so people recognise it from app to app:' }));
890
+ out.push(codeBlock('Button { Heresay.present() } label: {\n Label { Text("Report a problem") } icon: { HeresayMarkIcon() }\n}'));
891
+ }
892
+ return out;
864
893
  },
865
894
  prompt: function (cfg) {
866
895
  return 'Update how Heresay is set up in this ' + (mac ? 'macOS' : 'iOS') + ' app (the Heresay.configure call with key "' + p.key + '") so it matches this. ' +
@@ -871,44 +900,28 @@
871
900
  '\nIf the app doesn\'t call Heresay.introduce() yet, call it once the main screen appears.' +
872
901
  '\nFor what each option does, read the Heresay guide customize-apple (heresay_guide, or npx -y heresay@latest guide customize-apple).';
873
902
  },
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.',
903
+ 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
904
  };
876
905
  }
877
906
 
878
907
  /** The words the preview shows, from Words.swift. Only a likeness needs these few. */
879
908
  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: 'समस्या की रिपोर्ट करें…' },
909
+ en: { report: 'Report', send: 'Send', mine: 'Your reports', ph: 'What’s on your mind?', sentTo: 'Sent to this app’s team',
910
+ types: ['Broken', 'Confusing', 'Could be better', 'Idea'],
911
+ 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…',
912
+ gotIt: 'Got it', done: 'Done', sentLine: 'Sent. You’ll see the reply under Your reports.', menu: 'Report a Problem…' },
913
+ fr: { report: 'Signaler', send: 'Envoyer', mine: 'Vos signalements', ph: 'Qu’avez-vous en tête ?', sentTo: 'Envoyé à l’équipe de cette app',
914
+ types: ['Cassé', 'Déroutant', 'Pourrait être mieux', 'Idée'],
915
+ 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…',
916
+ gotIt: 'Compris', done: 'OK', sentLine: 'Envoyé. Vous verrez la réponse dans Vos signalements.', menu: 'Signaler un problème…' },
917
+ ta: { report: 'தெரிவி', send: 'அனுப்பு', mine: 'உங்கள் புகார்கள்', ph: 'உங்கள் மனதில் என்ன இருக்கிறது?', sentTo: 'இந்த ஆப்பின் குழுவுக்கு அனுப்பப்படும்',
918
+ types: ['வேலை செய்யவில்லை', 'குழப்பமாக உள்ளது', 'இன்னும் சிறப்பாக்கலாம்', 'யோசனை'],
919
+ powered: 'Heresay மூலம் இயங்குகிறது', introTitle: 'ஏதாவது சரியில்லையா?', introBody: 'குழுவிடம் இங்கே சொல்லுங்கள்.', introMenu: 'குழுவிடம் இங்கே சொல்லுங்கள், அல்லது எப்போது வேண்டுமானாலும் Help › சிக்கலைத் தெரிவி… மூலம்.',
920
+ gotIt: 'சரி', done: 'முடிந்தது', sentLine: 'அனுப்பப்பட்டது. பதிலை “உங்கள் புகார்கள்” பகுதியில் பார்க்கலாம்.', menu: 'சிக்கலைத் தெரிவி…' },
921
+ hi: { report: 'रिपोर्ट करें', send: 'भेजें', mine: 'आपकी रिपोर्ट', ph: 'आपके मन में क्या है?', sentTo: 'इस ऐप की टीम को भेजा जाता है',
922
+ types: ['टूटा हुआ', 'उलझन भरा', 'बेहतर हो सकता है', 'सुझाव'],
923
+ powered: 'Heresay द्वारा संचालित', introTitle: 'कुछ गड़बड़ दिखी?', introBody: 'टीम को यहीं बताएँ।', introMenu: 'टीम को यहीं बताएँ, या कभी भी Help › समस्या की रिपोर्ट करें… से।',
924
+ gotIt: 'ठीक है', done: 'हो गया', sentLine: 'भेज दिया गया। जवाब आप “आपकी रिपोर्ट” में देखेंगे।', menu: 'समस्या की रिपोर्ट करें…' },
912
925
  };
913
926
  var TYPE_IDS = ['broken', 'confusing', 'improvement', 'idea'];
914
927
  var TYPE_ICON = { broken: '⚠︎', confusing: '?', improvement: '✦', idea: '💡' };
@@ -940,32 +953,29 @@
940
953
  mark(neutral ? markC : '#fff', sz[3]) + (icon ? '' : '<b>' + esc(label) + '</b>') + '</div>' : '';
941
954
 
942
955
  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>';
956
+ var pills = types.map(function (t) {
957
+ 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
958
  }).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;
959
+ var foot = '<div class="am-powered">' + esc(w.sentTo) + ' · ' + mark(markC, 14) + esc(w.powered) + '</div>';
960
+ 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>';
961
+ 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>';
962
+ var form = '<div class="am-body"><div style="display:flex;gap:6px;margin-bottom:10px;overflow:hidden">' + pills + '</div>' +
963
+ '<div class="am-text" style="min-height:90px">' + esc(cfg.placeholder || w.ph) + '</div><div style="margin-top:10px">' + sendBtn + '</div></div>' + foot;
964
+ 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>' +
965
+ '<b style="font-size:15px">' + esc(w.sentLine) + '</b>' + (cfg.thanks ? '<p>' + esc(cfg.thanks) + '</p>' : '') +
966
+ '<div><strong style="background:' + acc + '">' + esc(w.done) + '</strong></div></div>' + foot;
956
967
  var sheetSize = cfg.sheet || '';
957
968
  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 });
969
+ ? '<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>' : '';
970
+ var intro = mac && cfg.entry !== 'none' ? w.introMenu : w.introBody;
961
971
  // The introduction: a welcome sheet on iPhone, its own small window on the Mac.
962
972
  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>';
973
+ var introText = badge + '<b>' + esc(w.introTitle) + '</b><p>' + esc(intro) + '</p>';
964
974
  var alert = show !== 'intro' ? '' : mac
965
975
  ? '<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>'
976
+ '<div class="am-intro-foot"><strong style="background:' + acc + '">' + esc(w.gotIt) + '</strong></div>' + foot + '</div>'
967
977
  : '<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>';
978
+ '<strong style="background:' + acc + '">' + esc(w.gotIt) + '</strong>' + foot + '</div>';
969
979
  var menu = mac && cfg.entry !== 'none' && show === 'button'
970
980
  ? '<div class="am-menu"><span>' + esc(w.menu) + '</span><kbd>⌥⌘R</kbd></div>' : '';
971
981
  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: put <code>data-heresay-open</code> on your own feedback or help menu item, or call <code>Heresay.open()</code>; the panel opens centred, or next to it with <code>data-panel="beside"</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,9 @@
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>data-heresay-open</code></td><td>Put it on any element (<code>data-heresay-open="broken"</code> starts as that type) and a click opens the panel from it, with no JavaScript. By default (and recommended) that is a centred window with the page dimmed; the bar layout docks at the bottom centre. Add <code>data-panel="beside"</code> to the script tag to open it next to the element instead (<code>Heresay.open({ anchor: element })</code> does the same from code). Code with no click opens it centred; phones get a bottom sheet; <code>data-panel</code> sheet, center or corner wins. Clicking outside closes it and keeps the draft. In Swift, <code>Heresay.present()</code> from your own button opens a centred sheet; add <code>.heresayAnchor()</code> to that button for a popover next to it on iPad and Mac.</td></tr>
115
+ <tr><td><code>data-heresay-mark</code></td><td>Put it on an empty element inside your own button (<code>&lt;button data-heresay-open&gt;&lt;span data-heresay-mark&gt;&lt;/span&gt; Report a problem&lt;/button&gt;</code>) and it is filled with the Heresay mark, 1em square and hidden from screen readers, so the button is recognisable from app to app. It takes your <code>data-accent</code> (unless <code>data-mark="heresay"</code>); <code>data-heresay-mark="currentColor"</code> takes the text colour. Elements added later are filled too; elements without the attribute are never touched. In Swift, use <code>HeresayMarkIcon()</code> in a <code>Label</code>.</td></tr>
116
+ <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
117
  <tr><td><code>Heresay.close()</code></td><td>Close the panel.</td></tr></table>
120
118
  <p>Each report also carries the page it came from: its title, its address without the query string, and the window size.</p>
121
119
  <pre><code><span class="k">// after your user signs in</span>
@@ -1,6 +1,103 @@
1
1
  {
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.",
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. `when` (optional, strings, or an object keyed by web/swift): offer the feature only if the code contains any of them. `detect` may be keyed the same way. `offer`: recommended (offer on its own) or optional (offered only right after a version update that introduced it).",
3
3
  "changes": [
4
+ {
5
+ "id": "open-next-to-trigger",
6
+ "since": "0.2.51",
7
+ "offer": "optional",
8
+ "title": "Open the Report panel next to the app's own Report button (optional)",
9
+ "summary": "When the app opens Heresay from its own Report, Feedback or Help item, the panel opens as a centred window with the page dimmed. That is the recommended default, so most apps need nothing. If the person prefers it right beside that item, set data-panel=\"beside\" (web) or add .heresayAnchor() to the button (Swift). Ask: centred window (recommended) or next to your button?",
10
+ "platforms": [
11
+ "web",
12
+ "ios",
13
+ "macos"
14
+ ],
15
+ "when": {
16
+ "web": [
17
+ "data-position=\"none\"",
18
+ "data-position='none'",
19
+ "data-button=\"none\"",
20
+ "Heresay.open("
21
+ ],
22
+ "swift": [
23
+ "Heresay.present("
24
+ ]
25
+ },
26
+ "detect": {
27
+ "web": [
28
+ "data-heresay-open"
29
+ ],
30
+ "swift": [
31
+ "heresayAnchor"
32
+ ]
33
+ },
34
+ "how": {
35
+ "web": "guide customize-web, How it opens (data-panel=\"beside\" on the script tag)",
36
+ "ios": "guide customize-apple, Placement (.heresayAnchor())",
37
+ "macos": "guide customize-apple, Placement (.heresayAnchor())"
38
+ }
39
+ },
40
+ {
41
+ "id": "mark-in-own-button",
42
+ "since": "0.2.51",
43
+ "offer": "optional",
44
+ "title": "Put the Heresay mark in the app's own Report button (optional)",
45
+ "summary": "The app has its own Report, Feedback or Help button. Adding the Heresay mark to it (mark plus label, or a round mark-only button) makes it recognisable from app to app. Web: an empty <span data-heresay-mark></span> inside the button. Swift: HeresayMarkIcon() in a Label. Ask: add the mark to your button?",
46
+ "platforms": [
47
+ "web",
48
+ "ios",
49
+ "macos"
50
+ ],
51
+ "when": {
52
+ "web": [
53
+ "data-heresay-open",
54
+ "data-position=\"none\"",
55
+ "data-position='none'",
56
+ "Heresay.open("
57
+ ],
58
+ "swift": [
59
+ "Heresay.present("
60
+ ]
61
+ },
62
+ "detect": {
63
+ "web": [
64
+ "data-heresay-mark"
65
+ ],
66
+ "swift": [
67
+ "HeresayMark"
68
+ ]
69
+ },
70
+ "how": {
71
+ "web": "guide customize-web, The mark in your own button",
72
+ "ios": "guide customize-apple, The mark in your own button",
73
+ "macos": "guide customize-apple, The mark in your own button"
74
+ }
75
+ },
76
+ {
77
+ "id": "layouts",
78
+ "since": "0.2.50",
79
+ "offer": "optional",
80
+ "title": "Pick another Report panel layout",
81
+ "summary": "Three layouts exist: composer (type pills and a text box; the default and recommended for most apps), steps (guided rows; consumer apps) and bar (a compact floating bar; dense pro tools). Only worth changing if the app clearly fits another.",
82
+ "platforms": [
83
+ "web",
84
+ "ios",
85
+ "macos"
86
+ ],
87
+ "detect": {
88
+ "web": [
89
+ "data-layout"
90
+ ],
91
+ "swift": [
92
+ "layout:"
93
+ ]
94
+ },
95
+ "how": {
96
+ "web": "guide customize-web, Layout",
97
+ "ios": "guide customize-apple, Layout",
98
+ "macos": "guide customize-apple, Layout"
99
+ }
100
+ },
4
101
  {
5
102
  "id": "crash-reports",
6
103
  "since": "0.2.48",