react-semaphor 0.1.423 → 0.1.425
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/dist/analytics-protocol/index.cjs +1 -1
- package/dist/analytics-protocol/index.js +243 -91
- package/dist/appearance/index.cjs +1 -1
- package/dist/appearance/index.js +1 -1
- package/dist/brand-studio/index.cjs +2 -2
- package/dist/brand-studio/index.js +8 -8
- package/dist/chunks/{analyze-result-contract-D7pjjYPy.js → analyze-result-contract-DnfF8kBb.js} +434 -427
- package/dist/chunks/analyze-result-contract-ege_u6Nl.js +1 -0
- package/dist/chunks/{braces-8TRlDwDw.js → braces-BdbUk_r9.js} +1 -1
- package/dist/chunks/{braces-D2tStQjF.js → braces-CbO-aIwH.js} +1 -1
- package/dist/chunks/calendar-preferences-dialog-BLaSWhLl.js +1 -0
- package/dist/chunks/{calendar-preferences-dialog-t5ET6MON.js → calendar-preferences-dialog-DJwV0aqn.js} +4 -4
- package/dist/chunks/{catalog-field-grounding-CJKAqtiC.js → catalog-field-grounding-DcxPLns0.js} +10 -10
- package/dist/chunks/{switch-2bh3Hka1.js → code-editor-Bkk7s8hI.js} +7382 -6809
- package/dist/chunks/code-editor-CkXyNgYc.js +138 -0
- package/dist/chunks/{common-types-4bjoIgvm.js → common-types-ClkOI-3O.js} +4 -4
- package/dist/chunks/comparison-document-migration-CQJ0DZlL.js +414 -0
- package/dist/chunks/comparison-document-migration-Db64RWYD.js +1 -0
- package/dist/chunks/{index-yHe0SeLO.js → dashboard-5agU0G_D.js} +56752 -55440
- package/dist/chunks/dashboard-MKIqgGDp.js +1402 -0
- package/dist/chunks/{dashboard-briefing-launcher-S2akO-ub.js → dashboard-briefing-launcher-CII8-4qo.js} +11 -6
- package/dist/chunks/{dashboard-briefing-launcher-Cavd0QJb.js → dashboard-briefing-launcher-qyEVfuOm.js} +226 -209
- package/dist/chunks/dashboard-controls-PJpeYZHw.js +36 -0
- package/dist/chunks/dashboard-controls-aJY0FNPP.js +2196 -0
- package/dist/chunks/dashboard-input-contract-BFpERluO.js +18 -0
- package/dist/chunks/dashboard-input-contract-DV3cshjz.js +1 -0
- package/dist/chunks/{dashboard-json-Do2-pdPZ.js → dashboard-json-CzHSP6Fa.js} +16 -15
- package/dist/chunks/dashboard-json-DtmR5yCf.js +1 -0
- package/dist/chunks/date-formatter-BTTYdAik.js +1 -0
- package/dist/chunks/date-formatter-D-89jTjG.js +514 -0
- package/dist/chunks/{edit-dashboard-visual-Cw6bq4_w.js → edit-dashboard-visual-AkZzwBCV.js} +8892 -8996
- package/dist/chunks/edit-dashboard-visual-Cif6uDqN.js +182 -0
- package/dist/chunks/{index-CjzRe2su.js → index-CnujJ3fa.js} +3 -3
- package/dist/chunks/{index-DRlMUglg.js → index-Dpm_VET4.js} +2 -2
- package/dist/chunks/{index-CJdxSyQq.js → index-If0wlXGi.js} +308 -308
- package/dist/chunks/index-jSrCwPQz.js +31 -0
- package/dist/chunks/{x-CXDkqdur.js → index-xHCrHprY.js} +59 -59
- package/dist/chunks/{layout-grid-C0OI-MRn.js → layout-grid-B08pP7v6.js} +1 -1
- package/dist/chunks/{layout-grid-CiubineE.js → layout-grid-D5tYJg1-.js} +1 -1
- package/dist/chunks/metric-comparison-4oA4ouU9.js +354 -0
- package/dist/chunks/metric-comparison-nQKquVnx.js +1 -0
- package/dist/chunks/{palette-C4KTXOug.js → palette-C0yjT5Tv.js} +1 -1
- package/dist/chunks/{palette-Cp1hqZtm.js → palette-jqaAcwiQ.js} +1 -1
- package/dist/chunks/{save-DgMfP0j8.js → save-HCJjjzdX.js} +1 -1
- package/dist/chunks/{save-C__QggEE.js → save-Xdc4pnys.js} +1 -1
- package/dist/chunks/{search-BHsQIWBV.js → search-DHZCro8B.js} +1 -1
- package/dist/chunks/{search-DNCejM7Z.js → search-Dcud9ajy.js} +1 -1
- package/dist/chunks/{update-policy-C1pmhLz9.js → update-policy-BgONreNd.js} +1 -1
- package/dist/chunks/{update-policy-BCJc0oI5.js → update-policy-CY2k-pJP.js} +9 -9
- package/dist/chunks/{use-create-flow-overlay-state-5MDbZcs1.js → use-create-flow-overlay-state-ByOKVV2K.js} +62 -62
- package/dist/chunks/{use-create-flow-overlay-state-BNczg9Gj.js → use-create-flow-overlay-state-DmuReEnk.js} +2 -2
- package/dist/chunks/validators-B4VMLX3_.js +1 -0
- package/dist/chunks/{validators-PXkij33j.js → validators-Cz-XuORM.js} +123 -119
- package/dist/dashboard/index.cjs +1 -1
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.cjs +2 -2
- package/dist/dashboard-authoring/index.js +6 -4
- package/dist/data-app-builder/index.cjs +6 -6
- package/dist/data-app-builder/index.js +5 -5
- package/dist/data-app-codegen/index.cjs +1 -1
- package/dist/data-app-codegen/index.js +2 -2
- package/dist/data-app-codegen-node/index.cjs +1 -1
- package/dist/data-app-codegen-node/index.js +3 -3
- package/dist/data-app-sdk/index.cjs +1 -1
- package/dist/data-app-sdk/index.js +6 -6
- package/dist/data-app-sdk-adapters/index.cjs +1 -1
- package/dist/data-app-sdk-adapters/index.js +1 -1
- package/dist/data-app-sdk-validation/index.cjs +1 -1
- package/dist/data-app-sdk-validation/index.js +65 -68
- package/dist/format-utils/index.cjs +2 -2
- package/dist/format-utils/index.js +59 -58
- package/dist/index.cjs +1 -1
- package/dist/index.js +19 -19
- package/dist/style.css +1 -1
- package/dist/surfboard/index.cjs +1 -1
- package/dist/surfboard/index.js +3 -3
- package/dist/types/analytics-protocol.d.ts +299 -3
- package/dist/types/brand-studio.d.ts +2 -2
- package/dist/types/briefings.d.ts +65 -41
- package/dist/types/dashboard-assistant.d.ts +28 -7
- package/dist/types/dashboard-authoring.d.ts +123 -43
- package/dist/types/dashboard.d.ts +97 -48
- package/dist/types/data-app-builder.d.ts +2 -2
- package/dist/types/data-app-sdk.d.ts +1 -1
- package/dist/types/format-utils.d.ts +98 -10
- package/dist/types/index.js +1 -1
- package/dist/types/main.d.ts +229 -95
- package/dist/types/shared.d.ts +84 -43
- package/dist/types/surfboard.d.ts +99 -49
- package/dist/types/types.d.ts +110 -50
- package/package.json +2 -1
- package/dist/chunks/analyze-result-contract-DpDcImgk.js +0 -1
- package/dist/chunks/calendar-preferences-dialog-CTmeASaM.js +0 -1
- package/dist/chunks/contracts-CoCOpd_i.js +0 -11
- package/dist/chunks/contracts-CtB2VONT.js +0 -1
- package/dist/chunks/dashboard-controls-BJLrErjW.js +0 -2322
- package/dist/chunks/dashboard-controls-DzbP8AXA.js +0 -52
- package/dist/chunks/dashboard-json-5tWb5KD6.js +0 -1
- package/dist/chunks/date-formatter-B4EBSe9C.js +0 -1
- package/dist/chunks/date-formatter-BlhBftA9.js +0 -416
- package/dist/chunks/edit-dashboard-visual-Yh5YFgMF.js +0 -178
- package/dist/chunks/index-BPM3gDRw.js +0 -1406
- package/dist/chunks/switch-DMT7qf_R.js +0 -138
- package/dist/chunks/validators-DMlVbd1p.js +0 -1
- package/dist/chunks/x-B6ghREd2.js +0 -31
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";const K=require("./analyze-result-contract-
|
|
1
|
+
"use strict";const K=require("./analyze-result-contract-ege_u6Nl.js"),S=require("../data-app-sdk-adapters/index.cjs"),re=K.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_SCHEMA_VERSION,T=K.SEMAPHOR_DATA_APP_CODEGEN_SUMMARY_VALIDATOR_VERSION,k="semaphor-generated-data-app-contract/v1",G="semaphor-generated-data-app-contract-manifest/v1";function x(e){return E(e)?[...K.validateSemaphorDataAppCodegenSummary(e).issues,...ae(e)]:["Plan artifact must be a Semaphor codegenSummary object."]}function ne(e){const t=x(e);if(t.length>0)throw new Error(`Invalid Semaphor codegenSummary:
|
|
2
2
|
- ${t.join(`
|
|
3
3
|
- `)}`)}function ae(e){var r;const t=E(e);if(!t)return[];const n=[];return((r=E(t.validation))==null?void 0:r.status)==="blocked"&&n.push("validation.status blocked cannot be generated. Resolve blocked semantic model gaps and replan before generating contract files."),Array.isArray(t.unsupportedInsights)&&t.unsupportedInsights.forEach((i,o)=>{var a;((a=E(i))==null?void 0:a.reason)==="missing_relationship"&&n.push(`unsupportedInsights.${o}.reason missing_relationship blocks contract generation. Call semaphor_propose_semantic_model_change, apply an approved semantic model patch, and replan before generating contract files.`)}),Array.isArray(t.views)&&t.views.forEach((i,o)=>{var s;const a=E((s=E(i))==null?void 0:s.computation);(a==null?void 0:a.kind)==="unsupported"&&a.reason==="missing_relationship"&&n.push(`views.${o}.computation.reason missing_relationship blocks contract generation. Call semaphor_propose_semantic_model_change, apply an approved semantic model patch, and replan before generating contract files.`)}),n}function E(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}const J=["sources.ts","fields.ts","inputs.ts","queries.ts","bindings.ts","accessors.ts","metadata.ts","index.ts"],ie=["USAGE.md"],Y=[...J,...ie,"contract.manifest.json"];async function se({manifest:e,generatedFiles:t}){const n=[],r=y(e);if(!r)return{issues:[{message:"Generated contract manifest must be an object.",repairHint:"Regenerate the generated contract instead of hand-editing the manifest."}]};r.schemaVersion!==G&&n.push({path:"schemaVersion",message:`schemaVersion must be ${G}. Regenerate the contract with semaphor_create_data_app_contract.`,repairHint:"Regenerate the contract with semaphor_create_data_app_contract."}),r.generatedContractSchemaVersion!==k&&n.push({path:"generatedContractSchemaVersion",message:`generatedContractSchemaVersion must be ${k}. Regenerate the contract with semaphor_generate_data_app_contract.`,repairHint:"Regenerate the contract with semaphor_generate_data_app_contract."});const i=y(r.generator);A(i==null?void 0:i.name)||n.push({path:"generator.name",message:"generator.name is required.",repairHint:"Regenerate the generated contract so manifest generator metadata is written deterministically."}),A(i==null?void 0:i.version)||n.push({path:"generator.version",message:"generator.version is required.",repairHint:"Regenerate the generated contract so manifest generator metadata is written deterministically."});for(const a of x(r.codegenSummary))n.push({path:`codegenSummary.${a}`,message:`codegenSummary.${a}`,repairHint:"Regenerate the generated contract from a valid Data App codegenSummary."});if(r.codegenSummaryValidatorVersion!==T&&n.push({path:"codegenSummaryValidatorVersion",message:`codegenSummaryValidatorVersion must be ${T}. Regenerate the contract with semaphor_generate_data_app_contract.`,repairHint:"Regenerate the contract with semaphor_generate_data_app_contract."}),typeof r.codegenSummaryHash!="string")n.push({path:"codegenSummaryHash",message:"codegenSummaryHash is required.",repairHint:"Regenerate the generated contract so manifest hashes are written deterministically."});else if(y(r.codegenSummary)){const a=await fe(r.codegenSummary);r.codegenSummaryHash!==a&&n.push({path:"codegenSummaryHash",message:"codegenSummaryHash does not match codegenSummary. Regenerate the contract instead of editing the manifest.",repairHint:"Regenerate the generated contract instead of editing the manifest."})}n.push(...de(r.codegenSummary));const o=t?oe(t):[];if(n.push(...o),t&&o.length===0&&n.push(...ce(t)),typeof r.generatedContentHash!="string")n.push({path:"generatedContentHash",message:"generatedContentHash is required.",repairHint:"Regenerate the generated contract so manifest hashes are written deterministically."});else if(t&&o.length===0){const a=await ue(t);r.generatedContentHash!==a&&n.push({path:"generatedContentHash",message:"generatedContentHash does not match generated TypeScript files. Regenerate the contract instead of hand-editing generated files.",repairHint:"Regenerate the contract instead of hand-editing generated files."})}return{issues:n}}function oe(e){var r;const t=[],n=new Set(Y);for(const i of Object.keys(e)){if(i.includes("/")||i.includes("\\")){const o=((r=i.split("/").pop())==null?void 0:r.split("\\").pop())||i;t.push({path:`generatedFiles.${i}`,message:`generatedFiles keys must be generated filenames such as "${o}", not path-qualified keys such as "${i}".`,repairHint:'Pass generatedFiles keyed by filename, for example "queries.ts", not "src/semaphor/generated/queries.ts".'});continue}n.has(i)||t.push({path:`generatedFiles.${i}`,message:`generatedFiles contains unknown generated contract file "${i}".`,repairHint:"Pass only the generated files returned by semaphor_generate_data_app_contract, keyed by filename."})}return t}function ce(e){const t=e["USAGE.md"];return typeof t!="string"?[{path:"generatedFiles.USAGE.md",message:"generatedFiles.USAGE.md is required.",repairHint:"Regenerate the generated contract so the generated usage guide is written."}]:["queries","queryOptionsForView","rowsForView","metricValuesForView","kpiPropsForView","roleValuesForView","appInputSpecs","inputOptionQueries"].filter(r=>!t.includes(`\`${r}\``)).map(r=>({path:"generatedFiles.USAGE.md",message:`generatedFiles.USAGE.md must document ${r}.`,repairHint:"Regenerate the generated contract so the usage guide matches generated exports."}))}function de(e){const t=y(e);if(!t)return[];const n=[],r=new Set(b(t.inputs).map(o=>{var a;return(a=y(o))==null?void 0:a.id}).filter(A)),i=new Set(b(t.views).map(o=>{var a;return(a=y(o))==null?void 0:a.id}).filter(A));return b(t.filterContracts).forEach((o,a)=>{const s=y(o),c=s==null?void 0:s.inputId;(!A(c)||!r.has(c))&&n.push({path:`codegenSummary.filterContracts.${a}.inputId`,message:`codegenSummary.filterContracts.${a}.inputId must reference a generated input.`,repairHint:"Regenerate the generated contract from a valid planner output."}),Array.isArray(s==null?void 0:s.bindings)&&s.bindings.forEach((u,f)=>{const p=y(u),m=p==null?void 0:p.viewId;(!A(m)||!i.has(m))&&n.push({path:`codegenSummary.filterContracts.${a}.bindings.${f}.viewId`,message:`codegenSummary.filterContracts.${a}.bindings.${f}.viewId must reference a generated view.`,repairHint:"Regenerate the generated contract from a valid planner output."});const h=y(p==null?void 0:p.fieldRef);A(h==null?void 0:h.name)||n.push({path:`codegenSummary.filterContracts.${a}.bindings.${f}.fieldRef`,message:`codegenSummary.filterContracts.${a}.bindings.${f}.fieldRef is required.`,repairHint:"Regenerate the generated contract from a valid planner output."})})}),n}async function ue(e){const t=Object.keys(e).filter(r=>r.endsWith(".ts")).sort();let n="";for(const r of t)n+=`${r}\0${e[r]}\0`;return`sha256:${await Q(n)}`}async function fe(e){return`sha256:${await Q(M(e))}`}function M(e){if(e===null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(r=>M(r)).join(",")}]`;const t=e;return`{${Object.keys(t).sort().filter(r=>t[r]!==void 0).map(r=>`${JSON.stringify(r)}:${M(t[r])}`).join(",")}}`}async function Q(e){var r;if(!((r=globalThis.crypto)!=null&&r.subtle))throw new Error("SHA-256 digest support is required for generated contract validation.");const t=new TextEncoder().encode(e),n=await globalThis.crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(n)).map(i=>i.toString(16).padStart(2,"0")).join("")}function y(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function b(e){return Array.isArray(e)?e:[]}function A(e){return typeof e=="string"&&e.length>0}function pe(e){const t=d(e),n=V(t),r=[],i=[];return I(t==null?void 0:t.views).filter(o=>{var s;const a=d((s=d(o))==null?void 0:s.sdkSpec);return!!(a!=null&&a.builder&&(a!=null&&a.spec))}).forEach((o,a)=>{var u;const s=String(((u=d(o))==null?void 0:u.id)||`view_${a}`),c=W(o,n);if(c){r.push({viewId:s,...c});return}i.push({viewId:s,path:`views.${s}.sdkSpec`,message:`Generated view execution validation could not build intent for "${s}".`})}),{requests:r,issues:i}}function W(e,t){const n=d(e),r=d(n==null?void 0:n.sdkSpec),i=d(r==null?void 0:r.spec);if(!n||!(r!=null&&r.builder)||!i)return null;const o=me(t)?t:V(d(t)),a=be(r.builder),s=d(w(i,o))||{},c=ye({view:n,builder:a,rawSpec:i,spec:{...s,id:n.id,label:Ne(n,i)},context:o});try{if(a==="analysis"){const u=c;return{intent:S.toSemaphorAnalysisIntent(u),resultShape:"analysis",analysisOptions:S.toSemaphorAnalysisQueryOptions(u)}}if(a==="metric")return{intent:S.toSemaphorMetricIntent(c),resultShape:"metric"};if(a==="records")return{intent:S.toSemaphorRecordsIntent(c),resultShape:"records"};if(a==="matrix")return{intent:S.toSemaphorMatrixIntent(c),resultShape:"matrix"};if(a==="sql")return{intent:S.toSemaphorSqlIntent(c),resultShape:"sql"}}catch{return null}return null}function ge({input:e,filterContract:t,codegenSummary:n}){const r=d(e),i=d(t),o=d(r==null?void 0:r.optionQuery)||d(i==null?void 0:i.optionQuery);if(!r||!o)return null;const a=V(d(n)),s=d(o.spec),c=he(o,s,a),u=o.valueFieldRef||o.valueField||(s==null?void 0:s.valueField),f=o.labelFieldRef||o.labelField||(s==null?void 0:s.labelField);if(!c||!u||!f)return null;const m={...d(w(s||{},a))||{},id:o.id||(s==null?void 0:s.id)||`${r.id}-options`,inputId:r.id,source:c,valueField:u,labelField:f,population:o.population||(s==null?void 0:s.population),dependencies:o.dependencies||(s==null?void 0:s.dependencies),limit:o.limit||(s==null?void 0:s.limit)||100};try{return S.toSemaphorInputOptionsIntent(w(m,a))}catch{return null}}function le({input:e,filterContract:t,binding:n,option:r,codegenSummary:i}){const o=V(d(i)),a=d(e),s=d(t),c=d(n),u=w((c==null?void 0:c.fieldRef)||(s==null?void 0:s.fieldRef)||(a==null?void 0:a.fieldRef),o),f=String((s==null?void 0:s.operator)||(a==null?void 0:a.operator)||"in"),p=Fe(c);return{inputId:String((s==null?void 0:s.inputId)||(a==null?void 0:a.id)||""),kind:"filter",operator:f,value:He(f,r.value),isActive:!0,...u?{field:u}:{},...p?{relationshipHint:p}:{}}}function V(e){return{sourcesByKey:new Map(I(e==null?void 0:e.sources).map(d).filter(Me).filter(t=>typeof t.sourceKey=="string").map(t=>[String(t.sourceKey),Z(t)]))}}function me(e){var t;return e instanceof Object&&((t=d(e))==null?void 0:t.sourcesByKey)instanceof Map}function he(e,t,n){if(typeof e.sourceKey=="string")return n.sourcesByKey.get(e.sourceKey)||{sourceKey:e.sourceKey};if(e.source)return e.source;if(t!=null&&t.source)return t.source;if(typeof(t==null?void 0:t.sourceKey)=="string")return n.sourcesByKey.get(t.sourceKey)||{sourceKey:t.sourceKey}}function ye({view:e,builder:t,rawSpec:n,spec:r,context:i}){var s;if(t!=="records"&&t!=="sql")return r;const o=d((s=d(e.visualSpec))==null?void 0:s.tableBehavior);if(!o)return r;const a={...r};if(Oe(o)==="server"&&(a.pagination={page:1,pageSize:Se({tableBehavior:o,spec:r})}),t==="records"&&Ve(o)==="server"){const c=Ae({view:e,rawSpec:n,tableBehavior:o,context:i});c&&(a.orderBy=c)}return a}function Se({tableBehavior:e,spec:t}){const n=d(e.pagination),r=d(t.pagination);return F(n==null?void 0:n.pageSize)||F(r==null?void 0:r.pageSize)||F(t.limit)||100}function Ae({view:e,rawSpec:t,tableBehavior:n,context:r}){const i=d(n.sorting),o=g(i==null?void 0:i.defaultField);if(!o)return;const s=_e({view:e,rawSpec:t,context:r}).filter(c=>we(c.lookup).includes(o));if(s.length===1)return{field:s[0].field,direction:(i==null?void 0:i.defaultDirection)==="desc"?"desc":"asc"}}function _e({view:e,rawSpec:t,context:n}){var i;const r=[];for(const o of I(t.fields))$(r,o,n);$(r,t.dateField,n),$(r,(i=d(t.orderBy))==null?void 0:i.field,n);for(const o of I(e.fields))$(r,o,n);return Te(r,o=>Ee(o.lookup))}function $(e,t,n){const r=d(t);if(typeof(r==null?void 0:r.name)!="string"||r.name.length===0)return;const i=d(w(r,n))||r;e.push({lookup:r,field:i})}function we(e){return ke([g(e.name),X(e),Ie(e)])}function Ee(e){return[X(e),g(e.name),g(e.role),g(e.aggregate)].join("|")}function X(e){return[g(e.sourceKey)||Re(e.source),g(e.name),g(e.aggregate)].filter(Boolean).join(":")}function Re(e){const t=d(e);if(!t)return"";if(typeof t.kind=="string"&&typeof t.domainId=="string"){if(typeof t.datasetId=="string")return`${t.kind}:${t.domainId}:datasetId:${t.datasetId}`;if(typeof t.datasetName=="string")return`${t.kind}:${t.domainId}:datasetName:${t.datasetName}`}return JSON.stringify(t)}function Ie(e){return Ge([ve(e),g(e.aggregate).toLowerCase(),g(e.label)||g(e.name)].filter(Boolean))}function ve(e){return typeof e.sourceKey=="string"?Ce(e.sourceKey):$e(e.source)}function $e(e){const t=d(e);return t?g(t.datasetName)||g(t.datasetId)||g(t.name)||g(t.kind):""}function Ce(e){const t=String(e).split(":");return t[t.length-1]||String(e)}function Oe(e){var t;return g((t=d(e.pagination))==null?void 0:t.mode)}function Ve(e){var t;return g((t=d(e.sorting))==null?void 0:t.mode)}function w(e,t){if(!e||typeof e!="object")return e;if(Array.isArray(e))return e.map(i=>w(i,t));const n=e;if(typeof n.sourceKey=="string"&&typeof n.kind=="string"&&(typeof n.datasetName=="string"||typeof n.datasetId=="string"))return Z(n);const r={};for(const[i,o]of Object.entries(n))i!=="sourceKey"&&(r[i]=w(o,t));if(typeof n.sourceKey=="string"){const i=t.sourcesByKey.get(n.sourceKey);i&&!r.source&&(r.source=i)}return r}function Z(e){const{sourceKey:t,...n}=e;return n}function Ne(e,t){const n=d(e.visualSpec);return(n==null?void 0:n.title)||e.title||t.label}function be(e){const t=String(e||"").replace(/^semaphor\./,"");return["metric","records","analysis","matrix","sql"].includes(t)?t:""}function Fe(e){if(e!=null&&e.relationshipHint)return e.relationshipHint;const t=I(e==null?void 0:e.relationshipsUsed).map(n=>{var r;return(r=d(n))==null?void 0:r.id}).filter(n=>typeof n=="string"&&n.length>0);return t.length>0?{relationshipIds:t}:void 0}function He(e,t){return e==="in"||e==="not_in"?[t]:e==="between"?Array.isArray(t)?t:[t,t]:t}function F(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function g(e){return typeof e=="string"?e:""}function Te(e,t){const n=new Set,r=[];for(const i of e){const o=t(i);!o||n.has(o)||(n.add(o),r.push(i))}return r}function ke(e){return Array.from(new Set(e.filter(Boolean)))}function Ge(e){return(Array.isArray(e)?e.join(" "):e).replace(/[^a-zA-Z0-9]+/g," ").trim().split(/\s+/).filter(Boolean).map((n,r)=>{const i=n.toLowerCase();return r===0?i:i.charAt(0).toUpperCase()+i.slice(1)}).join("")}function d(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function I(e){return Array.isArray(e)?e:[]}function Me(e){return e!==void 0}const De=new Set(["diagnostic_fix","fix_diagnostics","fix_inspector_warnings","fix_runtime_warnings","fix_warnings"]),Ke=new Set(["add","edit","mixed","remove"]),j=new Set(["fields","metricBindingKeys","sdkSpec"]);function xe({beforeSummary:e,afterSummary:t,migrationReport:n,operationIntent:r,constraints:i,preferences:o}){const a=l(r),s=typeof(a==null?void 0:a.kind)=="string"?a.kind.trim():"";return Ke.has(s)?{ok:!1,policy:{kind:s,mode:"invalid_operation_kind",reason:"Retired Data App operation aliases are not accepted. Use the hard-migrated analytics/layout/style operationIntent kinds."},violations:[{path:"operationIntent.kind",reason:"Use analytics_add, analytics_edit, analytics_remove, input_add, input_edit, layout_only, style_only, runtime_debug, semantic_model_repair, save_or_publish, or greenfield_create."}]}:B(o)?{ok:!1,policy:{kind:s,mode:"invalid_update_constraints",reason:"Metric aggregate override updates must use operationIntent.measureAggregateOverrides so deterministic update policy can guard the targeted edit."},violations:[{path:"preferences.measureAggregateOverrides",reason:"preferences is retired. Move measureAggregateOverrides to operationIntent.measureAggregateOverrides for update calls."}]}:B(i)?{ok:!1,policy:{kind:s,mode:"invalid_update_constraints",reason:"Metric aggregate override updates must use operationIntent.measureAggregateOverrides so deterministic update policy can guard the targeted edit."},violations:[{path:"constraints.measureAggregateOverrides",reason:"Move measureAggregateOverrides to operationIntent.measureAggregateOverrides for update calls."}]}:De.has(s)?U({beforeSummary:e,afterSummary:t,migrationReport:n,operationIntent:a,mode:"diagnostic_warning_fix",allowedViewChangeReasons:j,label:"Diagnostic warning fixes",reason:"Diagnostic warning fixes are preserve-by-default and may not add/remove views, inputs, or filter contracts."}):s==="analytics_edit"&&Array.isArray(a==null?void 0:a.measureAggregateOverrides)&&a.measureAggregateOverrides.length>0?U({beforeSummary:e,afterSummary:t,migrationReport:n,operationIntent:a,mode:"metric_aggregate_override_edit",allowedViewChangeReasons:j,label:"Metric aggregate override edits",reason:"Metric aggregate override edits are preserve-by-default and may only adjust fields/sdkSpec on targeted views."}):{ok:!0,policy:{kind:s,mode:"general_iterative_update",reason:"General generated-contract edits are allowed to change the requested contract shape. Review the migration report for expected UI work."},violations:[]}}function B(e){var t;return Array.isArray((t=l(e))==null?void 0:t.measureAggregateOverrides)}function U({beforeSummary:e,afterSummary:t,migrationReport:n,operationIntent:r,mode:i,allowedViewChangeReasons:o,label:a,reason:s}){const c=[],u=je(r==null?void 0:r.targetViewIds),f=l(n)||{};u.size===0&&c.push({path:"operationIntent.targetViewIds",reason:`${a} must declare targetViewIds so the update cannot broaden to unrelated views.`}),H({bucket:l(f.views),label:"views",operationLabel:a,violations:c}),H({bucket:l(f.inputs),label:"inputs",operationLabel:a,violations:c}),L({bucket:l(f.inputs),label:"inputs",operationLabel:a,violations:c}),H({bucket:l(f.filterContracts),label:"filterContracts",operationLabel:a,violations:c}),L({bucket:l(f.filterContracts),label:"filterContracts",operationLabel:a,violations:c});for(const m of ee(l(f.views))){u.size>0&&!u.has(_(m.id))&&c.push({path:`views.${_(m.id)||"<unknown>"}`,reason:`${a} may only change explicitly targeted views.`});const h=Array.isArray(m.reasons)?m.reasons.filter(R=>typeof R!="string"||!o.has(R)):[];h.length>0&&c.push({path:`views.${_(m.id)||"<unknown>"}`,reason:`${a} may only adjust fields/sdkSpec/metricBindingKeys; changed ${h.join(", ")}.`})}const p=qe({beforeSummary:e,afterSummary:t,targetViewIds:u,label:a});return p&&c.push(p),{ok:c.length===0,policy:{kind:_(r==null?void 0:r.kind)||"diagnostic_fix",mode:i,allowedViewChangeReasons:Array.from(o).sort(),targetViewIds:Array.from(u).sort(),reason:s},violations:c}}function qe({beforeSummary:e,afterSummary:t,targetViewIds:n,label:r}){const i=l(e),o=l(t);if(!i||!o)return{path:"codegenSummary",reason:`${r} require before/after codegen summaries for full-scope verification.`};const a=P(i),s=P(o),c=z(i.views),u=z(o.views),f=Array.isArray(a.views)?a.views:[];a.views=f;for(const p of n){const m=c.get(p),h=u.get(p);if(!m||!h)continue;const R=f.find(te=>{var q;return((q=l(te))==null?void 0:q.id)===p}),v=l(h);if(!R||!v)continue;const N=R;N.fields=C(v.fields),N.metricBindingKeys=C(v.metricBindingKeys),N.sdkSpec=C(v.sdkSpec)}return O(a)===O(s)?null:{path:"codegenSummary",reason:`${r} may only change fields/sdkSpec/metricBindingKeys on targetViewIds; another generated contract section changed.`}}function P(e){const t=C(e);for(const n of["implementationChecklist","assumptions","nextStep","nextRequiredTool","validation"])delete t[n];return Ue(t.unsupportedInsights)&&delete t.unsupportedInsights,t}function H({bucket:e,label:t,operationLabel:n,violations:r}){for(const i of D(e==null?void 0:e.added))r.push({path:`${t}.${_(i.id)||"<unknown>"}`,reason:`${n} may not add ${t}.`});for(const i of D(e==null?void 0:e.removed))r.push({path:`${t}.${_(i.id)||"<unknown>"}`,reason:`${n} may not remove ${t}.`})}function L({bucket:e,label:t,operationLabel:n,violations:r}){for(const i of ee(e))r.push({path:`${t}.${_(i.id)||"<unknown>"}`,reason:`${n} may not change ${t}.`})}function ee(e){return D(e==null?void 0:e.changed)}function D(e){return Array.isArray(e)?e.map(l).filter(Be):[]}function je(e){return Array.isArray(e)?new Set(e.filter(t=>typeof t=="string"&&t.trim().length>0).map(t=>t.trim())):new Set}function z(e){var n;const t=new Map;for(const r of Array.isArray(e)?e:[]){const i=(n=l(r))==null?void 0:n.id;typeof i=="string"&&i.trim()&&t.set(i,r)}return t}function C(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function O(e){if(e===null||typeof e!="object")return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(n=>O(n)).join(",")}]`;const t=e;return`{${Object.keys(t).sort().filter(n=>t[n]!==void 0).map(n=>`${JSON.stringify(n)}:${O(t[n])}`).join(",")}}`}function l(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function Be(e){return e!==void 0}function Ue(e){return Array.isArray(e)&&e.length===0}function _(e){return typeof e=="string"?e:""}exports.CODEGEN_SUMMARY_SCHEMA_VERSION=re;exports.CODEGEN_SUMMARY_VALIDATOR_VERSION=T;exports.CONTRACT_MANIFEST_SCHEMA_VERSION=G;exports.GENERATED_CONTRACT_SCHEMA_VERSION=k;exports.GENERATED_CONTRACT_TYPESCRIPT_FILES=J;exports.REQUIRED_GENERATED_CONTRACT_FILES=Y;exports.assertValidCodegenSummary=ne;exports.buildSemaphorGeneratedActiveInput=le;exports.buildSemaphorGeneratedInputOptionIntent=ge;exports.buildSemaphorGeneratedViewExecutionRequest=W;exports.buildSemaphorGeneratedViewExecutionRequests=pe;exports.evaluateSemaphorDataAppContractUpdatePolicy=xe;exports.validateCodegenSummary=x;exports.validateSemaphorGeneratedContract=se;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as W, a as X, v as Z } from "./analyze-result-contract-
|
|
1
|
+
import { S as W, a as X, v as Z } from "./analyze-result-contract-DnfF8kBb.js";
|
|
2
2
|
import { toSemaphorInputOptionsIntent as ee, toSemaphorAnalysisQueryOptions as te, toSemaphorAnalysisIntent as re, toSemaphorMetricIntent as ne, toSemaphorRecordsIntent as ae, toSemaphorMatrixIntent as se, toSemaphorSqlIntent as ie } from "../data-app-sdk-adapters/index.js";
|
|
3
3
|
const Je = W, x = X, G = "semaphor-generated-data-app-contract/v1", T = "semaphor-generated-data-app-contract-manifest/v1";
|
|
4
4
|
function P(e) {
|
|
@@ -899,13 +899,13 @@ export {
|
|
|
899
899
|
ue as R,
|
|
900
900
|
x as a,
|
|
901
901
|
T as b,
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
902
|
+
ce as c,
|
|
903
|
+
Ye as d,
|
|
904
|
+
Ze as e,
|
|
905
|
+
Xe as f,
|
|
906
|
+
he as g,
|
|
907
|
+
We as h,
|
|
908
|
+
et as i,
|
|
909
|
+
Qe as j,
|
|
910
910
|
P as v
|
|
911
911
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useState as H, useEffect as ie, useCallback as B, useMemo as P, useRef as Se, Fragment as gt } from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { b5 as
|
|
2
|
+
import { E as de, D as _e, u as Z, F as M, a4 as yt, Q as vt, V as xt, W as Ct, c as fe, Y as St, a5 as kt, B as q, d as Nt, e as Ze, a6 as wt, a7 as Dt, a8 as Et, a9 as pe, aa as je, ab as Re, ac as ke, ad as Ne, ae as It, af as Qe, ag as Ft, ah as Vt, ai as me, aj as Tt, ak as $e, al as et, am as tt, an as rt, L as oe, Z as at, _ as we, $ as De, a0 as Ee, a1 as Ie, a2 as Fe, ao as st, ap as _t, aq as Pe, ar as Lt, as as We, at as At, au as qt, av as Ve } from "./code-editor-Bkk7s8hI.js";
|
|
3
|
+
import { b5 as Mt, u as Ot, b6 as ce, b7 as Ut, b8 as Le, b9 as zt, ba as Bt, bb as jt, p as j, bc as Rt, bd as Qt, be as nt, bf as $t, bg as Pt, bh as Wt, bi as Kt, bj as Ht, aG as Yt, bk as Gt, bl as ot, bm as lt, bn as Xt, bo as Jt, bp as Zt, bq as er, br as it, bs as dt, bt as tr, bu as rr, bv as ar, bw as sr, bx as nr, aX as or, by as lr, bz as ir } from "./dashboard-5agU0G_D.js";
|
|
4
4
|
import { jsx as r, jsxs as m, Fragment as ae } from "react/jsx-runtime";
|
|
5
|
-
import { c as ct, X as ut, C as Ke } from "./
|
|
6
|
-
import "./analyze-result-contract-
|
|
7
|
-
import { S as pt } from "./save-
|
|
8
|
-
import { C as He } from "./search-
|
|
5
|
+
import { c as ct, X as ut, C as Ke } from "./index-xHCrHprY.js";
|
|
6
|
+
import "./analyze-result-contract-DnfF8kBb.js";
|
|
7
|
+
import { S as pt } from "./save-HCJjjzdX.js";
|
|
8
|
+
import { C as He } from "./search-DHZCro8B.js";
|
|
9
9
|
/**
|
|
10
10
|
* @license lucide-react v0.453.0 - ISC
|
|
11
11
|
*
|
|
@@ -30,7 +30,7 @@ const cr = ct("Link2", [
|
|
|
30
30
|
["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
|
|
31
31
|
]);
|
|
32
32
|
function ur(t) {
|
|
33
|
-
const [a, n] = H(null), [s, l] = H(null), d =
|
|
33
|
+
const [a, n] = H(null), [s, l] = H(null), d = Mt();
|
|
34
34
|
return ie(() => {
|
|
35
35
|
if (!t || t.trim() === "") {
|
|
36
36
|
n(null), l(null);
|
|
@@ -158,7 +158,7 @@ function hr(t, a) {
|
|
|
158
158
|
const l = (p = s.cards) == null ? void 0 : p.find(
|
|
159
159
|
(f) => f.id === s.activeCardId
|
|
160
160
|
);
|
|
161
|
-
return l ? (
|
|
161
|
+
return l ? (Rt({
|
|
162
162
|
...a,
|
|
163
163
|
frame: s,
|
|
164
164
|
card: l,
|
|
@@ -206,8 +206,8 @@ function br() {
|
|
|
206
206
|
};
|
|
207
207
|
}, [a]) };
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
const { authToken: t, tokenProps: a } =
|
|
209
|
+
function Ae() {
|
|
210
|
+
const { authToken: t, tokenProps: a } = Ot(), n = ce(), s = Ut(), l = Le(), { selectVisual: d } = zt(), {
|
|
211
211
|
setFrame: p,
|
|
212
212
|
setCard: f,
|
|
213
213
|
setIsDevMode: u,
|
|
@@ -229,9 +229,9 @@ function Le() {
|
|
|
229
229
|
setIsVisualEditing: o,
|
|
230
230
|
setSelectedFrameId: D,
|
|
231
231
|
clearSelectedFrameId: V
|
|
232
|
-
} = _e(), U = Z((_) => _.selectedSheetId), W = Z((_) => _.selectedFrameId), J = Z((_) => _.dashboard), te = Z((_) => _.filterValues),
|
|
232
|
+
} = _e(), U = Z((_) => _.selectedSheetId), W = Z((_) => _.selectedFrameId), J = Z((_) => _.dashboard), te = Z((_) => _.filterValues), L = Z(
|
|
233
233
|
(_) => _.inlineFilterValuesMap
|
|
234
|
-
), Q =
|
|
234
|
+
), Q = Bt((l == null ? void 0 : l.id) || "", {
|
|
235
235
|
enabled: !!(l != null && l.id) && !!(t != null && t.accessToken)
|
|
236
236
|
}), Y = B(
|
|
237
237
|
async (_) => {
|
|
@@ -266,7 +266,7 @@ function Le() {
|
|
|
266
266
|
selectedSheetId: U,
|
|
267
267
|
selectedFrameId: W,
|
|
268
268
|
filterValues: te,
|
|
269
|
-
inlineFilterValuesMap:
|
|
269
|
+
inlineFilterValuesMap: L
|
|
270
270
|
}))
|
|
271
271
|
throw new Error("Failed to setup editor with visual data");
|
|
272
272
|
return { success: !0, fromCache: K };
|
|
@@ -302,29 +302,29 @@ function Le() {
|
|
|
302
302
|
U,
|
|
303
303
|
W,
|
|
304
304
|
te,
|
|
305
|
-
|
|
305
|
+
L
|
|
306
306
|
]
|
|
307
307
|
), be = B(
|
|
308
308
|
async (_) => {
|
|
309
309
|
var K;
|
|
310
|
-
const E = (
|
|
310
|
+
const E = (A) => (j.error(A), { success: !1, error: A });
|
|
311
311
|
try {
|
|
312
312
|
if (d(_), !U)
|
|
313
313
|
return E("No sheet selected. Please select a sheet first.");
|
|
314
|
-
const { data:
|
|
314
|
+
const { data: A, fromCache: ge } = await Ye(
|
|
315
315
|
a.apiServiceUrl,
|
|
316
316
|
(t == null ? void 0 : t.accessToken) || "",
|
|
317
317
|
_.id,
|
|
318
318
|
n,
|
|
319
319
|
"Adding visual to dashboard..."
|
|
320
|
-
), ue = (
|
|
320
|
+
), ue = (A == null ? void 0 : A.frameObject) ?? ((K = A == null ? void 0 : A.visual) == null ? void 0 : K.frameObject);
|
|
321
321
|
if (!ue)
|
|
322
322
|
return E("Visual has no frame data");
|
|
323
323
|
const $ = mt(ue);
|
|
324
324
|
if (!($ != null && $.cards) || $.cards.length === 0)
|
|
325
325
|
return E("Visual frame is malformed");
|
|
326
326
|
const le = {
|
|
327
|
-
...
|
|
327
|
+
...jt($),
|
|
328
328
|
visualId: _.id
|
|
329
329
|
// Link this frame to the library visual
|
|
330
330
|
};
|
|
@@ -333,9 +333,9 @@ function Le() {
|
|
|
333
333
|
le,
|
|
334
334
|
"end"
|
|
335
335
|
), O(!0), D(le.id), { success: !0, fromCache: ge };
|
|
336
|
-
} catch (
|
|
337
|
-
return console.error("Error adding visual:",
|
|
338
|
-
|
|
336
|
+
} catch (A) {
|
|
337
|
+
return console.error("Error adding visual:", A), E(
|
|
338
|
+
A instanceof Error ? A.message : "Failed to add visual to dashboard"
|
|
339
339
|
);
|
|
340
340
|
}
|
|
341
341
|
},
|
|
@@ -372,7 +372,7 @@ function Tr() {
|
|
|
372
372
|
ie(() => {
|
|
373
373
|
var w;
|
|
374
374
|
if (!t) return;
|
|
375
|
-
const { tableName: p, schemaName: f, databaseName: u, connectionId: v } =
|
|
375
|
+
const { tableName: p, schemaName: f, databaseName: u, connectionId: v } = Qt(t), g = (w = t.selectedEntities) == null ? void 0 : w[0], x = (g == null ? void 0 : g.type) === "model" && "id" in g ? g.id : "";
|
|
376
376
|
a(v || ""), n(u || ""), s(f || ""), l(p || ""), d(x);
|
|
377
377
|
}, [
|
|
378
378
|
t,
|
|
@@ -388,7 +388,7 @@ function ft() {
|
|
|
388
388
|
const t = M((g) => g.card), a = M((g) => g.frame), n = P(
|
|
389
389
|
() => nt(a, t),
|
|
390
390
|
[a, t]
|
|
391
|
-
), { manifest: s } =
|
|
391
|
+
), { manifest: s } = $t(
|
|
392
392
|
((u = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : u.url) || ""
|
|
393
393
|
), l = P(
|
|
394
394
|
() => {
|
|
@@ -401,8 +401,8 @@ function ft() {
|
|
|
401
401
|
);
|
|
402
402
|
},
|
|
403
403
|
[s, (v = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : v.componentName]
|
|
404
|
-
), d =
|
|
405
|
-
() =>
|
|
404
|
+
), d = Pt(n, l), p = P(
|
|
405
|
+
() => Wt({
|
|
406
406
|
frame: a,
|
|
407
407
|
configCard: n,
|
|
408
408
|
isMultiInputVisual: d === "multiple"
|
|
@@ -412,9 +412,9 @@ function ft() {
|
|
|
412
412
|
const g = p.findIndex(
|
|
413
413
|
(h) => (h == null ? void 0 : h.id) === t.id
|
|
414
414
|
);
|
|
415
|
-
return g < 0 ? -1 :
|
|
415
|
+
return g < 0 ? -1 : Kt(t, g);
|
|
416
416
|
}, [p, t]);
|
|
417
|
-
return P(() => !n || d !== "multiple" || f < 0 ? t.type :
|
|
417
|
+
return P(() => !n || d !== "multiple" || f < 0 ? t.type : Ht(
|
|
418
418
|
t,
|
|
419
419
|
f,
|
|
420
420
|
l == null ? void 0 : l.slots
|
|
@@ -427,7 +427,7 @@ function _r({
|
|
|
427
427
|
showLabel: s = !1,
|
|
428
428
|
showLocal: l = !1
|
|
429
429
|
}) {
|
|
430
|
-
const d = Z((N) => N.selectedFrameId), p =
|
|
430
|
+
const d = Z((N) => N.selectedFrameId), p = Yt((N) => N.selectedVisual), f = M((N) => N.frame);
|
|
431
431
|
let u;
|
|
432
432
|
if (t)
|
|
433
433
|
u = t;
|
|
@@ -472,7 +472,7 @@ function _r({
|
|
|
472
472
|
};
|
|
473
473
|
return /* @__PURE__ */ r(vt, { children: /* @__PURE__ */ m(xt, { delayDuration: 300, children: [
|
|
474
474
|
/* @__PURE__ */ r(Ct, { asChild: !0, children: /* @__PURE__ */ m(
|
|
475
|
-
|
|
475
|
+
Gt,
|
|
476
476
|
{
|
|
477
477
|
variant: "outline",
|
|
478
478
|
className: fe(
|
|
@@ -516,14 +516,14 @@ function gr(t, a) {
|
|
|
516
516
|
};
|
|
517
517
|
}
|
|
518
518
|
function qe(t) {
|
|
519
|
-
const a =
|
|
519
|
+
const a = Dt(t);
|
|
520
520
|
return a ? (j.error(a), !1) : !0;
|
|
521
521
|
}
|
|
522
|
-
function
|
|
522
|
+
function Lr({
|
|
523
523
|
className: t,
|
|
524
524
|
variant: a = "outline"
|
|
525
525
|
}) {
|
|
526
|
-
const n = M((d) => d.onSave), { getUpdatedFrame: s } =
|
|
526
|
+
const n = M((d) => d.onSave), { getUpdatedFrame: s } = Ae();
|
|
527
527
|
function l() {
|
|
528
528
|
const d = s();
|
|
529
529
|
qe(d) && (n == null || n(d));
|
|
@@ -542,11 +542,11 @@ function Ar({
|
|
|
542
542
|
}
|
|
543
543
|
);
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function Ar({
|
|
546
546
|
className: t,
|
|
547
547
|
variant: a = "default"
|
|
548
548
|
}) {
|
|
549
|
-
const n = ce(), [s, l] = H(!1), { setIsVisualEditing: d } = _e(), { getUpdatedFrame: p } =
|
|
549
|
+
const n = ce(), [s, l] = H(!1), { setIsVisualEditing: d } = _e(), { getUpdatedFrame: p } = Ae(), f = Le(), u = M((h) => h.frame), v = lt();
|
|
550
550
|
return /* @__PURE__ */ r(
|
|
551
551
|
q,
|
|
552
552
|
{
|
|
@@ -595,7 +595,7 @@ function Lr({
|
|
|
595
595
|
function qr({
|
|
596
596
|
className: t
|
|
597
597
|
}) {
|
|
598
|
-
const a = ce(), [n, s] = H(!1), l =
|
|
598
|
+
const a = ce(), [n, s] = H(!1), l = Le(), d = M((S) => S.frame), p = Z((S) => S.selectedSheetId), f = Z((S) => S.dashboard), { updateFrame: u, setIsVisualEditing: v } = _e(), { getUpdatedFrame: g } = Ae(), h = lt(), x = Xt();
|
|
599
599
|
return /* @__PURE__ */ r(
|
|
600
600
|
q,
|
|
601
601
|
{
|
|
@@ -620,7 +620,7 @@ function qr({
|
|
|
620
620
|
...N,
|
|
621
621
|
visualId: S
|
|
622
622
|
// Keep the link to library visual
|
|
623
|
-
}, R =
|
|
623
|
+
}, R = wt(f, F.id), G = await x(F, {
|
|
624
624
|
previousFrame: R
|
|
625
625
|
});
|
|
626
626
|
await h.mutateAsync({
|
|
@@ -697,13 +697,13 @@ function Or({
|
|
|
697
697
|
setActiveTabCardId: X
|
|
698
698
|
} = de();
|
|
699
699
|
function se() {
|
|
700
|
-
var J, te,
|
|
700
|
+
var J, te, L, Q;
|
|
701
701
|
const O = l.getQueryData(v);
|
|
702
702
|
d != null && d.queryData || s({
|
|
703
703
|
queryKey: v,
|
|
704
704
|
queryData: O
|
|
705
705
|
}), l.setQueryData(v, null), l.removeQueries({ queryKey: v, exact: !0 }), g(""), h({}), N(), F(void 0), x(""), w(""), S({});
|
|
706
|
-
const o = M.getState().frame, D = M.getState().card, V = nt(o, D), U = ((J = V == null ? void 0 : V.customCardPreferences) == null ? void 0 : J.visualType) === "multiple" || !!((te = V == null ? void 0 : V.customCardPreferences) != null && te.dataInputCardIds) || (((
|
|
706
|
+
const o = M.getState().frame, D = M.getState().card, V = nt(o, D), U = ((J = V == null ? void 0 : V.customCardPreferences) == null ? void 0 : J.visualType) === "multiple" || !!((te = V == null ? void 0 : V.customCardPreferences) != null && te.dataInputCardIds) || (((L = V == null ? void 0 : V.customCardPreferences) == null ? void 0 : L.minInputs) || 0) > 1 || (((Q = V == null ? void 0 : V.customCardPreferences) == null ? void 0 : Q.maxInputs) || 0) > 1, W = gr(D, U);
|
|
707
707
|
G({
|
|
708
708
|
...o,
|
|
709
709
|
cards: o.cards.map(
|
|
@@ -1012,7 +1012,7 @@ function Ur({
|
|
|
1012
1012
|
const F = P(
|
|
1013
1013
|
() => new Set(n || []),
|
|
1014
1014
|
[n]
|
|
1015
|
-
), R =
|
|
1015
|
+
), R = At(t), G = Et(t), [ee, X] = H(
|
|
1016
1016
|
null
|
|
1017
1017
|
), [se, O] = H(
|
|
1018
1018
|
null
|
|
@@ -1040,7 +1040,7 @@ function Ur({
|
|
|
1040
1040
|
return c.filter((b) => i.has(b.value));
|
|
1041
1041
|
},
|
|
1042
1042
|
[w, x, t]
|
|
1043
|
-
),
|
|
1043
|
+
), L = B(
|
|
1044
1044
|
(e) => t === "dashboard" && (e === "field_selector" || e === "metric_selector"),
|
|
1045
1045
|
[t]
|
|
1046
1046
|
), Q = P(
|
|
@@ -1055,7 +1055,7 @@ function Ur({
|
|
|
1055
1055
|
fields: u || [],
|
|
1056
1056
|
metrics: v || []
|
|
1057
1057
|
};
|
|
1058
|
-
if (!
|
|
1058
|
+
if (!L(o.control.type))
|
|
1059
1059
|
return {
|
|
1060
1060
|
fields: u || [],
|
|
1061
1061
|
metrics: v || []
|
|
@@ -1079,7 +1079,7 @@ function Ur({
|
|
|
1079
1079
|
u,
|
|
1080
1080
|
v,
|
|
1081
1081
|
o,
|
|
1082
|
-
|
|
1082
|
+
L,
|
|
1083
1083
|
g
|
|
1084
1084
|
]);
|
|
1085
1085
|
ie(() => {
|
|
@@ -1092,7 +1092,7 @@ function Ur({
|
|
|
1092
1092
|
}), O(null), X(null));
|
|
1093
1093
|
}, [a, p, F, t]);
|
|
1094
1094
|
const be = (e) => {
|
|
1095
|
-
if (!
|
|
1095
|
+
if (!L(e.type))
|
|
1096
1096
|
return {
|
|
1097
1097
|
fields: u || [],
|
|
1098
1098
|
metrics: v || []
|
|
@@ -1119,7 +1119,7 @@ function Ur({
|
|
|
1119
1119
|
})) : []
|
|
1120
1120
|
};
|
|
1121
1121
|
}, _ = (e) => {
|
|
1122
|
-
if (!
|
|
1122
|
+
if (!L(e.control.type))
|
|
1123
1123
|
return {
|
|
1124
1124
|
nextControl: e.control,
|
|
1125
1125
|
cardBindingsById: void 0
|
|
@@ -1128,7 +1128,7 @@ function Ur({
|
|
|
1128
1128
|
controlType: e.control.type,
|
|
1129
1129
|
participants: g || [],
|
|
1130
1130
|
selectedCardIds: e.nextSelectedCardIds
|
|
1131
|
-
}), b =
|
|
1131
|
+
}), b = qt({
|
|
1132
1132
|
control: e.control,
|
|
1133
1133
|
choices: i.choices
|
|
1134
1134
|
}), C = Object.fromEntries(
|
|
@@ -1150,7 +1150,7 @@ function Ur({
|
|
|
1150
1150
|
const b = e.map((C) => (Ne({
|
|
1151
1151
|
control: C,
|
|
1152
1152
|
defaultValues: c
|
|
1153
|
-
}),
|
|
1153
|
+
}), It(
|
|
1154
1154
|
C
|
|
1155
1155
|
)));
|
|
1156
1156
|
l(b, c, i);
|
|
@@ -1203,7 +1203,7 @@ function Ur({
|
|
|
1203
1203
|
cardBindingsById: k,
|
|
1204
1204
|
affectedBindingControlIds: y
|
|
1205
1205
|
});
|
|
1206
|
-
},
|
|
1206
|
+
}, A = (e, c) => {
|
|
1207
1207
|
if (!c.trim())
|
|
1208
1208
|
return;
|
|
1209
1209
|
const i = lr(c);
|
|
@@ -1268,12 +1268,12 @@ function Ur({
|
|
|
1268
1268
|
}, ye = (() => {
|
|
1269
1269
|
if (!o)
|
|
1270
1270
|
return !1;
|
|
1271
|
-
if (o.step === 2 &&
|
|
1271
|
+
if (o.step === 2 && L(o.control.type))
|
|
1272
1272
|
return (o.selectedCardIds || []).length > 0;
|
|
1273
1273
|
if (o.step !== 2 && o.step !== 3 || !o.control.label.trim())
|
|
1274
1274
|
return !1;
|
|
1275
1275
|
const c = o.control.source.kind === "sql_query" ? o.control : Qe(o.control);
|
|
1276
|
-
if (c.source.kind === "manual" && (
|
|
1276
|
+
if (c.source.kind === "manual" && (Ft(c) && c.source.options.length === 0 || c.source.options.some(
|
|
1277
1277
|
(b) => b.label.trim().length === 0 || b.value.trim().length === 0
|
|
1278
1278
|
)))
|
|
1279
1279
|
return !1;
|
|
@@ -1281,14 +1281,14 @@ function Ur({
|
|
|
1281
1281
|
const { connectionId: i, sql: b, valueColumn: C } = c.source;
|
|
1282
1282
|
return i.trim().length > 0 && b.trim().length > 0 && C.trim().length > 0;
|
|
1283
1283
|
}
|
|
1284
|
-
return
|
|
1284
|
+
return Vt(
|
|
1285
1285
|
me(c, o.defaultValue)
|
|
1286
1286
|
);
|
|
1287
1287
|
})(), Me = () => {
|
|
1288
1288
|
var k;
|
|
1289
1289
|
if (!o)
|
|
1290
1290
|
return;
|
|
1291
|
-
const e = Qe(o.control), c =
|
|
1291
|
+
const e = Qe(o.control), c = Lt({
|
|
1292
1292
|
label: e.label,
|
|
1293
1293
|
fallbackId: e.id,
|
|
1294
1294
|
existingControls: a,
|
|
@@ -1355,7 +1355,7 @@ function Ur({
|
|
|
1355
1355
|
}
|
|
1356
1356
|
);
|
|
1357
1357
|
O(c), D(null), N == null || N();
|
|
1358
|
-
}, [a, o, s, E, N]), bt = o ?
|
|
1358
|
+
}, [a, o, s, E, N]), bt = o ? L(o.control.type) ? ["Choose type", "Select cards", "Configure", "Finish"] : ["Choose type", "Configure", "Finish"] : [], Ue = o != null && o.createdControlId ? `[[param.${o.createdControlId}]]` : o ? `[[param.${Tt(o.control.label) || o.control.id}]]` : "", xe = $e({
|
|
1359
1359
|
controls: a,
|
|
1360
1360
|
defaultValues: s
|
|
1361
1361
|
}), Ce = o ? [...a, o.control] : a, ze = o ? $e({
|
|
@@ -1439,7 +1439,7 @@ function Ur({
|
|
|
1439
1439
|
)
|
|
1440
1440
|
] });
|
|
1441
1441
|
})(),
|
|
1442
|
-
o.step === 2 &&
|
|
1442
|
+
o.step === 2 && L(o.control.type) && /* @__PURE__ */ m("div", { className: "space-y-3", children: [
|
|
1443
1443
|
/* @__PURE__ */ m("div", { className: "space-y-3", children: [
|
|
1444
1444
|
/* @__PURE__ */ r(
|
|
1445
1445
|
ht,
|
|
@@ -1523,7 +1523,7 @@ function Ur({
|
|
|
1523
1523
|
}
|
|
1524
1524
|
)
|
|
1525
1525
|
] }),
|
|
1526
|
-
o.step === 2 && !
|
|
1526
|
+
o.step === 2 && !L(o.control.type) && /* @__PURE__ */ r(
|
|
1527
1527
|
Ge,
|
|
1528
1528
|
{
|
|
1529
1529
|
control: o.control,
|
|
@@ -1548,7 +1548,7 @@ function Ur({
|
|
|
1548
1548
|
nextDisabled: !ye
|
|
1549
1549
|
}
|
|
1550
1550
|
),
|
|
1551
|
-
o.step === 3 &&
|
|
1551
|
+
o.step === 3 && L(o.control.type) && /* @__PURE__ */ r(
|
|
1552
1552
|
Ge,
|
|
1553
1553
|
{
|
|
1554
1554
|
control: o.control,
|
|
@@ -1573,7 +1573,7 @@ function Ur({
|
|
|
1573
1573
|
nextDisabled: !ye
|
|
1574
1574
|
}
|
|
1575
1575
|
),
|
|
1576
|
-
o.step === 3 && !
|
|
1576
|
+
o.step === 3 && !L(o.control.type) && /* @__PURE__ */ r(
|
|
1577
1577
|
Je,
|
|
1578
1578
|
{
|
|
1579
1579
|
control: o.control,
|
|
@@ -1597,7 +1597,7 @@ function Ur({
|
|
|
1597
1597
|
onDone: Oe
|
|
1598
1598
|
}
|
|
1599
1599
|
),
|
|
1600
|
-
o.step === 4 &&
|
|
1600
|
+
o.step === 4 && L(o.control.type) && /* @__PURE__ */ r(
|
|
1601
1601
|
Je,
|
|
1602
1602
|
{
|
|
1603
1603
|
control: o.control,
|
|
@@ -1737,7 +1737,7 @@ function Ur({
|
|
|
1737
1737
|
)
|
|
1738
1738
|
] })
|
|
1739
1739
|
] }),
|
|
1740
|
-
|
|
1740
|
+
L(e.type) ? /* @__PURE__ */ r(
|
|
1741
1741
|
er,
|
|
1742
1742
|
{
|
|
1743
1743
|
type: e.type,
|
|
@@ -1825,7 +1825,7 @@ function Ur({
|
|
|
1825
1825
|
sr,
|
|
1826
1826
|
{
|
|
1827
1827
|
controlId: e.id,
|
|
1828
|
-
onCommit: (y) =>
|
|
1828
|
+
onCommit: (y) => A(e.id, y)
|
|
1829
1829
|
},
|
|
1830
1830
|
e.id
|
|
1831
1831
|
)
|
|
@@ -1923,11 +1923,11 @@ function zr(t) {
|
|
|
1923
1923
|
}
|
|
1924
1924
|
export {
|
|
1925
1925
|
Ur as C,
|
|
1926
|
-
|
|
1926
|
+
Lr as E,
|
|
1927
1927
|
dr as L,
|
|
1928
1928
|
_r as V,
|
|
1929
1929
|
Mr as a,
|
|
1930
|
-
|
|
1930
|
+
Ar as b,
|
|
1931
1931
|
qr as c,
|
|
1932
1932
|
cr as d,
|
|
1933
1933
|
zr as e,
|
|
@@ -1936,5 +1936,5 @@ export {
|
|
|
1936
1936
|
mr as h,
|
|
1937
1937
|
Or as i,
|
|
1938
1938
|
Vr as r,
|
|
1939
|
-
|
|
1939
|
+
Ae as u
|
|
1940
1940
|
};
|