@pitcher/canvas-ui 2026.1.15-103854-beta → 2026.1.15-141335-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.css CHANGED
@@ -2667,7 +2667,7 @@ to {
2667
2667
  padding: 0;
2668
2668
  }
2669
2669
 
2670
- .data-accessor-input[data-v-a4296e5c] .n-input__prefix {
2670
+ .data-accessor-input[data-v-dce6a881] .n-input__prefix {
2671
2671
  margin-right: 0;
2672
2672
  }
2673
2673
  .cb-dynamic-data-table-settings {
package/canvas-ui.js CHANGED
@@ -84630,10 +84630,6 @@ const defaultWhenUsedInSection = {
84630
84630
  is_editable: false,
84631
84631
  is_removable: false
84632
84632
  };
84633
- const defaultWhenUsedInTemplate = {
84634
- is_editable: true,
84635
- is_removable: true
84636
- };
84637
84633
  const SERVER_ONLY_PROPS = [
84638
84634
  "content_url",
84639
84635
  "thumbnail_url",
@@ -137874,37 +137870,19 @@ function useComponentPermissions({
137874
137870
  isAnyTypeOfAdmin: false
137875
137871
  }))
137876
137872
  );
137877
- const launchDarkly = inject(
137878
- "launchDarkly",
137879
- computed(() => ({}))
137880
- );
137881
- const { canvasContent, activeCanvas } = useCanvas$1();
137873
+ const { canvasContent } = useCanvas$1();
137882
137874
  return computed(() => {
137883
- if (usedInSectionId.value) {
137884
- const parent = findParentByNodeId(canvasContent.value, id.value);
137885
- const canRemove = !!when_used_in_section.value?.is_removable;
137886
- const canEdit = !!when_used_in_section.value?.is_editable;
137887
- const canDuplicate = parent ? !!parent.when_used_in_section?.is_editable : false;
137888
- return {
137889
- hasSomethingEditable: canEdit || canRemove || canDuplicate,
137890
- canRemove,
137891
- canEdit,
137892
- canDuplicate
137893
- };
137894
- }
137895
- 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);
137896
- if (activeCanvas.value?.template?.id && launchDarkly.value.enable_template_component_permissions && hasExplicitPermissions) {
137897
- const canRemove = !!when_used_in_section.value?.is_removable;
137898
- const canEdit = !!when_used_in_section.value?.is_editable;
137899
- const canDuplicate = canEdit;
137900
- return {
137901
- hasSomethingEditable: canEdit || canRemove || canDuplicate,
137902
- canRemove,
137903
- canEdit,
137904
- canDuplicate
137905
- };
137906
- }
137907
- return calculateCanvasPermissions(id.value, !!pitcherInfo.value?.isAnyTypeOfAdmin);
137875
+ if (!usedInSectionId.value) return calculateCanvasPermissions(id.value, !!pitcherInfo.value?.isAnyTypeOfAdmin);
137876
+ const parent = findParentByNodeId(canvasContent.value, id.value);
137877
+ const canRemove = !!when_used_in_section.value?.is_removable;
137878
+ const canEdit = !!when_used_in_section.value?.is_editable;
137879
+ const canDuplicate = parent ? !!parent.when_used_in_section?.is_editable : false;
137880
+ return {
137881
+ hasSomethingEditable: canEdit || canRemove || canDuplicate,
137882
+ canRemove,
137883
+ canEdit,
137884
+ canDuplicate
137885
+ };
137908
137886
  });
137909
137887
  }
137910
137888
 
