react-semaphor 0.1.607 → 0.1.609

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.
Files changed (84) hide show
  1. package/dist/analytics-protocol/index.js +1 -1
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/brand-studio/index.js +1 -1
  4. package/dist/briefings/index.js +1 -1
  5. package/dist/chunks/{appearance-provider-C4lPZcaN.js → appearance-provider-BW022_Qu.js} +106 -106
  6. package/dist/chunks/{assistant-chat-B7Fngg8U.js → assistant-chat-DAmFZEnD.js} +8 -8
  7. package/dist/chunks/attachment-filter-line-ClTS4GvQ.js +1 -0
  8. package/dist/chunks/{bookmark-impact-DjrrJomS.js → bookmark-impact-BEVaXjug.js} +1 -1
  9. package/dist/chunks/{bookmark-state-x9hJS83D.js → bookmark-state-DnkzIsyw.js} +1 -1
  10. package/dist/chunks/{brand-DgFcvKJI.js → brand-BjC1mPjw.js} +1 -1
  11. package/dist/chunks/card-filter-builder-BGIVEHmJ.js +11 -0
  12. package/dist/chunks/{visual-contract-DQPKg5QW.js → check-input-qgwboKei.js} +13 -5
  13. package/dist/chunks/{comparison-window-caption-zUZDe4tL.js → comparison-window-caption-WzGsqv4n.js} +1 -1
  14. package/dist/chunks/{currency-presentation-binding-w9WDUk3b.js → currency-presentation-binding-ClrH_6Tq.js} +1 -1
  15. package/dist/chunks/{custom-visual-inputs-D8U98aBz.js → custom-visual-inputs-CoAs_73N.js} +1 -1
  16. package/dist/chunks/custom-visual-write-BWApKrHe.js +1 -0
  17. package/dist/chunks/{dashboard-BEd6i29E.js → dashboard-DbBgEesz.js} +1 -1
  18. package/dist/chunks/{dashboard-briefing-launcher-DMDYM9IA.js → dashboard-briefing-launcher-DadG4ES9.js} +14 -9
  19. package/dist/chunks/{dashboard-controls-5B2vCIjJ.js → dashboard-controls-CyQg_GC1.js} +3 -3
  20. package/dist/chunks/{dashboard-json-C6r30x-5.js → dashboard-json-ZSAQQkcR.js} +1 -1
  21. package/dist/chunks/{dashboard-temporal-snapshot-Wki-YACw.js → dashboard-temporal-snapshot-BSTfqT29.js} +1 -1
  22. package/dist/chunks/edit-dashboard-visual-DIF1fllI.js +103 -0
  23. package/dist/chunks/{filter-line-COFQaF4_.js → filter-line-W-qQAjke.js} +1 -1
  24. package/dist/chunks/{filter-reach-preview-BWRGfSmb.js → filter-reach-preview-CfbwaLf4.js} +1 -1
  25. package/dist/chunks/filter-value-text-DQwYZHz0.js +1 -0
  26. package/dist/chunks/kpi-trend-rule-B4ebKzNj.js +1 -0
  27. package/dist/chunks/{layout-grid-DahW4ClC.js → layout-grid-Cs350bW-.js} +1 -1
  28. package/dist/chunks/{matrix-analytical-definition-Bd-dXB8q.js → matrix-analytical-definition-jn075ooo.js} +1 -1
  29. package/dist/chunks/{matrix-member-presentation-CfvxPV-i.js → matrix-member-presentation-Chz6uGYz.js} +1 -1
  30. package/dist/chunks/{matrix-operation-contract-Cw7U53Ao.js → matrix-operation-contract-DceN49RX.js} +1 -1
  31. package/dist/chunks/{metric-formatting-QDqXfQGY.js → metric-formatting-toJrRqu4.js} +1 -1
  32. package/dist/chunks/{numeric-range-options-s6i_nDXg.js → numeric-range-options-Drc1EZ6H.js} +1 -1
  33. package/dist/chunks/{palette-CYvJHSqP.js → palette-DpLPXjUd.js} +1 -1
  34. package/dist/chunks/{pivot-result-contract-expectations-BX5gLcze.js → pivot-result-contract-expectations-D_ane7I2.js} +1 -1
  35. package/dist/chunks/{pivot-result-identity-DOISzHU4.js → pivot-result-identity-DRhVJMsF.js} +1 -1
  36. package/dist/chunks/{raw-temporal-value-Cssny3RJ.js → raw-temporal-value-B4Md6Xfb.js} +1 -1
  37. package/dist/chunks/{report-preferences-dialog-BNpB9byP.js → report-preferences-dialog-DEfUYExu.js} +1 -1
  38. package/dist/chunks/{report-runtime-context-B8HuY0bu.js → report-runtime-context-CkxgMKr6.js} +1 -1
  39. package/dist/chunks/resolve-dashboard-input-context-Dm4PD8Gx.js +8 -0
  40. package/dist/chunks/{sandbox-host-Drf58_oU.js → sandbox-host-BqcLSoTV.js} +1 -1
  41. package/dist/chunks/{saved-dashboard-context-dbdbQ5bB.js → saved-dashboard-context-GjEJuDjj.js} +1 -1
  42. package/dist/chunks/{selection-filter-compiler-DK8KkS9g.js → selection-filter-compiler-BxtEEB6Z.js} +1 -1
  43. package/dist/chunks/semaphor-ready-indicator-BViyPq5k.js +622 -0
  44. package/dist/chunks/set-q-2M4nis.js +1 -0
  45. package/dist/chunks/slider-C2nbml5r.js +599 -0
  46. package/dist/chunks/{stored-dashboard-DmgJQcyZ.js → stored-dashboard-CTwrNvBy.js} +1 -1
  47. package/dist/chunks/{table-cell-text-2x6r_oHO.js → table-cell-text-DJe6I1G3.js} +1 -1
  48. package/dist/chunks/{table-export-sheet-CWqKiQu4.js → table-export-sheet-CthBUHu4.js} +1 -1
  49. package/dist/chunks/{token-types-BSyWn2pb.js → token-types-BM0mpZce.js} +1 -1
  50. package/dist/chunks/{validators-BPGmPz8-.js → validators-U8IL8djK.js} +1 -1
  51. package/dist/chunks/variable-draft-DAVLIY3l.js +1 -0
  52. package/dist/dashboard/index.js +1 -1
  53. package/dist/dashboard-authoring/index.js +1 -1
  54. package/dist/extensions/index.js +1 -1
  55. package/dist/format-utils/index.js +1 -1
  56. package/dist/index.js +1 -1
  57. package/dist/report-runtime-context/index.js +1 -1
  58. package/dist/style.css +1 -1
  59. package/dist/surfboard/index.js +1 -1
  60. package/dist/types/index.js +1 -1
  61. package/dist/types/lib/dashboard-viewer/table-view.d.ts +6 -1
  62. package/dist/types/lib/types/explorer-types.d.ts +12 -0
  63. package/dist/types/shared/dashboard-authoring/card-settings/custom-visual-write.d.ts +6 -0
  64. package/dist/types/shared/dashboard-authoring/card-sort-comparison.d.ts +13 -0
  65. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +1 -0
  66. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +12 -0
  67. package/dist/types/shared/dashboard-authoring/index.d.ts +1 -0
  68. package/dist/types/shared/dashboard-authoring/table-sheet-shape.d.ts +8 -0
  69. package/dist/types/shared/dashboard-authoring/variable-draft.d.ts +1 -0
  70. package/dist/types/shared/dashboard-viewer/table-settings.d.ts +8 -0
  71. package/dist/types/shared/extensions/visual-contract.d.ts +3 -1
  72. package/dist/types/shared/usage-events/envelope.d.ts +2 -2
  73. package/package.json +1 -1
  74. package/dist/chunks/attachment-filter-line-wJRB0GSP.js +0 -1
  75. package/dist/chunks/card-filter-builder-CvxygmsE.js +0 -16
  76. package/dist/chunks/check-input-7DVPUuco.js +0 -1
  77. package/dist/chunks/edit-dashboard-visual-F2w7v4iB.js +0 -83
  78. package/dist/chunks/filter-value-text-BSAMEgve.js +0 -1
  79. package/dist/chunks/kpi-trend-rule-BcnKbY7d.js +0 -1
  80. package/dist/chunks/resolve-dashboard-input-context-B-0tONJg.js +0 -8
  81. package/dist/chunks/semaphor-ready-indicator-BSFsqsBJ.js +0 -617
  82. package/dist/chunks/set-oJDaJdtI.js +0 -1
  83. package/dist/chunks/slider-DAvAdfMC.js +0 -599
  84. package/dist/chunks/variable-draft-DGA22H2g.js +0 -1
