@pitcher/canvas-ui 2026.1.14-133153 → 2026.1.14-133826-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 +18 -18
- package/canvas-ui.js +439 -483
- package/canvas-ui.js.map +1 -1
- package/lib/apps/canvas-builder/components/ui/ContentList/ContentList.vue.d.ts +12 -8
- package/lib/apps/canvas-builder/components/ui/SectionList/SectionList.vue.d.ts +12 -3
- package/lib/types/launchDarkly.types.d.ts +1 -1
- package/package.json +1 -1
package/canvas-ui.js
CHANGED
|
@@ -95692,115 +95692,111 @@ const _hoisted_14$h = {
|
|
|
95692
95692
|
key: 0,
|
|
95693
95693
|
class: "flex items-center ml-2"
|
|
95694
95694
|
};
|
|
95695
|
-
const _hoisted_15$f = {
|
|
95696
|
-
|
|
95697
|
-
const _hoisted_17$c = { class: "c-select-filter__popover w-[350px] rounded flex flex-col bg-base" };
|
|
95698
|
-
const _hoisted_18$a = { class: "pa-2 max-h-[300px] overflow-y-auto" };
|
|
95699
|
-
const _hoisted_19$a = {
|
|
95700
|
-
key: 0,
|
|
95695
|
+
const _hoisted_15$f = {
|
|
95696
|
+
key: 2,
|
|
95701
95697
|
class: "flex items-center ml-2"
|
|
95702
95698
|
};
|
|
95703
|
-
const
|
|
95704
|
-
const
|
|
95699
|
+
const _hoisted_16$e = { class: "flex flex-col w-full flex-1 min-h-0" };
|
|
95700
|
+
const _hoisted_17$c = {
|
|
95705
95701
|
key: 0,
|
|
95706
95702
|
class: "flex-1 overflow-y-auto bg-white w-full pl-1 pr-6 py-0"
|
|
95707
95703
|
};
|
|
95708
|
-
const
|
|
95704
|
+
const _hoisted_18$a = { class: "space-y-1 mt-4" };
|
|
95705
|
+
const _hoisted_19$a = ["onClick"];
|
|
95706
|
+
const _hoisted_20$9 = { class: "text-sm text-gray-700" };
|
|
95707
|
+
const _hoisted_21$7 = { class: "flex items-center mb-0" };
|
|
95708
|
+
const _hoisted_22$5 = { class: "text-sm font-bold text-gray-700" };
|
|
95709
95709
|
const _hoisted_23$5 = ["onClick"];
|
|
95710
|
-
const _hoisted_24$5 = {
|
|
95711
|
-
const _hoisted_25$5 = { class: "flex items-center mb-0" };
|
|
95712
|
-
const _hoisted_26$5 = { class: "text-sm font-bold text-gray-700" };
|
|
95713
|
-
const _hoisted_27$5 = ["onClick"];
|
|
95714
|
-
const _hoisted_28$5 = {
|
|
95710
|
+
const _hoisted_24$5 = {
|
|
95715
95711
|
key: 0,
|
|
95716
95712
|
class: "relative mr-4"
|
|
95717
95713
|
};
|
|
95718
|
-
const
|
|
95714
|
+
const _hoisted_25$5 = {
|
|
95719
95715
|
key: 0,
|
|
95720
95716
|
class: "absolute inset-0 flex items-center justify-center bg-gray-200 bg-opacity-75 border-rounded-1"
|
|
95721
95717
|
};
|
|
95722
|
-
const
|
|
95718
|
+
const _hoisted_26$5 = {
|
|
95723
95719
|
key: 1,
|
|
95724
95720
|
class: "w-18 h-14 border-rounded-1 mr-4 flex-shrink-0 bg-gray-200 flex items-center justify-center"
|
|
95725
95721
|
};
|
|
95726
|
-
const
|
|
95727
|
-
const
|
|
95728
|
-
const
|
|
95729
|
-
const
|
|
95722
|
+
const _hoisted_27$5 = { class: "flex-1 min-w-0" };
|
|
95723
|
+
const _hoisted_28$5 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
|
|
95724
|
+
const _hoisted_29$5 = { class: "text-xs text-gray-500" };
|
|
95725
|
+
const _hoisted_30$4 = {
|
|
95730
95726
|
key: 1,
|
|
95731
95727
|
class: "flex-1 overflow-y-auto bg-white w-full"
|
|
95732
95728
|
};
|
|
95733
|
-
const
|
|
95734
|
-
const
|
|
95729
|
+
const _hoisted_31$4 = { class: "w-full px-0" };
|
|
95730
|
+
const _hoisted_32$4 = {
|
|
95735
95731
|
key: 0,
|
|
95736
95732
|
class: "flex flex-col items-center justify-center text-center p-8 gap-4"
|
|
95737
95733
|
};
|
|
95738
|
-
const
|
|
95734
|
+
const _hoisted_33$4 = {
|
|
95739
95735
|
key: 0,
|
|
95740
95736
|
class: "mb-0"
|
|
95741
95737
|
};
|
|
95742
|
-
const
|
|
95743
|
-
const
|
|
95744
|
-
const
|
|
95745
|
-
const
|
|
95746
|
-
const
|
|
95738
|
+
const _hoisted_34$4 = { class: "flex items-center px-0 pt-2 pb-1" };
|
|
95739
|
+
const _hoisted_35$4 = { class: "text-m font-semibold text-gray-900" };
|
|
95740
|
+
const _hoisted_36$4 = { class: "ml-2 text-sm text-gray-500" };
|
|
95741
|
+
const _hoisted_37$4 = ["data-result-selected", "onClick"];
|
|
95742
|
+
const _hoisted_38$4 = {
|
|
95747
95743
|
key: 1,
|
|
95748
95744
|
class: "w-18 h-14 border-rounded-1 mr-4 flex-shrink-0 bg-gray-200 flex items-center justify-center"
|
|
95749
95745
|
};
|
|
95750
|
-
const
|
|
95751
|
-
const
|
|
95752
|
-
const
|
|
95753
|
-
const
|
|
95754
|
-
const
|
|
95755
|
-
const
|
|
95746
|
+
const _hoisted_39$4 = { class: "flex-1 min-w-0" };
|
|
95747
|
+
const _hoisted_40$4 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
|
|
95748
|
+
const _hoisted_41$4 = ["innerHTML"];
|
|
95749
|
+
const _hoisted_42$4 = { class: "text-xs text-gray-500" };
|
|
95750
|
+
const _hoisted_43$4 = { class: "text-xs text-gray-400" };
|
|
95751
|
+
const _hoisted_44$4 = {
|
|
95756
95752
|
key: 0,
|
|
95757
95753
|
class: "px-0 py-0"
|
|
95758
95754
|
};
|
|
95759
|
-
const
|
|
95760
|
-
const
|
|
95761
|
-
const
|
|
95762
|
-
const
|
|
95763
|
-
const
|
|
95764
|
-
const
|
|
95765
|
-
const
|
|
95766
|
-
const
|
|
95767
|
-
const
|
|
95768
|
-
const
|
|
95769
|
-
const
|
|
95755
|
+
const _hoisted_45$4 = { key: 1 };
|
|
95756
|
+
const _hoisted_46$4 = { class: "flex items-center px-0 pt-2 pb-1" };
|
|
95757
|
+
const _hoisted_47$4 = { class: "text-m font-semibold text-gray-900" };
|
|
95758
|
+
const _hoisted_48$4 = { class: "ml-2 text-sm text-gray-500" };
|
|
95759
|
+
const _hoisted_49$4 = ["data-result-selected", "onClick"];
|
|
95760
|
+
const _hoisted_50$4 = { class: "w-18 h-14 border-rounded-1 mr-4 flex-shrink-0 bg-gray-200 flex items-center justify-center" };
|
|
95761
|
+
const _hoisted_51$3 = { class: "flex-1 min-w-0" };
|
|
95762
|
+
const _hoisted_52$3 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
|
|
95763
|
+
const _hoisted_53$3 = { class: "text-xs text-gray-500" };
|
|
95764
|
+
const _hoisted_54$2 = { class: "text-xs text-gray-400" };
|
|
95765
|
+
const _hoisted_55$2 = {
|
|
95770
95766
|
key: 0,
|
|
95771
95767
|
class: "px-0 py-0"
|
|
95772
95768
|
};
|
|
95773
|
-
const
|
|
95769
|
+
const _hoisted_56$2 = {
|
|
95774
95770
|
key: 2,
|
|
95775
95771
|
class: "flex flex-col items-center justify-center text-center p-8 gap-4"
|
|
95776
95772
|
};
|
|
95777
|
-
const
|
|
95773
|
+
const _hoisted_57$2 = {
|
|
95778
95774
|
key: 2,
|
|
95779
95775
|
class: "flex-1 overflow-y-auto bg-white w-full"
|
|
95780
95776
|
};
|
|
95781
|
-
const
|
|
95782
|
-
const
|
|
95777
|
+
const _hoisted_58$2 = { class: "w-full px-0" };
|
|
95778
|
+
const _hoisted_59$2 = {
|
|
95783
95779
|
key: 0,
|
|
95784
95780
|
class: "flex flex-col items-center justify-center text-center p-8 gap-4"
|
|
95785
95781
|
};
|
|
95786
|
-
const
|
|
95787
|
-
const
|
|
95788
|
-
const
|
|
95789
|
-
const
|
|
95790
|
-
const
|
|
95782
|
+
const _hoisted_60$2 = { class: "flex items-center px-0 pt-2 pb-1" };
|
|
95783
|
+
const _hoisted_61$2 = { class: "text-m font-semibold text-gray-900" };
|
|
95784
|
+
const _hoisted_62$2 = { class: "ml-2 text-sm text-gray-500" };
|
|
95785
|
+
const _hoisted_63$2 = ["data-result-selected", "onClick"];
|
|
95786
|
+
const _hoisted_64$2 = {
|
|
95791
95787
|
key: 1,
|
|
95792
95788
|
class: "w-18 h-14 border-rounded-1 mr-4 flex-shrink-0 bg-gray-200 flex items-center justify-center"
|
|
95793
95789
|
};
|
|
95794
|
-
const
|
|
95795
|
-
const
|
|
95796
|
-
const
|
|
95797
|
-
const
|
|
95798
|
-
const
|
|
95799
|
-
const
|
|
95790
|
+
const _hoisted_65$2 = { class: "flex-1 min-w-0" };
|
|
95791
|
+
const _hoisted_66$2 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
|
|
95792
|
+
const _hoisted_67$2 = ["innerHTML"];
|
|
95793
|
+
const _hoisted_68$2 = { class: "text-xs text-gray-500" };
|
|
95794
|
+
const _hoisted_69$1 = { class: "text-xs text-gray-400" };
|
|
95795
|
+
const _hoisted_70$1 = {
|
|
95800
95796
|
key: 0,
|
|
95801
95797
|
class: "flex flex-col items-center justify-center text-center p-8 gap-4"
|
|
95802
95798
|
};
|
|
95803
|
-
const
|
|
95799
|
+
const _hoisted_71$1 = {
|
|
95804
95800
|
key: 0,
|
|
95805
95801
|
class: "flex flex-wrap line-height-6 pt-4 pb-2 px-6 border-t border-gray-200 gap-y-4 gap-x-4"
|
|
95806
95802
|
};
|
|
@@ -95827,7 +95823,6 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
95827
95823
|
const selectedFileTypes = ref([]);
|
|
95828
95824
|
const showFileTypeDropdown = ref(false);
|
|
95829
95825
|
const selectedCanvasFilters = ref([]);
|
|
95830
|
-
const showCanvasTypeDropdown = ref(false);
|
|
95831
95826
|
const fileTypeOptions = [
|
|
95832
95827
|
{ label: "Folder", value: "folder" },
|
|
95833
95828
|
{ label: "PDF", value: "pdf" },
|
|
@@ -95840,42 +95835,6 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
95840
95835
|
{ label: "AR", value: "ar" },
|
|
95841
95836
|
{ label: "Web", value: "web" }
|
|
95842
95837
|
];
|
|
95843
|
-
const canvasTypeOptions = computed(() => {
|
|
95844
|
-
const options = [
|
|
95845
|
-
{ label: t("canvasUI.CAlgoliaSearch.canvasFilters.templates"), value: "template" },
|
|
95846
|
-
{ label: t("canvasUI.CAlgoliaSearch.canvasFilters.products"), value: "section" },
|
|
95847
|
-
{ label: t("canvasUI.CAlgoliaSearch.canvasFilters.blocks"), value: "block" }
|
|
95848
|
-
];
|
|
95849
|
-
if (!props.isAdmin) {
|
|
95850
|
-
options.unshift({ label: t("canvasUI.CAlgoliaSearch.canvasFilters.saved"), value: "saved_canvas" });
|
|
95851
|
-
}
|
|
95852
|
-
if (props.isAdmin) {
|
|
95853
|
-
options.splice(1, 0, {
|
|
95854
|
-
label: t("canvasUI.CAlgoliaSearch.canvasFilters.productTemplates"),
|
|
95855
|
-
value: "product_template"
|
|
95856
|
-
});
|
|
95857
|
-
}
|
|
95858
|
-
return options;
|
|
95859
|
-
});
|
|
95860
|
-
const ALLOWED_CANVAS_TYPES = ["saved_canvas", "template", "product_template", "section", "block"];
|
|
95861
|
-
const ALLOWED_FILE_TYPES = [
|
|
95862
|
-
"folder",
|
|
95863
|
-
"pdf",
|
|
95864
|
-
"image",
|
|
95865
|
-
"audio",
|
|
95866
|
-
"video",
|
|
95867
|
-
"document",
|
|
95868
|
-
"presentation",
|
|
95869
|
-
"spreadsheet",
|
|
95870
|
-
"ar",
|
|
95871
|
-
"web"
|
|
95872
|
-
];
|
|
95873
|
-
const visibleCanvasTypeOptions = computed(() => {
|
|
95874
|
-
if (showRecentView.value || !searchQuery.value.trim()) {
|
|
95875
|
-
return canvasTypeOptions.value;
|
|
95876
|
-
}
|
|
95877
|
-
return canvasTypeOptions.value.filter((option) => availableCanvasTypes.value.has(option.value));
|
|
95878
|
-
});
|
|
95879
95838
|
const hasActiveFilters = computed(() => selectedFileTypes.value.length > 0 || selectedCanvasFilters.value.length > 0);
|
|
95880
95839
|
const clearAllFilters = () => {
|
|
95881
95840
|
selectedFileTypes.value = [];
|
|
@@ -95886,9 +95845,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
95886
95845
|
selectedFileTypes.value = [];
|
|
95887
95846
|
selectedCanvasFilters.value = [];
|
|
95888
95847
|
searchType.value = null;
|
|
95889
|
-
if (searchQuery.value.trim()
|
|
95890
|
-
applyFiltersToResults();
|
|
95891
|
-
} else if (searchQuery.value.trim()) {
|
|
95848
|
+
if (searchQuery.value.trim()) {
|
|
95892
95849
|
try {
|
|
95893
95850
|
skipNextSuggestionFetch.value = true;
|
|
95894
95851
|
await performSearch(searchQuery.value);
|
|
@@ -96024,11 +95981,8 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96024
95981
|
};
|
|
96025
95982
|
const contentResults = ref([]);
|
|
96026
95983
|
const canvasResults = ref([]);
|
|
96027
|
-
const unfilteredContentResults = ref([]);
|
|
96028
|
-
const unfilteredCanvasResults = ref([]);
|
|
96029
95984
|
const isSearching = ref(false);
|
|
96030
95985
|
const hasSearchCompleted = ref(false);
|
|
96031
|
-
let currentSearchId = 0;
|
|
96032
95986
|
const querySuggestions = ref([]);
|
|
96033
95987
|
const selectedSuggestionIndex = ref(-1);
|
|
96034
95988
|
const selectedResultIndex = ref(-1);
|
|
@@ -96045,44 +95999,6 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96045
95999
|
}
|
|
96046
96000
|
return canvasResults.value;
|
|
96047
96001
|
});
|
|
96048
|
-
const availableFileTypes = computed(() => {
|
|
96049
|
-
if (showRecentView.value || !searchQuery.value.trim()) {
|
|
96050
|
-
return /* @__PURE__ */ new Set();
|
|
96051
|
-
}
|
|
96052
|
-
const types = /* @__PURE__ */ new Set();
|
|
96053
|
-
unfilteredContentResults.value.forEach((item) => {
|
|
96054
|
-
if (item.type === "folder") {
|
|
96055
|
-
types.add("folder");
|
|
96056
|
-
} else if (item.type === "file" && item.file_category) {
|
|
96057
|
-
types.add(item.file_category);
|
|
96058
|
-
}
|
|
96059
|
-
});
|
|
96060
|
-
return types;
|
|
96061
|
-
});
|
|
96062
|
-
const availableCanvasTypes = computed(() => {
|
|
96063
|
-
if (showRecentView.value || !searchQuery.value.trim()) {
|
|
96064
|
-
return /* @__PURE__ */ new Set();
|
|
96065
|
-
}
|
|
96066
|
-
const types = /* @__PURE__ */ new Set();
|
|
96067
|
-
unfilteredCanvasResults.value.forEach((item) => {
|
|
96068
|
-
if (item.content_type) {
|
|
96069
|
-
types.add(item.content_type);
|
|
96070
|
-
}
|
|
96071
|
-
});
|
|
96072
|
-
return types;
|
|
96073
|
-
});
|
|
96074
|
-
const visibleFileTypeOptions = computed(() => {
|
|
96075
|
-
if (showRecentView.value || !searchQuery.value.trim()) {
|
|
96076
|
-
return fileTypeOptions;
|
|
96077
|
-
}
|
|
96078
|
-
return fileTypeOptions.filter((option) => availableFileTypes.value.has(option.value));
|
|
96079
|
-
});
|
|
96080
|
-
const hasContentFilters = computed(() => {
|
|
96081
|
-
return visibleFileTypeOptions.value.length > 0 || selectedFileTypes.value.length > 0;
|
|
96082
|
-
});
|
|
96083
|
-
const hasCanvasFilters = computed(() => {
|
|
96084
|
-
return visibleCanvasTypeOptions.value.length > 0 || selectedCanvasFilters.value.length > 0;
|
|
96085
|
-
});
|
|
96086
96002
|
const shouldShowNoResults = computed(() => {
|
|
96087
96003
|
if (showRecentView.value || !searchQuery.value.trim() || isSearching.value || !hasSearchCompleted.value) return false;
|
|
96088
96004
|
if (searchType.value === "content") {
|
|
@@ -96126,32 +96042,6 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96126
96042
|
};
|
|
96127
96043
|
watch(searchType, () => {
|
|
96128
96044
|
selectedResultIndex.value = -1;
|
|
96129
|
-
showFileTypeDropdown.value = false;
|
|
96130
|
-
showCanvasTypeDropdown.value = false;
|
|
96131
|
-
});
|
|
96132
|
-
watch(visibleFileTypeOptions, (newOptions) => {
|
|
96133
|
-
if (selectedFileTypes.value.length > 0) {
|
|
96134
|
-
const availableValues = new Set(newOptions.map((option) => option.value));
|
|
96135
|
-
const stillAvailable = selectedFileTypes.value.filter((type) => availableValues.has(type));
|
|
96136
|
-
if (stillAvailable.length !== selectedFileTypes.value.length) {
|
|
96137
|
-
selectedFileTypes.value = stillAvailable;
|
|
96138
|
-
if (searchQuery.value.trim()) {
|
|
96139
|
-
performSearch(searchQuery.value.trim());
|
|
96140
|
-
}
|
|
96141
|
-
}
|
|
96142
|
-
}
|
|
96143
|
-
});
|
|
96144
|
-
watch(visibleCanvasTypeOptions, (newOptions) => {
|
|
96145
|
-
if (selectedCanvasFilters.value.length > 0) {
|
|
96146
|
-
const availableValues = new Set(newOptions.map((option) => option.value));
|
|
96147
|
-
const stillAvailable = selectedCanvasFilters.value.filter((type) => availableValues.has(type));
|
|
96148
|
-
if (stillAvailable.length !== selectedCanvasFilters.value.length) {
|
|
96149
|
-
selectedCanvasFilters.value = stillAvailable;
|
|
96150
|
-
if (searchQuery.value.trim()) {
|
|
96151
|
-
performSearch(searchQuery.value.trim());
|
|
96152
|
-
}
|
|
96153
|
-
}
|
|
96154
|
-
}
|
|
96155
96045
|
});
|
|
96156
96046
|
const scrollSelectedResultIntoView = () => {
|
|
96157
96047
|
nextTick(() => {
|
|
@@ -96195,8 +96085,6 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96195
96085
|
if (!query.trim()) {
|
|
96196
96086
|
contentResults.value = [];
|
|
96197
96087
|
canvasResults.value = [];
|
|
96198
|
-
unfilteredContentResults.value = [];
|
|
96199
|
-
unfilteredCanvasResults.value = [];
|
|
96200
96088
|
hasSearchCompleted.value = false;
|
|
96201
96089
|
isSearching.value = false;
|
|
96202
96090
|
searchError.value = null;
|
|
@@ -96205,51 +96093,59 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96205
96093
|
isSearching.value = true;
|
|
96206
96094
|
hasSearchCompleted.value = false;
|
|
96207
96095
|
searchError.value = null;
|
|
96208
|
-
const searchId = ++currentSearchId;
|
|
96209
96096
|
const shouldSkipSuggestionFetch = skipNextSuggestionFetch.value;
|
|
96210
96097
|
if (shouldSkipSuggestionFetch) {
|
|
96211
96098
|
skipNextSuggestionFetch.value = false;
|
|
96212
96099
|
}
|
|
96213
96100
|
try {
|
|
96214
|
-
const
|
|
96215
|
-
|
|
96216
|
-
|
|
96217
|
-
|
|
96101
|
+
const ALLOWED_CANVAS_TYPES = ["saved_canvas", "template", "product_template", "section", "block"];
|
|
96102
|
+
const ALLOWED_FILE_TYPES = [
|
|
96103
|
+
"folder",
|
|
96104
|
+
"pdf",
|
|
96105
|
+
"image",
|
|
96106
|
+
"audio",
|
|
96107
|
+
"video",
|
|
96108
|
+
"document",
|
|
96109
|
+
"presentation",
|
|
96110
|
+
"spreadsheet",
|
|
96111
|
+
"ar",
|
|
96112
|
+
"web"
|
|
96113
|
+
];
|
|
96114
|
+
const validCanvasFilters = selectedCanvasFilters.value.filter((f) => ALLOWED_CANVAS_TYPES.includes(f));
|
|
96115
|
+
if (selectedCanvasFilters.value.length > 0 && validCanvasFilters.length === 0) {
|
|
96116
|
+
console.warn(
|
|
96117
|
+
"[CAlgoliaSearch] All selected canvas filters are invalid and were removed:",
|
|
96118
|
+
selectedCanvasFilters.value
|
|
96119
|
+
);
|
|
96120
|
+
selectedCanvasFilters.value = [];
|
|
96121
|
+
} else if (validCanvasFilters.length < selectedCanvasFilters.value.length) {
|
|
96122
|
+
const removedFilters = selectedCanvasFilters.value.filter((f) => !validCanvasFilters.includes(f));
|
|
96123
|
+
console.warn("[CAlgoliaSearch] Some canvas filters were invalid and removed:", removedFilters);
|
|
96218
96124
|
selectedCanvasFilters.value = validCanvasFilters;
|
|
96219
96125
|
}
|
|
96220
|
-
const
|
|
96221
|
-
|
|
96222
|
-
|
|
96223
|
-
console.warn(
|
|
96126
|
+
const canvasFilters = validCanvasFilters.length > 0 ? ` AND (${validCanvasFilters.map((filter) => `content_type:"${filter}"`).join(" OR ")})` : "";
|
|
96127
|
+
const validFileTypes = selectedFileTypes.value.filter((t2) => ALLOWED_FILE_TYPES.includes(t2));
|
|
96128
|
+
if (selectedFileTypes.value.length > 0 && validFileTypes.length === 0) {
|
|
96129
|
+
console.warn(
|
|
96130
|
+
"[CAlgoliaSearch] All selected file type filters are invalid and were removed:",
|
|
96131
|
+
selectedFileTypes.value
|
|
96132
|
+
);
|
|
96133
|
+
selectedFileTypes.value = [];
|
|
96134
|
+
} else if (validFileTypes.length < selectedFileTypes.value.length) {
|
|
96135
|
+
const removedFilters = selectedFileTypes.value.filter((t2) => !validFileTypes.includes(t2));
|
|
96136
|
+
console.warn("[CAlgoliaSearch] Some file type filters were invalid and removed:", removedFilters);
|
|
96224
96137
|
selectedFileTypes.value = validFileTypes;
|
|
96225
96138
|
}
|
|
96139
|
+
const contentFilters = validFileTypes.length > 0 ? ` AND (${validFileTypes.map((type) => type === "folder" ? `type:"${type}"` : `file_category:"${type}"`).join(" OR ")})` : "";
|
|
96226
96140
|
const results = await searchViaBackend(query.trim(), {
|
|
96227
|
-
canvas:
|
|
96228
|
-
content:
|
|
96141
|
+
canvas: canvasFilters,
|
|
96142
|
+
content: contentFilters
|
|
96229
96143
|
});
|
|
96230
96144
|
if (query.trim() !== searchQuery.value.trim()) {
|
|
96231
96145
|
return;
|
|
96232
96146
|
}
|
|
96233
|
-
|
|
96234
|
-
|
|
96235
|
-
let filteredContent = unfilteredContentResults.value;
|
|
96236
|
-
let filteredCanvas = unfilteredCanvasResults.value;
|
|
96237
|
-
if (validFileTypes.length > 0) {
|
|
96238
|
-
filteredContent = filteredContent.filter((item) => {
|
|
96239
|
-
if (validFileTypes.includes("folder") && item.type === "folder") {
|
|
96240
|
-
return true;
|
|
96241
|
-
}
|
|
96242
|
-
if (item.type === "file") {
|
|
96243
|
-
return validFileTypes.includes(item.file_category);
|
|
96244
|
-
}
|
|
96245
|
-
return false;
|
|
96246
|
-
});
|
|
96247
|
-
}
|
|
96248
|
-
if (validCanvasFilters.length > 0) {
|
|
96249
|
-
filteredCanvas = filteredCanvas.filter((item) => validCanvasFilters.includes(item.content_type));
|
|
96250
|
-
}
|
|
96251
|
-
contentResults.value = filteredContent;
|
|
96252
|
-
canvasResults.value = filteredCanvas;
|
|
96147
|
+
contentResults.value = results.content?.hits || [];
|
|
96148
|
+
canvasResults.value = results.canvas?.hits || [];
|
|
96253
96149
|
selectedResultIndex.value = -1;
|
|
96254
96150
|
searchError.value = null;
|
|
96255
96151
|
if (query.trim().length >= 2 && !shouldSkipSuggestionFetch) {
|
|
@@ -96262,27 +96158,23 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96262
96158
|
}
|
|
96263
96159
|
await nextTick();
|
|
96264
96160
|
setTimeout(() => {
|
|
96265
|
-
|
|
96266
|
-
|
|
96267
|
-
hasSearchCompleted.value = true;
|
|
96268
|
-
}
|
|
96161
|
+
isSearching.value = false;
|
|
96162
|
+
hasSearchCompleted.value = true;
|
|
96269
96163
|
}, 50);
|
|
96270
96164
|
} catch (error) {
|
|
96271
96165
|
console.error("Search error:", error);
|
|
96272
|
-
|
|
96273
|
-
|
|
96274
|
-
|
|
96275
|
-
|
|
96276
|
-
|
|
96277
|
-
|
|
96278
|
-
|
|
96279
|
-
|
|
96280
|
-
|
|
96281
|
-
|
|
96282
|
-
|
|
96283
|
-
|
|
96284
|
-
searchError.value = "Search failed. Please try again";
|
|
96285
|
-
}
|
|
96166
|
+
contentResults.value = [];
|
|
96167
|
+
canvasResults.value = [];
|
|
96168
|
+
isSearching.value = false;
|
|
96169
|
+
hasSearchCompleted.value = true;
|
|
96170
|
+
if (error.message === "AUTH_REQUIRED") {
|
|
96171
|
+
searchError.value = "Please sign in to search";
|
|
96172
|
+
} else if (error.message === "AUTH_EXPIRED") {
|
|
96173
|
+
searchError.value = "Your session has expired. Please sign in again";
|
|
96174
|
+
} else if (error.message === "AUTH_FORBIDDEN") {
|
|
96175
|
+
searchError.value = "You do not have permission to search this instance";
|
|
96176
|
+
} else {
|
|
96177
|
+
searchError.value = "Search failed. Please try again";
|
|
96286
96178
|
}
|
|
96287
96179
|
}
|
|
96288
96180
|
};
|
|
@@ -96292,38 +96184,19 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96292
96184
|
if (!query || typeof query !== "string") return "";
|
|
96293
96185
|
return query;
|
|
96294
96186
|
}
|
|
96295
|
-
function applyFiltersToResults() {
|
|
96296
|
-
if (unfilteredContentResults.value.length === 0 && unfilteredCanvasResults.value.length === 0) {
|
|
96297
|
-
return;
|
|
96298
|
-
}
|
|
96299
|
-
const validFileTypes = selectedFileTypes.value.filter((type) => ALLOWED_FILE_TYPES.includes(type));
|
|
96300
|
-
const validCanvasFilters = selectedCanvasFilters.value.filter((type) => ALLOWED_CANVAS_TYPES.includes(type));
|
|
96301
|
-
let filteredContent = unfilteredContentResults.value;
|
|
96302
|
-
let filteredCanvas = unfilteredCanvasResults.value;
|
|
96303
|
-
if (validFileTypes.length > 0) {
|
|
96304
|
-
filteredContent = filteredContent.filter((item) => {
|
|
96305
|
-
if (validFileTypes.includes("folder") && item.type === "folder") {
|
|
96306
|
-
return true;
|
|
96307
|
-
}
|
|
96308
|
-
if (item.type === "file") {
|
|
96309
|
-
return validFileTypes.includes(item.file_category);
|
|
96310
|
-
}
|
|
96311
|
-
return false;
|
|
96312
|
-
});
|
|
96313
|
-
}
|
|
96314
|
-
if (validCanvasFilters.length > 0) {
|
|
96315
|
-
filteredCanvas = filteredCanvas.filter((item) => validCanvasFilters.includes(item.content_type));
|
|
96316
|
-
}
|
|
96317
|
-
contentResults.value = filteredContent;
|
|
96318
|
-
canvasResults.value = filteredCanvas;
|
|
96319
|
-
selectedResultIndex.value = -1;
|
|
96320
|
-
}
|
|
96321
96187
|
const debouncedFilterSearch = () => {
|
|
96322
96188
|
if (filterChangeTimer) clearTimeout(filterChangeTimer);
|
|
96323
96189
|
if (searchTimer) clearTimeout(searchTimer);
|
|
96324
96190
|
filterChangeTimer = setTimeout(async () => {
|
|
96325
96191
|
if (searchQuery.value.trim() && !showRecentView.value) {
|
|
96326
|
-
|
|
96192
|
+
try {
|
|
96193
|
+
skipNextSuggestionFetch.value = true;
|
|
96194
|
+
await performSearch(searchQuery.value);
|
|
96195
|
+
} catch (error) {
|
|
96196
|
+
console.error("[debouncedFilterSearch] Search failed:", error);
|
|
96197
|
+
} finally {
|
|
96198
|
+
skipNextSuggestionFetch.value = false;
|
|
96199
|
+
}
|
|
96327
96200
|
}
|
|
96328
96201
|
}, 500);
|
|
96329
96202
|
};
|
|
@@ -96349,8 +96222,6 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96349
96222
|
showRecentView.value = true;
|
|
96350
96223
|
contentResults.value = [];
|
|
96351
96224
|
canvasResults.value = [];
|
|
96352
|
-
unfilteredContentResults.value = [];
|
|
96353
|
-
unfilteredCanvasResults.value = [];
|
|
96354
96225
|
querySuggestions.value = [];
|
|
96355
96226
|
selectedSuggestionIndex.value = -1;
|
|
96356
96227
|
selectedResultIndex.value = -1;
|
|
@@ -96364,8 +96235,6 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96364
96235
|
showRecentView.value = true;
|
|
96365
96236
|
contentResults.value = [];
|
|
96366
96237
|
canvasResults.value = [];
|
|
96367
|
-
unfilteredContentResults.value = [];
|
|
96368
|
-
unfilteredCanvasResults.value = [];
|
|
96369
96238
|
querySuggestions.value = [];
|
|
96370
96239
|
selectedSuggestionIndex.value = -1;
|
|
96371
96240
|
selectedResultIndex.value = -1;
|
|
@@ -96490,31 +96359,31 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96490
96359
|
if (endChar < highlightValue.length) truncated = truncated + "...";
|
|
96491
96360
|
return sanitizeHtml(truncated);
|
|
96492
96361
|
};
|
|
96493
|
-
const
|
|
96494
|
-
if (
|
|
96495
|
-
|
|
96496
|
-
selectedFileTypes.value.push(value);
|
|
96497
|
-
}
|
|
96362
|
+
const toggleCanvasFilter = (filterType) => {
|
|
96363
|
+
if (selectedCanvasFilters.value.includes(filterType)) {
|
|
96364
|
+
selectedCanvasFilters.value.splice(selectedCanvasFilters.value.indexOf(filterType), 1);
|
|
96498
96365
|
} else {
|
|
96499
|
-
|
|
96366
|
+
selectedCanvasFilters.value.push(filterType);
|
|
96500
96367
|
}
|
|
96501
96368
|
debouncedFilterSearch();
|
|
96502
96369
|
};
|
|
96503
|
-
const
|
|
96370
|
+
const clearCanvasFilters = () => {
|
|
96371
|
+
selectedCanvasFilters.value = [];
|
|
96372
|
+
debouncedFilterSearch();
|
|
96373
|
+
};
|
|
96374
|
+
const toggleFileType = (fileType, checked) => {
|
|
96504
96375
|
if (checked) {
|
|
96505
|
-
if (!
|
|
96506
|
-
|
|
96376
|
+
if (!selectedFileTypes.value.includes(fileType)) {
|
|
96377
|
+
selectedFileTypes.value.push(fileType);
|
|
96507
96378
|
}
|
|
96508
96379
|
} else {
|
|
96509
|
-
|
|
96380
|
+
const index = selectedFileTypes.value.indexOf(fileType);
|
|
96381
|
+
if (index > -1) {
|
|
96382
|
+
selectedFileTypes.value.splice(index, 1);
|
|
96383
|
+
}
|
|
96510
96384
|
}
|
|
96511
96385
|
debouncedFilterSearch();
|
|
96512
96386
|
};
|
|
96513
|
-
const clearCanvasFilters = () => {
|
|
96514
|
-
selectedCanvasFilters.value = [];
|
|
96515
|
-
showCanvasTypeDropdown.value = false;
|
|
96516
|
-
debouncedFilterSearch();
|
|
96517
|
-
};
|
|
96518
96387
|
const clearFileTypes = () => {
|
|
96519
96388
|
selectedFileTypes.value = [];
|
|
96520
96389
|
showFileTypeDropdown.value = false;
|
|
@@ -96685,7 +96554,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96685
96554
|
show: "",
|
|
96686
96555
|
verticalAlignment: "top",
|
|
96687
96556
|
"z-index": _ctx.zIndex,
|
|
96688
|
-
"onUpdate:show": _cache[
|
|
96557
|
+
"onUpdate:show": _cache[15] || (_cache[15] = ($event) => emit("toggleSearch", $event))
|
|
96689
96558
|
}, {
|
|
96690
96559
|
default: withCtx(() => [
|
|
96691
96560
|
createElementVNode("div", {
|
|
@@ -96694,7 +96563,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96694
96563
|
}, [
|
|
96695
96564
|
createElementVNode("div", _hoisted_1$4w, [
|
|
96696
96565
|
createElementVNode("div", _hoisted_2$3j, [
|
|
96697
|
-
_cache[
|
|
96566
|
+
_cache[16] || (_cache[16] = createElementVNode("div", { class: "absolute left-2.5 top-1/2 transform -translate-y-1/2 z-10" }, [
|
|
96698
96567
|
createElementVNode("i", { class: "c-icon far fa-search text-gray-400 text-l" })
|
|
96699
96568
|
], -1)),
|
|
96700
96569
|
withDirectives(createElementVNode("input", {
|
|
@@ -96791,7 +96660,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96791
96660
|
createElementVNode("span", null, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.tabs.pitchDecks")), 1)
|
|
96792
96661
|
], 2)) : createCommentVNode("", true)
|
|
96793
96662
|
]),
|
|
96794
|
-
searchType.value
|
|
96663
|
+
searchType.value ? (openBlock(), createElementBlock("div", _hoisted_9$O, [
|
|
96795
96664
|
searchType.value === "content" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
96796
96665
|
createVNode(unref(NPopover), {
|
|
96797
96666
|
class: "c-select-filter",
|
|
@@ -96827,23 +96696,24 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96827
96696
|
default: withCtx(() => [
|
|
96828
96697
|
createElementVNode("div", _hoisted_12$p, [
|
|
96829
96698
|
createElementVNode("div", _hoisted_13$k, [
|
|
96830
|
-
(openBlock(
|
|
96831
|
-
return
|
|
96699
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(fileTypeOptions, (option) => {
|
|
96700
|
+
return createElementVNode("div", {
|
|
96832
96701
|
key: option.value,
|
|
96833
96702
|
class: "w-full h-7 flex items-center"
|
|
96834
96703
|
}, [
|
|
96835
96704
|
createVNode(unref(NCheckbox), {
|
|
96836
96705
|
checked: selectedFileTypes.value.includes(option.value),
|
|
96837
96706
|
class: "px-2 truncate",
|
|
96838
|
-
"onUpdate:checked": (
|
|
96707
|
+
"onUpdate:checked": (v) => toggleFileType(option.value, v),
|
|
96708
|
+
value: option.value
|
|
96839
96709
|
}, {
|
|
96840
96710
|
default: withCtx(() => [
|
|
96841
96711
|
createTextVNode(toDisplayString(option.label), 1)
|
|
96842
96712
|
]),
|
|
96843
96713
|
_: 2
|
|
96844
|
-
}, 1032, ["checked", "onUpdate:checked"])
|
|
96714
|
+
}, 1032, ["checked", "onUpdate:checked", "value"])
|
|
96845
96715
|
]);
|
|
96846
|
-
}),
|
|
96716
|
+
}), 64))
|
|
96847
96717
|
]),
|
|
96848
96718
|
createElementVNode("div", {
|
|
96849
96719
|
class: "pa-2",
|
|
@@ -96866,99 +96736,114 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96866
96736
|
_: 1
|
|
96867
96737
|
}, 8, ["show"]),
|
|
96868
96738
|
hasActiveFilters.value ? (openBlock(), createElementBlock("div", _hoisted_14$h, [
|
|
96869
|
-
_cache[
|
|
96739
|
+
_cache[17] || (_cache[17] = createElementVNode("div", { class: "h-6 w-px bg-gray-300 mx-2" }, null, -1)),
|
|
96870
96740
|
createElementVNode("span", {
|
|
96871
96741
|
class: "text-sm text-gray-600 hover:text-gray-800 font-normal cursor-pointer",
|
|
96872
96742
|
onClick: clearAllFilters
|
|
96873
96743
|
}, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.filters.clear")), 1)
|
|
96874
96744
|
])) : createCommentVNode("", true)
|
|
96875
96745
|
], 64)) : searchType.value === "canvases" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
96876
|
-
|
|
96877
|
-
|
|
96878
|
-
|
|
96879
|
-
|
|
96880
|
-
|
|
96881
|
-
|
|
96882
|
-
|
|
96883
|
-
|
|
96746
|
+
!_ctx.isAdmin ? (openBlock(), createBlock(unref(NTag), {
|
|
96747
|
+
key: 0,
|
|
96748
|
+
class: "select-none cursor-pointer",
|
|
96749
|
+
style: normalizeStyle({
|
|
96750
|
+
"--n-color": selectedCanvasFilters.value.includes("saved_canvas") ? "var(--p-primary5)" : "var(--p-primary6)",
|
|
96751
|
+
"--n-border": "1px solid var(--p-primary5)",
|
|
96752
|
+
"--n-height": "28px"
|
|
96753
|
+
}),
|
|
96754
|
+
themeOverrides: {
|
|
96755
|
+
borderRadius: "4px"
|
|
96756
|
+
},
|
|
96757
|
+
onClick: _cache[8] || (_cache[8] = ($event) => toggleCanvasFilter("saved_canvas"))
|
|
96884
96758
|
}, {
|
|
96885
|
-
|
|
96886
|
-
|
|
96887
|
-
class: "select-none cursor-pointer",
|
|
96888
|
-
style: normalizeStyle({
|
|
96889
|
-
"--n-color": selectedCanvasFilters.value.length ? "var(--p-primary5)" : "var(--p-primary6)",
|
|
96890
|
-
"--n-border": "1px solid var(--p-primary5)",
|
|
96891
|
-
"--n-height": "28px"
|
|
96892
|
-
}),
|
|
96893
|
-
themeOverrides: {
|
|
96894
|
-
borderRadius: "4px"
|
|
96895
|
-
},
|
|
96896
|
-
onClick: _cache[8] || (_cache[8] = ($event) => showCanvasTypeDropdown.value = !showCanvasTypeDropdown.value)
|
|
96897
|
-
}, {
|
|
96898
|
-
default: withCtx(() => [
|
|
96899
|
-
createElementVNode("div", _hoisted_15$f, [
|
|
96900
|
-
createElementVNode("span", null, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.filters.type")), 1),
|
|
96901
|
-
selectedCanvasFilters.value.length ? (openBlock(), createElementBlock("span", _hoisted_16$e, ": " + toDisplayString(selectedCanvasFilters.value.length), 1)) : createCommentVNode("", true)
|
|
96902
|
-
])
|
|
96903
|
-
]),
|
|
96904
|
-
_: 1
|
|
96905
|
-
}, 8, ["style"])
|
|
96759
|
+
default: withCtx(() => [
|
|
96760
|
+
createElementVNode("span", null, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.canvasFilters.saved")), 1)
|
|
96906
96761
|
]),
|
|
96762
|
+
_: 1
|
|
96763
|
+
}, 8, ["style"])) : createCommentVNode("", true),
|
|
96764
|
+
createVNode(unref(NTag), {
|
|
96765
|
+
class: "select-none cursor-pointer",
|
|
96766
|
+
style: normalizeStyle({
|
|
96767
|
+
"--n-color": selectedCanvasFilters.value.includes("template") ? "var(--p-primary5)" : "var(--p-primary6)",
|
|
96768
|
+
"--n-border": "1px solid var(--p-primary5)",
|
|
96769
|
+
"--n-height": "28px"
|
|
96770
|
+
}),
|
|
96771
|
+
themeOverrides: {
|
|
96772
|
+
borderRadius: "4px"
|
|
96773
|
+
},
|
|
96774
|
+
onClick: _cache[9] || (_cache[9] = ($event) => toggleCanvasFilter("template"))
|
|
96775
|
+
}, {
|
|
96907
96776
|
default: withCtx(() => [
|
|
96908
|
-
createElementVNode("
|
|
96909
|
-
createElementVNode("div", _hoisted_18$a, [
|
|
96910
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(visibleCanvasTypeOptions.value, (option) => {
|
|
96911
|
-
return openBlock(), createElementBlock("div", {
|
|
96912
|
-
key: option.value,
|
|
96913
|
-
class: "w-full h-7 flex items-center"
|
|
96914
|
-
}, [
|
|
96915
|
-
createVNode(unref(NCheckbox), {
|
|
96916
|
-
checked: selectedCanvasFilters.value.includes(option.value),
|
|
96917
|
-
class: "px-2 truncate",
|
|
96918
|
-
"onUpdate:checked": (checked) => handleCanvasTypeToggle(option.value, checked)
|
|
96919
|
-
}, {
|
|
96920
|
-
default: withCtx(() => [
|
|
96921
|
-
createTextVNode(toDisplayString(option.label), 1)
|
|
96922
|
-
]),
|
|
96923
|
-
_: 2
|
|
96924
|
-
}, 1032, ["checked", "onUpdate:checked"])
|
|
96925
|
-
]);
|
|
96926
|
-
}), 128))
|
|
96927
|
-
]),
|
|
96928
|
-
createElementVNode("div", {
|
|
96929
|
-
class: "pa-2",
|
|
96930
|
-
style: normalizeStyle({ borderTop: `1px solid ${unref(themeVars).primary5}` })
|
|
96931
|
-
}, [
|
|
96932
|
-
createVNode(CButton, {
|
|
96933
|
-
block: "",
|
|
96934
|
-
class: "pa-2",
|
|
96935
|
-
text: "",
|
|
96936
|
-
onClick: clearCanvasFilters
|
|
96937
|
-
}, {
|
|
96938
|
-
default: withCtx(() => [
|
|
96939
|
-
createTextVNode(toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.filters.clear")), 1)
|
|
96940
|
-
]),
|
|
96941
|
-
_: 1
|
|
96942
|
-
})
|
|
96943
|
-
], 4)
|
|
96944
|
-
])
|
|
96777
|
+
createElementVNode("span", null, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.canvasFilters.templates")), 1)
|
|
96945
96778
|
]),
|
|
96946
96779
|
_: 1
|
|
96947
|
-
}, 8, ["
|
|
96948
|
-
|
|
96949
|
-
|
|
96780
|
+
}, 8, ["style"]),
|
|
96781
|
+
_ctx.isAdmin ? (openBlock(), createBlock(unref(NTag), {
|
|
96782
|
+
key: 1,
|
|
96783
|
+
class: "select-none cursor-pointer",
|
|
96784
|
+
style: normalizeStyle({
|
|
96785
|
+
"--n-color": selectedCanvasFilters.value.includes("product_template") ? "var(--p-primary5)" : "var(--p-primary6)",
|
|
96786
|
+
"--n-border": "1px solid var(--p-primary5)",
|
|
96787
|
+
"--n-height": "28px"
|
|
96788
|
+
}),
|
|
96789
|
+
themeOverrides: {
|
|
96790
|
+
borderRadius: "4px"
|
|
96791
|
+
},
|
|
96792
|
+
onClick: _cache[10] || (_cache[10] = ($event) => toggleCanvasFilter("product_template"))
|
|
96793
|
+
}, {
|
|
96794
|
+
default: withCtx(() => [
|
|
96795
|
+
createElementVNode("span", null, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.canvasFilters.productTemplates")), 1)
|
|
96796
|
+
]),
|
|
96797
|
+
_: 1
|
|
96798
|
+
}, 8, ["style"])) : createCommentVNode("", true),
|
|
96799
|
+
createVNode(unref(NTag), {
|
|
96800
|
+
class: "select-none cursor-pointer",
|
|
96801
|
+
style: normalizeStyle({
|
|
96802
|
+
"--n-color": selectedCanvasFilters.value.includes("section") ? "var(--p-primary5)" : "var(--p-primary6)",
|
|
96803
|
+
"--n-border": "1px solid var(--p-primary5)",
|
|
96804
|
+
"--n-height": "28px"
|
|
96805
|
+
}),
|
|
96806
|
+
themeOverrides: {
|
|
96807
|
+
borderRadius: "4px"
|
|
96808
|
+
},
|
|
96809
|
+
onClick: _cache[11] || (_cache[11] = ($event) => toggleCanvasFilter("section"))
|
|
96810
|
+
}, {
|
|
96811
|
+
default: withCtx(() => [
|
|
96812
|
+
createElementVNode("span", null, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.canvasFilters.products")), 1)
|
|
96813
|
+
]),
|
|
96814
|
+
_: 1
|
|
96815
|
+
}, 8, ["style"]),
|
|
96816
|
+
createVNode(unref(NTag), {
|
|
96817
|
+
class: "select-none cursor-pointer",
|
|
96818
|
+
style: normalizeStyle({
|
|
96819
|
+
"--n-color": selectedCanvasFilters.value.includes("block") ? "var(--p-primary5)" : "var(--p-primary6)",
|
|
96820
|
+
"--n-border": "1px solid var(--p-primary5)",
|
|
96821
|
+
"--n-height": "28px"
|
|
96822
|
+
}),
|
|
96823
|
+
themeOverrides: {
|
|
96824
|
+
borderRadius: "4px"
|
|
96825
|
+
},
|
|
96826
|
+
onClick: _cache[12] || (_cache[12] = ($event) => toggleCanvasFilter("block"))
|
|
96827
|
+
}, {
|
|
96828
|
+
default: withCtx(() => [
|
|
96829
|
+
createElementVNode("span", null, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.canvasFilters.blocks")), 1)
|
|
96830
|
+
]),
|
|
96831
|
+
_: 1
|
|
96832
|
+
}, 8, ["style"]),
|
|
96833
|
+
selectedCanvasFilters.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_15$f, [
|
|
96834
|
+
_cache[18] || (_cache[18] = createElementVNode("div", { class: "h-6 w-px bg-gray-300 mx-2" }, null, -1)),
|
|
96950
96835
|
createElementVNode("span", {
|
|
96951
96836
|
class: "text-sm text-gray-600 hover:text-gray-800 font-normal cursor-pointer",
|
|
96952
|
-
onClick:
|
|
96837
|
+
onClick: clearCanvasFilters
|
|
96953
96838
|
}, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.filters.clear")), 1)
|
|
96954
96839
|
])) : createCommentVNode("", true)
|
|
96955
96840
|
], 64)) : createCommentVNode("", true)
|
|
96956
96841
|
])) : createCommentVNode("", true)
|
|
96957
96842
|
])) : createCommentVNode("", true)
|
|
96958
96843
|
]),
|
|
96959
|
-
createElementVNode("div",
|
|
96960
|
-
showRecentView.value ? (openBlock(), createElementBlock("div",
|
|
96961
|
-
createElementVNode("div",
|
|
96844
|
+
createElementVNode("div", _hoisted_16$e, [
|
|
96845
|
+
showRecentView.value ? (openBlock(), createElementBlock("div", _hoisted_17$c, [
|
|
96846
|
+
createElementVNode("div", _hoisted_18$a, [
|
|
96962
96847
|
(openBlock(true), createElementBlock(Fragment, null, renderList(recentSearches.value, (search) => {
|
|
96963
96848
|
return openBlock(), createElementBlock("div", {
|
|
96964
96849
|
key: search,
|
|
@@ -96971,14 +96856,14 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96971
96856
|
icon: "clock-rotate-left",
|
|
96972
96857
|
size: "16"
|
|
96973
96858
|
}),
|
|
96974
|
-
createElementVNode("span",
|
|
96975
|
-
], 8,
|
|
96859
|
+
createElementVNode("span", _hoisted_20$9, toDisplayString(search), 1)
|
|
96860
|
+
], 8, _hoisted_19$a);
|
|
96976
96861
|
}), 128))
|
|
96977
96862
|
]),
|
|
96978
96863
|
recentlyOpenedDocs.value.length > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
96979
|
-
_cache[
|
|
96980
|
-
createElementVNode("div",
|
|
96981
|
-
createElementVNode("span",
|
|
96864
|
+
_cache[19] || (_cache[19] = createElementVNode("hr", { class: "border-0 h-px bg-gray-200 mt-2 mb-3 w-full" }, null, -1)),
|
|
96865
|
+
createElementVNode("div", _hoisted_21$7, [
|
|
96866
|
+
createElementVNode("span", _hoisted_22$5, toDisplayString(unref(t)("canvasUI.components.fileViewer.recentlyOpened")), 1)
|
|
96982
96867
|
]),
|
|
96983
96868
|
createElementVNode("div", {
|
|
96984
96869
|
class: normalizeClass(_ctx.isAdmin ? "space-y-2" : "space-y-0")
|
|
@@ -96992,7 +96877,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96992
96877
|
]),
|
|
96993
96878
|
onClick: ($event) => handleRecentDocClick(doc, doc.type)
|
|
96994
96879
|
}, [
|
|
96995
|
-
doc.type === "file" ? (openBlock(), createElementBlock("div",
|
|
96880
|
+
doc.type === "file" ? (openBlock(), createElementBlock("div", _hoisted_24$5, [
|
|
96996
96881
|
createVNode(_sfc_main$6K, {
|
|
96997
96882
|
class: "h-14 border-rounded-1 overflow-hidden flex-0",
|
|
96998
96883
|
cover: "",
|
|
@@ -97001,7 +96886,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97001
96886
|
src: recentThumbnails.value[doc.id] || "",
|
|
97002
96887
|
width: "72"
|
|
97003
96888
|
}, null, 8, ["file-data", "src"]),
|
|
97004
|
-
isLoadingThumbnails.value && !recentThumbnails.value[doc.id] ? (openBlock(), createElementBlock("div",
|
|
96889
|
+
isLoadingThumbnails.value && !recentThumbnails.value[doc.id] ? (openBlock(), createElementBlock("div", _hoisted_25$5, [
|
|
97005
96890
|
createVNode(CIcon, {
|
|
97006
96891
|
class: "animate-spin",
|
|
97007
96892
|
color: "var(--p-primary)",
|
|
@@ -97009,7 +96894,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97009
96894
|
size: "20"
|
|
97010
96895
|
})
|
|
97011
96896
|
])) : createCommentVNode("", true)
|
|
97012
|
-
])) : (openBlock(), createElementBlock("div",
|
|
96897
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_26$5, [
|
|
97013
96898
|
doc.type === "canvas" ? (openBlock(), createBlock(CIcon, {
|
|
97014
96899
|
key: 0,
|
|
97015
96900
|
color: "var(--p-text2)",
|
|
@@ -97022,33 +96907,33 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97022
96907
|
size: "32"
|
|
97023
96908
|
}))
|
|
97024
96909
|
])),
|
|
97025
|
-
createElementVNode("div",
|
|
97026
|
-
createElementVNode("h3",
|
|
97027
|
-
createElementVNode("p",
|
|
96910
|
+
createElementVNode("div", _hoisted_27$5, [
|
|
96911
|
+
createElementVNode("h3", _hoisted_28$5, toDisplayString(doc.name), 1),
|
|
96912
|
+
createElementVNode("p", _hoisted_29$5, toDisplayString(doc.type === "canvas" ? formatCanvasType(doc.content_type) : doc.type === "folder" ? "Folder" : doc.file_category || "File"), 1)
|
|
97028
96913
|
])
|
|
97029
|
-
], 10,
|
|
96914
|
+
], 10, _hoisted_23$5);
|
|
97030
96915
|
}), 128))
|
|
97031
96916
|
], 2)
|
|
97032
96917
|
], 64)) : createCommentVNode("", true)
|
|
97033
|
-
])) : !searchType.value ? (openBlock(), createElementBlock("div",
|
|
97034
|
-
createElementVNode("div",
|
|
97035
|
-
isSearching.value ? (openBlock(), createElementBlock("div",
|
|
96918
|
+
])) : !searchType.value ? (openBlock(), createElementBlock("div", _hoisted_30$4, [
|
|
96919
|
+
createElementVNode("div", _hoisted_31$4, [
|
|
96920
|
+
isSearching.value ? (openBlock(), createElementBlock("div", _hoisted_32$4, [
|
|
97036
96921
|
createVNode(CIcon, {
|
|
97037
96922
|
class: "animate-spin text-6xl",
|
|
97038
96923
|
color: "var(--p-primary)",
|
|
97039
96924
|
icon: "spinner"
|
|
97040
96925
|
})
|
|
97041
96926
|
])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
97042
|
-
filteredContentFiles.value.length > 0 ? (openBlock(), createElementBlock("div",
|
|
97043
|
-
createElementVNode("div",
|
|
96927
|
+
filteredContentFiles.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_33$4, [
|
|
96928
|
+
createElementVNode("div", _hoisted_34$4, [
|
|
97044
96929
|
createVNode(CIcon, {
|
|
97045
96930
|
class: "mr-2",
|
|
97046
96931
|
color: "var(--p-text2)",
|
|
97047
96932
|
icon: "folder",
|
|
97048
96933
|
size: "16"
|
|
97049
96934
|
}),
|
|
97050
|
-
createElementVNode("span",
|
|
97051
|
-
createElementVNode("span",
|
|
96935
|
+
createElementVNode("span", _hoisted_35$4, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.sections.content")), 1),
|
|
96936
|
+
createElementVNode("span", _hoisted_36$4, "(" + toDisplayString(filteredContentFiles.value.length) + ")", 1)
|
|
97052
96937
|
]),
|
|
97053
96938
|
createElementVNode("div", null, [
|
|
97054
96939
|
(openBlock(true), createElementBlock(Fragment, null, renderList(filteredContentFiles.value.slice(0, 5), (item) => {
|
|
@@ -97070,30 +96955,30 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97070
96955
|
"object-fit": "cover",
|
|
97071
96956
|
src: item.picture_url || "",
|
|
97072
96957
|
width: "72"
|
|
97073
|
-
}, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div",
|
|
96958
|
+
}, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div", _hoisted_38$4, [
|
|
97074
96959
|
createVNode(CIcon, {
|
|
97075
96960
|
color: "var(--p-text2)",
|
|
97076
96961
|
icon: "folder",
|
|
97077
96962
|
size: "32"
|
|
97078
96963
|
})
|
|
97079
96964
|
])),
|
|
97080
|
-
createElementVNode("div",
|
|
97081
|
-
createElementVNode("h3",
|
|
96965
|
+
createElementVNode("div", _hoisted_39$4, [
|
|
96966
|
+
createElementVNode("h3", _hoisted_40$4, toDisplayString(item.name), 1),
|
|
97082
96967
|
item.type === "file" && getSnippet(item) ? (openBlock(), createElementBlock("p", {
|
|
97083
96968
|
key: 0,
|
|
97084
96969
|
class: "text-xs text-gray-600 mb-1",
|
|
97085
96970
|
innerHTML: getSnippet(item)
|
|
97086
|
-
}, null, 8,
|
|
97087
|
-
createElementVNode("p",
|
|
96971
|
+
}, null, 8, _hoisted_41$4)) : createCommentVNode("", true),
|
|
96972
|
+
createElementVNode("p", _hoisted_42$4, toDisplayString(item.type === "folder" ? "Folder" : item.file_category || item.content_type || "File"), 1)
|
|
97088
96973
|
]),
|
|
97089
|
-
createElementVNode("div",
|
|
97090
|
-
], 10,
|
|
96974
|
+
createElementVNode("div", _hoisted_43$4, toDisplayString(item.type === "folder" ? item.parent_folder?.name || "" : item.folder?.name || ""), 1)
|
|
96975
|
+
], 10, _hoisted_37$4);
|
|
97091
96976
|
}), 128))
|
|
97092
96977
|
]),
|
|
97093
|
-
filteredContentFiles.value.length > 5 ? (openBlock(), createElementBlock("div",
|
|
96978
|
+
filteredContentFiles.value.length > 5 ? (openBlock(), createElementBlock("div", _hoisted_44$4, [
|
|
97094
96979
|
createElementVNode("span", {
|
|
97095
96980
|
class: "text-sm text-gray-600 hover:text-gray-800 font-bold flex items-center cursor-pointer",
|
|
97096
|
-
onClick: _cache[
|
|
96981
|
+
onClick: _cache[13] || (_cache[13] = ($event) => searchType.value = "content")
|
|
97097
96982
|
}, [
|
|
97098
96983
|
createTextVNode(toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.actions.viewAll")) + " ", 1),
|
|
97099
96984
|
createVNode(CIcon, {
|
|
@@ -97104,16 +96989,16 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97104
96989
|
])
|
|
97105
96990
|
])) : createCommentVNode("", true)
|
|
97106
96991
|
])) : createCommentVNode("", true),
|
|
97107
|
-
filteredCanvasFiles.value.length > 0 ? (openBlock(), createElementBlock("div",
|
|
97108
|
-
createElementVNode("div",
|
|
96992
|
+
filteredCanvasFiles.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_45$4, [
|
|
96993
|
+
createElementVNode("div", _hoisted_46$4, [
|
|
97109
96994
|
createVNode(CIcon, {
|
|
97110
96995
|
class: "mr-2",
|
|
97111
96996
|
color: "var(--p-text2)",
|
|
97112
96997
|
icon: "presentation",
|
|
97113
96998
|
size: "16"
|
|
97114
96999
|
}),
|
|
97115
|
-
createElementVNode("span",
|
|
97116
|
-
createElementVNode("span",
|
|
97000
|
+
createElementVNode("span", _hoisted_47$4, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.sections.pitchDecks")), 1),
|
|
97001
|
+
createElementVNode("span", _hoisted_48$4, "(" + toDisplayString(filteredCanvasFiles.value.length) + ")", 1)
|
|
97117
97002
|
]),
|
|
97118
97003
|
createElementVNode("div", null, [
|
|
97119
97004
|
(openBlock(true), createElementBlock(Fragment, null, renderList(filteredCanvasFiles.value.slice(0, 5), (item) => {
|
|
@@ -97127,25 +97012,25 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97127
97012
|
"data-result-selected": isResultSelected(item),
|
|
97128
97013
|
onClick: ($event) => handleResultClick(item, "canvas")
|
|
97129
97014
|
}, [
|
|
97130
|
-
createElementVNode("div",
|
|
97015
|
+
createElementVNode("div", _hoisted_50$4, [
|
|
97131
97016
|
createVNode(CIcon, {
|
|
97132
97017
|
color: "var(--p-text2)",
|
|
97133
97018
|
icon: "presentation",
|
|
97134
97019
|
size: "32"
|
|
97135
97020
|
})
|
|
97136
97021
|
]),
|
|
97137
|
-
createElementVNode("div",
|
|
97138
|
-
createElementVNode("h3",
|
|
97139
|
-
createElementVNode("p",
|
|
97022
|
+
createElementVNode("div", _hoisted_51$3, [
|
|
97023
|
+
createElementVNode("h3", _hoisted_52$3, toDisplayString(item.name), 1),
|
|
97024
|
+
createElementVNode("p", _hoisted_53$3, toDisplayString(formatCanvasType(item.content_type)), 1)
|
|
97140
97025
|
]),
|
|
97141
|
-
createElementVNode("div",
|
|
97142
|
-
], 10,
|
|
97026
|
+
createElementVNode("div", _hoisted_54$2, toDisplayString(item.folder?.name || ""), 1)
|
|
97027
|
+
], 10, _hoisted_49$4);
|
|
97143
97028
|
}), 128))
|
|
97144
97029
|
]),
|
|
97145
|
-
filteredCanvasFiles.value.length > 5 ? (openBlock(), createElementBlock("div",
|
|
97030
|
+
filteredCanvasFiles.value.length > 5 ? (openBlock(), createElementBlock("div", _hoisted_55$2, [
|
|
97146
97031
|
createElementVNode("span", {
|
|
97147
97032
|
class: "text-sm text-gray-600 hover:text-gray-800 font-bold flex items-center cursor-pointer",
|
|
97148
|
-
onClick: _cache[
|
|
97033
|
+
onClick: _cache[14] || (_cache[14] = ($event) => searchType.value = "canvases")
|
|
97149
97034
|
}, [
|
|
97150
97035
|
createTextVNode(toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.actions.viewAll")) + " ", 1),
|
|
97151
97036
|
createVNode(CIcon, {
|
|
@@ -97156,7 +97041,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97156
97041
|
])
|
|
97157
97042
|
])) : createCommentVNode("", true)
|
|
97158
97043
|
])) : createCommentVNode("", true),
|
|
97159
|
-
searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div",
|
|
97044
|
+
searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_56$2, [
|
|
97160
97045
|
createVNode(CIcon, {
|
|
97161
97046
|
class: "text-6xl",
|
|
97162
97047
|
color: searchError.value ? "var(--p-error)" : "var(--p-text3)",
|
|
@@ -97169,16 +97054,16 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97169
97054
|
])) : createCommentVNode("", true)
|
|
97170
97055
|
], 64))
|
|
97171
97056
|
])
|
|
97172
|
-
])) : (openBlock(), createElementBlock("div",
|
|
97173
|
-
createElementVNode("div",
|
|
97174
|
-
isSearching.value ? (openBlock(), createElementBlock("div",
|
|
97057
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_57$2, [
|
|
97058
|
+
createElementVNode("div", _hoisted_58$2, [
|
|
97059
|
+
isSearching.value ? (openBlock(), createElementBlock("div", _hoisted_59$2, [
|
|
97175
97060
|
createVNode(CIcon, {
|
|
97176
97061
|
class: "animate-spin text-6xl",
|
|
97177
97062
|
color: "var(--p-primary)",
|
|
97178
97063
|
icon: "spinner"
|
|
97179
97064
|
})
|
|
97180
97065
|
])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
97181
|
-
createElementVNode("div",
|
|
97066
|
+
createElementVNode("div", _hoisted_60$2, [
|
|
97182
97067
|
searchType.value === "content" ? (openBlock(), createBlock(CIcon, {
|
|
97183
97068
|
key: 0,
|
|
97184
97069
|
class: "mr-2",
|
|
@@ -97192,8 +97077,8 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97192
97077
|
icon: "presentation",
|
|
97193
97078
|
size: "16"
|
|
97194
97079
|
})),
|
|
97195
|
-
createElementVNode("span",
|
|
97196
|
-
createElementVNode("span",
|
|
97080
|
+
createElementVNode("span", _hoisted_61$2, toDisplayString(searchType.value === "content" ? unref(t)("canvasUI.CAlgoliaSearch.sections.content") : unref(t)("canvasUI.CAlgoliaSearch.sections.pitchDecks")), 1),
|
|
97081
|
+
createElementVNode("span", _hoisted_62$2, " (" + toDisplayString(searchType.value === "content" ? filteredContentFiles.value.length : filteredCanvasFiles.value.length) + ") ", 1)
|
|
97197
97082
|
]),
|
|
97198
97083
|
createElementVNode("div", null, [
|
|
97199
97084
|
(openBlock(true), createElementBlock(Fragment, null, renderList(searchType.value === "content" ? filteredContentFiles.value : filteredCanvasFiles.value, (item) => {
|
|
@@ -97218,7 +97103,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97218
97103
|
"object-fit": "cover",
|
|
97219
97104
|
src: item.picture_url || "",
|
|
97220
97105
|
width: "72"
|
|
97221
|
-
}, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div",
|
|
97106
|
+
}, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div", _hoisted_64$2, [
|
|
97222
97107
|
searchType.value === "content" ? (openBlock(), createBlock(CIcon, {
|
|
97223
97108
|
key: 0,
|
|
97224
97109
|
color: "var(--p-text2)",
|
|
@@ -97231,20 +97116,20 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97231
97116
|
size: "32"
|
|
97232
97117
|
}))
|
|
97233
97118
|
])),
|
|
97234
|
-
createElementVNode("div",
|
|
97235
|
-
createElementVNode("h3",
|
|
97119
|
+
createElementVNode("div", _hoisted_65$2, [
|
|
97120
|
+
createElementVNode("h3", _hoisted_66$2, toDisplayString(item.name), 1),
|
|
97236
97121
|
searchType.value === "content" && item.type === "file" && getSnippet(item) ? (openBlock(), createElementBlock("p", {
|
|
97237
97122
|
key: 0,
|
|
97238
97123
|
class: "text-xs text-gray-600 mb-1",
|
|
97239
97124
|
innerHTML: getSnippet(item)
|
|
97240
|
-
}, null, 8,
|
|
97241
|
-
createElementVNode("p",
|
|
97125
|
+
}, null, 8, _hoisted_67$2)) : createCommentVNode("", true),
|
|
97126
|
+
createElementVNode("p", _hoisted_68$2, toDisplayString(searchType.value === "content" ? item.type === "folder" ? "Folder" : item.file_category || item.content_type || "File" : formatCanvasType(item.content_type)), 1)
|
|
97242
97127
|
]),
|
|
97243
|
-
createElementVNode("div",
|
|
97244
|
-
], 10,
|
|
97128
|
+
createElementVNode("div", _hoisted_69$1, toDisplayString(searchType.value === "content" && item.type === "folder" ? item.parent_folder?.name || "" : item.folder?.name || ""), 1)
|
|
97129
|
+
], 10, _hoisted_63$2);
|
|
97245
97130
|
}), 128))
|
|
97246
97131
|
]),
|
|
97247
|
-
searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div",
|
|
97132
|
+
searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_70$1, [
|
|
97248
97133
|
createVNode(CIcon, {
|
|
97249
97134
|
class: "text-6xl",
|
|
97250
97135
|
color: searchError.value ? "var(--p-error)" : "var(--p-text3)",
|
|
@@ -97259,7 +97144,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97259
97144
|
])
|
|
97260
97145
|
]))
|
|
97261
97146
|
]),
|
|
97262
|
-
!showRecentView.value ? (openBlock(), createElementBlock("div",
|
|
97147
|
+
!showRecentView.value ? (openBlock(), createElementBlock("div", _hoisted_71$1, [
|
|
97263
97148
|
createVNode(CShortcut, null, {
|
|
97264
97149
|
default: withCtx(() => [
|
|
97265
97150
|
createVNode(CShortcutIcon, { icon: "arrow-up" }),
|
|
@@ -97301,7 +97186,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97301
97186
|
}
|
|
97302
97187
|
});
|
|
97303
97188
|
|
|
97304
|
-
const CAlgoliaSearch = /* @__PURE__ */ _export_sfc(_sfc_main$5K, [["__scopeId", "data-v-
|
|
97189
|
+
const CAlgoliaSearch = /* @__PURE__ */ _export_sfc(_sfc_main$5K, [["__scopeId", "data-v-da2357d4"]]);
|
|
97305
97190
|
|
|
97306
97191
|
const BulletListExtended = BulletList.extend({
|
|
97307
97192
|
addOptions() {
|
|
@@ -137841,19 +137726,37 @@ function useComponentPermissions({
|
|
|
137841
137726
|
isAnyTypeOfAdmin: false
|
|
137842
137727
|
}))
|
|
137843
137728
|
);
|
|
137844
|
-
const
|
|
137729
|
+
const launchDarkly = inject(
|
|
137730
|
+
"launchDarkly",
|
|
137731
|
+
computed(() => ({}))
|
|
137732
|
+
);
|
|
137733
|
+
const { canvasContent, activeCanvas } = useCanvas$1();
|
|
137845
137734
|
return computed(() => {
|
|
137846
|
-
if (
|
|
137847
|
-
|
|
137848
|
-
|
|
137849
|
-
|
|
137850
|
-
|
|
137851
|
-
|
|
137852
|
-
|
|
137853
|
-
|
|
137854
|
-
|
|
137855
|
-
|
|
137856
|
-
|
|
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);
|
|
137857
137760
|
});
|
|
137858
137761
|
}
|
|
137859
137762
|
|
|
@@ -156830,7 +156733,9 @@ const _sfc_main$1P = /* @__PURE__ */ defineComponent({
|
|
|
156830
156733
|
visible: {},
|
|
156831
156734
|
allow_admins_to_overwrite: { type: Boolean },
|
|
156832
156735
|
style: {},
|
|
156833
|
-
printModeIdx: {}
|
|
156736
|
+
printModeIdx: {},
|
|
156737
|
+
when_used_in_section: { default: () => defaultWhenUsedInSection },
|
|
156738
|
+
usedInSectionId: { default: "" }
|
|
156834
156739
|
},
|
|
156835
156740
|
emits: ["style"],
|
|
156836
156741
|
setup(__props, { emit: __emit }) {
|
|
@@ -156845,12 +156750,42 @@ const _sfc_main$1P = /* @__PURE__ */ defineComponent({
|
|
|
156845
156750
|
computed(() => [])
|
|
156846
156751
|
);
|
|
156847
156752
|
const { isCompletionWizardEnabled, retriggerWizard } = useCanvasCompletionWizard();
|
|
156848
|
-
const
|
|
156849
|
-
|
|
156850
|
-
|
|
156851
|
-
|
|
156852
|
-
|
|
156853
|
-
|
|
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
|
+
});
|
|
156854
156789
|
const sectionSelectorAppSrc = computed(() => {
|
|
156855
156790
|
if (!sectionSelectorApps.value?.length || !props.data.selection_app_name) return null;
|
|
156856
156791
|
const relatedApp = sectionSelectorApps.value.find((app) => app.app_metadata?.name === props.data.selection_app_name);
|
|
@@ -156917,7 +156852,7 @@ const _sfc_main$1P = /* @__PURE__ */ defineComponent({
|
|
|
156917
156852
|
async (selectedData) => {
|
|
156918
156853
|
console.info(`[SectionList]: Received done callback for ${props.id} with data`, selectedData);
|
|
156919
156854
|
if (!selectedData) return;
|
|
156920
|
-
const sections = (selectedData?.section_ids || []).map((
|
|
156855
|
+
const sections = (selectedData?.section_ids || []).map((id2) => ({ id: typeof id2 === "string" ? id2 : id2.id }));
|
|
156921
156856
|
const updatedData = { ...props.data, sections };
|
|
156922
156857
|
updateNodeDataById(props.id, updatedData);
|
|
156923
156858
|
const currentContext = cloneDeep(activeCanvas.value?.context || {});
|
|
@@ -156943,22 +156878,6 @@ const _sfc_main$1P = /* @__PURE__ */ defineComponent({
|
|
|
156943
156878
|
sectionListRef.value?.toggleSectionSelector();
|
|
156944
156879
|
}
|
|
156945
156880
|
}
|
|
156946
|
-
const {
|
|
156947
|
-
isImpact,
|
|
156948
|
-
mode,
|
|
156949
|
-
isEditMode,
|
|
156950
|
-
componentSelectedMode,
|
|
156951
|
-
isViewOnlyMode,
|
|
156952
|
-
componentEditMode,
|
|
156953
|
-
componentNodesById,
|
|
156954
|
-
activeCanvas,
|
|
156955
|
-
saveCanvasContentWithContext,
|
|
156956
|
-
removeComponentById,
|
|
156957
|
-
setComponentSelectedMode,
|
|
156958
|
-
setComponentSettingsMode,
|
|
156959
|
-
updateNodeDataById,
|
|
156960
|
-
canvasContent
|
|
156961
|
-
} = useCanvas$1();
|
|
156962
156881
|
return (_ctx, _cache) => {
|
|
156963
156882
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
156964
156883
|
unref(shouldDisplayPlaceholderComponent)(unref(isEditMode), unref(mode), _ctx.visible) ? (openBlock(), createBlock(PlaceholderComponent, {
|
|
@@ -156966,25 +156885,25 @@ const _sfc_main$1P = /* @__PURE__ */ defineComponent({
|
|
|
156966
156885
|
name: _ctx.tracking_id
|
|
156967
156886
|
}, null, 8, ["name"])) : unref(isEditMode) && !unref(isViewOnlyMode) ? (openBlock(), createBlock(_sfc_main$34, {
|
|
156968
156887
|
key: 1,
|
|
156969
|
-
id:
|
|
156970
|
-
active: unref(componentEditMode) && unref(componentEditMode)?.id ===
|
|
156888
|
+
id: unref(id),
|
|
156889
|
+
active: unref(componentEditMode) && unref(componentEditMode)?.id === unref(id),
|
|
156971
156890
|
class: normalizeClass({ "mt-12": sectionListName.value }),
|
|
156972
156891
|
edit: isEditable.value,
|
|
156973
156892
|
"exclude-stylables": [unref(ThemeComponentOptionEnum).COLOR_PICKER],
|
|
156974
156893
|
remove: isRemovable.value,
|
|
156975
|
-
selected: unref(componentSelectedMode) && unref(componentSelectedMode)?.id ===
|
|
156894
|
+
selected: unref(componentSelectedMode) && unref(componentSelectedMode)?.id === unref(id),
|
|
156976
156895
|
settings: "",
|
|
156977
156896
|
stylable: "",
|
|
156978
156897
|
style: normalizeStyle(unref(omit$1)(_ctx.style, "paddingBottom", "paddingLeft", "paddingTop", "paddingRight")),
|
|
156979
156898
|
onEdit: handleEdit,
|
|
156980
|
-
onRemove: _cache[0] || (_cache[0] = ($event) => unref(removeComponentById)(
|
|
156981
|
-
onSelect: _cache[1] || (_cache[1] = ($event) => unref(setComponentSelectedMode)(
|
|
156982
|
-
onSettings: _cache[2] || (_cache[2] = ($event) => unref(setComponentSettingsMode)(
|
|
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))),
|
|
156983
156902
|
onStyle: _cache[3] || (_cache[3] = ($event) => emit("style", $event))
|
|
156984
156903
|
}, {
|
|
156985
156904
|
default: withCtx(() => [
|
|
156986
156905
|
createVNode(RawSectionList, mergeProps({
|
|
156987
|
-
id:
|
|
156906
|
+
id: unref(id),
|
|
156988
156907
|
ref_key: "sectionListRef",
|
|
156989
156908
|
ref: sectionListRef,
|
|
156990
156909
|
class: "pa-2",
|
|
@@ -157002,7 +156921,7 @@ const _sfc_main$1P = /* @__PURE__ */ defineComponent({
|
|
|
157002
156921
|
_: 1
|
|
157003
156922
|
}, 8, ["id", "active", "class", "edit", "exclude-stylables", "remove", "selected", "style"])) : (openBlock(), createBlock(RawSectionList, mergeProps({
|
|
157004
156923
|
key: 2,
|
|
157005
|
-
id:
|
|
156924
|
+
id: unref(id),
|
|
157006
156925
|
data: _ctx.data
|
|
157007
156926
|
}, unref(attrs), {
|
|
157008
156927
|
"has-section-selector-app": !!sectionSelectorAppSrc.value,
|
|
@@ -159530,7 +159449,8 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
|
|
|
159530
159449
|
autofill: {},
|
|
159531
159450
|
linkable: {},
|
|
159532
159451
|
autofill_content_types: {},
|
|
159533
|
-
when_used_in_section: {}
|
|
159452
|
+
when_used_in_section: { default: () => defaultWhenUsedInSection },
|
|
159453
|
+
usedInSectionId: { default: "" }
|
|
159534
159454
|
},
|
|
159535
159455
|
emits: ["style"],
|
|
159536
159456
|
setup(__props, { emit: __emit }) {
|
|
@@ -159541,12 +159461,42 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
|
|
|
159541
159461
|
computed(() => [])
|
|
159542
159462
|
);
|
|
159543
159463
|
const { isCompletionWizardEnabled, retriggerWizard } = useCanvasCompletionWizard();
|
|
159544
|
-
const
|
|
159545
|
-
|
|
159546
|
-
|
|
159547
|
-
|
|
159548
|
-
|
|
159549
|
-
|
|
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
|
+
});
|
|
159550
159500
|
const sectionSelectorAppSrc = computed(() => {
|
|
159551
159501
|
if (!sectionSelectorApps.value?.length || !props.data.selection_app_name) return null;
|
|
159552
159502
|
const relatedApp = sectionSelectorApps.value.find((app) => app.app_metadata?.name === props.data.selection_app_name);
|
|
@@ -159612,7 +159562,7 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
|
|
|
159612
159562
|
async (selectedData) => {
|
|
159613
159563
|
console.info(`[SectionList]: Received done callback for ${props.id} with data`, selectedData);
|
|
159614
159564
|
if (!selectedData) return;
|
|
159615
|
-
const sections = (selectedData?.section_ids || []).map((
|
|
159565
|
+
const sections = (selectedData?.section_ids || []).map((id2) => ({ id: typeof id2 === "string" ? id2 : id2.id }));
|
|
159616
159566
|
const updatedData = { ...props.data, sections };
|
|
159617
159567
|
updateNodeDataById(props.id, updatedData);
|
|
159618
159568
|
const currentContext = cloneDeep(activeCanvas.value?.context || {});
|
|
@@ -159638,22 +159588,6 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
|
|
|
159638
159588
|
contentListRef.value?.toggleSectionSelector();
|
|
159639
159589
|
}
|
|
159640
159590
|
}
|
|
159641
|
-
const {
|
|
159642
|
-
isImpact,
|
|
159643
|
-
mode,
|
|
159644
|
-
isEditMode,
|
|
159645
|
-
componentSelectedMode,
|
|
159646
|
-
isViewOnlyMode,
|
|
159647
|
-
componentEditMode,
|
|
159648
|
-
componentNodesById,
|
|
159649
|
-
activeCanvas,
|
|
159650
|
-
saveCanvasContentWithContext,
|
|
159651
|
-
removeComponentById,
|
|
159652
|
-
setComponentSelectedMode,
|
|
159653
|
-
setComponentSettingsMode,
|
|
159654
|
-
updateNodeDataById,
|
|
159655
|
-
canvasContent
|
|
159656
|
-
} = useCanvas$1();
|
|
159657
159591
|
return (_ctx, _cache) => {
|
|
159658
159592
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
159659
159593
|
unref(shouldDisplayPlaceholderComponent)(unref(isEditMode), unref(mode), _ctx.visible) ? (openBlock(), createBlock(PlaceholderComponent, {
|
|
@@ -159661,25 +159595,25 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
|
|
|
159661
159595
|
name: _ctx.tracking_id
|
|
159662
159596
|
}, null, 8, ["name"])) : unref(isEditMode) && !unref(isViewOnlyMode) ? (openBlock(), createBlock(_sfc_main$34, {
|
|
159663
159597
|
key: 1,
|
|
159664
|
-
id:
|
|
159665
|
-
active: unref(componentEditMode) && unref(componentEditMode)?.id ===
|
|
159598
|
+
id: unref(id),
|
|
159599
|
+
active: unref(componentEditMode) && unref(componentEditMode)?.id === unref(id),
|
|
159666
159600
|
class: normalizeClass({ "mt-12": componentName.value }),
|
|
159667
159601
|
edit: isEditable.value,
|
|
159668
159602
|
"exclude-stylables": [unref(ThemeComponentOptionEnum).COLOR_PICKER],
|
|
159669
159603
|
remove: isRemovable.value,
|
|
159670
|
-
selected: unref(componentSelectedMode) && unref(componentSelectedMode)?.id ===
|
|
159604
|
+
selected: unref(componentSelectedMode) && unref(componentSelectedMode)?.id === unref(id),
|
|
159671
159605
|
settings: "",
|
|
159672
159606
|
stylable: "",
|
|
159673
159607
|
style: normalizeStyle(unref(omit$1)(_ctx.style, "paddingBottom", "paddingLeft", "paddingTop", "paddingRight")),
|
|
159674
159608
|
onEdit: handleEdit,
|
|
159675
|
-
onRemove: _cache[0] || (_cache[0] = ($event) => unref(removeComponentById)(
|
|
159676
|
-
onSelect: _cache[1] || (_cache[1] = ($event) => unref(setComponentSelectedMode)(
|
|
159677
|
-
onSettings: _cache[2] || (_cache[2] = ($event) => unref(setComponentSettingsMode)(
|
|
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))),
|
|
159678
159612
|
onStyle: _cache[3] || (_cache[3] = ($event) => emit("style", $event))
|
|
159679
159613
|
}, {
|
|
159680
159614
|
default: withCtx(() => [
|
|
159681
159615
|
createVNode(ContentListRaw, mergeProps({
|
|
159682
|
-
id:
|
|
159616
|
+
id: unref(id),
|
|
159683
159617
|
ref_key: "contentListRef",
|
|
159684
159618
|
ref: contentListRef,
|
|
159685
159619
|
class: ["pa-2", props.class],
|
|
@@ -159697,7 +159631,7 @@ const _sfc_main$1H = /* @__PURE__ */ defineComponent({
|
|
|
159697
159631
|
_: 1
|
|
159698
159632
|
}, 8, ["id", "active", "class", "edit", "exclude-stylables", "remove", "selected", "style"])) : (openBlock(), createBlock(ContentListRaw, mergeProps({
|
|
159699
159633
|
key: 2,
|
|
159700
|
-
id:
|
|
159634
|
+
id: unref(id),
|
|
159701
159635
|
data: _ctx.data
|
|
159702
159636
|
}, unref(attrs), {
|
|
159703
159637
|
"has-section-selector-app": !!sectionSelectorAppSrc.value,
|
|
@@ -162583,7 +162517,9 @@ const _sfc_main$1w = /* @__PURE__ */ defineComponent({
|
|
|
162583
162517
|
isCanvasTemplate,
|
|
162584
162518
|
isCanvas,
|
|
162585
162519
|
isTemplate,
|
|
162586
|
-
isSection
|
|
162520
|
+
isSection,
|
|
162521
|
+
parentIdByNodeId,
|
|
162522
|
+
componentNodesById
|
|
162587
162523
|
} = useCanvas$1();
|
|
162588
162524
|
const { getComponentDefaultVisibility } = useCanvasVisibility();
|
|
162589
162525
|
const { crmShape } = useCrmShape();
|
|
@@ -162609,7 +162545,7 @@ const _sfc_main$1w = /* @__PURE__ */ defineComponent({
|
|
|
162609
162545
|
);
|
|
162610
162546
|
const areSectionsSystemControlled = computed(() => launchDarkly.value?.are_sections_system_controlled);
|
|
162611
162547
|
const allowEditOrRemove = computed(
|
|
162612
|
-
() => (selectedComponentType.value === ComponentTypes.Text || selectedComponentType.value === ComponentTypes.Carousel || selectedComponentType.value === ComponentTypes.Multimedia) &&
|
|
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)
|
|
162613
162549
|
);
|
|
162614
162550
|
const canSelectSectionListStrategy = computed(
|
|
162615
162551
|
() => isAdmin.value && isCanvasTemplate.value && isSectionOrContentList.value
|
|
@@ -162670,7 +162606,27 @@ const _sfc_main$1w = /* @__PURE__ */ defineComponent({
|
|
|
162670
162606
|
selectedContentGridDataPath.value = value || "";
|
|
162671
162607
|
formValues.contentGridDataAccessor = value || "";
|
|
162672
162608
|
}
|
|
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
|
+
}
|
|
162673
162621
|
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
|
+
}
|
|
162674
162630
|
const map = activeSettingsNode.value?.when_used_in_section ?? cloneDeep(defaultWhenUsedInSection);
|
|
162675
162631
|
let value = "";
|
|
162676
162632
|
value += map.is_editable ? "1" : "0";
|
|
@@ -163172,7 +163128,7 @@ const _sfc_main$1w = /* @__PURE__ */ defineComponent({
|
|
|
163172
163128
|
}
|
|
163173
163129
|
});
|
|
163174
163130
|
|
|
163175
|
-
const ComponentDrawerSettings = /* @__PURE__ */ _export_sfc(_sfc_main$1w, [["__scopeId", "data-v-
|
|
163131
|
+
const ComponentDrawerSettings = /* @__PURE__ */ _export_sfc(_sfc_main$1w, [["__scopeId", "data-v-7724d85a"]]);
|
|
163176
163132
|
|
|
163177
163133
|
function useConnectUpload() {
|
|
163178
163134
|
async function uploadToConnect(formData) {
|