@pitcher/canvas-ui 2026.1.14-135114 → 2026.1.14-143747-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 +30 -30
- package/canvas-ui.js +311 -454
- package/canvas-ui.js.map +1 -1
- package/lib/apps/browser/stores/api.d.ts +0 -18
- 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() {
|
|
@@ -109731,11 +109616,9 @@ const _sfc_main$4U = /* @__PURE__ */ defineComponent({
|
|
|
109731
109616
|
function filterByItemVisibility(items) {
|
|
109732
109617
|
const isAdmin = state$3.appName.value === "admin";
|
|
109733
109618
|
return items.reduce((acc, item) => {
|
|
109734
|
-
const hasCountData = "files_count" in item || "folders_count" in item || "available_files_count" in item || "available_folders_count" in item;
|
|
109735
109619
|
const filesCount = item.available_files_count ?? item.files_count ?? 0;
|
|
109736
109620
|
const foldersCount = item.available_folders_count ?? item.folders_count ?? 0;
|
|
109737
|
-
const
|
|
109738
|
-
const shouldHideItem = item.name?.startsWith(".") || isFolderEmpty || item.folder?.file_thumbnail_urls?.length === 0;
|
|
109621
|
+
const shouldHideItem = item.name?.startsWith(".") || item.type == "folder" && filesCount === 0 && foldersCount === 0 || item.folder?.file_thumbnail_urls?.length === 0;
|
|
109739
109622
|
if (!shouldHideItem && !isAdmin || isAdmin) {
|
|
109740
109623
|
acc.push({
|
|
109741
109624
|
...item,
|
|
@@ -110112,8 +109995,7 @@ const getInitialState$1 = () => ({
|
|
|
110112
109995
|
// instance metadata template fields dictionary
|
|
110113
109996
|
searchQuery: "",
|
|
110114
109997
|
searchMetadataFilters: {},
|
|
110115
|
-
filteredItems: []
|
|
110116
|
-
folderCache: {}
|
|
109998
|
+
filteredItems: []
|
|
110117
109999
|
});
|
|
110118
110000
|
const state$2 = reactive(getInitialState$1());
|
|
110119
110001
|
const fileOrderedStatuses = [FileStatusEnum.PENDING, FileStatusEnum.VIEWABLE];
|
|
@@ -110198,15 +110080,6 @@ function updateFolderState(folder) {
|
|
|
110198
110080
|
state$2.folders = folder.folders;
|
|
110199
110081
|
state$2.files = folder.files;
|
|
110200
110082
|
state$2.currentFolderPath = folder.path;
|
|
110201
|
-
folder.folders.forEach((subfolder) => {
|
|
110202
|
-
state$2.folderCache[subfolder.id] = {
|
|
110203
|
-
files_count: subfolder.files_count,
|
|
110204
|
-
folders_count: subfolder.folders_count,
|
|
110205
|
-
available_files_count: subfolder.available_files_count,
|
|
110206
|
-
available_folders_count: subfolder.available_folders_count,
|
|
110207
|
-
timestamp: Date.now()
|
|
110208
|
-
};
|
|
110209
|
-
});
|
|
110210
110083
|
if (useAppStore$4().showFilteredResults.value) {
|
|
110211
110084
|
const filesById = new Map(state$2.files.map((file) => [file.id, file]));
|
|
110212
110085
|
state$2.filteredItems = state$2.filteredItems.map((filteredItem) => {
|
|
@@ -110471,24 +110344,7 @@ function init({
|
|
|
110471
110344
|
}
|
|
110472
110345
|
let filteredFolders = [];
|
|
110473
110346
|
if (!hasMetadataFilters && foldersResponse.status === "fulfilled" && foldersResponse.value) {
|
|
110474
|
-
|
|
110475
|
-
filteredFolders = foldersFromSearch.map((folder) => {
|
|
110476
|
-
const cached = state$2.folderCache[folder.id];
|
|
110477
|
-
if (cached) {
|
|
110478
|
-
const result = {
|
|
110479
|
-
...folder,
|
|
110480
|
-
type: "folder"
|
|
110481
|
-
};
|
|
110482
|
-
if (cached.files_count !== void 0) result.files_count = cached.files_count;
|
|
110483
|
-
if (cached.folders_count !== void 0) result.folders_count = cached.folders_count;
|
|
110484
|
-
if (cached.available_files_count !== void 0) result.available_files_count = cached.available_files_count;
|
|
110485
|
-
if (cached.available_folders_count !== void 0) {
|
|
110486
|
-
result.available_folders_count = cached.available_folders_count;
|
|
110487
|
-
}
|
|
110488
|
-
return result;
|
|
110489
|
-
}
|
|
110490
|
-
return { ...folder, type: "folder" };
|
|
110491
|
-
});
|
|
110347
|
+
filteredFolders = foldersResponse.value.results?.map((f) => ({ ...f, type: "folder" })) ?? [];
|
|
110492
110348
|
} else if (!hasMetadataFilters && !useAppStore$4().isLocalSearch.value) {
|
|
110493
110349
|
console.error(
|
|
110494
110350
|
"Failed to fetch folders:",
|
|
@@ -176434,10 +176290,10 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
176434
176290
|
__name: "ActionsToolbar",
|
|
176435
176291
|
setup(__props) {
|
|
176436
176292
|
useCssVars((_ctx) => ({
|
|
176437
|
-
"
|
|
176438
|
-
"
|
|
176439
|
-
"
|
|
176440
|
-
"
|
|
176293
|
+
"c6ccac5c": unref(themeVars).primary4,
|
|
176294
|
+
"3edbaaa2": unref(themeVars).primary,
|
|
176295
|
+
"c6ccac58": unref(themeVars).primary6,
|
|
176296
|
+
"0f45ae31": unref(themeVars).base
|
|
176441
176297
|
}));
|
|
176442
176298
|
const {
|
|
176443
176299
|
toggleContentPanel,
|
|
@@ -176665,7 +176521,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
176665
176521
|
return (nameMatch || createdByMatch || tagMatch) && metadataMatch;
|
|
176666
176522
|
});
|
|
176667
176523
|
const folderResults = folders.map((folder) => {
|
|
176668
|
-
|
|
176524
|
+
return {
|
|
176669
176525
|
id: folder.id,
|
|
176670
176526
|
name: folder.name,
|
|
176671
176527
|
folder_id: apiState.currentFolderId,
|
|
@@ -176677,11 +176533,6 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
176677
176533
|
file_thumbnail_urls: folder.file_thumbnail_urls,
|
|
176678
176534
|
thumbnail_url: folder.thumbnail_url
|
|
176679
176535
|
};
|
|
176680
|
-
if (folder.files_count !== void 0) result.files_count = folder.files_count;
|
|
176681
|
-
if (folder.folders_count !== void 0) result.folders_count = folder.folders_count;
|
|
176682
|
-
if (folder.available_files_count !== void 0) result.available_files_count = folder.available_files_count;
|
|
176683
|
-
if (folder.available_folders_count !== void 0) result.available_folders_count = folder.available_folders_count;
|
|
176684
|
-
return result;
|
|
176685
176536
|
});
|
|
176686
176537
|
const fileResults = files.map((file) => {
|
|
176687
176538
|
return {
|
|
@@ -176910,7 +176761,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
176910
176761
|
}
|
|
176911
176762
|
});
|
|
176912
176763
|
|
|
176913
|
-
const ActionsToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-
|
|
176764
|
+
const ActionsToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-fecebf5a"]]);
|
|
176914
176765
|
|
|
176915
176766
|
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
176916
176767
|
__name: "FavoritesTable",
|
|
@@ -183776,7 +183627,7 @@ function evaluateIsExecutedCondition(condition, event) {
|
|
|
183776
183627
|
});
|
|
183777
183628
|
jsCondition = jsCondition.replace(
|
|
183778
183629
|
/(["'])((?:[^"\\]|\\.)*)\1\s*(===|!==)\s*(["'])((?:[^"\\]|\\.)*)\4/g,
|
|
183779
|
-
(
|
|
183630
|
+
(_match, _leftQuote, leftValue, operator, _rightQuote, rightValue) => {
|
|
183780
183631
|
return `"${leftValue}".toLowerCase() ${operator} "${rightValue}".toLowerCase()`;
|
|
183781
183632
|
}
|
|
183782
183633
|
);
|
|
@@ -183811,7 +183662,7 @@ function evaluateIsExecutedForPascalCaseEvent(condition, event) {
|
|
|
183811
183662
|
});
|
|
183812
183663
|
jsCondition = jsCondition.replace(
|
|
183813
183664
|
/(["'])((?:[^"\\]|\\.)*)\1\s*(===|!==)\s*(["'])((?:[^"\\]|\\.)*)\4/g,
|
|
183814
|
-
(
|
|
183665
|
+
(_match, _leftQuote, leftValue, operator, _rightQuote, rightValue) => {
|
|
183815
183666
|
return `"${leftValue}".toLowerCase() ${operator} "${rightValue}".toLowerCase()`;
|
|
183816
183667
|
}
|
|
183817
183668
|
);
|
|
@@ -183825,7 +183676,9 @@ function evaluateIsExecutedForPascalCaseEvent(condition, event) {
|
|
|
183825
183676
|
}
|
|
183826
183677
|
}
|
|
183827
183678
|
function getEventColor(sfEvent) {
|
|
183828
|
-
if (!sfEvent.WhatCount && !sfEvent.WhoCount)
|
|
183679
|
+
if (!sfEvent.WhatCount && !sfEvent.WhoCount) {
|
|
183680
|
+
return SfEventColors.TIME_OFF_TERRITORY;
|
|
183681
|
+
}
|
|
183829
183682
|
let isSubmitted = false;
|
|
183830
183683
|
if (sfEvent.is_executed_condition) {
|
|
183831
183684
|
isSubmitted = evaluateIsExecutedCondition(sfEvent.is_executed_condition, sfEvent);
|
|
@@ -183833,14 +183686,18 @@ function getEventColor(sfEvent) {
|
|
|
183833
183686
|
isSubmitted = false;
|
|
183834
183687
|
}
|
|
183835
183688
|
const now = /* @__PURE__ */ new Date();
|
|
183836
|
-
if (isSubmitted)
|
|
183837
|
-
|
|
183689
|
+
if (isSubmitted) {
|
|
183690
|
+
return SfEventColors.SUBMITTED;
|
|
183691
|
+
} else if (sfEvent.IsAllDayEvent) {
|
|
183838
183692
|
const endDate = new Date(sfEvent.EndDateTime);
|
|
183839
183693
|
const todayStart = startOfDay(now);
|
|
183840
183694
|
const endDayStart = startOfDay(endDate);
|
|
183841
183695
|
return isAfter$1(todayStart, endDayStart) ? SfEventColors.PAST : SfEventColors.PLANNED;
|
|
183842
|
-
} else if (isAfter$1(now, new Date(sfEvent.EndDateTime)))
|
|
183843
|
-
|
|
183696
|
+
} else if (isAfter$1(now, new Date(sfEvent.EndDateTime))) {
|
|
183697
|
+
return SfEventColors.PAST;
|
|
183698
|
+
} else {
|
|
183699
|
+
return SfEventColors.PLANNED;
|
|
183700
|
+
}
|
|
183844
183701
|
}
|
|
183845
183702
|
const minFutureDate = (date = /* @__PURE__ */ new Date()) => add(date, { minutes: MIN_DIFFERENCE_IN_MINUTES });
|
|
183846
183703
|
const minPastDate = (date = /* @__PURE__ */ new Date()) => sub(date, { minutes: MIN_DIFFERENCE_IN_MINUTES });
|