@@ -1 +0,0 @@
1
- import{k as w,r as I,l as k}from"./validators-BPGmPz8-.js";import{a as p}from"./matrix-operation-contract-Cw7U53Ao.js";import{d as T,c as D}from"./raw-temporal-value-Cssny3RJ.js";import"../value-format-preferences/index.js";import{al as O,ah as L}from"./pivot-result-contract-expectations-BX5gLcze.js";const f={kind:"plain"},y={kind:"temporal"},S={"=":"=","!=":"!=",">":">",">=":">=","<":"<","<=":"<=",in:"in","not in":"not in",between:"between","not between":"not between",contains:"contains (ignoring case)",startsWith:"starts with (ignoring case)",endsWith:"ends with (ignoring case)",like:"matches the LIKE pattern (ignoring case)","not like":"does not match the LIKE pattern (ignoring case)",isNull:"is empty",isNotNull:"is not empty"},V={between:"in","not between":"not in"};function A(t,n={}){const{operator:e,values:i,reading:r}=t,s=r.kind==="bucket"?`${t.subject} (${O(r.bucket)})`:t.subject,o=S[e],l=t.shownAs?` (shown as ${JSON.stringify(t.shownAs)})`:"",d=(a,c=0)=>({text:a,omittedValues:c});if(e==="isNull"||e==="isNotNull")return d(`${s} ${o}`);if(t.latestValue)return d(`${s} ${o} the latest value of this field (resolved at run time)`);const h=t.relative?I(e):void 0;if(t.relative&&h){const{definition:a}=w(t.relative),c=i.length===1&&!p(t.relative).dataAnchored?`; last resolved here as ${u(i[0],r)}`:"";return d(`${s} ${o} the ${h} of the relative window ${a} (${JSON.stringify(T(e,t.relative))}; resolved again at run time${c})`);}if(e==="between"||e==="not between"){const a=i.length===2?v(i[0],i[1],r,n.timeZone):void 0;if(t.relative)return d(`${s} ${V[e]} ${E(t.relative,a)}`);if(a){const c=a.wholeDaysIn?` (whole days in ${a.wholeDaysIn})`:"";return d(`${s} ${o} ${a.from} and ${a.to}${c}${l}`);}}return e==="in"||e==="not in"||i.length!==1?d(`${s} ${o} (${N(i,r,n.maxListedValues)})${l}`,$(i.length,n.maxListedValues)):d(`${s} ${o} ${u(i[0],r)}${l}`);}function _(t,n={}){return t==null?{text:"no value",omittedValues:0}:Array.isArray(t)?{text:N(t,f,n.maxListedValues),omittedValues:$(t.length,n.maxListedValues)}:{text:u(t),omittedValues:0};}function u(t,n=f){if(n.kind!=="plain"){const e=b(t,n);if(e!==void 0)return e;}return t instanceof Date?b(t,y)??JSON.stringify(String(t)):t===void 0?"null":typeof t=="number"||typeof t=="boolean"||t===null?String(t):JSON.stringify(t)??String(t);}function N(t,n=f,e=Number.POSITIVE_INFINITY){const i=t.slice(0,Number.isFinite(e)?e:void 0).map(s=>u(s,n)).join(", "),r=$(t.length,e);return r>0?`${i}, and ${r} more values`:i;}function $(t,n=Number.POSITIVE_INFINITY){return Math.max(0,t-n);}function m(t){if(t instanceof Date)return Number.isNaN(t.getTime())?void 0:{kind:"instant",instant:t};if(typeof t!="string")return;const n=D(t);return n==="instant"?{kind:n,instant:new Date(t)}:n?{kind:n,text:t}:void 0;}function b(t,n){if(n.kind==="bucket")return typeof t=="string"&&L(t,n.bucket).ok?t:void 0;const e=m(t);if(e)return e.kind==="instant"?e.instant.toISOString():e.text;}function v(t,n,e,i){const r=e.kind==="temporal"?m(t):void 0,s=e.kind==="temporal"?m(n):void 0;if(i&&(r==null?void 0:r.kind)==="instant"&&(s==null?void 0:s.kind)==="instant"){const o=g(r.instant,i),l=g(s.instant,i);if(o&&l&&o.time==="00:00:00"&&r.instant.getUTCMilliseconds()===0&&l.time==="23:59:59"&&[0,999].includes(s.instant.getUTCMilliseconds()))return{from:o.date,to:l.date,wholeDaysIn:i};}return{from:u(t,e),to:u(n,e)};}function g(t,n){try{const e=Object.fromEntries(new Intl.DateTimeFormat("en-CA",{timeZone:n,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h23"}).formatToParts(t).map(i=>[i.type,i.value]));return{date:`${e.year}-${e.month}-${e.day}`,time:`${e.hour}:${e.minute}:${e.second}`};}catch{return;}}function E(t,n){const{label:e,definition:i}=w(t),r=n&&!p(t).dataAnchored?`; last resolved here as ${n.from} to ${n.to}${n.wholeDaysIn?`, whole days in ${n.wholeDaysIn}`:""}`:"";return`${e?`${JSON.stringify(e)} `:""}(relative window: ${i}; resolved again at run time${r})`;}const R={"=":"=","!=":"!=",">":">",">=":">=","<":"<","<=":"<=",in:"in","not in":"not in",like:"like","not like":"not like",between:"between","not between":"not between","is null":"isNull","is not null":"isNotNull"};function j(t,n,e={}){const i=t.valueType==="date";return A({subject:n,operator:R[t.operation],values:t.values,reading:i?y:f,...(i?{relative:k(t.relativeMeta)}:{})},e);}export{f as P,y as T,A as a,_ as b,j as d,$ as o};
@@ -1 +0,0 @@
1
- import{r as _,n as $,o as x,p as T}from"./resolve-dashboard-input-context-B-0tONJg.js";import{b as O}from"./filter-reach-preview-BWRGfSmb.js";function N(t,e,o={}){var a,c,h;if(e.clear){if(e.html!==void 0||e.slots||e.settings)return m("Start over takes the visual off the card; send its new code as a separate change.","customVisual","Send clear alone.");if(!t.customVisual&&t.type==="customVisual")return{ok:!0,card:t,manifest:void 0};const{customVisual:l,...u}=t;return{ok:!0,card:{...u,type:"customVisual"},manifest:void 0};}const s=t.customVisual??{};let n=s,i=o.manifest;if(e.html!==void 0){const l=_(e.html,{kind:"visual"});if(!l.ok){const u=l.findings.filter(r=>r.severity==="error");return{ok:!1,problem:{code:"invalid_change",message:u.map(r=>r.message).join(" ")||"The visual is invalid.",path:"html",fix:((a=u.find(r=>r.fix))==null?void 0:a.fix)??"Fix the HTML against the contract (semaphor_get_extension_contract) and send it again.",details:{reason:"custom_visual_invalid",findings:l.findings}}};}if(i=l.manifest,e.html!==((c=s.draft)==null?void 0:c.html)){const{version:u,draft:r,...f}=n;n={...f,draft:{html:e.html}};}n=I(n,i);}if((e.slots&&Object.keys(e.slots).length||e.settings&&Object.keys(e.settings).length)&&!i)return m("This visual's slots and settings can't be read, so they can't be changed.","customVisual","Send the visual's html with the change, or change it in the editor.");if(e.slots){for(const u of Object.keys(e.slots))if(!i.slots.some(r=>r.id===u))return m(`This visual has no slot "${u}"; it has ${p(i.slots.map(r=>r.id))}.`,`slots.${u}`,"Name one of its slots.",i.slots.map(r=>r.id));const l=v(n.slots,e.slots,S);l!==n.slots&&(n=g(n,"slots",l));}if(e.settings){const l={};for(const[r,f]of Object.entries(e.settings)){const d=(h=i.settings)==null?void 0:h[r];if(!d){const b=Object.keys(i.settings??{});return m(b.length?`This visual has no setting "${r}"; it has ${p(b)}.`:`This visual has no settings, so "${r}" can't be set.`,`settings.${r}`,"Name one of its settings.",b);}if(f===null||f===d.default){l[r]=null;continue;}const k=y(d,f);if(k)return m(`"${d.label}" ${k}.`,`settings.${r}`,"Send a value the setting takes.",j(d));l[r]=f;}const u=v(n.settings,l,(r,f)=>r===f);u!==n.settings&&(n=g(n,"settings",u));}return n===s&&t.type==="customVisual"?{ok:!0,card:t,manifest:i}:{ok:!0,card:{...t,type:"customVisual",customVisual:n},manifest:i};}function m(t,e,o,s){return{ok:!1,problem:{code:"invalid_change",message:t,path:e,fix:o,...(s!=null&&s.length?{allowed:s}:{})}};}function I(t,e){let o=t;if(t.slots){const s=Object.fromEntries(Object.entries(t.slots).filter(([n])=>e.slots.some(i=>i.id===n)));Object.keys(s).length!==Object.keys(t.slots).length&&(o=g(o,"slots",s));}if(t.settings){const s=Object.fromEntries(Object.entries(t.settings).filter(([n,i])=>{var c;const a=(c=e.settings)==null?void 0:c[n];return a&&i!==a.default&&!y(a,i);}));Object.keys(s).length!==Object.keys(t.settings).length&&(o=g(o,"settings",s));}return o;}function y(t,e){switch(t.type){case"boolean":return typeof e=="boolean"?void 0:"is on or off (true or false)";case"number":return typeof e!="number"||!Number.isFinite(e)?"takes a number":t.min!==void 0&&e<t.min?`is at least ${t.min}`:t.max!==void 0&&e>t.max?`is at most ${t.max}`:void 0;case"string":return typeof e!="string"?"takes text":t.maxLength!==void 0&&e.length>t.maxLength?`takes at most ${t.maxLength} characters`:void 0;case"select":return typeof e=="string"&&t.options.some(o=>o.value===e)?void 0:`is one of ${p(t.options.map(o=>o.value))}`;case"color":return typeof e=="string"&&($(e)||x(e))?void 0:"takes a theme colour (palette-1 to palette-8, primary, positive…) or a hex colour";}}function j(t){if(t.type==="select")return t.options.map(e=>e.value);if(t.type==="boolean")return["true","false"];}function p(t){const e=t.map(o=>`"${o}"`);return e.length<=1?e[0]??"none":`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`;}function v(t,e,o){let s=t;for(const[n,i]of Object.entries(e)){const a=s==null?void 0:s[n];if(i===null){if(a===void 0)continue;const{[n]:c,...h}=s;s=h;}else(a===void 0||!o(a,i))&&(s={...s,[n]:i});}return s;}function g(t,e,o){const{[e]:s,...n}=t;return o&&Object.keys(o).length?{...n,[e]:o}:n;}function S(t,e){return"fieldId"in t?"fieldId"in e&&t.fieldId===e.fieldId:"column"in e&&t.column===e.column;}function R(t,e,o){const s=t.findIndex(a=>a.id===e);if(s===-1)return t;const n=t.filter((a,c)=>c!==s),i=Math.max(0,Math.min(Math.trunc(o),n.length));return i===s?t:[...n.slice(0,i),t[s],...n.slice(i)];}const w=/* @__PURE__ */new Set(["bar","line","pie","doughnut","table","detailTable","stackedBar","stackedLine","horizontalBar","radar","polarArea","scatter","bubble","funnel","custom","customVisual"]);function D(t){return!!(t&&w.has(t));}const F=250;function L(t){return{id:t.id,...T(t.field,{dataSource:t.dataSource,connectionId:t.connectionId}),width:F};}function A(t,e,o){const s=t.flatMap(n=>{if(o!==void 0&&n.id!==o)return[];const i=(n.inlineFilters??[]).findIndex(a=>a.id===e);return i===-1?[]:[{card:n,filter:n.inlineFilters[i],index:i}];});return s.length===1?{kind:"found",...s[0]}:s.length>1?{kind:"ambiguous",cards:s.map(n=>n.card)}:{kind:"none"};}const B=["hour","day","week","month","quarter","year"],M=12,P={automatic:"Automatic",card:"Set on this card",trend_by:"From Trend By"};function C(t,e,o={}){if(!t)return;const s=t.granularity;if(t.skipped)return{head:`Too many points by ${s}`,detail:t.grainSource==="trend_by"?"Pick a coarser grain on the Trend By.":"Pick a coarser grain, or Automatic."};const n=P[t.grainSource],i=t.span==="recent"?`The last 12 ${s}s: no date range`:t.span==="history"?`The 12 ${s}s ending with this one`:t.window?O({...t.window,timezone:t.calendar.tz},o.now):void 0;return{head:`By ${s} · ${e} ${e===1?"point":"points"}`,detail:i?`${i} · ${n}`:n};}export{B as K,M as a,L as b,D as c,C as d,A as f,R as m,N as w};