@pitcher/canvas-ui 2026.1.9-124939-beta → 2026.1.9-131543-beta

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/canvas-ui.js CHANGED
@@ -99252,6 +99252,25 @@ const INITIAL_CALL_STATE = {
99252
99252
  };
99253
99253
 
99254
99254
  const realTimeExtraCrmShape = ref({});
99255
+ function buildSchemaFromData(data) {
99256
+ if (data === null || data === void 0) {
99257
+ return null;
99258
+ }
99259
+ if (Array.isArray(data)) {
99260
+ if (data.length === 0) {
99261
+ return [];
99262
+ }
99263
+ return [buildSchemaFromData(data[0])];
99264
+ }
99265
+ if (typeof data === "object") {
99266
+ const schema = {};
99267
+ for (const [key, value] of Object.entries(data)) {
99268
+ schema[key] = buildSchemaFromData(value);
99269
+ }
99270
+ return schema;
99271
+ }
99272
+ return null;
99273
+ }
99255
99274
  function isEmptyValue(value) {
99256
99275
  return !value || typeof value === "string" && value.trim() === "";
99257
99276
  }
@@ -99271,6 +99290,7 @@ function removeEmptyValues(obj) {
99271
99290
  return result;
99272
99291
  }
99273
99292
  function useCrmShape() {
99293
+ const { activeCanvas } = useCanvas$1();
99274
99294
  const call = useLocalStorage(CALL_STORAGE_KEY, INITIAL_CALL_STATE, {
99275
99295
  deep: true,
99276
99296
  listenToStorageChanges: true
@@ -99287,6 +99307,13 @@ function useCrmShape() {
99287
99307
  "myUser",
99288
99308
  computed(() => null)
99289
99309
  );
99310
+ const pitcherDataSchema = computed(() => {
99311
+ const pitcherData = activeCanvas.value?.context?.pitcher_data;
99312
+ if (!pitcherData || typeof pitcherData !== "object") {
99313
+ return {};
99314
+ }
99315
+ return { pitcher_data: buildSchemaFromData(pitcherData) };
99316
+ });
99290
99317
  function getDefaultCrmShape({
99291
99318
  accountName = "",
99292
99319
  myUser: myUser2 = null,
@@ -99325,7 +99352,9 @@ function useCrmShape() {
99325
99352
  showDefault: !!launchDarkly.value.enable_default_crm_shape
99326
99353
  }),
99327
99354
  isEmpty(realTimeExtraCrmShape.value) ? {} : realTimeExtraCrmShape.value,
99328
- isEmpty(extraCrmShape.value) ? {} : extraCrmShape.value
99355
+ isEmpty(extraCrmShape.value) ? {} : extraCrmShape.value,
99356
+ // Derive schema from actual pitcher_data in canvas context
99357
+ isEmpty(pitcherDataSchema.value) ? {} : pitcherDataSchema.value
99329
99358
  );
99330
99359
  });
99331
99360
  return {
@@ -120825,7 +120854,7 @@ function useCanvasContext() {
120825
120854
  };
120826
120855
  const crmShapeWithSectionCtx = computed(() => {
120827
120856
  const mergedCtx = getSectionCtx();
120828
- return !isEmpty(crmShape.value) ? { ...mergedCtx, ...crmShape.value } : mergedCtx;
120857
+ return !isEmpty(crmShape.value) ? merge$1({}, crmShape.value, mergedCtx) : mergedCtx;
120829
120858
  });
120830
120859
  return {
120831
120860
  getSectionCtx,