@pitcher/canvas-ui 2026.1.14-133826-beta → 2026.1.14-133846-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
@@ -88219,15 +88219,14 @@ async function crmQueryAdaptive(payload) {
88219
88219
  } catch {
88220
88220
  useSmartStore = false;
88221
88221
  }
88222
- console.log(`[crmQueryAdaptive] Called query: `, query2);
88222
+ console.log(`crmQueryAdaptive called with the query: `, query2);
88223
88223
  if (useSmartStore) {
88224
88224
  const fields = extractFieldsFromSoql(query2);
88225
88225
  const objectName = extractObjectFromSoql(query2);
88226
88226
  const smartQuery = convertSoqlToSmartQuery(query2);
88227
- console.log(`[crmSmartQuery] Called query: `, smartQuery);
88227
+ console.log(`Smart Query: `, smartQuery);
88228
88228
  const smartStoreResults = await crmSmartQuery({ query: smartQuery });
88229
88229
  const records = transformSmartStoreResults(smartStoreResults, fields, objectName);
88230
- console.log(`[SmartStore] Results: `, records);
88231
88230
  return {
88232
88231
  records,
88233
88232
  totalSize: records.length
@@ -99253,25 +99252,6 @@ const INITIAL_CALL_STATE = {
99253
99252
  };
99254
99253
 
99255
99254
  const realTimeExtraCrmShape = ref({});
99256
- function buildSchemaFromData(data) {
99257
- if (data === null || data === void 0) {
99258
- return null;
99259
- }
99260
- if (Array.isArray(data)) {
99261
- if (data.length === 0) {
99262
- return [];
99263
- }
99264
- return [buildSchemaFromData(data[0])];
99265
- }
99266
- if (typeof data === "object") {
99267
- const schema = {};
99268
- for (const [key, value] of Object.entries(data)) {
99269
- schema[key] = buildSchemaFromData(value);
99270
- }
99271
- return schema;
99272
- }
99273
- return null;
99274
- }
99275
99255
  function isEmptyValue(value) {
99276
99256
  return !value || typeof value === "string" && value.trim() === "";
99277
99257
  }
@@ -99291,7 +99271,6 @@ function removeEmptyValues(obj) {
99291
99271
  return result;
99292
99272
  }
99293
99273
  function useCrmShape() {
99294
- const { activeCanvas } = useCanvas$1();
99295
99274
  const call = useLocalStorage(CALL_STORAGE_KEY, INITIAL_CALL_STATE, {
99296
99275
  deep: true,
99297
99276
  listenToStorageChanges: true
@@ -99308,13 +99287,6 @@ function useCrmShape() {
99308
99287
  "myUser",
99309
99288
  computed(() => null)
99310
99289
  );
99311
- const pitcherDataSchema = computed(() => {
99312
- const pitcherData = activeCanvas.value?.context?.pitcher_data;
99313
- if (!pitcherData || typeof pitcherData !== "object") {
99314
- return {};
99315
- }
99316
- return { pitcher_data: buildSchemaFromData(pitcherData) };
99317
- });
99318
99290
  function getDefaultCrmShape({
99319
99291
  accountName = "",
99320
99292
  myUser: myUser2 = null,
@@ -99353,9 +99325,7 @@ function useCrmShape() {
99353
99325
  showDefault: !!launchDarkly.value.enable_default_crm_shape
99354
99326
  }),
99355
99327
  isEmpty(realTimeExtraCrmShape.value) ? {} : realTimeExtraCrmShape.value,
99356
- isEmpty(extraCrmShape.value) ? {} : extraCrmShape.value,
99357
- // Derive schema from actual pitcher_data in canvas context
99358
- isEmpty(pitcherDataSchema.value) ? {} : pitcherDataSchema.value
99328
+ isEmpty(extraCrmShape.value) ? {} : extraCrmShape.value
99359
99329
  );
99360
99330
  });
99361
99331
  return {
@@ -109616,9 +109586,11 @@ const _sfc_main$4U = /* @__PURE__ */ defineComponent({
109616
109586
  function filterByItemVisibility(items) {
109617
109587
  const isAdmin = state$3.appName.value === "admin";
109618
109588
  return items.reduce((acc, item) => {
109589
+ const hasCountData = "files_count" in item || "folders_count" in item || "available_files_count" in item || "available_folders_count" in item;
109619
109590
  const filesCount = item.available_files_count ?? item.files_count ?? 0;
109620
109591
  const foldersCount = item.available_folders_count ?? item.folders_count ?? 0;
109621
- const shouldHideItem = item.name?.startsWith(".") || item.type == "folder" && filesCount === 0 && foldersCount === 0 || item.folder?.file_thumbnail_urls?.length === 0;
109592
+ const isFolderEmpty = item.type == "folder" && hasCountData && filesCount === 0 && foldersCount === 0;
109593
+ const shouldHideItem = item.name?.startsWith(".") || isFolderEmpty || item.folder?.file_thumbnail_urls?.length === 0;
109622
109594
  if (!shouldHideItem && !isAdmin || isAdmin) {
109623
109595
  acc.push({
109624
109596
  ...item,
@@ -109995,7 +109967,8 @@ const getInitialState$1 = () => ({
109995
109967
  // instance metadata template fields dictionary
109996
109968
  searchQuery: "",
109997
109969
  searchMetadataFilters: {},
109998
- filteredItems: []
109970
+ filteredItems: [],
109971
+ folderCache: {}
109999
109972
  });
110000
109973
  const state$2 = reactive(getInitialState$1());
110001
109974
  const fileOrderedStatuses = [FileStatusEnum.PENDING, FileStatusEnum.VIEWABLE];
@@ -110080,6 +110053,15 @@ function updateFolderState(folder) {
110080
110053
  state$2.folders = folder.folders;
110081
110054
  state$2.files = folder.files;
110082
110055
  state$2.currentFolderPath = folder.path;
110056
+ folder.folders.forEach((subfolder) => {
110057
+ state$2.folderCache[subfolder.id] = {
110058
+ files_count: subfolder.files_count,
110059
+ folders_count: subfolder.folders_count,
110060
+ available_files_count: subfolder.available_files_count,
110061
+ available_folders_count: subfolder.available_folders_count,
110062
+ timestamp: Date.now()
110063
+ };
110064
+ });
110083
110065
  if (useAppStore$4().showFilteredResults.value) {
110084
110066
  const filesById = new Map(state$2.files.map((file) => [file.id, file]));
110085
110067
  state$2.filteredItems = state$2.filteredItems.map((filteredItem) => {
@@ -110344,7 +110326,24 @@ function init({
110344
110326
  }
110345
110327
  let filteredFolders = [];
110346
110328
  if (!hasMetadataFilters && foldersResponse.status === "fulfilled" && foldersResponse.value) {
110347
- filteredFolders = foldersResponse.value.results?.map((f) => ({ ...f, type: "folder" })) ?? [];
110329
+ const foldersFromSearch = foldersResponse.value.results ?? [];
110330
+ filteredFolders = foldersFromSearch.map((folder) => {
110331
+ const cached = state$2.folderCache[folder.id];
110332
+ if (cached) {
110333
+ const result = {
110334
+ ...folder,
110335
+ type: "folder"
110336
+ };
110337
+ if (cached.files_count !== void 0) result.files_count = cached.files_count;
110338
+ if (cached.folders_count !== void 0) result.folders_count = cached.folders_count;
110339
+ if (cached.available_files_count !== void 0) result.available_files_count = cached.available_files_count;
110340
+ if (cached.available_folders_count !== void 0) {
110341
+ result.available_folders_count = cached.available_folders_count;
110342
+ }
110343
+ return result;
110344
+ }
110345
+ return { ...folder, type: "folder" };
110346
+ });
110348
110347
  } else if (!hasMetadataFilters && !useAppStore$4().isLocalSearch.value) {
110349
110348
  console.error(
110350
110349
  "Failed to fetch folders:",
@@ -120825,7 +120824,7 @@ const _sfc_main$4k = /* @__PURE__ */ defineComponent({
120825
120824
 
120826
120825
  function useCanvasContext() {
120827
120826
  const { activeCanvas, isPrintDisplayMode, builderCache } = useCanvas$1();
120828
- const { crmShape, getDefaultCrmShape } = useCrmShape();
120827
+ const { getDefaultCrmShape } = useCrmShape();
120829
120828
  const myUser = inject(
120830
120829
  "myUser",
120831
120830
  computed(() => null)
@@ -120857,21 +120856,14 @@ function useCanvasContext() {
120857
120856
  builderCache.value[sectionOverrideKey] = mergedCtx;
120858
120857
  return mergedCtx;
120859
120858
  };
120860
- const fullContext = computed(() => {
120859
+ const crmShape = computed(() => getDefaultCrmShape({ myUser: myUser.value }));
120860
+ const crmShapeWithSectionCtx = computed(() => {
120861
120861
  const mergedCtx = getSectionCtx();
120862
- const defaultShape = getDefaultCrmShape({
120863
- myUser: myUser.value,
120864
- showDefault: true
120865
- });
120866
- return mergeWith({}, defaultShape, crmShape.value ?? {}, mergedCtx, (_objValue, srcValue) => {
120867
- if (Array.isArray(srcValue)) {
120868
- return srcValue;
120869
- }
120870
- return void 0;
120871
- });
120862
+ return !isEmpty(crmShape.value) ? { ...mergedCtx, ...crmShape.value } : mergedCtx;
120872
120863
  });
120873
120864
  return {
120874
- fullContext
120865
+ getSectionCtx,
120866
+ crmShapeWithSectionCtx
120875
120867
  };
120876
120868
  }
120877
120869
 
@@ -120917,10 +120909,10 @@ const _sfc_main$4j = /* @__PURE__ */ defineComponent({
120917
120909
  __name: "SelectionPanel",
120918
120910
  setup(__props) {
120919
120911
  useCssVars((_ctx) => ({
120920
- "7e857d3a": unref(themeVars).text,
120921
- "7e7d3ede": unref(themeVars).base,
120922
- "e1e1c7fe": unref(themeVars).primary6,
120923
- "e1e1c804": unref(themeVars).primary3
120912
+ "6fe3245a": unref(themeVars).text,
120913
+ "6fdae5fe": unref(themeVars).base,
120914
+ "85f799be": unref(themeVars).primary6,
120915
+ "85f799c4": unref(themeVars).primary3
120924
120916
  }));
120925
120917
  const { t } = useI18n();
120926
120918
  const { renderContentType, isFileExpired, isFileExpiring } = useFileDisplayHelpers();
@@ -120942,7 +120934,7 @@ const _sfc_main$4j = /* @__PURE__ */ defineComponent({
120942
120934
  "launchDarkly",
120943
120935
  computed(() => ({}))
120944
120936
  );
120945
- const { fullContext } = useCanvasContext();
120937
+ const { crmShapeWithSectionCtx } = useCanvasContext();
120946
120938
  const isCrmShapeEnabled = computed(() => launchDarkly.value?.enable_crm_shape_for_external_links ?? false);
120947
120939
  const draggableItems = computed({
120948
120940
  get: () => isDragNDropEnabled.value ? addedItems.value : selectedItems.value,
@@ -120957,7 +120949,7 @@ const _sfc_main$4j = /* @__PURE__ */ defineComponent({
120957
120949
  function getParsedUrl(url) {
120958
120950
  if (!url || !isCrmShapeEnabled.value) return url;
120959
120951
  try {
120960
- return renderTemplate(url, fullContext.value);
120952
+ return renderTemplate(url, crmShapeWithSectionCtx.value);
120961
120953
  } catch (error) {
120962
120954
  console.warn("Failed to parse template in external URL, using original URL:", error);
120963
120955
  return url;
@@ -121261,7 +121253,7 @@ const _sfc_main$4j = /* @__PURE__ */ defineComponent({
121261
121253
  }
121262
121254
  });
121263
121255
 
121264
- const SelectionPanel = /* @__PURE__ */ _export_sfc(_sfc_main$4j, [["__scopeId", "data-v-05db071e"]]);
121256
+ const SelectionPanel = /* @__PURE__ */ _export_sfc(_sfc_main$4j, [["__scopeId", "data-v-aa03fa77"]]);
121265
121257
 
121266
121258
  const _hoisted_1$3q = { class: "flex justify-between gap-2 items-center truncate py-1" };
121267
121259
  const _hoisted_2$2z = {
@@ -123793,13 +123785,13 @@ const _sfc_main$45 = /* @__PURE__ */ defineComponent({
123793
123785
  computed(() => ({}))
123794
123786
  );
123795
123787
  const { crmShape } = useCrmShape();
123796
- const { fullContext } = useCanvasContext();
123788
+ const { crmShapeWithSectionCtx } = useCanvasContext();
123797
123789
  const isCrmShapeEnabled = computed(() => launchDarkly.value?.enable_crm_shape_for_external_links ?? false);
123798
123790
  const parsedUrl = computed(() => {
123799
123791
  if (!url.value.trim()) return url.value;
123800
123792
  if (!isCrmShapeEnabled.value) return url.value;
123801
123793
  try {
123802
- return renderTemplate(url.value, fullContext.value);
123794
+ return renderTemplate(url.value, crmShapeWithSectionCtx.value);
123803
123795
  } catch (error) {
123804
123796
  console.error("Error parsing URL template:", error);
123805
123797
  return url.value;
@@ -123905,7 +123897,7 @@ const _sfc_main$45 = /* @__PURE__ */ defineComponent({
123905
123897
  }
123906
123898
  });
123907
123899
 
123908
- const ExternalLinks = /* @__PURE__ */ _export_sfc(_sfc_main$45, [["__scopeId", "data-v-ba7b39ff"]]);
123900
+ const ExternalLinks = /* @__PURE__ */ _export_sfc(_sfc_main$45, [["__scopeId", "data-v-1287b675"]]);
123909
123901
 
123910
123902
  const _hoisted_1$3d = { class: "mr-3 h-full" };
123911
123903
  const _hoisted_2$2m = { class: "flex flex-col gap-3 mb-3" };
@@ -137726,37 +137718,19 @@ function useComponentPermissions({
137726
137718
  isAnyTypeOfAdmin: false
137727
137719
  }))
137728
137720
  );
137729
- const launchDarkly = inject(
137730
- "launchDarkly",
137731
- computed(() => ({}))
137732
- );
137733
- const { canvasContent, activeCanvas } = useCanvas$1();
137721
+ const { canvasContent } = useCanvas$1();
137734
137722
  return computed(() => {
137735
- if (usedInSectionId.value) {
137736
- const parent = findParentByNodeId(canvasContent.value, id.value);
137737
- const canRemove = !!when_used_in_section.value?.is_removable;
137738
- const canEdit = !!when_used_in_section.value?.is_editable;
137739
- const canDuplicate = parent ? !!parent.when_used_in_section?.is_editable : false;
137740
- return {
137741
- hasSomethingEditable: canEdit || canRemove || canDuplicate,
137742
- canRemove,
137743
- canEdit,
137744
- canDuplicate
137745
- };
137746
- }
137747
- const hasExplicitPermissions = when_used_in_section.value !== null && when_used_in_section.value !== void 0 && (when_used_in_section.value.is_editable !== void 0 || when_used_in_section.value.is_removable !== void 0);
137748
- if (activeCanvas.value?.template?.id && launchDarkly.value.enable_template_component_permissions && hasExplicitPermissions) {
137749
- const canRemove = !!when_used_in_section.value?.is_removable;
137750
- const canEdit = !!when_used_in_section.value?.is_editable;
137751
- const canDuplicate = canEdit;
137752
- return {
137753
- hasSomethingEditable: canEdit || canRemove || canDuplicate,
137754
- canRemove,
137755
- canEdit,
137756
- canDuplicate
137757
- };
137758
- }
137759
- return calculateCanvasPermissions(id.value, !!pitcherInfo.value?.isAnyTypeOfAdmin);
137723
+ if (!usedInSectionId.value) return calculateCanvasPermissions(id.value, !!pitcherInfo.value?.isAnyTypeOfAdmin);
137724
+ const parent = findParentByNodeId(canvasContent.value, id.value);
137725
+ const canRemove = !!when_used_in_section.value?.is_removable;
137726
+ const canEdit = !!when_used_in_section.value?.is_editable;
137727
+ const canDuplicate = parent ? !!parent.when_used_in_section?.is_editable : false;
137728
+ return {
137729
+ hasSomethingEditable: canEdit || canRemove || canDuplicate,
137730
+ canRemove,
137731
+ canEdit,
137732
+ canDuplicate
137733
+ };
137760
137734
  });
137761
137735
  }
137762
137736
 
@@ -148009,7 +147983,7 @@ const _sfc_main$2i = /* @__PURE__ */ defineComponent({
148009
147983
  } = useCanvas$1();
148010
147984
  const { discardOverridesConfirmationOptions, getComponentOverrides } = useCanvasSectionOverrides();
148011
147985
  const { getDerivedStyleFromFeatureFlags } = useComponentStyle(componentNode);
148012
- const { fullContext } = useCanvasContext();
147986
+ const { crmShapeWithSectionCtx } = useCanvasContext();
148013
147987
  const { setContentSelectorMode } = useContentSelector();
148014
147988
  const confirmation = useConfirmation();
148015
147989
  const themeVars = useThemeVars();
@@ -148162,7 +148136,7 @@ const _sfc_main$2i = /* @__PURE__ */ defineComponent({
148162
148136
  try {
148163
148137
  return {
148164
148138
  ...value,
148165
- external_url: renderTemplate(value.external_url, fullContext.value)
148139
+ external_url: renderTemplate(value.external_url, crmShapeWithSectionCtx.value)
148166
148140
  };
148167
148141
  } catch (error) {
148168
148142
  console.warn("Failed to parse template in external URL, using original URL:", error);
@@ -148680,7 +148654,7 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
148680
148654
  setCanvasMetadata,
148681
148655
  isImpact
148682
148656
  } = useCanvas$1();
148683
- const { fullContext } = useCanvasContext();
148657
+ const { crmShapeWithSectionCtx } = useCanvasContext();
148684
148658
  const { coreRestApiAxios } = useCoreApi();
148685
148659
  const { applyPrintModeToElement } = usePrintMode();
148686
148660
  const { discardOverridesConfirmationOptions, getComponentOverrides } = useCanvasSectionOverrides();
@@ -148737,7 +148711,7 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
148737
148711
  const memoizedModelValue = computed(() => getModelValue(computedTextProps.value.data?.content));
148738
148712
  function getModelValue(value = "") {
148739
148713
  if (!shouldInterpolate.value || !value.trim()) return value;
148740
- return renderTemplate(value, fullContext.value);
148714
+ return renderTemplate(value, crmShapeWithSectionCtx.value);
148741
148715
  }
148742
148716
  const debouncedUpdateNodeData = debounce((data2, nodeId, sectionId) => {
148743
148717
  return updateNodeData(data2, nodeId, sectionId);
@@ -148845,7 +148819,7 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
148845
148819
  );
148846
148820
  applyPrintModeToElement(contentElement.value, () => {
148847
148821
  const content = computedTextProps.value.data?.content || "";
148848
- return shouldInterpolate.value ? renderTemplate(content, fullContext.value) : content;
148822
+ return shouldInterpolate.value ? renderTemplate(content, crmShapeWithSectionCtx.value) : content;
148849
148823
  });
148850
148824
  if (enableScaleContent && spanStyles) {
148851
148825
  setTimeout(() => {
@@ -148957,7 +148931,7 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
148957
148931
  }
148958
148932
  });
148959
148933
 
148960
- const Text = /* @__PURE__ */ _export_sfc(_sfc_main$2h, [["__scopeId", "data-v-73a884c3"]]);
148934
+ const Text = /* @__PURE__ */ _export_sfc(_sfc_main$2h, [["__scopeId", "data-v-b2424519"]]);
148961
148935
 
148962
148936
  const _hoisted_1$1Q = { class: "absolute top-2 right-2 flex items-center gap-1 z-10" };
148963
148937
  const _hoisted_2$1m = { class: "text-xs" };
@@ -156733,9 +156707,7 @@ const _sfc_main$1P = /* @__PURE__ */ defineComponent({
156733
156707
  visible: {},
156734
156708
  allow_admins_to_overwrite: { type: Boolean },
156735
156709
  style: {},
156736
- printModeIdx: {},
156737
- when_used_in_section: { default: () => defaultWhenUsedInSection },
156738
- usedInSectionId: { default: "" }
156710
+ printModeIdx: {}
156739
156711
  },
156740
156712
  emits: ["style"],
156741
156713
  setup(__props, { emit: __emit }) {
@@ -156750,42 +156722,12 @@ const _sfc_main$1P = /* @__PURE__ */ defineComponent({
156750
156722
  computed(() => [])
156751
156723
  );
156752
156724
  const { isCompletionWizardEnabled, retriggerWizard } = useCanvasCompletionWizard();
156753
- const {
156754
- isImpact,
156755
- mode,
156756
- isEditMode,
156757
- componentSelectedMode,
156758
- isViewOnlyMode,
156759
- componentEditMode,
156760
- componentNodesById,
156761
- activeCanvas,
156762
- saveCanvasContentWithContext,
156763
- removeComponentById,
156764
- setComponentSelectedMode,
156765
- setComponentSettingsMode,
156766
- updateNodeDataById,
156767
- canvasContent
156768
- } = useCanvas$1();
156769
- const { id, usedInSectionId, when_used_in_section } = toRefs(props);
156770
- const componentPermissions = useComponentPermissions({
156771
- id,
156772
- usedInSectionId,
156773
- when_used_in_section
156774
- });
156775
- const isEditable = computed(() => {
156776
- if (!componentPermissions.value.canEdit) return false;
156777
- if (isImpact.value) {
156778
- return !props.data.selection_strategy || props.data.selection_strategy === "free" || isCompletionWizardEnabled.value && wizardStepSectionListIds.value.includes(props.id);
156779
- }
156780
- return true;
156781
- });
156782
- const isRemovable = computed(() => {
156783
- if (!componentPermissions.value.canRemove) return false;
156784
- if (isImpact.value) {
156785
- return !props.data.selection_strategy || props.data.selection_strategy === "free";
156786
- }
156787
- return true;
156788
- });
156725
+ const isEditable = computed(
156726
+ () => isImpact.value ? !props.data.selection_strategy || props.data.selection_strategy === "free" || isCompletionWizardEnabled.value && wizardStepSectionListIds.value.includes(props.id) : true
156727
+ );
156728
+ const isRemovable = computed(
156729
+ () => isImpact.value ? !props.data.selection_strategy || props.data.selection_strategy === "free" : true
156730
+ );
156789
156731
  const sectionSelectorAppSrc = computed(() => {
156790
156732
  if (!sectionSelectorApps.value?.length || !props.data.selection_app_name) return null;
156791
156733
  const relatedApp = sectionSelectorApps.value.find((app) => app.app_metadata?.name === props.data.selection_app_name);
@@ -156852,7 +156794,7 @@ const _sfc_main$1P = /* @__PURE__ */ defineComponent({
156852
156794
  async (selectedData) => {
156853
156795
  console.info(`[SectionList]: Received done callback for ${props.id} with data`, selectedData);
156854
156796
  if (!selectedData) return;
156855
- const sections = (selectedData?.section_ids || []).map((id2) => ({ id: typeof id2 === "string" ? id2 : id2.id }));
156797
+ const sections = (selectedData?.section_ids || []).map((id) => ({ id: typeof id === "string" ? id : id.id }));
156856
156798
  const updatedData = { ...props.data, sections };
156857
156799
  updateNodeDataById(props.id, updatedData);
156858
156800
  const currentContext = cloneDeep(activeCanvas.value?.context || {});
@@ -156878,6 +156820,22 @@ const _sfc_main$1P = /* @__PURE__ */ defineComponent({
156878
156820
  sectionListRef.value?.toggleSectionSelector();
156879
156821
  }
156880
156822
  }
156823
+ const {
156824
+ isImpact,
156825
+ mode,
156826
+ isEditMode,
156827
+ componentSelectedMode,
156828
+ isViewOnlyMode,
156829
+ componentEditMode,
156830
+ componentNodesById,
156831
+ activeCanvas,
156832
+ saveCanvasContentWithContext,
156833
+ removeComponentById,
156834
+ setComponentSelectedMode,
156835
+ setComponentSettingsMode,
156836
+ updateNodeDataById,
156837
+ canvasContent
156838
+ } = useCanvas$1();
156881
156839
  return (_ctx, _cache) => {
156882
156840
  return openBlock(), createElementBlock(Fragment, null, [
156883
156841
  unref(shouldDisplayPlaceholderComponent)(unref(isEditMode), unref(mode), _ctx.visible) ? (openBlock(), createBlock(PlaceholderComponent, {
@@ -156885,25 +156843,25 @@ const _sfc_main$1P = /* @__PURE__ */ defineComponent({
156885
156843
  name: _ctx.tracking_id
156886
156844
  }, null, 8, ["name"])) : unref(isEditMode) && !unref(isViewOnlyMode) ? (openBlock(), createBlock(_sfc_main$34, {
156887
156845
  key: 1,
156888
- id: unref(id),
156889
- active: unref(componentEditMode) && unref(componentEditMode)?.id === unref(id),
156846
+ id: _ctx.id,
156847
+ active: unref(componentEditMode) && unref(componentEditMode)?.id === _ctx.id,
156890
156848
  class: normalizeClass({ "mt-12": sectionListName.value }),
156891
156849
  edit: isEditable.value,
156892
156850
  "exclude-stylables": [unref(ThemeComponentOptionEnum).COLOR_PICKER],
156893
156851
  remove: isRemovable.value,
156894
- selected: unref(componentSelectedMode) && unref(componentSelectedMode)?.id === unref(id),
156852
+ selected: unref(componentSelectedMode) && unref(componentSelectedMode)?.id === _ctx.id,
156895
156853
  settings: "",
156896
156854
  stylable: "",
156897
156855
  style: normalizeStyle(unref(omit$1)(_ctx.style, "paddingBottom", "paddingLeft", "paddingTop", "paddingRight")),
156898
156856
  onEdit: handleEdit,
156899
- onRemove: _cache[0] || (_cache[0] = ($event) => unref(removeComponentById)(unref(id))),
156900
- onSelect: _cache[1] || (_cache[1] = ($event) => unref(setComponentSelectedMode)(unref(id))),
156901
- onSettings: _cache[2] || (_cache[2] = ($event) => unref(setComponentSettingsMode)(unref(id))),
156857
+ onRemove: _cache[0] || (_cache[0] = ($event) => unref(removeComponentById)(_ctx.id)),
156858
+ onSelect: _cache[1] || (_cache[1] = ($event) => unref(setComponentSelectedMode)(_ctx.id)),
156859
+ onSettings: _cache[2] || (_cache[2] = ($event) => unref(setComponentSettingsMode)(_ctx.id)),
156902
156860
  onStyle: _cache[3] || (_cache[3] = ($event) => emit("style", $event))
156903
156861
  }, {
156904
156862
  default: withCtx(() => [
156905
156863
  createVNode(RawSectionList, mergeProps({
156906
- id: unref(id),
156864
+ id: _ctx.id,
156907
156865
  ref_key: "sectionListRef",
156908
156866
  ref: sectionListRef,
156909
156867
  class: "pa-2",
@@ -156921,7 +156879,7 @@ const _sfc_main$1P = /* @__PURE__ */ defineComponent({
156921
156879
  _: 1
156922
156880
  }, 8, ["id", "active", "class", "edit", "exclude-stylables", "remove", "selected", "style"])) : (openBlock(), createBlock(RawSectionList, mergeProps({
156923
156881
  key: 2,
156924
- id: unref(id),
156882
+ id: _ctx.id,
156925
156883
  data: _ctx.data
156926
156884
  }, unref(attrs), {
156927
156885
  "has-section-selector-app": !!sectionSelectorAppSrc.value,
@@ -159449,8 +159407,7 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
159449
159407
  autofill: {},
159450
159408
  linkable: {},
159451
159409
  autofill_content_types: {},
159452
- when_used_in_section: { default: () => defaultWhenUsedInSection },
159453
- usedInSectionId: { default: "" }
159410
+ when_used_in_section: {}
159454
159411
  },
159455
159412
  emits: ["style"],
159456
159413
  setup(__props, { emit: __emit }) {
@@ -159461,42 +159418,12 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
159461
159418
  computed(() => [])
159462
159419
  );
159463
159420
  const { isCompletionWizardEnabled, retriggerWizard } = useCanvasCompletionWizard();
159464
- const {
159465
- isImpact,
159466
- mode,
159467
- isEditMode,
159468
- componentSelectedMode,
159469
- isViewOnlyMode,
159470
- componentEditMode,
159471
- componentNodesById,
159472
- activeCanvas,
159473
- saveCanvasContentWithContext,
159474
- removeComponentById,
159475
- setComponentSelectedMode,
159476
- setComponentSettingsMode,
159477
- updateNodeDataById,
159478
- canvasContent
159479
- } = useCanvas$1();
159480
- const { id, usedInSectionId, when_used_in_section } = toRefs(props);
159481
- const componentPermissions = useComponentPermissions({
159482
- id,
159483
- usedInSectionId,
159484
- when_used_in_section
159485
- });
159486
- const isEditable = computed(() => {
159487
- if (!componentPermissions.value.canEdit) return false;
159488
- if (isImpact.value) {
159489
- return !props.data.selection_strategy || props.data.selection_strategy === "free" || isCompletionWizardEnabled.value && wizardStepSectionListIds.value.includes(props.id);
159490
- }
159491
- return true;
159492
- });
159493
- const isRemovable = computed(() => {
159494
- if (!componentPermissions.value.canRemove) return false;
159495
- if (isImpact.value) {
159496
- return !props.data.selection_strategy || props.data.selection_strategy === "free";
159497
- }
159498
- return true;
159499
- });
159421
+ const isEditable = computed(
159422
+ () => isImpact.value ? !props.data.selection_strategy || props.data.selection_strategy === "free" || isCompletionWizardEnabled.value && wizardStepSectionListIds.value.includes(props.id) : true
159423
+ );
159424
+ const isRemovable = computed(
159425
+ () => isImpact.value ? !props.data.selection_strategy || props.data.selection_strategy === "free" : true
159426
+ );
159500
159427
  const sectionSelectorAppSrc = computed(() => {
159501
159428
  if (!sectionSelectorApps.value?.length || !props.data.selection_app_name) return null;
159502
159429
  const relatedApp = sectionSelectorApps.value.find((app) => app.app_metadata?.name === props.data.selection_app_name);
@@ -159562,7 +159489,7 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
159562
159489
  async (selectedData) => {
159563
159490
  console.info(`[SectionList]: Received done callback for ${props.id} with data`, selectedData);
159564
159491
  if (!selectedData) return;
159565
- const sections = (selectedData?.section_ids || []).map((id2) => ({ id: typeof id2 === "string" ? id2 : id2.id }));
159492
+ const sections = (selectedData?.section_ids || []).map((id) => ({ id: typeof id === "string" ? id : id.id }));
159566
159493
  const updatedData = { ...props.data, sections };
159567
159494
  updateNodeDataById(props.id, updatedData);
159568
159495
  const currentContext = cloneDeep(activeCanvas.value?.context || {});
@@ -159588,6 +159515,22 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
159588
159515
  contentListRef.value?.toggleSectionSelector();
159589
159516
  }
159590
159517
  }
159518
+ const {
159519
+ isImpact,
159520
+ mode,
159521
+ isEditMode,
159522
+ componentSelectedMode,
159523
+ isViewOnlyMode,
159524
+ componentEditMode,
159525
+ componentNodesById,
159526
+ activeCanvas,
159527
+ saveCanvasContentWithContext,
159528
+ removeComponentById,
159529
+ setComponentSelectedMode,
159530
+ setComponentSettingsMode,
159531
+ updateNodeDataById,
159532
+ canvasContent
159533
+ } = useCanvas$1();
159591
159534
  return (_ctx, _cache) => {
159592
159535
  return openBlock(), createElementBlock(Fragment, null, [
159593
159536
  unref(shouldDisplayPlaceholderComponent)(unref(isEditMode), unref(mode), _ctx.visible) ? (openBlock(), createBlock(PlaceholderComponent, {
@@ -159595,25 +159538,25 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
159595
159538
  name: _ctx.tracking_id
159596
159539
  }, null, 8, ["name"])) : unref(isEditMode) && !unref(isViewOnlyMode) ? (openBlock(), createBlock(_sfc_main$34, {
159597
159540
  key: 1,
159598
- id: unref(id),
159599
- active: unref(componentEditMode) && unref(componentEditMode)?.id === unref(id),
159541
+ id: _ctx.id,
159542
+ active: unref(componentEditMode) && unref(componentEditMode)?.id === _ctx.id,
159600
159543
  class: normalizeClass({ "mt-12": componentName.value }),
159601
159544
  edit: isEditable.value,
159602
159545
  "exclude-stylables": [unref(ThemeComponentOptionEnum).COLOR_PICKER],
159603
159546
  remove: isRemovable.value,
159604
- selected: unref(componentSelectedMode) && unref(componentSelectedMode)?.id === unref(id),
159547
+ selected: unref(componentSelectedMode) && unref(componentSelectedMode)?.id === _ctx.id,
159605
159548
  settings: "",
159606
159549
  stylable: "",
159607
159550
  style: normalizeStyle(unref(omit$1)(_ctx.style, "paddingBottom", "paddingLeft", "paddingTop", "paddingRight")),
159608
159551
  onEdit: handleEdit,
159609
- onRemove: _cache[0] || (_cache[0] = ($event) => unref(removeComponentById)(unref(id))),
159610
- onSelect: _cache[1] || (_cache[1] = ($event) => unref(setComponentSelectedMode)(unref(id))),
159611
- onSettings: _cache[2] || (_cache[2] = ($event) => unref(setComponentSettingsMode)(unref(id))),
159552
+ onRemove: _cache[0] || (_cache[0] = ($event) => unref(removeComponentById)(_ctx.id)),
159553
+ onSelect: _cache[1] || (_cache[1] = ($event) => unref(setComponentSelectedMode)(_ctx.id)),
159554
+ onSettings: _cache[2] || (_cache[2] = ($event) => unref(setComponentSettingsMode)(_ctx.id)),
159612
159555
  onStyle: _cache[3] || (_cache[3] = ($event) => emit("style", $event))
159613
159556
  }, {
159614
159557
  default: withCtx(() => [
159615
159558
  createVNode(ContentListRaw, mergeProps({
159616
- id: unref(id),
159559
+ id: _ctx.id,
159617
159560
  ref_key: "contentListRef",
159618
159561
  ref: contentListRef,
159619
159562
  class: ["pa-2", props.class],
@@ -159631,7 +159574,7 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
159631
159574
  _: 1
159632
159575
  }, 8, ["id", "active", "class", "edit", "exclude-stylables", "remove", "selected", "style"])) : (openBlock(), createBlock(ContentListRaw, mergeProps({
159633
159576
  key: 2,
159634
- id: unref(id),
159577
+ id: _ctx.id,
159635
159578
  data: _ctx.data
159636
159579
  }, unref(attrs), {
159637
159580
  "has-section-selector-app": !!sectionSelectorAppSrc.value,
@@ -162517,9 +162460,7 @@ const _sfc_main$1w = /* @__PURE__ */ defineComponent({
162517
162460
  isCanvasTemplate,
162518
162461
  isCanvas,
162519
162462
  isTemplate,
162520
- isSection,
162521
- parentIdByNodeId,
162522
- componentNodesById
162463
+ isSection
162523
162464
  } = useCanvas$1();
162524
162465
  const { getComponentDefaultVisibility } = useCanvasVisibility();
162525
162466
  const { crmShape } = useCrmShape();
@@ -162545,7 +162486,7 @@ const _sfc_main$1w = /* @__PURE__ */ defineComponent({
162545
162486
  );
162546
162487
  const areSectionsSystemControlled = computed(() => launchDarkly.value?.are_sections_system_controlled);
162547
162488
  const allowEditOrRemove = computed(
162548
- () => isAdmin.value && ((selectedComponentType.value === ComponentTypes.Text || selectedComponentType.value === ComponentTypes.Carousel || selectedComponentType.value === ComponentTypes.Multimedia) && isSection.value || launchDarkly.value.enable_template_component_permissions && isCanvasTemplate.value)
162489
+ () => (selectedComponentType.value === ComponentTypes.Text || selectedComponentType.value === ComponentTypes.Carousel || selectedComponentType.value === ComponentTypes.Multimedia) && isAdmin.value && isSection.value
162549
162490
  );
162550
162491
  const canSelectSectionListStrategy = computed(
162551
162492
  () => isAdmin.value && isCanvasTemplate.value && isSectionOrContentList.value
@@ -162606,27 +162547,7 @@ const _sfc_main$1w = /* @__PURE__ */ defineComponent({
162606
162547
  selectedContentGridDataPath.value = value || "";
162607
162548
  formValues.contentGridDataAccessor = value || "";
162608
162549
  }
162609
- function isComponentInsideSectionList() {
162610
- if (!activeSettingsNode.value?.id) return false;
162611
- let currentParentId = parentIdByNodeId.value[activeSettingsNode.value.id];
162612
- while (currentParentId) {
162613
- const parentNode = componentNodesById.value[currentParentId];
162614
- if (parentNode?.type === ComponentTypes.SectionList || parentNode?.type === ComponentTypes.ContentList) {
162615
- return true;
162616
- }
162617
- currentParentId = parentIdByNodeId.value[currentParentId];
162618
- }
162619
- return false;
162620
- }
162621
162550
  function getEditOrRemoveOption() {
162622
- if (!activeSettingsNode.value?.when_used_in_section) {
162623
- if (launchDarkly.value.enable_template_component_permissions && isCanvasTemplate.value && !isSection.value) {
162624
- if (isComponentInsideSectionList()) {
162625
- return "00";
162626
- }
162627
- return "11";
162628
- }
162629
- }
162630
162551
  const map = activeSettingsNode.value?.when_used_in_section ?? cloneDeep(defaultWhenUsedInSection);
162631
162552
  let value = "";
162632
162553
  value += map.is_editable ? "1" : "0";
@@ -163128,7 +163049,7 @@ const _sfc_main$1w = /* @__PURE__ */ defineComponent({
163128
163049
  }
163129
163050
  });
163130
163051
 
163131
- const ComponentDrawerSettings = /* @__PURE__ */ _export_sfc(_sfc_main$1w, [["__scopeId", "data-v-7724d85a"]]);
163052
+ const ComponentDrawerSettings = /* @__PURE__ */ _export_sfc(_sfc_main$1w, [["__scopeId", "data-v-dce6a881"]]);
163132
163053
 
163133
163054
  function useConnectUpload() {
163134
163055
  async function uploadToConnect(formData) {
@@ -176361,10 +176282,10 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
176361
176282
  __name: "ActionsToolbar",
176362
176283
  setup(__props) {
176363
176284
  useCssVars((_ctx) => ({
176364
- "c6ccac5c": unref(themeVars).primary4,
176365
- "3edbaaa2": unref(themeVars).primary,
176366
- "c6ccac58": unref(themeVars).primary6,
176367
- "0f45ae31": unref(themeVars).base
176285
+ "6b5e9219": unref(themeVars).primary4,
176286
+ "3d451d7b": unref(themeVars).primary,
176287
+ "6b5e921b": unref(themeVars).primary6,
176288
+ "42dfd1f8": unref(themeVars).base
176368
176289
  }));
176369
176290
  const {
176370
176291
  toggleContentPanel,
@@ -176592,7 +176513,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
176592
176513
  return (nameMatch || createdByMatch || tagMatch) && metadataMatch;
176593
176514
  });
176594
176515
  const folderResults = folders.map((folder) => {
176595
- return {
176516
+ const result = {
176596
176517
  id: folder.id,
176597
176518
  name: folder.name,
176598
176519
  folder_id: apiState.currentFolderId,
@@ -176604,6 +176525,11 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
176604
176525
  file_thumbnail_urls: folder.file_thumbnail_urls,
176605
176526
  thumbnail_url: folder.thumbnail_url
176606
176527
  };
176528
+ if (folder.files_count !== void 0) result.files_count = folder.files_count;
176529
+ if (folder.folders_count !== void 0) result.folders_count = folder.folders_count;
176530
+ if (folder.available_files_count !== void 0) result.available_files_count = folder.available_files_count;
176531
+ if (folder.available_folders_count !== void 0) result.available_folders_count = folder.available_folders_count;
176532
+ return result;
176607
176533
  });
176608
176534
  const fileResults = files.map((file) => {
176609
176535
  return {
@@ -176832,7 +176758,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
176832
176758
  }
176833
176759
  });
176834
176760
 
176835
- const ActionsToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-fecebf5a"]]);
176761
+ const ActionsToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-41ca4793"]]);
176836
176762
 
176837
176763
  const _sfc_main$t = /* @__PURE__ */ defineComponent({
176838
176764
  __name: "FavoritesTable",
@@ -183754,14 +183680,8 @@ function getEventColor(sfEvent) {
183754
183680
  } else {
183755
183681
  isSubmitted = false;
183756
183682
  }
183757
- const now = /* @__PURE__ */ new Date();
183758
183683
  if (isSubmitted) return SfEventColors.SUBMITTED;
183759
- else if (sfEvent.IsAllDayEvent) {
183760
- const endDate = new Date(sfEvent.EndDateTime);
183761
- const todayStart = startOfDay(now);
183762
- const endDayStart = startOfDay(endDate);
183763
- return isAfter$1(todayStart, endDayStart) ? SfEventColors.PAST : SfEventColors.PLANNED;
183764
- } else if (isAfter$1(now, new Date(sfEvent.EndDateTime))) return SfEventColors.PAST;
183684
+ else if (isAfter$1(/* @__PURE__ */ new Date(), new Date(sfEvent.EndDateTime))) return SfEventColors.PAST;
183765
183685
  else return SfEventColors.PLANNED;
183766
183686
  }
183767
183687
  const minFutureDate = (date = /* @__PURE__ */ new Date()) => add(date, { minutes: MIN_DIFFERENCE_IN_MINUTES });