@pitcher/canvas-ui 2026.1.14-143747-beta → 2026.1.15-101627-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 +449 -300
- package/canvas-ui.js.map +1 -1
- package/lib/apps/browser/stores/api.d.ts +18 -0
- package/lib/apps/canvas-builder/composables/useCanvas.d.ts +0 -5
- package/lib/composables/useSmartStore.d.ts +1 -1
- package/lib/sdk/api/modules/query.d.ts +3 -3
- package/lib/types/instanceSettings.types.d.ts +0 -1
- package/lib/types/launchDarkly.types.d.ts +1 -1
- package/package.json +1 -1
package/canvas-ui.js
CHANGED
|
@@ -88214,7 +88214,7 @@ async function crmQueryAdaptive(payload) {
|
|
|
88214
88214
|
try {
|
|
88215
88215
|
const env = await highLevelApi.API.request("get_env");
|
|
88216
88216
|
const isIos = env?.mode === "IOS";
|
|
88217
|
-
const isSfdcSyncEnabled = env?.
|
|
88217
|
+
const isSfdcSyncEnabled = env?.launch_darkly?.sfdc_offline_enabled === true;
|
|
88218
88218
|
useSmartStore = isIos && isSfdcSyncEnabled;
|
|
88219
88219
|
} catch {
|
|
88220
88220
|
useSmartStore = false;
|
|
@@ -95692,111 +95692,115 @@ const _hoisted_14$h = {
|
|
|
95692
95692
|
key: 0,
|
|
95693
95693
|
class: "flex items-center ml-2"
|
|
95694
95694
|
};
|
|
95695
|
-
const _hoisted_15$f = {
|
|
95696
|
-
|
|
95695
|
+
const _hoisted_15$f = { class: "flex items-center" };
|
|
95696
|
+
const _hoisted_16$e = { key: 0 };
|
|
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,
|
|
95697
95701
|
class: "flex items-center ml-2"
|
|
95698
95702
|
};
|
|
95699
|
-
const
|
|
95700
|
-
const
|
|
95703
|
+
const _hoisted_20$9 = { class: "flex flex-col w-full flex-1 min-h-0" };
|
|
95704
|
+
const _hoisted_21$7 = {
|
|
95701
95705
|
key: 0,
|
|
95702
95706
|
class: "flex-1 overflow-y-auto bg-white w-full pl-1 pr-6 py-0"
|
|
95703
95707
|
};
|
|
95704
|
-
const
|
|
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" };
|
|
95708
|
+
const _hoisted_22$5 = { class: "space-y-1 mt-4" };
|
|
95709
95709
|
const _hoisted_23$5 = ["onClick"];
|
|
95710
|
-
const _hoisted_24$5 = {
|
|
95710
|
+
const _hoisted_24$5 = { class: "text-sm text-gray-700" };
|
|
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 = {
|
|
95711
95715
|
key: 0,
|
|
95712
95716
|
class: "relative mr-4"
|
|
95713
95717
|
};
|
|
95714
|
-
const
|
|
95718
|
+
const _hoisted_29$5 = {
|
|
95715
95719
|
key: 0,
|
|
95716
95720
|
class: "absolute inset-0 flex items-center justify-center bg-gray-200 bg-opacity-75 border-rounded-1"
|
|
95717
95721
|
};
|
|
95718
|
-
const
|
|
95722
|
+
const _hoisted_30$4 = {
|
|
95719
95723
|
key: 1,
|
|
95720
95724
|
class: "w-18 h-14 border-rounded-1 mr-4 flex-shrink-0 bg-gray-200 flex items-center justify-center"
|
|
95721
95725
|
};
|
|
95722
|
-
const
|
|
95723
|
-
const
|
|
95724
|
-
const
|
|
95725
|
-
const
|
|
95726
|
+
const _hoisted_31$4 = { class: "flex-1 min-w-0" };
|
|
95727
|
+
const _hoisted_32$4 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
|
|
95728
|
+
const _hoisted_33$4 = { class: "text-xs text-gray-500" };
|
|
95729
|
+
const _hoisted_34$4 = {
|
|
95726
95730
|
key: 1,
|
|
95727
95731
|
class: "flex-1 overflow-y-auto bg-white w-full"
|
|
95728
95732
|
};
|
|
95729
|
-
const
|
|
95730
|
-
const
|
|
95733
|
+
const _hoisted_35$4 = { class: "w-full px-0" };
|
|
95734
|
+
const _hoisted_36$4 = {
|
|
95731
95735
|
key: 0,
|
|
95732
95736
|
class: "flex flex-col items-center justify-center text-center p-8 gap-4"
|
|
95733
95737
|
};
|
|
95734
|
-
const
|
|
95738
|
+
const _hoisted_37$4 = {
|
|
95735
95739
|
key: 0,
|
|
95736
95740
|
class: "mb-0"
|
|
95737
95741
|
};
|
|
95738
|
-
const
|
|
95739
|
-
const
|
|
95740
|
-
const
|
|
95741
|
-
const
|
|
95742
|
-
const
|
|
95742
|
+
const _hoisted_38$4 = { class: "flex items-center px-0 pt-2 pb-1" };
|
|
95743
|
+
const _hoisted_39$4 = { class: "text-m font-semibold text-gray-900" };
|
|
95744
|
+
const _hoisted_40$4 = { class: "ml-2 text-sm text-gray-500" };
|
|
95745
|
+
const _hoisted_41$4 = ["data-result-selected", "onClick"];
|
|
95746
|
+
const _hoisted_42$4 = {
|
|
95743
95747
|
key: 1,
|
|
95744
95748
|
class: "w-18 h-14 border-rounded-1 mr-4 flex-shrink-0 bg-gray-200 flex items-center justify-center"
|
|
95745
95749
|
};
|
|
95746
|
-
const
|
|
95747
|
-
const
|
|
95748
|
-
const
|
|
95749
|
-
const
|
|
95750
|
-
const
|
|
95751
|
-
const
|
|
95750
|
+
const _hoisted_43$4 = { class: "flex-1 min-w-0" };
|
|
95751
|
+
const _hoisted_44$4 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
|
|
95752
|
+
const _hoisted_45$4 = ["innerHTML"];
|
|
95753
|
+
const _hoisted_46$4 = { class: "text-xs text-gray-500" };
|
|
95754
|
+
const _hoisted_47$4 = { class: "text-xs text-gray-400" };
|
|
95755
|
+
const _hoisted_48$4 = {
|
|
95752
95756
|
key: 0,
|
|
95753
95757
|
class: "px-0 py-0"
|
|
95754
95758
|
};
|
|
95755
|
-
const
|
|
95756
|
-
const
|
|
95757
|
-
const
|
|
95758
|
-
const
|
|
95759
|
-
const
|
|
95760
|
-
const
|
|
95761
|
-
const
|
|
95762
|
-
const
|
|
95763
|
-
const
|
|
95764
|
-
const
|
|
95765
|
-
const
|
|
95759
|
+
const _hoisted_49$4 = { key: 1 };
|
|
95760
|
+
const _hoisted_50$4 = { class: "flex items-center px-0 pt-2 pb-1" };
|
|
95761
|
+
const _hoisted_51$3 = { class: "text-m font-semibold text-gray-900" };
|
|
95762
|
+
const _hoisted_52$3 = { class: "ml-2 text-sm text-gray-500" };
|
|
95763
|
+
const _hoisted_53$3 = ["data-result-selected", "onClick"];
|
|
95764
|
+
const _hoisted_54$2 = { class: "w-18 h-14 border-rounded-1 mr-4 flex-shrink-0 bg-gray-200 flex items-center justify-center" };
|
|
95765
|
+
const _hoisted_55$2 = { class: "flex-1 min-w-0" };
|
|
95766
|
+
const _hoisted_56$2 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
|
|
95767
|
+
const _hoisted_57$2 = { class: "text-xs text-gray-500" };
|
|
95768
|
+
const _hoisted_58$2 = { class: "text-xs text-gray-400" };
|
|
95769
|
+
const _hoisted_59$2 = {
|
|
95766
95770
|
key: 0,
|
|
95767
95771
|
class: "px-0 py-0"
|
|
95768
95772
|
};
|
|
95769
|
-
const
|
|
95773
|
+
const _hoisted_60$2 = {
|
|
95770
95774
|
key: 2,
|
|
95771
95775
|
class: "flex flex-col items-center justify-center text-center p-8 gap-4"
|
|
95772
95776
|
};
|
|
95773
|
-
const
|
|
95777
|
+
const _hoisted_61$2 = {
|
|
95774
95778
|
key: 2,
|
|
95775
95779
|
class: "flex-1 overflow-y-auto bg-white w-full"
|
|
95776
95780
|
};
|
|
95777
|
-
const
|
|
95778
|
-
const
|
|
95781
|
+
const _hoisted_62$2 = { class: "w-full px-0" };
|
|
95782
|
+
const _hoisted_63$2 = {
|
|
95779
95783
|
key: 0,
|
|
95780
95784
|
class: "flex flex-col items-center justify-center text-center p-8 gap-4"
|
|
95781
95785
|
};
|
|
95782
|
-
const
|
|
95783
|
-
const
|
|
95784
|
-
const
|
|
95785
|
-
const
|
|
95786
|
-
const
|
|
95786
|
+
const _hoisted_64$2 = { class: "flex items-center px-0 pt-2 pb-1" };
|
|
95787
|
+
const _hoisted_65$2 = { class: "text-m font-semibold text-gray-900" };
|
|
95788
|
+
const _hoisted_66$2 = { class: "ml-2 text-sm text-gray-500" };
|
|
95789
|
+
const _hoisted_67$2 = ["data-result-selected", "onClick"];
|
|
95790
|
+
const _hoisted_68$2 = {
|
|
95787
95791
|
key: 1,
|
|
95788
95792
|
class: "w-18 h-14 border-rounded-1 mr-4 flex-shrink-0 bg-gray-200 flex items-center justify-center"
|
|
95789
95793
|
};
|
|
95790
|
-
const
|
|
95791
|
-
const
|
|
95792
|
-
const
|
|
95793
|
-
const
|
|
95794
|
-
const
|
|
95795
|
-
const
|
|
95794
|
+
const _hoisted_69$1 = { class: "flex-1 min-w-0" };
|
|
95795
|
+
const _hoisted_70$1 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
|
|
95796
|
+
const _hoisted_71$1 = ["innerHTML"];
|
|
95797
|
+
const _hoisted_72$1 = { class: "text-xs text-gray-500" };
|
|
95798
|
+
const _hoisted_73$1 = { class: "text-xs text-gray-400" };
|
|
95799
|
+
const _hoisted_74$1 = {
|
|
95796
95800
|
key: 0,
|
|
95797
95801
|
class: "flex flex-col items-center justify-center text-center p-8 gap-4"
|
|
95798
95802
|
};
|
|
95799
|
-
const
|
|
95803
|
+
const _hoisted_75$1 = {
|
|
95800
95804
|
key: 0,
|
|
95801
95805
|
class: "flex flex-wrap line-height-6 pt-4 pb-2 px-6 border-t border-gray-200 gap-y-4 gap-x-4"
|
|
95802
95806
|
};
|
|
@@ -95823,6 +95827,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
95823
95827
|
const selectedFileTypes = ref([]);
|
|
95824
95828
|
const showFileTypeDropdown = ref(false);
|
|
95825
95829
|
const selectedCanvasFilters = ref([]);
|
|
95830
|
+
const showCanvasTypeDropdown = ref(false);
|
|
95826
95831
|
const fileTypeOptions = [
|
|
95827
95832
|
{ label: "Folder", value: "folder" },
|
|
95828
95833
|
{ label: "PDF", value: "pdf" },
|
|
@@ -95835,6 +95840,42 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
95835
95840
|
{ label: "AR", value: "ar" },
|
|
95836
95841
|
{ label: "Web", value: "web" }
|
|
95837
95842
|
];
|
|
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
|
+
});
|
|
95838
95879
|
const hasActiveFilters = computed(() => selectedFileTypes.value.length > 0 || selectedCanvasFilters.value.length > 0);
|
|
95839
95880
|
const clearAllFilters = () => {
|
|
95840
95881
|
selectedFileTypes.value = [];
|
|
@@ -95845,7 +95886,9 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
95845
95886
|
selectedFileTypes.value = [];
|
|
95846
95887
|
selectedCanvasFilters.value = [];
|
|
95847
95888
|
searchType.value = null;
|
|
95848
|
-
if (searchQuery.value.trim()) {
|
|
95889
|
+
if (searchQuery.value.trim() && (unfilteredContentResults.value.length > 0 || unfilteredCanvasResults.value.length > 0)) {
|
|
95890
|
+
applyFiltersToResults();
|
|
95891
|
+
} else if (searchQuery.value.trim()) {
|
|
95849
95892
|
try {
|
|
95850
95893
|
skipNextSuggestionFetch.value = true;
|
|
95851
95894
|
await performSearch(searchQuery.value);
|
|
@@ -95981,8 +96024,11 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
95981
96024
|
};
|
|
95982
96025
|
const contentResults = ref([]);
|
|
95983
96026
|
const canvasResults = ref([]);
|
|
96027
|
+
const unfilteredContentResults = ref([]);
|
|
96028
|
+
const unfilteredCanvasResults = ref([]);
|
|
95984
96029
|
const isSearching = ref(false);
|
|
95985
96030
|
const hasSearchCompleted = ref(false);
|
|
96031
|
+
let currentSearchId = 0;
|
|
95986
96032
|
const querySuggestions = ref([]);
|
|
95987
96033
|
const selectedSuggestionIndex = ref(-1);
|
|
95988
96034
|
const selectedResultIndex = ref(-1);
|
|
@@ -95999,6 +96045,44 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
95999
96045
|
}
|
|
96000
96046
|
return canvasResults.value;
|
|
96001
96047
|
});
|
|
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
|
+
});
|
|
96002
96086
|
const shouldShowNoResults = computed(() => {
|
|
96003
96087
|
if (showRecentView.value || !searchQuery.value.trim() || isSearching.value || !hasSearchCompleted.value) return false;
|
|
96004
96088
|
if (searchType.value === "content") {
|
|
@@ -96042,6 +96126,32 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96042
96126
|
};
|
|
96043
96127
|
watch(searchType, () => {
|
|
96044
96128
|
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
|
+
}
|
|
96045
96155
|
});
|
|
96046
96156
|
const scrollSelectedResultIntoView = () => {
|
|
96047
96157
|
nextTick(() => {
|
|
@@ -96085,6 +96195,8 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96085
96195
|
if (!query.trim()) {
|
|
96086
96196
|
contentResults.value = [];
|
|
96087
96197
|
canvasResults.value = [];
|
|
96198
|
+
unfilteredContentResults.value = [];
|
|
96199
|
+
unfilteredCanvasResults.value = [];
|
|
96088
96200
|
hasSearchCompleted.value = false;
|
|
96089
96201
|
isSearching.value = false;
|
|
96090
96202
|
searchError.value = null;
|
|
@@ -96093,59 +96205,51 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96093
96205
|
isSearching.value = true;
|
|
96094
96206
|
hasSearchCompleted.value = false;
|
|
96095
96207
|
searchError.value = null;
|
|
96208
|
+
const searchId = ++currentSearchId;
|
|
96096
96209
|
const shouldSkipSuggestionFetch = skipNextSuggestionFetch.value;
|
|
96097
96210
|
if (shouldSkipSuggestionFetch) {
|
|
96098
96211
|
skipNextSuggestionFetch.value = false;
|
|
96099
96212
|
}
|
|
96100
96213
|
try {
|
|
96101
|
-
const
|
|
96102
|
-
|
|
96103
|
-
|
|
96104
|
-
"
|
|
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);
|
|
96214
|
+
const validCanvasFilters = selectedCanvasFilters.value.filter((filter) => ALLOWED_CANVAS_TYPES.includes(filter));
|
|
96215
|
+
if (selectedCanvasFilters.value.length !== validCanvasFilters.length) {
|
|
96216
|
+
const invalid = selectedCanvasFilters.value.filter((filter) => !ALLOWED_CANVAS_TYPES.includes(filter));
|
|
96217
|
+
console.warn("[CAlgoliaSearch] Invalid canvas filters removed:", invalid);
|
|
96124
96218
|
selectedCanvasFilters.value = validCanvasFilters;
|
|
96125
96219
|
}
|
|
96126
|
-
const
|
|
96127
|
-
|
|
96128
|
-
|
|
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);
|
|
96220
|
+
const validFileTypes = selectedFileTypes.value.filter((type) => ALLOWED_FILE_TYPES.includes(type));
|
|
96221
|
+
if (selectedFileTypes.value.length !== validFileTypes.length) {
|
|
96222
|
+
const invalid = selectedFileTypes.value.filter((type) => !ALLOWED_FILE_TYPES.includes(type));
|
|
96223
|
+
console.warn("[CAlgoliaSearch] Invalid file type filters removed:", invalid);
|
|
96137
96224
|
selectedFileTypes.value = validFileTypes;
|
|
96138
96225
|
}
|
|
96139
|
-
const contentFilters = validFileTypes.length > 0 ? ` AND (${validFileTypes.map((type) => type === "folder" ? `type:"${type}"` : `file_category:"${type}"`).join(" OR ")})` : "";
|
|
96140
96226
|
const results = await searchViaBackend(query.trim(), {
|
|
96141
|
-
canvas:
|
|
96142
|
-
content:
|
|
96227
|
+
canvas: "",
|
|
96228
|
+
content: ""
|
|
96143
96229
|
});
|
|
96144
96230
|
if (query.trim() !== searchQuery.value.trim()) {
|
|
96145
96231
|
return;
|
|
96146
96232
|
}
|
|
96147
|
-
|
|
96148
|
-
|
|
96233
|
+
unfilteredContentResults.value = results.content?.hits || [];
|
|
96234
|
+
unfilteredCanvasResults.value = results.canvas?.hits || [];
|
|
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;
|
|
96149
96253
|
selectedResultIndex.value = -1;
|
|
96150
96254
|
searchError.value = null;
|
|
96151
96255
|
if (query.trim().length >= 2 && !shouldSkipSuggestionFetch) {
|
|
@@ -96158,23 +96262,27 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96158
96262
|
}
|
|
96159
96263
|
await nextTick();
|
|
96160
96264
|
setTimeout(() => {
|
|
96161
|
-
|
|
96162
|
-
|
|
96265
|
+
if (searchId === currentSearchId) {
|
|
96266
|
+
isSearching.value = false;
|
|
96267
|
+
hasSearchCompleted.value = true;
|
|
96268
|
+
}
|
|
96163
96269
|
}, 50);
|
|
96164
96270
|
} catch (error) {
|
|
96165
96271
|
console.error("Search error:", error);
|
|
96166
|
-
|
|
96167
|
-
|
|
96168
|
-
|
|
96169
|
-
|
|
96170
|
-
|
|
96171
|
-
|
|
96172
|
-
|
|
96173
|
-
|
|
96174
|
-
|
|
96175
|
-
|
|
96176
|
-
|
|
96177
|
-
|
|
96272
|
+
if (searchId === currentSearchId) {
|
|
96273
|
+
contentResults.value = [];
|
|
96274
|
+
canvasResults.value = [];
|
|
96275
|
+
isSearching.value = false;
|
|
96276
|
+
hasSearchCompleted.value = true;
|
|
96277
|
+
if (error.message === "AUTH_REQUIRED") {
|
|
96278
|
+
searchError.value = "Please sign in to search";
|
|
96279
|
+
} else if (error.message === "AUTH_EXPIRED") {
|
|
96280
|
+
searchError.value = "Your session has expired. Please sign in again";
|
|
96281
|
+
} else if (error.message === "AUTH_FORBIDDEN") {
|
|
96282
|
+
searchError.value = "You do not have permission to search this instance";
|
|
96283
|
+
} else {
|
|
96284
|
+
searchError.value = "Search failed. Please try again";
|
|
96285
|
+
}
|
|
96178
96286
|
}
|
|
96179
96287
|
}
|
|
96180
96288
|
};
|
|
@@ -96184,19 +96292,38 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96184
96292
|
if (!query || typeof query !== "string") return "";
|
|
96185
96293
|
return query;
|
|
96186
96294
|
}
|
|
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
|
+
}
|
|
96187
96321
|
const debouncedFilterSearch = () => {
|
|
96188
96322
|
if (filterChangeTimer) clearTimeout(filterChangeTimer);
|
|
96189
96323
|
if (searchTimer) clearTimeout(searchTimer);
|
|
96190
96324
|
filterChangeTimer = setTimeout(async () => {
|
|
96191
96325
|
if (searchQuery.value.trim() && !showRecentView.value) {
|
|
96192
|
-
|
|
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
|
-
}
|
|
96326
|
+
applyFiltersToResults();
|
|
96200
96327
|
}
|
|
96201
96328
|
}, 500);
|
|
96202
96329
|
};
|
|
@@ -96222,6 +96349,8 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96222
96349
|
showRecentView.value = true;
|
|
96223
96350
|
contentResults.value = [];
|
|
96224
96351
|
canvasResults.value = [];
|
|
96352
|
+
unfilteredContentResults.value = [];
|
|
96353
|
+
unfilteredCanvasResults.value = [];
|
|
96225
96354
|
querySuggestions.value = [];
|
|
96226
96355
|
selectedSuggestionIndex.value = -1;
|
|
96227
96356
|
selectedResultIndex.value = -1;
|
|
@@ -96235,6 +96364,8 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96235
96364
|
showRecentView.value = true;
|
|
96236
96365
|
contentResults.value = [];
|
|
96237
96366
|
canvasResults.value = [];
|
|
96367
|
+
unfilteredContentResults.value = [];
|
|
96368
|
+
unfilteredCanvasResults.value = [];
|
|
96238
96369
|
querySuggestions.value = [];
|
|
96239
96370
|
selectedSuggestionIndex.value = -1;
|
|
96240
96371
|
selectedResultIndex.value = -1;
|
|
@@ -96359,31 +96490,31 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96359
96490
|
if (endChar < highlightValue.length) truncated = truncated + "...";
|
|
96360
96491
|
return sanitizeHtml(truncated);
|
|
96361
96492
|
};
|
|
96362
|
-
const
|
|
96363
|
-
if (
|
|
96364
|
-
|
|
96493
|
+
const handleFileTypeToggle = (value, checked) => {
|
|
96494
|
+
if (checked) {
|
|
96495
|
+
if (!selectedFileTypes.value.includes(value)) {
|
|
96496
|
+
selectedFileTypes.value.push(value);
|
|
96497
|
+
}
|
|
96365
96498
|
} else {
|
|
96366
|
-
|
|
96499
|
+
selectedFileTypes.value = selectedFileTypes.value.filter((v) => v !== value);
|
|
96367
96500
|
}
|
|
96368
96501
|
debouncedFilterSearch();
|
|
96369
96502
|
};
|
|
96370
|
-
const
|
|
96371
|
-
selectedCanvasFilters.value = [];
|
|
96372
|
-
debouncedFilterSearch();
|
|
96373
|
-
};
|
|
96374
|
-
const toggleFileType = (fileType, checked) => {
|
|
96503
|
+
const handleCanvasTypeToggle = (value, checked) => {
|
|
96375
96504
|
if (checked) {
|
|
96376
|
-
if (!
|
|
96377
|
-
|
|
96505
|
+
if (!selectedCanvasFilters.value.includes(value)) {
|
|
96506
|
+
selectedCanvasFilters.value.push(value);
|
|
96378
96507
|
}
|
|
96379
96508
|
} else {
|
|
96380
|
-
|
|
96381
|
-
if (index > -1) {
|
|
96382
|
-
selectedFileTypes.value.splice(index, 1);
|
|
96383
|
-
}
|
|
96509
|
+
selectedCanvasFilters.value = selectedCanvasFilters.value.filter((v) => v !== value);
|
|
96384
96510
|
}
|
|
96385
96511
|
debouncedFilterSearch();
|
|
96386
96512
|
};
|
|
96513
|
+
const clearCanvasFilters = () => {
|
|
96514
|
+
selectedCanvasFilters.value = [];
|
|
96515
|
+
showCanvasTypeDropdown.value = false;
|
|
96516
|
+
debouncedFilterSearch();
|
|
96517
|
+
};
|
|
96387
96518
|
const clearFileTypes = () => {
|
|
96388
96519
|
selectedFileTypes.value = [];
|
|
96389
96520
|
showFileTypeDropdown.value = false;
|
|
@@ -96554,7 +96685,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96554
96685
|
show: "",
|
|
96555
96686
|
verticalAlignment: "top",
|
|
96556
96687
|
"z-index": _ctx.zIndex,
|
|
96557
|
-
"onUpdate:show": _cache[
|
|
96688
|
+
"onUpdate:show": _cache[12] || (_cache[12] = ($event) => emit("toggleSearch", $event))
|
|
96558
96689
|
}, {
|
|
96559
96690
|
default: withCtx(() => [
|
|
96560
96691
|
createElementVNode("div", {
|
|
@@ -96563,7 +96694,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96563
96694
|
}, [
|
|
96564
96695
|
createElementVNode("div", _hoisted_1$4w, [
|
|
96565
96696
|
createElementVNode("div", _hoisted_2$3j, [
|
|
96566
|
-
_cache[
|
|
96697
|
+
_cache[13] || (_cache[13] = createElementVNode("div", { class: "absolute left-2.5 top-1/2 transform -translate-y-1/2 z-10" }, [
|
|
96567
96698
|
createElementVNode("i", { class: "c-icon far fa-search text-gray-400 text-l" })
|
|
96568
96699
|
], -1)),
|
|
96569
96700
|
withDirectives(createElementVNode("input", {
|
|
@@ -96660,7 +96791,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96660
96791
|
createElementVNode("span", null, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.tabs.pitchDecks")), 1)
|
|
96661
96792
|
], 2)) : createCommentVNode("", true)
|
|
96662
96793
|
]),
|
|
96663
|
-
searchType.value ? (openBlock(), createElementBlock("div", _hoisted_9$O, [
|
|
96794
|
+
searchType.value && (searchType.value === "content" && hasContentFilters.value || searchType.value === "canvases" && hasCanvasFilters.value) ? (openBlock(), createElementBlock("div", _hoisted_9$O, [
|
|
96664
96795
|
searchType.value === "content" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
96665
96796
|
createVNode(unref(NPopover), {
|
|
96666
96797
|
class: "c-select-filter",
|
|
@@ -96696,24 +96827,23 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96696
96827
|
default: withCtx(() => [
|
|
96697
96828
|
createElementVNode("div", _hoisted_12$p, [
|
|
96698
96829
|
createElementVNode("div", _hoisted_13$k, [
|
|
96699
|
-
(openBlock(), createElementBlock(Fragment, null, renderList(
|
|
96700
|
-
return
|
|
96830
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(visibleFileTypeOptions.value, (option) => {
|
|
96831
|
+
return openBlock(), createElementBlock("div", {
|
|
96701
96832
|
key: option.value,
|
|
96702
96833
|
class: "w-full h-7 flex items-center"
|
|
96703
96834
|
}, [
|
|
96704
96835
|
createVNode(unref(NCheckbox), {
|
|
96705
96836
|
checked: selectedFileTypes.value.includes(option.value),
|
|
96706
96837
|
class: "px-2 truncate",
|
|
96707
|
-
"onUpdate:checked": (
|
|
96708
|
-
value: option.value
|
|
96838
|
+
"onUpdate:checked": (checked) => handleFileTypeToggle(option.value, checked)
|
|
96709
96839
|
}, {
|
|
96710
96840
|
default: withCtx(() => [
|
|
96711
96841
|
createTextVNode(toDisplayString(option.label), 1)
|
|
96712
96842
|
]),
|
|
96713
96843
|
_: 2
|
|
96714
|
-
}, 1032, ["checked", "onUpdate:checked"
|
|
96844
|
+
}, 1032, ["checked", "onUpdate:checked"])
|
|
96715
96845
|
]);
|
|
96716
|
-
}),
|
|
96846
|
+
}), 128))
|
|
96717
96847
|
]),
|
|
96718
96848
|
createElementVNode("div", {
|
|
96719
96849
|
class: "pa-2",
|
|
@@ -96736,114 +96866,99 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96736
96866
|
_: 1
|
|
96737
96867
|
}, 8, ["show"]),
|
|
96738
96868
|
hasActiveFilters.value ? (openBlock(), createElementBlock("div", _hoisted_14$h, [
|
|
96739
|
-
_cache[
|
|
96869
|
+
_cache[14] || (_cache[14] = createElementVNode("div", { class: "h-6 w-px bg-gray-300 mx-2" }, null, -1)),
|
|
96740
96870
|
createElementVNode("span", {
|
|
96741
96871
|
class: "text-sm text-gray-600 hover:text-gray-800 font-normal cursor-pointer",
|
|
96742
96872
|
onClick: clearAllFilters
|
|
96743
96873
|
}, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.filters.clear")), 1)
|
|
96744
96874
|
])) : createCommentVNode("", true)
|
|
96745
96875
|
], 64)) : searchType.value === "canvases" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
96746
|
-
|
|
96747
|
-
|
|
96748
|
-
|
|
96749
|
-
|
|
96750
|
-
|
|
96751
|
-
|
|
96752
|
-
|
|
96753
|
-
|
|
96754
|
-
themeOverrides: {
|
|
96755
|
-
borderRadius: "4px"
|
|
96756
|
-
},
|
|
96757
|
-
onClick: _cache[8] || (_cache[8] = ($event) => toggleCanvasFilter("saved_canvas"))
|
|
96758
|
-
}, {
|
|
96759
|
-
default: withCtx(() => [
|
|
96760
|
-
createElementVNode("span", null, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.canvasFilters.saved")), 1)
|
|
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
|
-
}, {
|
|
96776
|
-
default: withCtx(() => [
|
|
96777
|
-
createElementVNode("span", null, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.canvasFilters.templates")), 1)
|
|
96778
|
-
]),
|
|
96779
|
-
_: 1
|
|
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"))
|
|
96876
|
+
createVNode(unref(NPopover), {
|
|
96877
|
+
class: "c-select-filter",
|
|
96878
|
+
placement: "bottom-start",
|
|
96879
|
+
raw: "",
|
|
96880
|
+
show: showCanvasTypeDropdown.value,
|
|
96881
|
+
"show-arrow": false,
|
|
96882
|
+
trigger: "manual",
|
|
96883
|
+
onClickoutside: _cache[9] || (_cache[9] = ($event) => showCanvasTypeDropdown.value = false)
|
|
96793
96884
|
}, {
|
|
96794
|
-
|
|
96795
|
-
|
|
96885
|
+
trigger: withCtx(() => [
|
|
96886
|
+
createVNode(unref(NTag), {
|
|
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"])
|
|
96796
96906
|
]),
|
|
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
96907
|
default: withCtx(() => [
|
|
96812
|
-
createElementVNode("
|
|
96813
|
-
|
|
96814
|
-
|
|
96815
|
-
|
|
96816
|
-
|
|
96817
|
-
|
|
96818
|
-
|
|
96819
|
-
|
|
96820
|
-
|
|
96821
|
-
|
|
96822
|
-
|
|
96823
|
-
|
|
96824
|
-
|
|
96825
|
-
|
|
96826
|
-
|
|
96827
|
-
|
|
96828
|
-
|
|
96829
|
-
|
|
96908
|
+
createElementVNode("div", _hoisted_17$c, [
|
|
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
|
+
])
|
|
96830
96945
|
]),
|
|
96831
96946
|
_: 1
|
|
96832
|
-
}, 8, ["
|
|
96833
|
-
|
|
96834
|
-
_cache[
|
|
96947
|
+
}, 8, ["show"]),
|
|
96948
|
+
hasActiveFilters.value ? (openBlock(), createElementBlock("div", _hoisted_19$a, [
|
|
96949
|
+
_cache[15] || (_cache[15] = createElementVNode("div", { class: "h-6 w-px bg-gray-300 mx-2" }, null, -1)),
|
|
96835
96950
|
createElementVNode("span", {
|
|
96836
96951
|
class: "text-sm text-gray-600 hover:text-gray-800 font-normal cursor-pointer",
|
|
96837
|
-
onClick:
|
|
96952
|
+
onClick: clearAllFilters
|
|
96838
96953
|
}, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.filters.clear")), 1)
|
|
96839
96954
|
])) : createCommentVNode("", true)
|
|
96840
96955
|
], 64)) : createCommentVNode("", true)
|
|
96841
96956
|
])) : createCommentVNode("", true)
|
|
96842
96957
|
])) : createCommentVNode("", true)
|
|
96843
96958
|
]),
|
|
96844
|
-
createElementVNode("div",
|
|
96845
|
-
showRecentView.value ? (openBlock(), createElementBlock("div",
|
|
96846
|
-
createElementVNode("div",
|
|
96959
|
+
createElementVNode("div", _hoisted_20$9, [
|
|
96960
|
+
showRecentView.value ? (openBlock(), createElementBlock("div", _hoisted_21$7, [
|
|
96961
|
+
createElementVNode("div", _hoisted_22$5, [
|
|
96847
96962
|
(openBlock(true), createElementBlock(Fragment, null, renderList(recentSearches.value, (search) => {
|
|
96848
96963
|
return openBlock(), createElementBlock("div", {
|
|
96849
96964
|
key: search,
|
|
@@ -96856,14 +96971,14 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96856
96971
|
icon: "clock-rotate-left",
|
|
96857
96972
|
size: "16"
|
|
96858
96973
|
}),
|
|
96859
|
-
createElementVNode("span",
|
|
96860
|
-
], 8,
|
|
96974
|
+
createElementVNode("span", _hoisted_24$5, toDisplayString(search), 1)
|
|
96975
|
+
], 8, _hoisted_23$5);
|
|
96861
96976
|
}), 128))
|
|
96862
96977
|
]),
|
|
96863
96978
|
recentlyOpenedDocs.value.length > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
96864
|
-
_cache[
|
|
96865
|
-
createElementVNode("div",
|
|
96866
|
-
createElementVNode("span",
|
|
96979
|
+
_cache[16] || (_cache[16] = createElementVNode("hr", { class: "border-0 h-px bg-gray-200 mt-2 mb-3 w-full" }, null, -1)),
|
|
96980
|
+
createElementVNode("div", _hoisted_25$5, [
|
|
96981
|
+
createElementVNode("span", _hoisted_26$5, toDisplayString(unref(t)("canvasUI.components.fileViewer.recentlyOpened")), 1)
|
|
96867
96982
|
]),
|
|
96868
96983
|
createElementVNode("div", {
|
|
96869
96984
|
class: normalizeClass(_ctx.isAdmin ? "space-y-2" : "space-y-0")
|
|
@@ -96877,7 +96992,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96877
96992
|
]),
|
|
96878
96993
|
onClick: ($event) => handleRecentDocClick(doc, doc.type)
|
|
96879
96994
|
}, [
|
|
96880
|
-
doc.type === "file" ? (openBlock(), createElementBlock("div",
|
|
96995
|
+
doc.type === "file" ? (openBlock(), createElementBlock("div", _hoisted_28$5, [
|
|
96881
96996
|
createVNode(_sfc_main$6K, {
|
|
96882
96997
|
class: "h-14 border-rounded-1 overflow-hidden flex-0",
|
|
96883
96998
|
cover: "",
|
|
@@ -96886,7 +97001,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96886
97001
|
src: recentThumbnails.value[doc.id] || "",
|
|
96887
97002
|
width: "72"
|
|
96888
97003
|
}, null, 8, ["file-data", "src"]),
|
|
96889
|
-
isLoadingThumbnails.value && !recentThumbnails.value[doc.id] ? (openBlock(), createElementBlock("div",
|
|
97004
|
+
isLoadingThumbnails.value && !recentThumbnails.value[doc.id] ? (openBlock(), createElementBlock("div", _hoisted_29$5, [
|
|
96890
97005
|
createVNode(CIcon, {
|
|
96891
97006
|
class: "animate-spin",
|
|
96892
97007
|
color: "var(--p-primary)",
|
|
@@ -96894,7 +97009,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96894
97009
|
size: "20"
|
|
96895
97010
|
})
|
|
96896
97011
|
])) : createCommentVNode("", true)
|
|
96897
|
-
])) : (openBlock(), createElementBlock("div",
|
|
97012
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_30$4, [
|
|
96898
97013
|
doc.type === "canvas" ? (openBlock(), createBlock(CIcon, {
|
|
96899
97014
|
key: 0,
|
|
96900
97015
|
color: "var(--p-text2)",
|
|
@@ -96907,33 +97022,33 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96907
97022
|
size: "32"
|
|
96908
97023
|
}))
|
|
96909
97024
|
])),
|
|
96910
|
-
createElementVNode("div",
|
|
96911
|
-
createElementVNode("h3",
|
|
96912
|
-
createElementVNode("p",
|
|
97025
|
+
createElementVNode("div", _hoisted_31$4, [
|
|
97026
|
+
createElementVNode("h3", _hoisted_32$4, toDisplayString(doc.name), 1),
|
|
97027
|
+
createElementVNode("p", _hoisted_33$4, toDisplayString(doc.type === "canvas" ? formatCanvasType(doc.content_type) : doc.type === "folder" ? "Folder" : doc.file_category || "File"), 1)
|
|
96913
97028
|
])
|
|
96914
|
-
], 10,
|
|
97029
|
+
], 10, _hoisted_27$5);
|
|
96915
97030
|
}), 128))
|
|
96916
97031
|
], 2)
|
|
96917
97032
|
], 64)) : createCommentVNode("", true)
|
|
96918
|
-
])) : !searchType.value ? (openBlock(), createElementBlock("div",
|
|
96919
|
-
createElementVNode("div",
|
|
96920
|
-
isSearching.value ? (openBlock(), createElementBlock("div",
|
|
97033
|
+
])) : !searchType.value ? (openBlock(), createElementBlock("div", _hoisted_34$4, [
|
|
97034
|
+
createElementVNode("div", _hoisted_35$4, [
|
|
97035
|
+
isSearching.value ? (openBlock(), createElementBlock("div", _hoisted_36$4, [
|
|
96921
97036
|
createVNode(CIcon, {
|
|
96922
97037
|
class: "animate-spin text-6xl",
|
|
96923
97038
|
color: "var(--p-primary)",
|
|
96924
97039
|
icon: "spinner"
|
|
96925
97040
|
})
|
|
96926
97041
|
])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
96927
|
-
filteredContentFiles.value.length > 0 ? (openBlock(), createElementBlock("div",
|
|
96928
|
-
createElementVNode("div",
|
|
97042
|
+
filteredContentFiles.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_37$4, [
|
|
97043
|
+
createElementVNode("div", _hoisted_38$4, [
|
|
96929
97044
|
createVNode(CIcon, {
|
|
96930
97045
|
class: "mr-2",
|
|
96931
97046
|
color: "var(--p-text2)",
|
|
96932
97047
|
icon: "folder",
|
|
96933
97048
|
size: "16"
|
|
96934
97049
|
}),
|
|
96935
|
-
createElementVNode("span",
|
|
96936
|
-
createElementVNode("span",
|
|
97050
|
+
createElementVNode("span", _hoisted_39$4, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.sections.content")), 1),
|
|
97051
|
+
createElementVNode("span", _hoisted_40$4, "(" + toDisplayString(filteredContentFiles.value.length) + ")", 1)
|
|
96937
97052
|
]),
|
|
96938
97053
|
createElementVNode("div", null, [
|
|
96939
97054
|
(openBlock(true), createElementBlock(Fragment, null, renderList(filteredContentFiles.value.slice(0, 5), (item) => {
|
|
@@ -96955,30 +97070,30 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96955
97070
|
"object-fit": "cover",
|
|
96956
97071
|
src: item.picture_url || "",
|
|
96957
97072
|
width: "72"
|
|
96958
|
-
}, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div",
|
|
97073
|
+
}, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div", _hoisted_42$4, [
|
|
96959
97074
|
createVNode(CIcon, {
|
|
96960
97075
|
color: "var(--p-text2)",
|
|
96961
97076
|
icon: "folder",
|
|
96962
97077
|
size: "32"
|
|
96963
97078
|
})
|
|
96964
97079
|
])),
|
|
96965
|
-
createElementVNode("div",
|
|
96966
|
-
createElementVNode("h3",
|
|
97080
|
+
createElementVNode("div", _hoisted_43$4, [
|
|
97081
|
+
createElementVNode("h3", _hoisted_44$4, toDisplayString(item.name), 1),
|
|
96967
97082
|
item.type === "file" && getSnippet(item) ? (openBlock(), createElementBlock("p", {
|
|
96968
97083
|
key: 0,
|
|
96969
97084
|
class: "text-xs text-gray-600 mb-1",
|
|
96970
97085
|
innerHTML: getSnippet(item)
|
|
96971
|
-
}, null, 8,
|
|
96972
|
-
createElementVNode("p",
|
|
97086
|
+
}, null, 8, _hoisted_45$4)) : createCommentVNode("", true),
|
|
97087
|
+
createElementVNode("p", _hoisted_46$4, toDisplayString(item.type === "folder" ? "Folder" : item.file_category || item.content_type || "File"), 1)
|
|
96973
97088
|
]),
|
|
96974
|
-
createElementVNode("div",
|
|
96975
|
-
], 10,
|
|
97089
|
+
createElementVNode("div", _hoisted_47$4, toDisplayString(item.type === "folder" ? item.parent_folder?.name || "" : item.folder?.name || ""), 1)
|
|
97090
|
+
], 10, _hoisted_41$4);
|
|
96976
97091
|
}), 128))
|
|
96977
97092
|
]),
|
|
96978
|
-
filteredContentFiles.value.length > 5 ? (openBlock(), createElementBlock("div",
|
|
97093
|
+
filteredContentFiles.value.length > 5 ? (openBlock(), createElementBlock("div", _hoisted_48$4, [
|
|
96979
97094
|
createElementVNode("span", {
|
|
96980
97095
|
class: "text-sm text-gray-600 hover:text-gray-800 font-bold flex items-center cursor-pointer",
|
|
96981
|
-
onClick: _cache[
|
|
97096
|
+
onClick: _cache[10] || (_cache[10] = ($event) => searchType.value = "content")
|
|
96982
97097
|
}, [
|
|
96983
97098
|
createTextVNode(toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.actions.viewAll")) + " ", 1),
|
|
96984
97099
|
createVNode(CIcon, {
|
|
@@ -96989,16 +97104,16 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96989
97104
|
])
|
|
96990
97105
|
])) : createCommentVNode("", true)
|
|
96991
97106
|
])) : createCommentVNode("", true),
|
|
96992
|
-
filteredCanvasFiles.value.length > 0 ? (openBlock(), createElementBlock("div",
|
|
96993
|
-
createElementVNode("div",
|
|
97107
|
+
filteredCanvasFiles.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_49$4, [
|
|
97108
|
+
createElementVNode("div", _hoisted_50$4, [
|
|
96994
97109
|
createVNode(CIcon, {
|
|
96995
97110
|
class: "mr-2",
|
|
96996
97111
|
color: "var(--p-text2)",
|
|
96997
97112
|
icon: "presentation",
|
|
96998
97113
|
size: "16"
|
|
96999
97114
|
}),
|
|
97000
|
-
createElementVNode("span",
|
|
97001
|
-
createElementVNode("span",
|
|
97115
|
+
createElementVNode("span", _hoisted_51$3, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.sections.pitchDecks")), 1),
|
|
97116
|
+
createElementVNode("span", _hoisted_52$3, "(" + toDisplayString(filteredCanvasFiles.value.length) + ")", 1)
|
|
97002
97117
|
]),
|
|
97003
97118
|
createElementVNode("div", null, [
|
|
97004
97119
|
(openBlock(true), createElementBlock(Fragment, null, renderList(filteredCanvasFiles.value.slice(0, 5), (item) => {
|
|
@@ -97012,25 +97127,25 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97012
97127
|
"data-result-selected": isResultSelected(item),
|
|
97013
97128
|
onClick: ($event) => handleResultClick(item, "canvas")
|
|
97014
97129
|
}, [
|
|
97015
|
-
createElementVNode("div",
|
|
97130
|
+
createElementVNode("div", _hoisted_54$2, [
|
|
97016
97131
|
createVNode(CIcon, {
|
|
97017
97132
|
color: "var(--p-text2)",
|
|
97018
97133
|
icon: "presentation",
|
|
97019
97134
|
size: "32"
|
|
97020
97135
|
})
|
|
97021
97136
|
]),
|
|
97022
|
-
createElementVNode("div",
|
|
97023
|
-
createElementVNode("h3",
|
|
97024
|
-
createElementVNode("p",
|
|
97137
|
+
createElementVNode("div", _hoisted_55$2, [
|
|
97138
|
+
createElementVNode("h3", _hoisted_56$2, toDisplayString(item.name), 1),
|
|
97139
|
+
createElementVNode("p", _hoisted_57$2, toDisplayString(formatCanvasType(item.content_type)), 1)
|
|
97025
97140
|
]),
|
|
97026
|
-
createElementVNode("div",
|
|
97027
|
-
], 10,
|
|
97141
|
+
createElementVNode("div", _hoisted_58$2, toDisplayString(item.folder?.name || ""), 1)
|
|
97142
|
+
], 10, _hoisted_53$3);
|
|
97028
97143
|
}), 128))
|
|
97029
97144
|
]),
|
|
97030
|
-
filteredCanvasFiles.value.length > 5 ? (openBlock(), createElementBlock("div",
|
|
97145
|
+
filteredCanvasFiles.value.length > 5 ? (openBlock(), createElementBlock("div", _hoisted_59$2, [
|
|
97031
97146
|
createElementVNode("span", {
|
|
97032
97147
|
class: "text-sm text-gray-600 hover:text-gray-800 font-bold flex items-center cursor-pointer",
|
|
97033
|
-
onClick: _cache[
|
|
97148
|
+
onClick: _cache[11] || (_cache[11] = ($event) => searchType.value = "canvases")
|
|
97034
97149
|
}, [
|
|
97035
97150
|
createTextVNode(toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.actions.viewAll")) + " ", 1),
|
|
97036
97151
|
createVNode(CIcon, {
|
|
@@ -97041,7 +97156,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97041
97156
|
])
|
|
97042
97157
|
])) : createCommentVNode("", true)
|
|
97043
97158
|
])) : createCommentVNode("", true),
|
|
97044
|
-
searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div",
|
|
97159
|
+
searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_60$2, [
|
|
97045
97160
|
createVNode(CIcon, {
|
|
97046
97161
|
class: "text-6xl",
|
|
97047
97162
|
color: searchError.value ? "var(--p-error)" : "var(--p-text3)",
|
|
@@ -97054,16 +97169,16 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97054
97169
|
])) : createCommentVNode("", true)
|
|
97055
97170
|
], 64))
|
|
97056
97171
|
])
|
|
97057
|
-
])) : (openBlock(), createElementBlock("div",
|
|
97058
|
-
createElementVNode("div",
|
|
97059
|
-
isSearching.value ? (openBlock(), createElementBlock("div",
|
|
97172
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_61$2, [
|
|
97173
|
+
createElementVNode("div", _hoisted_62$2, [
|
|
97174
|
+
isSearching.value ? (openBlock(), createElementBlock("div", _hoisted_63$2, [
|
|
97060
97175
|
createVNode(CIcon, {
|
|
97061
97176
|
class: "animate-spin text-6xl",
|
|
97062
97177
|
color: "var(--p-primary)",
|
|
97063
97178
|
icon: "spinner"
|
|
97064
97179
|
})
|
|
97065
97180
|
])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
97066
|
-
createElementVNode("div",
|
|
97181
|
+
createElementVNode("div", _hoisted_64$2, [
|
|
97067
97182
|
searchType.value === "content" ? (openBlock(), createBlock(CIcon, {
|
|
97068
97183
|
key: 0,
|
|
97069
97184
|
class: "mr-2",
|
|
@@ -97077,8 +97192,8 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97077
97192
|
icon: "presentation",
|
|
97078
97193
|
size: "16"
|
|
97079
97194
|
})),
|
|
97080
|
-
createElementVNode("span",
|
|
97081
|
-
createElementVNode("span",
|
|
97195
|
+
createElementVNode("span", _hoisted_65$2, toDisplayString(searchType.value === "content" ? unref(t)("canvasUI.CAlgoliaSearch.sections.content") : unref(t)("canvasUI.CAlgoliaSearch.sections.pitchDecks")), 1),
|
|
97196
|
+
createElementVNode("span", _hoisted_66$2, " (" + toDisplayString(searchType.value === "content" ? filteredContentFiles.value.length : filteredCanvasFiles.value.length) + ") ", 1)
|
|
97082
97197
|
]),
|
|
97083
97198
|
createElementVNode("div", null, [
|
|
97084
97199
|
(openBlock(true), createElementBlock(Fragment, null, renderList(searchType.value === "content" ? filteredContentFiles.value : filteredCanvasFiles.value, (item) => {
|
|
@@ -97103,7 +97218,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97103
97218
|
"object-fit": "cover",
|
|
97104
97219
|
src: item.picture_url || "",
|
|
97105
97220
|
width: "72"
|
|
97106
|
-
}, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div",
|
|
97221
|
+
}, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div", _hoisted_68$2, [
|
|
97107
97222
|
searchType.value === "content" ? (openBlock(), createBlock(CIcon, {
|
|
97108
97223
|
key: 0,
|
|
97109
97224
|
color: "var(--p-text2)",
|
|
@@ -97116,20 +97231,20 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97116
97231
|
size: "32"
|
|
97117
97232
|
}))
|
|
97118
97233
|
])),
|
|
97119
|
-
createElementVNode("div",
|
|
97120
|
-
createElementVNode("h3",
|
|
97234
|
+
createElementVNode("div", _hoisted_69$1, [
|
|
97235
|
+
createElementVNode("h3", _hoisted_70$1, toDisplayString(item.name), 1),
|
|
97121
97236
|
searchType.value === "content" && item.type === "file" && getSnippet(item) ? (openBlock(), createElementBlock("p", {
|
|
97122
97237
|
key: 0,
|
|
97123
97238
|
class: "text-xs text-gray-600 mb-1",
|
|
97124
97239
|
innerHTML: getSnippet(item)
|
|
97125
|
-
}, null, 8,
|
|
97126
|
-
createElementVNode("p",
|
|
97240
|
+
}, null, 8, _hoisted_71$1)) : createCommentVNode("", true),
|
|
97241
|
+
createElementVNode("p", _hoisted_72$1, toDisplayString(searchType.value === "content" ? item.type === "folder" ? "Folder" : item.file_category || item.content_type || "File" : formatCanvasType(item.content_type)), 1)
|
|
97127
97242
|
]),
|
|
97128
|
-
createElementVNode("div",
|
|
97129
|
-
], 10,
|
|
97243
|
+
createElementVNode("div", _hoisted_73$1, toDisplayString(searchType.value === "content" && item.type === "folder" ? item.parent_folder?.name || "" : item.folder?.name || ""), 1)
|
|
97244
|
+
], 10, _hoisted_67$2);
|
|
97130
97245
|
}), 128))
|
|
97131
97246
|
]),
|
|
97132
|
-
searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div",
|
|
97247
|
+
searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_74$1, [
|
|
97133
97248
|
createVNode(CIcon, {
|
|
97134
97249
|
class: "text-6xl",
|
|
97135
97250
|
color: searchError.value ? "var(--p-error)" : "var(--p-text3)",
|
|
@@ -97144,7 +97259,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97144
97259
|
])
|
|
97145
97260
|
]))
|
|
97146
97261
|
]),
|
|
97147
|
-
!showRecentView.value ? (openBlock(), createElementBlock("div",
|
|
97262
|
+
!showRecentView.value ? (openBlock(), createElementBlock("div", _hoisted_75$1, [
|
|
97148
97263
|
createVNode(CShortcut, null, {
|
|
97149
97264
|
default: withCtx(() => [
|
|
97150
97265
|
createVNode(CShortcutIcon, { icon: "arrow-up" }),
|
|
@@ -97186,7 +97301,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97186
97301
|
}
|
|
97187
97302
|
});
|
|
97188
97303
|
|
|
97189
|
-
const CAlgoliaSearch = /* @__PURE__ */ _export_sfc(_sfc_main$5K, [["__scopeId", "data-v-
|
|
97304
|
+
const CAlgoliaSearch = /* @__PURE__ */ _export_sfc(_sfc_main$5K, [["__scopeId", "data-v-840d4fd4"]]);
|
|
97190
97305
|
|
|
97191
97306
|
const BulletListExtended = BulletList.extend({
|
|
97192
97307
|
addOptions() {
|
|
@@ -109616,9 +109731,11 @@ const _sfc_main$4U = /* @__PURE__ */ defineComponent({
|
|
|
109616
109731
|
function filterByItemVisibility(items) {
|
|
109617
109732
|
const isAdmin = state$3.appName.value === "admin";
|
|
109618
109733
|
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;
|
|
109619
109735
|
const filesCount = item.available_files_count ?? item.files_count ?? 0;
|
|
109620
109736
|
const foldersCount = item.available_folders_count ?? item.folders_count ?? 0;
|
|
109621
|
-
const
|
|
109737
|
+
const isFolderEmpty = item.type == "folder" && hasCountData && filesCount === 0 && foldersCount === 0;
|
|
109738
|
+
const shouldHideItem = item.name?.startsWith(".") || isFolderEmpty || item.folder?.file_thumbnail_urls?.length === 0;
|
|
109622
109739
|
if (!shouldHideItem && !isAdmin || isAdmin) {
|
|
109623
109740
|
acc.push({
|
|
109624
109741
|
...item,
|
|
@@ -109995,7 +110112,8 @@ const getInitialState$1 = () => ({
|
|
|
109995
110112
|
// instance metadata template fields dictionary
|
|
109996
110113
|
searchQuery: "",
|
|
109997
110114
|
searchMetadataFilters: {},
|
|
109998
|
-
filteredItems: []
|
|
110115
|
+
filteredItems: [],
|
|
110116
|
+
folderCache: {}
|
|
109999
110117
|
});
|
|
110000
110118
|
const state$2 = reactive(getInitialState$1());
|
|
110001
110119
|
const fileOrderedStatuses = [FileStatusEnum.PENDING, FileStatusEnum.VIEWABLE];
|
|
@@ -110080,6 +110198,15 @@ function updateFolderState(folder) {
|
|
|
110080
110198
|
state$2.folders = folder.folders;
|
|
110081
110199
|
state$2.files = folder.files;
|
|
110082
110200
|
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
|
+
});
|
|
110083
110210
|
if (useAppStore$4().showFilteredResults.value) {
|
|
110084
110211
|
const filesById = new Map(state$2.files.map((file) => [file.id, file]));
|
|
110085
110212
|
state$2.filteredItems = state$2.filteredItems.map((filteredItem) => {
|
|
@@ -110344,7 +110471,24 @@ function init({
|
|
|
110344
110471
|
}
|
|
110345
110472
|
let filteredFolders = [];
|
|
110346
110473
|
if (!hasMetadataFilters && foldersResponse.status === "fulfilled" && foldersResponse.value) {
|
|
110347
|
-
|
|
110474
|
+
const foldersFromSearch = foldersResponse.value.results ?? [];
|
|
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
|
+
});
|
|
110348
110492
|
} else if (!hasMetadataFilters && !useAppStore$4().isLocalSearch.value) {
|
|
110349
110493
|
console.error(
|
|
110350
110494
|
"Failed to fetch folders:",
|
|
@@ -176290,10 +176434,10 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
176290
176434
|
__name: "ActionsToolbar",
|
|
176291
176435
|
setup(__props) {
|
|
176292
176436
|
useCssVars((_ctx) => ({
|
|
176293
|
-
"
|
|
176294
|
-
"
|
|
176295
|
-
"
|
|
176296
|
-
"
|
|
176437
|
+
"6b5e9219": unref(themeVars).primary4,
|
|
176438
|
+
"3d451d7b": unref(themeVars).primary,
|
|
176439
|
+
"6b5e921b": unref(themeVars).primary6,
|
|
176440
|
+
"42dfd1f8": unref(themeVars).base
|
|
176297
176441
|
}));
|
|
176298
176442
|
const {
|
|
176299
176443
|
toggleContentPanel,
|
|
@@ -176521,7 +176665,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
176521
176665
|
return (nameMatch || createdByMatch || tagMatch) && metadataMatch;
|
|
176522
176666
|
});
|
|
176523
176667
|
const folderResults = folders.map((folder) => {
|
|
176524
|
-
|
|
176668
|
+
const result = {
|
|
176525
176669
|
id: folder.id,
|
|
176526
176670
|
name: folder.name,
|
|
176527
176671
|
folder_id: apiState.currentFolderId,
|
|
@@ -176533,6 +176677,11 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
176533
176677
|
file_thumbnail_urls: folder.file_thumbnail_urls,
|
|
176534
176678
|
thumbnail_url: folder.thumbnail_url
|
|
176535
176679
|
};
|
|
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;
|
|
176536
176685
|
});
|
|
176537
176686
|
const fileResults = files.map((file) => {
|
|
176538
176687
|
return {
|
|
@@ -176761,7 +176910,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
176761
176910
|
}
|
|
176762
176911
|
});
|
|
176763
176912
|
|
|
176764
|
-
const ActionsToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-
|
|
176913
|
+
const ActionsToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-41ca4793"]]);
|
|
176765
176914
|
|
|
176766
176915
|
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
176767
176916
|
__name: "FavoritesTable",
|
|
@@ -181840,7 +181989,7 @@ function useSmartStore(env) {
|
|
|
181840
181989
|
return false;
|
|
181841
181990
|
}
|
|
181842
181991
|
const isIos = envValue?.mode === "IOS";
|
|
181843
|
-
const isSfdcSyncEnabled = envValue?.
|
|
181992
|
+
const isSfdcSyncEnabled = envValue?.launch_darkly?.sfdc_offline_enabled === true;
|
|
181844
181993
|
return isIos && isSfdcSyncEnabled;
|
|
181845
181994
|
} catch (error) {
|
|
181846
181995
|
console.error("[useSmartStore] Error checking SmartStore availability:", error);
|