@@ -156881,9 +156859,7 @@ const _sfc_main$1P = /* @__PURE__ */ defineComponent({
156881
156859
  visible: {},
156882
156860
  allow_admins_to_overwrite: { type: Boolean },
156883
156861
  style: {},
156884
- printModeIdx: {},
156885
- when_used_in_section: {},
156886
- usedInSectionId: { default: "" }
156862
+ printModeIdx: {}
156887
156863
  },
156888
156864
  emits: ["style"],
156889
156865
  setup(__props, { emit: __emit }) {
@@ -156898,42 +156874,12 @@ const _sfc_main$1P = /* @__PURE__ */ defineComponent({
156898
156874
  computed(() => [])
156899
156875
  );
156900
156876
  const { isCompletionWizardEnabled, retriggerWizard } = useCanvasCompletionWizard();
156901
- const {
156902
- isImpact,
156903
- mode,
156904
- isEditMode,
156905
- componentSelectedMode,
156906
- isViewOnlyMode,
156907
- componentEditMode,
156908
- componentNodesById,
156909
- activeCanvas,
156910
- saveCanvasContentWithContext,
156911
- removeComponentById,
156912
- setComponentSelectedMode,
156913
- setComponentSettingsMode,
156914
- updateNodeDataById,
156915
- canvasContent
156916
- } = useCanvas$1();
156917
- const { id, usedInSectionId, when_used_in_section } = toRefs(props);
156918
- const componentPermissions = useComponentPermissions({
156919
- id,
156920
- usedInSectionId,
156921
- when_used_in_section
156922
- });
156923
- const isEditable = computed(() => {
156924
- if (!componentPermissions.value.canEdit) return false;
156925
- if (isImpact.value) {
156926
- return !props.data.selection_strategy || props.data.selection_strategy === "free" || isCompletionWizardEnabled.value && wizardStepSectionListIds.value.includes(props.id);
156927
- }
156928
- return true;
156929
- });
156930
- const isRemovable = computed(() => {
156931
- if (!componentPermissions.value.canRemove) return false;
156932
- if (isImpact.value) {
156933
- return !props.data.selection_strategy || props.data.selection_strategy === "free";
156934
- }
156935
- return true;
156936
- });
156877
+ const isEditable = computed(
156878
+ () => isImpact.value ? !props.data.selection_strategy || props.data.selection_strategy === "free" || isCompletionWizardEnabled.value && wizardStepSectionListIds.value.includes(props.id) : true
156879
+ );
156880
+ const isRemovable = computed(
156881
+ () => isImpact.value ? !props.data.selection_strategy || props.data.selection_strategy === "free" : true
156882
+ );
156937
156883
  const sectionSelectorAppSrc = computed(() => {
156938
156884
  if (!sectionSelectorApps.value?.length || !props.data.selection_app_name) return null;
156939
156885
  const relatedApp = sectionSelectorApps.value.find((app) => app.app_metadata?.name === props.data.selection_app_name);
@@ -157000,7 +156946,7 @@ const _sfc_main$1P = /* @__PURE__ */ defineComponent({
157000
156946
  async (selectedData) => {
157001
156947
  console.info(`[SectionList]: Received done callback for ${props.id} with data`, selectedData);
157002
156948
  if (!selectedData) return;
157003
- const sections = (selectedData?.section_ids || []).map((id2) => ({ id: typeof id2 === "string" ? id2 : id2.id }));
156949
+ const sections = (selectedData?.section_ids || []).map((id) => ({ id: typeof id === "string" ? id : id.id }));
157004
156950
  const updatedData = { ...props.data, sections };
157005
156951
  updateNodeDataById(props.id, updatedData);
157006
156952
  const currentContext = cloneDeep(activeCanvas.value?.context || {});
@@ -157026,6 +156972,22 @@ const _sfc_main$1P = /* @__PURE__ */ defineComponent({
157026
156972
  sectionListRef.value?.toggleSectionSelector();
157027
156973
  }
157028
156974
  }
156975
+ const {
156976
+ isImpact,
156977
+ mode,
156978
+ isEditMode,
156979
+ componentSelectedMode,
156980
+ isViewOnlyMode,
156981
+ componentEditMode,
156982
+ componentNodesById,
156983
+ activeCanvas,
156984
+ saveCanvasContentWithContext,
156985
+ removeComponentById,
156986
+ setComponentSelectedMode,
156987
+ setComponentSettingsMode,
156988
+ updateNodeDataById,
156989
+ canvasContent
156990
+ } = useCanvas$1();
157029
156991
  return (_ctx, _cache) => {
157030
156992
  return openBlock(), createElementBlock(Fragment, null, [
157031
156993
  unref(shouldDisplayPlaceholderComponent)(unref(isEditMode), unref(mode), _ctx.visible) ? (openBlock(), createBlock(PlaceholderComponent, {
@@ -157033,25 +156995,25 @@ const _sfc_main$1P = /* @__PURE__ */ defineComponent({
157033
156995
  name: _ctx.tracking_id
157034
156996
  }, null, 8, ["name"])) : unref(isEditMode) && !unref(isViewOnlyMode) ? (openBlock(), createBlock(_sfc_main$34, {
157035
156997
  key: 1,
157036
- id: unref(id),
157037
- active: unref(componentEditMode) && unref(componentEditMode)?.id === unref(id),
156998
+ id: _ctx.id,
156999
+ active: unref(componentEditMode) && unref(componentEditMode)?.id === _ctx.id,
157038
157000
  class: normalizeClass({ "mt-12": sectionListName.value }),
157039
157001
  edit: isEditable.value,
157040
157002
  "exclude-stylables": [unref(ThemeComponentOptionEnum).COLOR_PICKER],
157041
157003
  remove: isRemovable.value,
157042
- selected: unref(componentSelectedMode) && unref(componentSelectedMode)?.id === unref(id),
157004
+ selected: unref(componentSelectedMode) && unref(componentSelectedMode)?.id === _ctx.id,
157043
157005
  settings: "",
157044
157006
  stylable: "",
157045
157007
  style: normalizeStyle(unref(omit$1)(_ctx.style, "paddingBottom", "paddingLeft", "paddingTop", "paddingRight")),
157046
157008
  onEdit: handleEdit,
157047
- onRemove: _cache[0] || (_cache[0] = ($event) => unref(removeComponentById)(unref(id))),
157048
- onSelect: _cache[1] || (_cache[1] = ($event) => unref(setComponentSelectedMode)(unref(id))),
157049
- onSettings: _cache[2] || (_cache[2] = ($event) => unref(setComponentSettingsMode)(unref(id))),
157009
+ onRemove: _cache[0] || (_cache[0] = ($event) => unref(removeComponentById)(_ctx.id)),
157010
+ onSelect: _cache[1] || (_cache[1] = ($event) => unref(setComponentSelectedMode)(_ctx.id)),
157011
+ onSettings: _cache[2] || (_cache[2] = ($event) => unref(setComponentSettingsMode)(_ctx.id)),
157050
157012
  onStyle: _cache[3] || (_cache[3] = ($event) => emit("style", $event))
157051
157013
  }, {
157052
157014
  default: withCtx(() => [
157053
157015
  createVNode(RawSectionList, mergeProps({
157054
- id: unref(id),
157016
+ id: _ctx.id,
157055
157017
  ref_key: "sectionListRef",
157056
157018
  ref: sectionListRef,
157057
157019
  class: "pa-2",
@@ -157069,7 +157031,7 @@ const _sfc_main$1P = /* @__PURE__ */ defineComponent({
157069
157031
  _: 1
157070
157032
  }, 8, ["id", "active", "class", "edit", "exclude-stylables", "remove", "selected", "style"])) : (openBlock(), createBlock(RawSectionList, mergeProps({
157071
157033
  key: 2,
157072
- id: unref(id),
157034
+ id: _ctx.id,
157073
157035
  data: _ctx.data
157074
157036
  }, unref(attrs), {
157075
157037
  "has-section-selector-app": !!sectionSelectorAppSrc.value,
@@ -159597,8 +159559,7 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
159597
159559
  autofill: {},
159598
159560
  linkable: {},
159599
159561
  autofill_content_types: {},
159600
- when_used_in_section: {},
159601
- usedInSectionId: { default: "" }
159562
+ when_used_in_section: {}
159602
159563
  },
159603
159564
  emits: ["style"],
159604
159565
  setup(__props, { emit: __emit }) {
@@ -159609,42 +159570,12 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
159609
159570
  computed(() => [])
159610
159571
  );
159611
159572
  const { isCompletionWizardEnabled, retriggerWizard } = useCanvasCompletionWizard();
159612
- const {
159613
- isImpact,
159614
- mode,
159615
- isEditMode,
159616
- componentSelectedMode,
159617
- isViewOnlyMode,
159618
- componentEditMode,
159619
- componentNodesById,
159620
- activeCanvas,
159621
- saveCanvasContentWithContext,
159622
- removeComponentById,
159623
- setComponentSelectedMode,
159624
- setComponentSettingsMode,
159625
- updateNodeDataById,
159626
- canvasContent
159627
- } = useCanvas$1();
159628
- const { id, usedInSectionId, when_used_in_section } = toRefs(props);
159629
- const componentPermissions = useComponentPermissions({
159630
- id,
159631
- usedInSectionId,
159632
- when_used_in_section
159633
- });
159634
- const isEditable = computed(() => {
159635
- if (!componentPermissions.value.canEdit) return false;
159636
- if (isImpact.value) {
159637
- return !props.data.selection_strategy || props.data.selection_strategy === "free" || isCompletionWizardEnabled.value && wizardStepSectionListIds.value.includes(props.id);
159638
- }
159639
- return true;
159640
- });
159641
- const isRemovable = computed(() => {
159642
- if (!componentPermissions.value.canRemove) return false;
159643
- if (isImpact.value) {
159644
- return !props.data.selection_strategy || props.data.selection_strategy === "free";
159645
- }
159646
- return true;
159647
- });
159573
+ const isEditable = computed(
159574
+ () => isImpact.value ? !props.data.selection_strategy || props.data.selection_strategy === "free" || isCompletionWizardEnabled.value && wizardStepSectionListIds.value.includes(props.id) : true
159575
+ );
159576
+ const isRemovable = computed(
159577
+ () => isImpact.value ? !props.data.selection_strategy || props.data.selection_strategy === "free" : true
159578
+ );
159648
159579
  const sectionSelectorAppSrc = computed(() => {
159649
159580
  if (!sectionSelectorApps.value?.length || !props.data.selection_app_name) return null;
159650
159581
  const relatedApp = sectionSelectorApps.value.find((app) => app.app_metadata?.name === props.data.selection_app_name);
@@ -159710,7 +159641,7 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
159710
159641
  async (selectedData) => {
159711
159642
  console.info(`[SectionList]: Received done callback for ${props.id} with data`, selectedData);
159712
159643
  if (!selectedData) return;
159713
- const sections = (selectedData?.section_ids || []).map((id2) => ({ id: typeof id2 === "string" ? id2 : id2.id }));
159644
+ const sections = (selectedData?.section_ids || []).map((id) => ({ id: typeof id === "string" ? id : id.id }));
159714
159645
  const updatedData = { ...props.data, sections };
159715
159646
  updateNodeDataById(props.id, updatedData);
159716
159647
  const currentContext = cloneDeep(activeCanvas.value?.context || {});
@@ -159736,6 +159667,22 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
159736
159667
  contentListRef.value?.toggleSectionSelector();
159737
159668
  }
159738
159669
  }
159670
+ const {
159671
+ isImpact,
159672
+ mode,
159673
+ isEditMode,
159674
+ componentSelectedMode,
159675
+ isViewOnlyMode,
159676
+ componentEditMode,
159677
+ componentNodesById,
159678
+ activeCanvas,
159679
+ saveCanvasContentWithContext,
159680
+ removeComponentById,
159681
+ setComponentSelectedMode,
159682
+ setComponentSettingsMode,
159683
+ updateNodeDataById,
159684
+ canvasContent
159685
+ } = useCanvas$1();
159739
159686
  return (_ctx, _cache) => {
159740
159687
  return openBlock(), createElementBlock(Fragment, null, [
159741
159688
  unref(shouldDisplayPlaceholderComponent)(unref(isEditMode), unref(mode), _ctx.visible) ? (openBlock(), createBlock(PlaceholderComponent, {
@@ -159743,25 +159690,25 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
159743
159690
  name: _ctx.tracking_id
159744
159691
  }, null, 8, ["name"])) : unref(isEditMode) && !unref(isViewOnlyMode) ? (openBlock(), createBlock(_sfc_main$34, {
159745
159692
  key: 1,
159746
- id: unref(id),
159747
- active: unref(componentEditMode) && unref(componentEditMode)?.id === unref(id),
159693
+ id: _ctx.id,
159694
+ active: unref(componentEditMode) && unref(componentEditMode)?.id === _ctx.id,
159748
159695
  class: normalizeClass({ "mt-12": componentName.value }),
159749
159696
  edit: isEditable.value,
159750
159697
  "exclude-stylables": [unref(ThemeComponentOptionEnum).COLOR_PICKER],
159751
159698
  remove: isRemovable.value,
159752
- selected: unref(componentSelectedMode) && unref(componentSelectedMode)?.id === unref(id),
159699
+ selected: unref(componentSelectedMode) && unref(componentSelectedMode)?.id === _ctx.id,
159753
159700
  settings: "",
159754
159701
  stylable: "",
159755
159702
  style: normalizeStyle(unref(omit$1)(_ctx.style, "paddingBottom", "paddingLeft", "paddingTop", "paddingRight")),
159756
159703
  onEdit: handleEdit,
159757
- onRemove: _cache[0] || (_cache[0] = ($event) => unref(removeComponentById)(unref(id))),
159758
- onSelect: _cache[1] || (_cache[1] = ($event) => unref(setComponentSelectedMode)(unref(id))),
159759
- onSettings: _cache[2] || (_cache[2] = ($event) => unref(setComponentSettingsMode)(unref(id))),
159704
+ onRemove: _cache[0] || (_cache[0] = ($event) => unref(removeComponentById)(_ctx.id)),
159705
+ onSelect: _cache[1] || (_cache[1] = ($event) => unref(setComponentSelectedMode)(_ctx.id)),
159706
+ onSettings: _cache[2] || (_cache[2] = ($event) => unref(setComponentSettingsMode)(_ctx.id)),
159760
159707
  onStyle: _cache[3] || (_cache[3] = ($event) => emit("style", $event))
159761
159708
  }, {
159762
159709
  default: withCtx(() => [
159763
159710
  createVNode(ContentListRaw, mergeProps({
159764
- id: unref(id),
159711
+ id: _ctx.id,
159765
159712
  ref_key: "contentListRef",
159766
159713
  ref: contentListRef,
159767
159714
  class: ["pa-2", props.class],
@@ -159779,7 +159726,7 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
159779
159726
  _: 1
159780
159727
  }, 8, ["id", "active", "class", "edit", "exclude-stylables", "remove", "selected", "style"])) : (openBlock(), createBlock(ContentListRaw, mergeProps({
159781
159728
  key: 2,
159782
- id: unref(id),
159729
+ id: _ctx.id,
159783
159730
  data: _ctx.data
159784
159731
  }, unref(attrs), {
159785
159732
  "has-section-selector-app": !!sectionSelectorAppSrc.value,
@@ -162691,7 +162638,7 @@ const _sfc_main$1w = /* @__PURE__ */ defineComponent({
162691
162638
  );
162692
162639
  const areSectionsSystemControlled = computed(() => launchDarkly.value?.are_sections_system_controlled);
162693
162640
  const allowEditOrRemove = computed(
162694
- () => isAdmin.value && ((selectedComponentType.value === ComponentTypes.Text || selectedComponentType.value === ComponentTypes.Carousel || selectedComponentType.value === ComponentTypes.Multimedia) && isSection.value || launchDarkly.value.enable_template_component_permissions && isCanvasTemplate.value)
162641
+ () => (selectedComponentType.value === ComponentTypes.Text || selectedComponentType.value === ComponentTypes.Carousel || selectedComponentType.value === ComponentTypes.Multimedia) && isAdmin.value && isSection.value
162695
162642
  );
162696
162643
  const canSelectSectionListStrategy = computed(
162697
162644
  () => isAdmin.value && isCanvasTemplate.value && isSectionOrContentList.value
@@ -162753,8 +162700,7 @@ const _sfc_main$1w = /* @__PURE__ */ defineComponent({
162753
162700
  formValues.contentGridDataAccessor = value || "";
162754
162701
  }
162755
162702
  function getEditOrRemoveOption() {
162756
- const defaultPermissions = isCanvasTemplate.value && launchDarkly.value.enable_template_component_permissions ? cloneDeep(defaultWhenUsedInTemplate) : cloneDeep(defaultWhenUsedInSection);
162757
- const map = activeSettingsNode.value?.when_used_in_section ?? defaultPermissions;
162703
+ const map = activeSettingsNode.value?.when_used_in_section ?? cloneDeep(defaultWhenUsedInSection);
162758
162704
  let value = "";
162759
162705
  value += map.is_editable ? "1" : "0";
162760
162706
  value += map.is_removable ? "1" : "0";
@@ -163255,7 +163201,7 @@ const _sfc_main$1w = /* @__PURE__ */ defineComponent({
163255
163201
  }
163256
163202
  });
163257
163203
 
163258
- const ComponentDrawerSettings = /* @__PURE__ */ _export_sfc(_sfc_main$1w, [["__scopeId", "data-v-a4296e5c"]]);
163204
+ const ComponentDrawerSettings = /* @__PURE__ */ _export_sfc(_sfc_main$1w, [["__scopeId", "data-v-dce6a881"]]);
163259
163205
 
163260
163206
  function useConnectUpload() {
163261
163207
  async function uploadToConnect(formData) {