@pitcher/canvas-ui 2026.1.14-133153 → 2026.1.14-133846-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/canvas-ui.css +88 -88
- package/canvas-ui.js +358 -482
- package/canvas-ui.js.map +1 -1
- package/lib/apps/browser/stores/api.d.ts +18 -0
- package/lib/apps/canvas-builder/composables/useCrmShape.d.ts +1 -1
- package/lib/apps/canvas-builder/composables/useCrmShapeWithSectionContext.d.ts +2 -1
- package/package.json +1 -1
package/canvas-ui.js
CHANGED
|
@@ -88219,15 +88219,14 @@ async function crmQueryAdaptive(payload) {
|
|
|
88219
88219
|
} catch {
|
|
88220
88220
|
useSmartStore = false;
|
|
88221
88221
|
}
|
|
88222
|
-
console.log(`
|
|
88222
|
+
console.log(`crmQueryAdaptive called with the query: `, query2);
|
|
88223
88223
|
if (useSmartStore) {
|
|
88224
88224
|
const fields = extractFieldsFromSoql(query2);
|
|
88225
88225
|
const objectName = extractObjectFromSoql(query2);
|
|
88226
88226
|
const smartQuery = convertSoqlToSmartQuery(query2);
|
|
88227
|
-
console.log(`
|
|
88227
|
+
console.log(`Smart Query: `, smartQuery);
|
|
88228
88228
|
const smartStoreResults = await crmSmartQuery({ query: smartQuery });
|
|
88229
88229
|
const records = transformSmartStoreResults(smartStoreResults, fields, objectName);
|
|
88230
|
-
console.log(`[SmartStore] Results: `, records);
|
|
88231
88230
|
return {
|
|
88232
88231
|
records,
|
|
88233
88232
|
totalSize: records.length
|
|
@@ -95692,115 +95691,111 @@ const _hoisted_14$h = {
|
|
|
95692
95691
|
key: 0,
|
|
95693
95692
|
class: "flex items-center ml-2"
|
|
95694
95693
|
};
|
|
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,
|
|
95694
|
+
const _hoisted_15$f = {
|
|
95695
|
+
key: 2,
|
|
95701
95696
|
class: "flex items-center ml-2"
|
|
95702
95697
|
};
|
|
95703
|
-
const
|
|
95704
|
-
const
|
|
95698
|
+
const _hoisted_16$e = { class: "flex flex-col w-full flex-1 min-h-0" };
|
|
95699
|
+
const _hoisted_17$c = {
|
|
95705
95700
|
key: 0,
|
|
95706
95701
|
class: "flex-1 overflow-y-auto bg-white w-full pl-1 pr-6 py-0"
|
|
95707
95702
|
};
|
|
95708
|
-
const
|
|
95703
|
+
const _hoisted_18$a = { class: "space-y-1 mt-4" };
|
|
95704
|
+
const _hoisted_19$a = ["onClick"];
|
|
95705
|
+
const _hoisted_20$9 = { class: "text-sm text-gray-700" };
|
|
95706
|
+
const _hoisted_21$7 = { class: "flex items-center mb-0" };
|
|
95707
|
+
const _hoisted_22$5 = { class: "text-sm font-bold text-gray-700" };
|
|
95709
95708
|
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 = {
|
|
95709
|
+
const _hoisted_24$5 = {
|
|
95715
95710
|
key: 0,
|
|
95716
95711
|
class: "relative mr-4"
|
|
95717
95712
|
};
|
|
95718
|
-
const
|
|
95713
|
+
const _hoisted_25$5 = {
|
|
95719
95714
|
key: 0,
|
|
95720
95715
|
class: "absolute inset-0 flex items-center justify-center bg-gray-200 bg-opacity-75 border-rounded-1"
|
|
95721
95716
|
};
|
|
95722
|
-
const
|
|
95717
|
+
const _hoisted_26$5 = {
|
|
95723
95718
|
key: 1,
|
|
95724
95719
|
class: "w-18 h-14 border-rounded-1 mr-4 flex-shrink-0 bg-gray-200 flex items-center justify-center"
|
|
95725
95720
|
};
|
|
95726
|
-
const
|
|
95727
|
-
const
|
|
95728
|
-
const
|
|
95729
|
-
const
|
|
95721
|
+
const _hoisted_27$5 = { class: "flex-1 min-w-0" };
|
|
95722
|
+
const _hoisted_28$5 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
|
|
95723
|
+
const _hoisted_29$5 = { class: "text-xs text-gray-500" };
|
|
95724
|
+
const _hoisted_30$4 = {
|
|
95730
95725
|
key: 1,
|
|
95731
95726
|
class: "flex-1 overflow-y-auto bg-white w-full"
|
|
95732
95727
|
};
|
|
95733
|
-
const
|
|
95734
|
-
const
|
|
95728
|
+
const _hoisted_31$4 = { class: "w-full px-0" };
|
|
95729
|
+
const _hoisted_32$4 = {
|
|
95735
95730
|
key: 0,
|
|
95736
95731
|
class: "flex flex-col items-center justify-center text-center p-8 gap-4"
|
|
95737
95732
|
};
|
|
95738
|
-
const
|
|
95733
|
+
const _hoisted_33$4 = {
|
|
95739
95734
|
key: 0,
|
|
95740
95735
|
class: "mb-0"
|
|
95741
95736
|
};
|
|
95742
|
-
const
|
|
95743
|
-
const
|
|
95744
|
-
const
|
|
95745
|
-
const
|
|
95746
|
-
const
|
|
95737
|
+
const _hoisted_34$4 = { class: "flex items-center px-0 pt-2 pb-1" };
|
|
95738
|
+
const _hoisted_35$4 = { class: "text-m font-semibold text-gray-900" };
|
|
95739
|
+
const _hoisted_36$4 = { class: "ml-2 text-sm text-gray-500" };
|
|
95740
|
+
const _hoisted_37$4 = ["data-result-selected", "onClick"];
|
|
95741
|
+
const _hoisted_38$4 = {
|
|
95747
95742
|
key: 1,
|
|
95748
95743
|
class: "w-18 h-14 border-rounded-1 mr-4 flex-shrink-0 bg-gray-200 flex items-center justify-center"
|
|
95749
95744
|
};
|
|
95750
|
-
const
|
|
95751
|
-
const
|
|
95752
|
-
const
|
|
95753
|
-
const
|
|
95754
|
-
const
|
|
95755
|
-
const
|
|
95745
|
+
const _hoisted_39$4 = { class: "flex-1 min-w-0" };
|
|
95746
|
+
const _hoisted_40$4 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
|
|
95747
|
+
const _hoisted_41$4 = ["innerHTML"];
|
|
95748
|
+
const _hoisted_42$4 = { class: "text-xs text-gray-500" };
|
|
95749
|
+
const _hoisted_43$4 = { class: "text-xs text-gray-400" };
|
|
95750
|
+
const _hoisted_44$4 = {
|
|
95756
95751
|
key: 0,
|
|
95757
95752
|
class: "px-0 py-0"
|
|
95758
95753
|
};
|
|
95759
|
-
const
|
|
95760
|
-
const
|
|
95761
|
-
const
|
|
95762
|
-
const
|
|
95763
|
-
const
|
|
95764
|
-
const
|
|
95765
|
-
const
|
|
95766
|
-
const
|
|
95767
|
-
const
|
|
95768
|
-
const
|
|
95769
|
-
const
|
|
95754
|
+
const _hoisted_45$4 = { key: 1 };
|
|
95755
|
+
const _hoisted_46$4 = { class: "flex items-center px-0 pt-2 pb-1" };
|
|
95756
|
+
const _hoisted_47$4 = { class: "text-m font-semibold text-gray-900" };
|
|
95757
|
+
const _hoisted_48$4 = { class: "ml-2 text-sm text-gray-500" };
|
|
95758
|
+
const _hoisted_49$4 = ["data-result-selected", "onClick"];
|
|
95759
|
+
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" };
|
|
95760
|
+
const _hoisted_51$3 = { class: "flex-1 min-w-0" };
|
|
95761
|
+
const _hoisted_52$3 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
|
|
95762
|
+
const _hoisted_53$3 = { class: "text-xs text-gray-500" };
|
|
95763
|
+
const _hoisted_54$2 = { class: "text-xs text-gray-400" };
|
|
95764
|
+
const _hoisted_55$2 = {
|
|
95770
95765
|
key: 0,
|
|
95771
95766
|
class: "px-0 py-0"
|
|
95772
95767
|
};
|
|
95773
|
-
const
|
|
95768
|
+
const _hoisted_56$2 = {
|
|
95774
95769
|
key: 2,
|
|
95775
95770
|
class: "flex flex-col items-center justify-center text-center p-8 gap-4"
|
|
95776
95771
|
};
|
|
95777
|
-
const
|
|
95772
|
+
const _hoisted_57$2 = {
|
|
95778
95773
|
key: 2,
|
|
95779
95774
|
class: "flex-1 overflow-y-auto bg-white w-full"
|
|
95780
95775
|
};
|
|
95781
|
-
const
|
|
95782
|
-
const
|
|
95776
|
+
const _hoisted_58$2 = { class: "w-full px-0" };
|
|
95777
|
+
const _hoisted_59$2 = {
|
|
95783
95778
|
key: 0,
|
|
95784
95779
|
class: "flex flex-col items-center justify-center text-center p-8 gap-4"
|
|
95785
95780
|
};
|
|
95786
|
-
const
|
|
95787
|
-
const
|
|
95788
|
-
const
|
|
95789
|
-
const
|
|
95790
|
-
const
|
|
95781
|
+
const _hoisted_60$2 = { class: "flex items-center px-0 pt-2 pb-1" };
|
|
95782
|
+
const _hoisted_61$2 = { class: "text-m font-semibold text-gray-900" };
|
|
95783
|
+
const _hoisted_62$2 = { class: "ml-2 text-sm text-gray-500" };
|
|
95784
|
+
const _hoisted_63$2 = ["data-result-selected", "onClick"];
|
|
95785
|
+
const _hoisted_64$2 = {
|
|
95791
95786
|
key: 1,
|
|
95792
95787
|
class: "w-18 h-14 border-rounded-1 mr-4 flex-shrink-0 bg-gray-200 flex items-center justify-center"
|
|
95793
95788
|
};
|
|
95794
|
-
const
|
|
95795
|
-
const
|
|
95796
|
-
const
|
|
95797
|
-
const
|
|
95798
|
-
const
|
|
95799
|
-
const
|
|
95789
|
+
const _hoisted_65$2 = { class: "flex-1 min-w-0" };
|
|
95790
|
+
const _hoisted_66$2 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
|
|
95791
|
+
const _hoisted_67$2 = ["innerHTML"];
|
|
95792
|
+
const _hoisted_68$2 = { class: "text-xs text-gray-500" };
|
|
95793
|
+
const _hoisted_69$1 = { class: "text-xs text-gray-400" };
|
|
95794
|
+
const _hoisted_70$1 = {
|
|
95800
95795
|
key: 0,
|
|
95801
95796
|
class: "flex flex-col items-center justify-center text-center p-8 gap-4"
|
|
95802
95797
|
};
|
|
95803
|
-
const
|
|
95798
|
+
const _hoisted_71$1 = {
|
|
95804
95799
|
key: 0,
|
|
95805
95800
|
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
95801
|
};
|
|
@@ -95827,7 +95822,6 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
95827
95822
|
const selectedFileTypes = ref([]);
|
|
95828
95823
|
const showFileTypeDropdown = ref(false);
|
|
95829
95824
|
const selectedCanvasFilters = ref([]);
|
|
95830
|
-
const showCanvasTypeDropdown = ref(false);
|
|
95831
95825
|
const fileTypeOptions = [
|
|
95832
95826
|
{ label: "Folder", value: "folder" },
|
|
95833
95827
|
{ label: "PDF", value: "pdf" },
|
|
@@ -95840,42 +95834,6 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
95840
95834
|
{ label: "AR", value: "ar" },
|
|
95841
95835
|
{ label: "Web", value: "web" }
|
|
95842
95836
|
];
|
|
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
95837
|
const hasActiveFilters = computed(() => selectedFileTypes.value.length > 0 || selectedCanvasFilters.value.length > 0);
|
|
95880
95838
|
const clearAllFilters = () => {
|
|
95881
95839
|
selectedFileTypes.value = [];
|
|
@@ -95886,9 +95844,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
95886
95844
|
selectedFileTypes.value = [];
|
|
95887
95845
|
selectedCanvasFilters.value = [];
|
|
95888
95846
|
searchType.value = null;
|
|
95889
|
-
if (searchQuery.value.trim()
|
|
95890
|
-
applyFiltersToResults();
|
|
95891
|
-
} else if (searchQuery.value.trim()) {
|
|
95847
|
+
if (searchQuery.value.trim()) {
|
|
95892
95848
|
try {
|
|
95893
95849
|
skipNextSuggestionFetch.value = true;
|
|
95894
95850
|
await performSearch(searchQuery.value);
|
|
@@ -96024,11 +95980,8 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96024
95980
|
};
|
|
96025
95981
|
const contentResults = ref([]);
|
|
96026
95982
|
const canvasResults = ref([]);
|
|
96027
|
-
const unfilteredContentResults = ref([]);
|
|
96028
|
-
const unfilteredCanvasResults = ref([]);
|
|
96029
95983
|
const isSearching = ref(false);
|
|
96030
95984
|
const hasSearchCompleted = ref(false);
|
|
96031
|
-
let currentSearchId = 0;
|
|
96032
95985
|
const querySuggestions = ref([]);
|
|
96033
95986
|
const selectedSuggestionIndex = ref(-1);
|
|
96034
95987
|
const selectedResultIndex = ref(-1);
|
|
@@ -96045,44 +95998,6 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96045
95998
|
}
|
|
96046
95999
|
return canvasResults.value;
|
|
96047
96000
|
});
|
|
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
96001
|
const shouldShowNoResults = computed(() => {
|
|
96087
96002
|
if (showRecentView.value || !searchQuery.value.trim() || isSearching.value || !hasSearchCompleted.value) return false;
|
|
96088
96003
|
if (searchType.value === "content") {
|
|
@@ -96126,32 +96041,6 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96126
96041
|
};
|
|
96127
96042
|
watch(searchType, () => {
|
|
96128
96043
|
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
96044
|
});
|
|
96156
96045
|
const scrollSelectedResultIntoView = () => {
|
|
96157
96046
|
nextTick(() => {
|
|
@@ -96195,8 +96084,6 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96195
96084
|
if (!query.trim()) {
|
|
96196
96085
|
contentResults.value = [];
|
|
96197
96086
|
canvasResults.value = [];
|
|
96198
|
-
unfilteredContentResults.value = [];
|
|
96199
|
-
unfilteredCanvasResults.value = [];
|
|
96200
96087
|
hasSearchCompleted.value = false;
|
|
96201
96088
|
isSearching.value = false;
|
|
96202
96089
|
searchError.value = null;
|
|
@@ -96205,51 +96092,59 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96205
96092
|
isSearching.value = true;
|
|
96206
96093
|
hasSearchCompleted.value = false;
|
|
96207
96094
|
searchError.value = null;
|
|
96208
|
-
const searchId = ++currentSearchId;
|
|
96209
96095
|
const shouldSkipSuggestionFetch = skipNextSuggestionFetch.value;
|
|
96210
96096
|
if (shouldSkipSuggestionFetch) {
|
|
96211
96097
|
skipNextSuggestionFetch.value = false;
|
|
96212
96098
|
}
|
|
96213
96099
|
try {
|
|
96214
|
-
const
|
|
96215
|
-
|
|
96216
|
-
|
|
96217
|
-
|
|
96100
|
+
const ALLOWED_CANVAS_TYPES = ["saved_canvas", "template", "product_template", "section", "block"];
|
|
96101
|
+
const ALLOWED_FILE_TYPES = [
|
|
96102
|
+
"folder",
|
|
96103
|
+
"pdf",
|
|
96104
|
+
"image",
|
|
96105
|
+
"audio",
|
|
96106
|
+
"video",
|
|
96107
|
+
"document",
|
|
96108
|
+
"presentation",
|
|
96109
|
+
"spreadsheet",
|
|
96110
|
+
"ar",
|
|
96111
|
+
"web"
|
|
96112
|
+
];
|
|
96113
|
+
const validCanvasFilters = selectedCanvasFilters.value.filter((f) => ALLOWED_CANVAS_TYPES.includes(f));
|
|
96114
|
+
if (selectedCanvasFilters.value.length > 0 && validCanvasFilters.length === 0) {
|
|
96115
|
+
console.warn(
|
|
96116
|
+
"[CAlgoliaSearch] All selected canvas filters are invalid and were removed:",
|
|
96117
|
+
selectedCanvasFilters.value
|
|
96118
|
+
);
|
|
96119
|
+
selectedCanvasFilters.value = [];
|
|
96120
|
+
} else if (validCanvasFilters.length < selectedCanvasFilters.value.length) {
|
|
96121
|
+
const removedFilters = selectedCanvasFilters.value.filter((f) => !validCanvasFilters.includes(f));
|
|
96122
|
+
console.warn("[CAlgoliaSearch] Some canvas filters were invalid and removed:", removedFilters);
|
|
96218
96123
|
selectedCanvasFilters.value = validCanvasFilters;
|
|
96219
96124
|
}
|
|
96220
|
-
const
|
|
96221
|
-
|
|
96222
|
-
|
|
96223
|
-
console.warn(
|
|
96125
|
+
const canvasFilters = validCanvasFilters.length > 0 ? ` AND (${validCanvasFilters.map((filter) => `content_type:"${filter}"`).join(" OR ")})` : "";
|
|
96126
|
+
const validFileTypes = selectedFileTypes.value.filter((t2) => ALLOWED_FILE_TYPES.includes(t2));
|
|
96127
|
+
if (selectedFileTypes.value.length > 0 && validFileTypes.length === 0) {
|
|
96128
|
+
console.warn(
|
|
96129
|
+
"[CAlgoliaSearch] All selected file type filters are invalid and were removed:",
|
|
96130
|
+
selectedFileTypes.value
|
|
96131
|
+
);
|
|
96132
|
+
selectedFileTypes.value = [];
|
|
96133
|
+
} else if (validFileTypes.length < selectedFileTypes.value.length) {
|
|
96134
|
+
const removedFilters = selectedFileTypes.value.filter((t2) => !validFileTypes.includes(t2));
|
|
96135
|
+
console.warn("[CAlgoliaSearch] Some file type filters were invalid and removed:", removedFilters);
|
|
96224
96136
|
selectedFileTypes.value = validFileTypes;
|
|
96225
96137
|
}
|
|
96138
|
+
const contentFilters = validFileTypes.length > 0 ? ` AND (${validFileTypes.map((type) => type === "folder" ? `type:"${type}"` : `file_category:"${type}"`).join(" OR ")})` : "";
|
|
96226
96139
|
const results = await searchViaBackend(query.trim(), {
|
|
96227
|
-
canvas:
|
|
96228
|
-
content:
|
|
96140
|
+
canvas: canvasFilters,
|
|
96141
|
+
content: contentFilters
|
|
96229
96142
|
});
|
|
96230
96143
|
if (query.trim() !== searchQuery.value.trim()) {
|
|
96231
96144
|
return;
|
|
96232
96145
|
}
|
|
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;
|
|
96146
|
+
contentResults.value = results.content?.hits || [];
|
|
96147
|
+
canvasResults.value = results.canvas?.hits || [];
|
|
96253
96148
|
selectedResultIndex.value = -1;
|
|
96254
96149
|
searchError.value = null;
|
|
96255
96150
|
if (query.trim().length >= 2 && !shouldSkipSuggestionFetch) {
|
|
@@ -96262,27 +96157,23 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96262
96157
|
}
|
|
96263
96158
|
await nextTick();
|
|
96264
96159
|
setTimeout(() => {
|
|
96265
|
-
|
|
96266
|
-
|
|
96267
|
-
hasSearchCompleted.value = true;
|
|
96268
|
-
}
|
|
96160
|
+
isSearching.value = false;
|
|
96161
|
+
hasSearchCompleted.value = true;
|
|
96269
96162
|
}, 50);
|
|
96270
96163
|
} catch (error) {
|
|
96271
96164
|
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
|
-
}
|
|
96165
|
+
contentResults.value = [];
|
|
96166
|
+
canvasResults.value = [];
|
|
96167
|
+
isSearching.value = false;
|
|
96168
|
+
hasSearchCompleted.value = true;
|
|
96169
|
+
if (error.message === "AUTH_REQUIRED") {
|
|
96170
|
+
searchError.value = "Please sign in to search";
|
|
96171
|
+
} else if (error.message === "AUTH_EXPIRED") {
|
|
96172
|
+
searchError.value = "Your session has expired. Please sign in again";
|
|
96173
|
+
} else if (error.message === "AUTH_FORBIDDEN") {
|
|
96174
|
+
searchError.value = "You do not have permission to search this instance";
|
|
96175
|
+
} else {
|
|
96176
|
+
searchError.value = "Search failed. Please try again";
|
|
96286
96177
|
}
|
|
96287
96178
|
}
|
|
96288
96179
|
};
|
|
@@ -96292,38 +96183,19 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96292
96183
|
if (!query || typeof query !== "string") return "";
|
|
96293
96184
|
return query;
|
|
96294
96185
|
}
|
|
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
96186
|
const debouncedFilterSearch = () => {
|
|
96322
96187
|
if (filterChangeTimer) clearTimeout(filterChangeTimer);
|
|
96323
96188
|
if (searchTimer) clearTimeout(searchTimer);
|
|
96324
96189
|
filterChangeTimer = setTimeout(async () => {
|
|
96325
96190
|
if (searchQuery.value.trim() && !showRecentView.value) {
|
|
96326
|
-
|
|
96191
|
+
try {
|
|
96192
|
+
skipNextSuggestionFetch.value = true;
|
|
96193
|
+
await performSearch(searchQuery.value);
|
|
96194
|
+
} catch (error) {
|
|
96195
|
+
console.error("[debouncedFilterSearch] Search failed:", error);
|
|
96196
|
+
} finally {
|
|
96197
|
+
skipNextSuggestionFetch.value = false;
|
|
96198
|
+
}
|
|
96327
96199
|
}
|
|
96328
96200
|
}, 500);
|
|
96329
96201
|
};
|
|
@@ -96349,8 +96221,6 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96349
96221
|
showRecentView.value = true;
|
|
96350
96222
|
contentResults.value = [];
|
|
96351
96223
|
canvasResults.value = [];
|
|
96352
|
-
unfilteredContentResults.value = [];
|
|
96353
|
-
unfilteredCanvasResults.value = [];
|
|
96354
96224
|
querySuggestions.value = [];
|
|
96355
96225
|
selectedSuggestionIndex.value = -1;
|
|
96356
96226
|
selectedResultIndex.value = -1;
|
|
@@ -96364,8 +96234,6 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96364
96234
|
showRecentView.value = true;
|
|
96365
96235
|
contentResults.value = [];
|
|
96366
96236
|
canvasResults.value = [];
|
|
96367
|
-
unfilteredContentResults.value = [];
|
|
96368
|
-
unfilteredCanvasResults.value = [];
|
|
96369
96237
|
querySuggestions.value = [];
|
|
96370
96238
|
selectedSuggestionIndex.value = -1;
|
|
96371
96239
|
selectedResultIndex.value = -1;
|
|
@@ -96490,31 +96358,31 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96490
96358
|
if (endChar < highlightValue.length) truncated = truncated + "...";
|
|
96491
96359
|
return sanitizeHtml(truncated);
|
|
96492
96360
|
};
|
|
96493
|
-
const
|
|
96494
|
-
if (
|
|
96495
|
-
|
|
96496
|
-
selectedFileTypes.value.push(value);
|
|
96497
|
-
}
|
|
96361
|
+
const toggleCanvasFilter = (filterType) => {
|
|
96362
|
+
if (selectedCanvasFilters.value.includes(filterType)) {
|
|
96363
|
+
selectedCanvasFilters.value.splice(selectedCanvasFilters.value.indexOf(filterType), 1);
|
|
96498
96364
|
} else {
|
|
96499
|
-
|
|
96365
|
+
selectedCanvasFilters.value.push(filterType);
|
|
96500
96366
|
}
|
|
96501
96367
|
debouncedFilterSearch();
|
|
96502
96368
|
};
|
|
96503
|
-
const
|
|
96369
|
+
const clearCanvasFilters = () => {
|
|
96370
|
+
selectedCanvasFilters.value = [];
|
|
96371
|
+
debouncedFilterSearch();
|
|
96372
|
+
};
|
|
96373
|
+
const toggleFileType = (fileType, checked) => {
|
|
96504
96374
|
if (checked) {
|
|
96505
|
-
if (!
|
|
96506
|
-
|
|
96375
|
+
if (!selectedFileTypes.value.includes(fileType)) {
|
|
96376
|
+
selectedFileTypes.value.push(fileType);
|
|
96507
96377
|
}
|
|
96508
96378
|
} else {
|
|
96509
|
-
|
|
96379
|
+
const index = selectedFileTypes.value.indexOf(fileType);
|
|
96380
|
+
if (index > -1) {
|
|
96381
|
+
selectedFileTypes.value.splice(index, 1);
|
|
96382
|
+
}
|
|
96510
96383
|
}
|
|
96511
96384
|
debouncedFilterSearch();
|
|
96512
96385
|
};
|
|
96513
|
-
const clearCanvasFilters = () => {
|
|
96514
|
-
selectedCanvasFilters.value = [];
|
|
96515
|
-
showCanvasTypeDropdown.value = false;
|
|
96516
|
-
debouncedFilterSearch();
|
|
96517
|
-
};
|
|
96518
96386
|
const clearFileTypes = () => {
|
|
96519
96387
|
selectedFileTypes.value = [];
|
|
96520
96388
|
showFileTypeDropdown.value = false;
|
|
@@ -96685,7 +96553,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96685
96553
|
show: "",
|
|
96686
96554
|
verticalAlignment: "top",
|
|
96687
96555
|
"z-index": _ctx.zIndex,
|
|
96688
|
-
"onUpdate:show": _cache[
|
|
96556
|
+
"onUpdate:show": _cache[15] || (_cache[15] = ($event) => emit("toggleSearch", $event))
|
|
96689
96557
|
}, {
|
|
96690
96558
|
default: withCtx(() => [
|
|
96691
96559
|
createElementVNode("div", {
|
|
@@ -96694,7 +96562,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96694
96562
|
}, [
|
|
96695
96563
|
createElementVNode("div", _hoisted_1$4w, [
|
|
96696
96564
|
createElementVNode("div", _hoisted_2$3j, [
|
|
96697
|
-
_cache[
|
|
96565
|
+
_cache[16] || (_cache[16] = createElementVNode("div", { class: "absolute left-2.5 top-1/2 transform -translate-y-1/2 z-10" }, [
|
|
96698
96566
|
createElementVNode("i", { class: "c-icon far fa-search text-gray-400 text-l" })
|
|
96699
96567
|
], -1)),
|
|
96700
96568
|
withDirectives(createElementVNode("input", {
|
|
@@ -96791,7 +96659,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96791
96659
|
createElementVNode("span", null, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.tabs.pitchDecks")), 1)
|
|
96792
96660
|
], 2)) : createCommentVNode("", true)
|
|
96793
96661
|
]),
|
|
96794
|
-
searchType.value
|
|
96662
|
+
searchType.value ? (openBlock(), createElementBlock("div", _hoisted_9$O, [
|
|
96795
96663
|
searchType.value === "content" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
96796
96664
|
createVNode(unref(NPopover), {
|
|
96797
96665
|
class: "c-select-filter",
|
|
@@ -96827,23 +96695,24 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96827
96695
|
default: withCtx(() => [
|
|
96828
96696
|
createElementVNode("div", _hoisted_12$p, [
|
|
96829
96697
|
createElementVNode("div", _hoisted_13$k, [
|
|
96830
|
-
(openBlock(
|
|
96831
|
-
return
|
|
96698
|
+
(openBlock(), createElementBlock(Fragment, null, renderList(fileTypeOptions, (option) => {
|
|
96699
|
+
return createElementVNode("div", {
|
|
96832
96700
|
key: option.value,
|
|
96833
96701
|
class: "w-full h-7 flex items-center"
|
|
96834
96702
|
}, [
|
|
96835
96703
|
createVNode(unref(NCheckbox), {
|
|
96836
96704
|
checked: selectedFileTypes.value.includes(option.value),
|
|
96837
96705
|
class: "px-2 truncate",
|
|
96838
|
-
"onUpdate:checked": (
|
|
96706
|
+
"onUpdate:checked": (v) => toggleFileType(option.value, v),
|
|
96707
|
+
value: option.value
|
|
96839
96708
|
}, {
|
|
96840
96709
|
default: withCtx(() => [
|
|
96841
96710
|
createTextVNode(toDisplayString(option.label), 1)
|
|
96842
96711
|
]),
|
|
96843
96712
|
_: 2
|
|
96844
|
-
}, 1032, ["checked", "onUpdate:checked"])
|
|
96713
|
+
}, 1032, ["checked", "onUpdate:checked", "value"])
|
|
96845
96714
|
]);
|
|
96846
|
-
}),
|
|
96715
|
+
}), 64))
|
|
96847
96716
|
]),
|
|
96848
96717
|
createElementVNode("div", {
|
|
96849
96718
|
class: "pa-2",
|
|
@@ -96866,99 +96735,114 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96866
96735
|
_: 1
|
|
96867
96736
|
}, 8, ["show"]),
|
|
96868
96737
|
hasActiveFilters.value ? (openBlock(), createElementBlock("div", _hoisted_14$h, [
|
|
96869
|
-
_cache[
|
|
96738
|
+
_cache[17] || (_cache[17] = createElementVNode("div", { class: "h-6 w-px bg-gray-300 mx-2" }, null, -1)),
|
|
96870
96739
|
createElementVNode("span", {
|
|
96871
96740
|
class: "text-sm text-gray-600 hover:text-gray-800 font-normal cursor-pointer",
|
|
96872
96741
|
onClick: clearAllFilters
|
|
96873
96742
|
}, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.filters.clear")), 1)
|
|
96874
96743
|
])) : createCommentVNode("", true)
|
|
96875
96744
|
], 64)) : searchType.value === "canvases" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
96876
|
-
|
|
96877
|
-
|
|
96878
|
-
|
|
96879
|
-
|
|
96880
|
-
|
|
96881
|
-
|
|
96882
|
-
|
|
96883
|
-
|
|
96745
|
+
!_ctx.isAdmin ? (openBlock(), createBlock(unref(NTag), {
|
|
96746
|
+
key: 0,
|
|
96747
|
+
class: "select-none cursor-pointer",
|
|
96748
|
+
style: normalizeStyle({
|
|
96749
|
+
"--n-color": selectedCanvasFilters.value.includes("saved_canvas") ? "var(--p-primary5)" : "var(--p-primary6)",
|
|
96750
|
+
"--n-border": "1px solid var(--p-primary5)",
|
|
96751
|
+
"--n-height": "28px"
|
|
96752
|
+
}),
|
|
96753
|
+
themeOverrides: {
|
|
96754
|
+
borderRadius: "4px"
|
|
96755
|
+
},
|
|
96756
|
+
onClick: _cache[8] || (_cache[8] = ($event) => toggleCanvasFilter("saved_canvas"))
|
|
96884
96757
|
}, {
|
|
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"])
|
|
96758
|
+
default: withCtx(() => [
|
|
96759
|
+
createElementVNode("span", null, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.canvasFilters.saved")), 1)
|
|
96906
96760
|
]),
|
|
96761
|
+
_: 1
|
|
96762
|
+
}, 8, ["style"])) : createCommentVNode("", true),
|
|
96763
|
+
createVNode(unref(NTag), {
|
|
96764
|
+
class: "select-none cursor-pointer",
|
|
96765
|
+
style: normalizeStyle({
|
|
96766
|
+
"--n-color": selectedCanvasFilters.value.includes("template") ? "var(--p-primary5)" : "var(--p-primary6)",
|
|
96767
|
+
"--n-border": "1px solid var(--p-primary5)",
|
|
96768
|
+
"--n-height": "28px"
|
|
96769
|
+
}),
|
|
96770
|
+
themeOverrides: {
|
|
96771
|
+
borderRadius: "4px"
|
|
96772
|
+
},
|
|
96773
|
+
onClick: _cache[9] || (_cache[9] = ($event) => toggleCanvasFilter("template"))
|
|
96774
|
+
}, {
|
|
96907
96775
|
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
|
-
])
|
|
96776
|
+
createElementVNode("span", null, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.canvasFilters.templates")), 1)
|
|
96945
96777
|
]),
|
|
96946
96778
|
_: 1
|
|
96947
|
-
}, 8, ["
|
|
96948
|
-
|
|
96949
|
-
|
|
96779
|
+
}, 8, ["style"]),
|
|
96780
|
+
_ctx.isAdmin ? (openBlock(), createBlock(unref(NTag), {
|
|
96781
|
+
key: 1,
|
|
96782
|
+
class: "select-none cursor-pointer",
|
|
96783
|
+
style: normalizeStyle({
|
|
96784
|
+
"--n-color": selectedCanvasFilters.value.includes("product_template") ? "var(--p-primary5)" : "var(--p-primary6)",
|
|
96785
|
+
"--n-border": "1px solid var(--p-primary5)",
|
|
96786
|
+
"--n-height": "28px"
|
|
96787
|
+
}),
|
|
96788
|
+
themeOverrides: {
|
|
96789
|
+
borderRadius: "4px"
|
|
96790
|
+
},
|
|
96791
|
+
onClick: _cache[10] || (_cache[10] = ($event) => toggleCanvasFilter("product_template"))
|
|
96792
|
+
}, {
|
|
96793
|
+
default: withCtx(() => [
|
|
96794
|
+
createElementVNode("span", null, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.canvasFilters.productTemplates")), 1)
|
|
96795
|
+
]),
|
|
96796
|
+
_: 1
|
|
96797
|
+
}, 8, ["style"])) : createCommentVNode("", true),
|
|
96798
|
+
createVNode(unref(NTag), {
|
|
96799
|
+
class: "select-none cursor-pointer",
|
|
96800
|
+
style: normalizeStyle({
|
|
96801
|
+
"--n-color": selectedCanvasFilters.value.includes("section") ? "var(--p-primary5)" : "var(--p-primary6)",
|
|
96802
|
+
"--n-border": "1px solid var(--p-primary5)",
|
|
96803
|
+
"--n-height": "28px"
|
|
96804
|
+
}),
|
|
96805
|
+
themeOverrides: {
|
|
96806
|
+
borderRadius: "4px"
|
|
96807
|
+
},
|
|
96808
|
+
onClick: _cache[11] || (_cache[11] = ($event) => toggleCanvasFilter("section"))
|
|
96809
|
+
}, {
|
|
96810
|
+
default: withCtx(() => [
|
|
96811
|
+
createElementVNode("span", null, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.canvasFilters.products")), 1)
|
|
96812
|
+
]),
|
|
96813
|
+
_: 1
|
|
96814
|
+
}, 8, ["style"]),
|
|
96815
|
+
createVNode(unref(NTag), {
|
|
96816
|
+
class: "select-none cursor-pointer",
|
|
96817
|
+
style: normalizeStyle({
|
|
96818
|
+
"--n-color": selectedCanvasFilters.value.includes("block") ? "var(--p-primary5)" : "var(--p-primary6)",
|
|
96819
|
+
"--n-border": "1px solid var(--p-primary5)",
|
|
96820
|
+
"--n-height": "28px"
|
|
96821
|
+
}),
|
|
96822
|
+
themeOverrides: {
|
|
96823
|
+
borderRadius: "4px"
|
|
96824
|
+
},
|
|
96825
|
+
onClick: _cache[12] || (_cache[12] = ($event) => toggleCanvasFilter("block"))
|
|
96826
|
+
}, {
|
|
96827
|
+
default: withCtx(() => [
|
|
96828
|
+
createElementVNode("span", null, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.canvasFilters.blocks")), 1)
|
|
96829
|
+
]),
|
|
96830
|
+
_: 1
|
|
96831
|
+
}, 8, ["style"]),
|
|
96832
|
+
selectedCanvasFilters.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_15$f, [
|
|
96833
|
+
_cache[18] || (_cache[18] = createElementVNode("div", { class: "h-6 w-px bg-gray-300 mx-2" }, null, -1)),
|
|
96950
96834
|
createElementVNode("span", {
|
|
96951
96835
|
class: "text-sm text-gray-600 hover:text-gray-800 font-normal cursor-pointer",
|
|
96952
|
-
onClick:
|
|
96836
|
+
onClick: clearCanvasFilters
|
|
96953
96837
|
}, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.filters.clear")), 1)
|
|
96954
96838
|
])) : createCommentVNode("", true)
|
|
96955
96839
|
], 64)) : createCommentVNode("", true)
|
|
96956
96840
|
])) : createCommentVNode("", true)
|
|
96957
96841
|
])) : createCommentVNode("", true)
|
|
96958
96842
|
]),
|
|
96959
|
-
createElementVNode("div",
|
|
96960
|
-
showRecentView.value ? (openBlock(), createElementBlock("div",
|
|
96961
|
-
createElementVNode("div",
|
|
96843
|
+
createElementVNode("div", _hoisted_16$e, [
|
|
96844
|
+
showRecentView.value ? (openBlock(), createElementBlock("div", _hoisted_17$c, [
|
|
96845
|
+
createElementVNode("div", _hoisted_18$a, [
|
|
96962
96846
|
(openBlock(true), createElementBlock(Fragment, null, renderList(recentSearches.value, (search) => {
|
|
96963
96847
|
return openBlock(), createElementBlock("div", {
|
|
96964
96848
|
key: search,
|
|
@@ -96971,14 +96855,14 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96971
96855
|
icon: "clock-rotate-left",
|
|
96972
96856
|
size: "16"
|
|
96973
96857
|
}),
|
|
96974
|
-
createElementVNode("span",
|
|
96975
|
-
], 8,
|
|
96858
|
+
createElementVNode("span", _hoisted_20$9, toDisplayString(search), 1)
|
|
96859
|
+
], 8, _hoisted_19$a);
|
|
96976
96860
|
}), 128))
|
|
96977
96861
|
]),
|
|
96978
96862
|
recentlyOpenedDocs.value.length > 0 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
96979
|
-
_cache[
|
|
96980
|
-
createElementVNode("div",
|
|
96981
|
-
createElementVNode("span",
|
|
96863
|
+
_cache[19] || (_cache[19] = createElementVNode("hr", { class: "border-0 h-px bg-gray-200 mt-2 mb-3 w-full" }, null, -1)),
|
|
96864
|
+
createElementVNode("div", _hoisted_21$7, [
|
|
96865
|
+
createElementVNode("span", _hoisted_22$5, toDisplayString(unref(t)("canvasUI.components.fileViewer.recentlyOpened")), 1)
|
|
96982
96866
|
]),
|
|
96983
96867
|
createElementVNode("div", {
|
|
96984
96868
|
class: normalizeClass(_ctx.isAdmin ? "space-y-2" : "space-y-0")
|
|
@@ -96992,7 +96876,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
96992
96876
|
]),
|
|
96993
96877
|
onClick: ($event) => handleRecentDocClick(doc, doc.type)
|
|
96994
96878
|
}, [
|
|
96995
|
-
doc.type === "file" ? (openBlock(), createElementBlock("div",
|
|
96879
|
+
doc.type === "file" ? (openBlock(), createElementBlock("div", _hoisted_24$5, [
|
|
96996
96880
|
createVNode(_sfc_main$6K, {
|
|
96997
96881
|
class: "h-14 border-rounded-1 overflow-hidden flex-0",
|
|
96998
96882
|
cover: "",
|
|
@@ -97001,7 +96885,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97001
96885
|
src: recentThumbnails.value[doc.id] || "",
|
|
97002
96886
|
width: "72"
|
|
97003
96887
|
}, null, 8, ["file-data", "src"]),
|
|
97004
|
-
isLoadingThumbnails.value && !recentThumbnails.value[doc.id] ? (openBlock(), createElementBlock("div",
|
|
96888
|
+
isLoadingThumbnails.value && !recentThumbnails.value[doc.id] ? (openBlock(), createElementBlock("div", _hoisted_25$5, [
|
|
97005
96889
|
createVNode(CIcon, {
|
|
97006
96890
|
class: "animate-spin",
|
|
97007
96891
|
color: "var(--p-primary)",
|
|
@@ -97009,7 +96893,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97009
96893
|
size: "20"
|
|
97010
96894
|
})
|
|
97011
96895
|
])) : createCommentVNode("", true)
|
|
97012
|
-
])) : (openBlock(), createElementBlock("div",
|
|
96896
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_26$5, [
|
|
97013
96897
|
doc.type === "canvas" ? (openBlock(), createBlock(CIcon, {
|
|
97014
96898
|
key: 0,
|
|
97015
96899
|
color: "var(--p-text2)",
|
|
@@ -97022,33 +96906,33 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97022
96906
|
size: "32"
|
|
97023
96907
|
}))
|
|
97024
96908
|
])),
|
|
97025
|
-
createElementVNode("div",
|
|
97026
|
-
createElementVNode("h3",
|
|
97027
|
-
createElementVNode("p",
|
|
96909
|
+
createElementVNode("div", _hoisted_27$5, [
|
|
96910
|
+
createElementVNode("h3", _hoisted_28$5, toDisplayString(doc.name), 1),
|
|
96911
|
+
createElementVNode("p", _hoisted_29$5, toDisplayString(doc.type === "canvas" ? formatCanvasType(doc.content_type) : doc.type === "folder" ? "Folder" : doc.file_category || "File"), 1)
|
|
97028
96912
|
])
|
|
97029
|
-
], 10,
|
|
96913
|
+
], 10, _hoisted_23$5);
|
|
97030
96914
|
}), 128))
|
|
97031
96915
|
], 2)
|
|
97032
96916
|
], 64)) : createCommentVNode("", true)
|
|
97033
|
-
])) : !searchType.value ? (openBlock(), createElementBlock("div",
|
|
97034
|
-
createElementVNode("div",
|
|
97035
|
-
isSearching.value ? (openBlock(), createElementBlock("div",
|
|
96917
|
+
])) : !searchType.value ? (openBlock(), createElementBlock("div", _hoisted_30$4, [
|
|
96918
|
+
createElementVNode("div", _hoisted_31$4, [
|
|
96919
|
+
isSearching.value ? (openBlock(), createElementBlock("div", _hoisted_32$4, [
|
|
97036
96920
|
createVNode(CIcon, {
|
|
97037
96921
|
class: "animate-spin text-6xl",
|
|
97038
96922
|
color: "var(--p-primary)",
|
|
97039
96923
|
icon: "spinner"
|
|
97040
96924
|
})
|
|
97041
96925
|
])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
97042
|
-
filteredContentFiles.value.length > 0 ? (openBlock(), createElementBlock("div",
|
|
97043
|
-
createElementVNode("div",
|
|
96926
|
+
filteredContentFiles.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_33$4, [
|
|
96927
|
+
createElementVNode("div", _hoisted_34$4, [
|
|
97044
96928
|
createVNode(CIcon, {
|
|
97045
96929
|
class: "mr-2",
|
|
97046
96930
|
color: "var(--p-text2)",
|
|
97047
96931
|
icon: "folder",
|
|
97048
96932
|
size: "16"
|
|
97049
96933
|
}),
|
|
97050
|
-
createElementVNode("span",
|
|
97051
|
-
createElementVNode("span",
|
|
96934
|
+
createElementVNode("span", _hoisted_35$4, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.sections.content")), 1),
|
|
96935
|
+
createElementVNode("span", _hoisted_36$4, "(" + toDisplayString(filteredContentFiles.value.length) + ")", 1)
|
|
97052
96936
|
]),
|
|
97053
96937
|
createElementVNode("div", null, [
|
|
97054
96938
|
(openBlock(true), createElementBlock(Fragment, null, renderList(filteredContentFiles.value.slice(0, 5), (item) => {
|
|
@@ -97070,30 +96954,30 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97070
96954
|
"object-fit": "cover",
|
|
97071
96955
|
src: item.picture_url || "",
|
|
97072
96956
|
width: "72"
|
|
97073
|
-
}, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div",
|
|
96957
|
+
}, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div", _hoisted_38$4, [
|
|
97074
96958
|
createVNode(CIcon, {
|
|
97075
96959
|
color: "var(--p-text2)",
|
|
97076
96960
|
icon: "folder",
|
|
97077
96961
|
size: "32"
|
|
97078
96962
|
})
|
|
97079
96963
|
])),
|
|
97080
|
-
createElementVNode("div",
|
|
97081
|
-
createElementVNode("h3",
|
|
96964
|
+
createElementVNode("div", _hoisted_39$4, [
|
|
96965
|
+
createElementVNode("h3", _hoisted_40$4, toDisplayString(item.name), 1),
|
|
97082
96966
|
item.type === "file" && getSnippet(item) ? (openBlock(), createElementBlock("p", {
|
|
97083
96967
|
key: 0,
|
|
97084
96968
|
class: "text-xs text-gray-600 mb-1",
|
|
97085
96969
|
innerHTML: getSnippet(item)
|
|
97086
|
-
}, null, 8,
|
|
97087
|
-
createElementVNode("p",
|
|
96970
|
+
}, null, 8, _hoisted_41$4)) : createCommentVNode("", true),
|
|
96971
|
+
createElementVNode("p", _hoisted_42$4, toDisplayString(item.type === "folder" ? "Folder" : item.file_category || item.content_type || "File"), 1)
|
|
97088
96972
|
]),
|
|
97089
|
-
createElementVNode("div",
|
|
97090
|
-
], 10,
|
|
96973
|
+
createElementVNode("div", _hoisted_43$4, toDisplayString(item.type === "folder" ? item.parent_folder?.name || "" : item.folder?.name || ""), 1)
|
|
96974
|
+
], 10, _hoisted_37$4);
|
|
97091
96975
|
}), 128))
|
|
97092
96976
|
]),
|
|
97093
|
-
filteredContentFiles.value.length > 5 ? (openBlock(), createElementBlock("div",
|
|
96977
|
+
filteredContentFiles.value.length > 5 ? (openBlock(), createElementBlock("div", _hoisted_44$4, [
|
|
97094
96978
|
createElementVNode("span", {
|
|
97095
96979
|
class: "text-sm text-gray-600 hover:text-gray-800 font-bold flex items-center cursor-pointer",
|
|
97096
|
-
onClick: _cache[
|
|
96980
|
+
onClick: _cache[13] || (_cache[13] = ($event) => searchType.value = "content")
|
|
97097
96981
|
}, [
|
|
97098
96982
|
createTextVNode(toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.actions.viewAll")) + " ", 1),
|
|
97099
96983
|
createVNode(CIcon, {
|
|
@@ -97104,16 +96988,16 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97104
96988
|
])
|
|
97105
96989
|
])) : createCommentVNode("", true)
|
|
97106
96990
|
])) : createCommentVNode("", true),
|
|
97107
|
-
filteredCanvasFiles.value.length > 0 ? (openBlock(), createElementBlock("div",
|
|
97108
|
-
createElementVNode("div",
|
|
96991
|
+
filteredCanvasFiles.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_45$4, [
|
|
96992
|
+
createElementVNode("div", _hoisted_46$4, [
|
|
97109
96993
|
createVNode(CIcon, {
|
|
97110
96994
|
class: "mr-2",
|
|
97111
96995
|
color: "var(--p-text2)",
|
|
97112
96996
|
icon: "presentation",
|
|
97113
96997
|
size: "16"
|
|
97114
96998
|
}),
|
|
97115
|
-
createElementVNode("span",
|
|
97116
|
-
createElementVNode("span",
|
|
96999
|
+
createElementVNode("span", _hoisted_47$4, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.sections.pitchDecks")), 1),
|
|
97000
|
+
createElementVNode("span", _hoisted_48$4, "(" + toDisplayString(filteredCanvasFiles.value.length) + ")", 1)
|
|
97117
97001
|
]),
|
|
97118
97002
|
createElementVNode("div", null, [
|
|
97119
97003
|
(openBlock(true), createElementBlock(Fragment, null, renderList(filteredCanvasFiles.value.slice(0, 5), (item) => {
|
|
@@ -97127,25 +97011,25 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97127
97011
|
"data-result-selected": isResultSelected(item),
|
|
97128
97012
|
onClick: ($event) => handleResultClick(item, "canvas")
|
|
97129
97013
|
}, [
|
|
97130
|
-
createElementVNode("div",
|
|
97014
|
+
createElementVNode("div", _hoisted_50$4, [
|
|
97131
97015
|
createVNode(CIcon, {
|
|
97132
97016
|
color: "var(--p-text2)",
|
|
97133
97017
|
icon: "presentation",
|
|
97134
97018
|
size: "32"
|
|
97135
97019
|
})
|
|
97136
97020
|
]),
|
|
97137
|
-
createElementVNode("div",
|
|
97138
|
-
createElementVNode("h3",
|
|
97139
|
-
createElementVNode("p",
|
|
97021
|
+
createElementVNode("div", _hoisted_51$3, [
|
|
97022
|
+
createElementVNode("h3", _hoisted_52$3, toDisplayString(item.name), 1),
|
|
97023
|
+
createElementVNode("p", _hoisted_53$3, toDisplayString(formatCanvasType(item.content_type)), 1)
|
|
97140
97024
|
]),
|
|
97141
|
-
createElementVNode("div",
|
|
97142
|
-
], 10,
|
|
97025
|
+
createElementVNode("div", _hoisted_54$2, toDisplayString(item.folder?.name || ""), 1)
|
|
97026
|
+
], 10, _hoisted_49$4);
|
|
97143
97027
|
}), 128))
|
|
97144
97028
|
]),
|
|
97145
|
-
filteredCanvasFiles.value.length > 5 ? (openBlock(), createElementBlock("div",
|
|
97029
|
+
filteredCanvasFiles.value.length > 5 ? (openBlock(), createElementBlock("div", _hoisted_55$2, [
|
|
97146
97030
|
createElementVNode("span", {
|
|
97147
97031
|
class: "text-sm text-gray-600 hover:text-gray-800 font-bold flex items-center cursor-pointer",
|
|
97148
|
-
onClick: _cache[
|
|
97032
|
+
onClick: _cache[14] || (_cache[14] = ($event) => searchType.value = "canvases")
|
|
97149
97033
|
}, [
|
|
97150
97034
|
createTextVNode(toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.actions.viewAll")) + " ", 1),
|
|
97151
97035
|
createVNode(CIcon, {
|
|
@@ -97156,7 +97040,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97156
97040
|
])
|
|
97157
97041
|
])) : createCommentVNode("", true)
|
|
97158
97042
|
])) : createCommentVNode("", true),
|
|
97159
|
-
searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div",
|
|
97043
|
+
searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_56$2, [
|
|
97160
97044
|
createVNode(CIcon, {
|
|
97161
97045
|
class: "text-6xl",
|
|
97162
97046
|
color: searchError.value ? "var(--p-error)" : "var(--p-text3)",
|
|
@@ -97169,16 +97053,16 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97169
97053
|
])) : createCommentVNode("", true)
|
|
97170
97054
|
], 64))
|
|
97171
97055
|
])
|
|
97172
|
-
])) : (openBlock(), createElementBlock("div",
|
|
97173
|
-
createElementVNode("div",
|
|
97174
|
-
isSearching.value ? (openBlock(), createElementBlock("div",
|
|
97056
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_57$2, [
|
|
97057
|
+
createElementVNode("div", _hoisted_58$2, [
|
|
97058
|
+
isSearching.value ? (openBlock(), createElementBlock("div", _hoisted_59$2, [
|
|
97175
97059
|
createVNode(CIcon, {
|
|
97176
97060
|
class: "animate-spin text-6xl",
|
|
97177
97061
|
color: "var(--p-primary)",
|
|
97178
97062
|
icon: "spinner"
|
|
97179
97063
|
})
|
|
97180
97064
|
])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
97181
|
-
createElementVNode("div",
|
|
97065
|
+
createElementVNode("div", _hoisted_60$2, [
|
|
97182
97066
|
searchType.value === "content" ? (openBlock(), createBlock(CIcon, {
|
|
97183
97067
|
key: 0,
|
|
97184
97068
|
class: "mr-2",
|
|
@@ -97192,8 +97076,8 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97192
97076
|
icon: "presentation",
|
|
97193
97077
|
size: "16"
|
|
97194
97078
|
})),
|
|
97195
|
-
createElementVNode("span",
|
|
97196
|
-
createElementVNode("span",
|
|
97079
|
+
createElementVNode("span", _hoisted_61$2, toDisplayString(searchType.value === "content" ? unref(t)("canvasUI.CAlgoliaSearch.sections.content") : unref(t)("canvasUI.CAlgoliaSearch.sections.pitchDecks")), 1),
|
|
97080
|
+
createElementVNode("span", _hoisted_62$2, " (" + toDisplayString(searchType.value === "content" ? filteredContentFiles.value.length : filteredCanvasFiles.value.length) + ") ", 1)
|
|
97197
97081
|
]),
|
|
97198
97082
|
createElementVNode("div", null, [
|
|
97199
97083
|
(openBlock(true), createElementBlock(Fragment, null, renderList(searchType.value === "content" ? filteredContentFiles.value : filteredCanvasFiles.value, (item) => {
|
|
@@ -97218,7 +97102,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97218
97102
|
"object-fit": "cover",
|
|
97219
97103
|
src: item.picture_url || "",
|
|
97220
97104
|
width: "72"
|
|
97221
|
-
}, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div",
|
|
97105
|
+
}, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div", _hoisted_64$2, [
|
|
97222
97106
|
searchType.value === "content" ? (openBlock(), createBlock(CIcon, {
|
|
97223
97107
|
key: 0,
|
|
97224
97108
|
color: "var(--p-text2)",
|
|
@@ -97231,20 +97115,20 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97231
97115
|
size: "32"
|
|
97232
97116
|
}))
|
|
97233
97117
|
])),
|
|
97234
|
-
createElementVNode("div",
|
|
97235
|
-
createElementVNode("h3",
|
|
97118
|
+
createElementVNode("div", _hoisted_65$2, [
|
|
97119
|
+
createElementVNode("h3", _hoisted_66$2, toDisplayString(item.name), 1),
|
|
97236
97120
|
searchType.value === "content" && item.type === "file" && getSnippet(item) ? (openBlock(), createElementBlock("p", {
|
|
97237
97121
|
key: 0,
|
|
97238
97122
|
class: "text-xs text-gray-600 mb-1",
|
|
97239
97123
|
innerHTML: getSnippet(item)
|
|
97240
|
-
}, null, 8,
|
|
97241
|
-
createElementVNode("p",
|
|
97124
|
+
}, null, 8, _hoisted_67$2)) : createCommentVNode("", true),
|
|
97125
|
+
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
97126
|
]),
|
|
97243
|
-
createElementVNode("div",
|
|
97244
|
-
], 10,
|
|
97127
|
+
createElementVNode("div", _hoisted_69$1, toDisplayString(searchType.value === "content" && item.type === "folder" ? item.parent_folder?.name || "" : item.folder?.name || ""), 1)
|
|
97128
|
+
], 10, _hoisted_63$2);
|
|
97245
97129
|
}), 128))
|
|
97246
97130
|
]),
|
|
97247
|
-
searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div",
|
|
97131
|
+
searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_70$1, [
|
|
97248
97132
|
createVNode(CIcon, {
|
|
97249
97133
|
class: "text-6xl",
|
|
97250
97134
|
color: searchError.value ? "var(--p-error)" : "var(--p-text3)",
|
|
@@ -97259,7 +97143,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97259
97143
|
])
|
|
97260
97144
|
]))
|
|
97261
97145
|
]),
|
|
97262
|
-
!showRecentView.value ? (openBlock(), createElementBlock("div",
|
|
97146
|
+
!showRecentView.value ? (openBlock(), createElementBlock("div", _hoisted_71$1, [
|
|
97263
97147
|
createVNode(CShortcut, null, {
|
|
97264
97148
|
default: withCtx(() => [
|
|
97265
97149
|
createVNode(CShortcutIcon, { icon: "arrow-up" }),
|
|
@@ -97301,7 +97185,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
|
|
|
97301
97185
|
}
|
|
97302
97186
|
});
|
|
97303
97187
|
|
|
97304
|
-
const CAlgoliaSearch = /* @__PURE__ */ _export_sfc(_sfc_main$5K, [["__scopeId", "data-v-
|
|
97188
|
+
const CAlgoliaSearch = /* @__PURE__ */ _export_sfc(_sfc_main$5K, [["__scopeId", "data-v-da2357d4"]]);
|
|
97305
97189
|
|
|
97306
97190
|
const BulletListExtended = BulletList.extend({
|
|
97307
97191
|
addOptions() {
|
|
@@ -99368,25 +99252,6 @@ const INITIAL_CALL_STATE = {
|
|
|
99368
99252
|
};
|
|
99369
99253
|
|
|
99370
99254
|
const realTimeExtraCrmShape = ref({});
|
|
99371
|
-
function buildSchemaFromData(data) {
|
|
99372
|
-
if (data === null || data === void 0) {
|
|
99373
|
-
return null;
|
|
99374
|
-
}
|
|
99375
|
-
if (Array.isArray(data)) {
|
|
99376
|
-
if (data.length === 0) {
|
|
99377
|
-
return [];
|
|
99378
|
-
}
|
|
99379
|
-
return [buildSchemaFromData(data[0])];
|
|
99380
|
-
}
|
|
99381
|
-
if (typeof data === "object") {
|
|
99382
|
-
const schema = {};
|
|
99383
|
-
for (const [key, value] of Object.entries(data)) {
|
|
99384
|
-
schema[key] = buildSchemaFromData(value);
|
|
99385
|
-
}
|
|
99386
|
-
return schema;
|
|
99387
|
-
}
|
|
99388
|
-
return null;
|
|
99389
|
-
}
|
|
99390
99255
|
function isEmptyValue(value) {
|
|
99391
99256
|
return !value || typeof value === "string" && value.trim() === "";
|
|
99392
99257
|
}
|
|
@@ -99406,7 +99271,6 @@ function removeEmptyValues(obj) {
|
|
|
99406
99271
|
return result;
|
|
99407
99272
|
}
|
|
99408
99273
|
function useCrmShape() {
|
|
99409
|
-
const { activeCanvas } = useCanvas$1();
|
|
99410
99274
|
const call = useLocalStorage(CALL_STORAGE_KEY, INITIAL_CALL_STATE, {
|
|
99411
99275
|
deep: true,
|
|
99412
99276
|
listenToStorageChanges: true
|
|
@@ -99423,13 +99287,6 @@ function useCrmShape() {
|
|
|
99423
99287
|
"myUser",
|
|
99424
99288
|
computed(() => null)
|
|
99425
99289
|
);
|
|
99426
|
-
const pitcherDataSchema = computed(() => {
|
|
99427
|
-
const pitcherData = activeCanvas.value?.context?.pitcher_data;
|
|
99428
|
-
if (!pitcherData || typeof pitcherData !== "object") {
|
|
99429
|
-
return {};
|
|
99430
|
-
}
|
|
99431
|
-
return { pitcher_data: buildSchemaFromData(pitcherData) };
|
|
99432
|
-
});
|
|
99433
99290
|
function getDefaultCrmShape({
|
|
99434
99291
|
accountName = "",
|
|
99435
99292
|
myUser: myUser2 = null,
|
|
@@ -99468,9 +99325,7 @@ function useCrmShape() {
|
|
|
99468
99325
|
showDefault: !!launchDarkly.value.enable_default_crm_shape
|
|
99469
99326
|
}),
|
|
99470
99327
|
isEmpty(realTimeExtraCrmShape.value) ? {} : realTimeExtraCrmShape.value,
|
|
99471
|
-
isEmpty(extraCrmShape.value) ? {} : extraCrmShape.value
|
|
99472
|
-
// Derive schema from actual pitcher_data in canvas context
|
|
99473
|
-
isEmpty(pitcherDataSchema.value) ? {} : pitcherDataSchema.value
|
|
99328
|
+
isEmpty(extraCrmShape.value) ? {} : extraCrmShape.value
|
|
99474
99329
|
);
|
|
99475
99330
|
});
|
|
99476
99331
|
return {
|
|
@@ -109731,9 +109586,11 @@ const _sfc_main$4U = /* @__PURE__ */ defineComponent({
|
|
|
109731
109586
|
function filterByItemVisibility(items) {
|
|
109732
109587
|
const isAdmin = state$3.appName.value === "admin";
|
|
109733
109588
|
return items.reduce((acc, item) => {
|
|
109589
|
+
const hasCountData = "files_count" in item || "folders_count" in item || "available_files_count" in item || "available_folders_count" in item;
|
|
109734
109590
|
const filesCount = item.available_files_count ?? item.files_count ?? 0;
|
|
109735
109591
|
const foldersCount = item.available_folders_count ?? item.folders_count ?? 0;
|
|
109736
|
-
const
|
|
109592
|
+
const isFolderEmpty = item.type == "folder" && hasCountData && filesCount === 0 && foldersCount === 0;
|
|
109593
|
+
const shouldHideItem = item.name?.startsWith(".") || isFolderEmpty || item.folder?.file_thumbnail_urls?.length === 0;
|
|
109737
109594
|
if (!shouldHideItem && !isAdmin || isAdmin) {
|
|
109738
109595
|
acc.push({
|
|
109739
109596
|
...item,
|
|
@@ -110110,7 +109967,8 @@ const getInitialState$1 = () => ({
|
|
|
110110
109967
|
// instance metadata template fields dictionary
|
|
110111
109968
|
searchQuery: "",
|
|
110112
109969
|
searchMetadataFilters: {},
|
|
110113
|
-
filteredItems: []
|
|
109970
|
+
filteredItems: [],
|
|
109971
|
+
folderCache: {}
|
|
110114
109972
|
});
|
|
110115
109973
|
const state$2 = reactive(getInitialState$1());
|
|
110116
109974
|
const fileOrderedStatuses = [FileStatusEnum.PENDING, FileStatusEnum.VIEWABLE];
|
|
@@ -110195,6 +110053,15 @@ function updateFolderState(folder) {
|
|
|
110195
110053
|
state$2.folders = folder.folders;
|
|
110196
110054
|
state$2.files = folder.files;
|
|
110197
110055
|
state$2.currentFolderPath = folder.path;
|
|
110056
|
+
folder.folders.forEach((subfolder) => {
|
|
110057
|
+
state$2.folderCache[subfolder.id] = {
|
|
110058
|
+
files_count: subfolder.files_count,
|
|
110059
|
+
folders_count: subfolder.folders_count,
|
|
110060
|
+
available_files_count: subfolder.available_files_count,
|
|
110061
|
+
available_folders_count: subfolder.available_folders_count,
|
|
110062
|
+
timestamp: Date.now()
|
|
110063
|
+
};
|
|
110064
|
+
});
|
|
110198
110065
|
if (useAppStore$4().showFilteredResults.value) {
|
|
110199
110066
|
const filesById = new Map(state$2.files.map((file) => [file.id, file]));
|
|
110200
110067
|
state$2.filteredItems = state$2.filteredItems.map((filteredItem) => {
|
|
@@ -110459,7 +110326,24 @@ function init({
|
|
|
110459
110326
|
}
|
|
110460
110327
|
let filteredFolders = [];
|
|
110461
110328
|
if (!hasMetadataFilters && foldersResponse.status === "fulfilled" && foldersResponse.value) {
|
|
110462
|
-
|
|
110329
|
+
const foldersFromSearch = foldersResponse.value.results ?? [];
|
|
110330
|
+
filteredFolders = foldersFromSearch.map((folder) => {
|
|
110331
|
+
const cached = state$2.folderCache[folder.id];
|
|
110332
|
+
if (cached) {
|
|
110333
|
+
const result = {
|
|
110334
|
+
...folder,
|
|
110335
|
+
type: "folder"
|
|
110336
|
+
};
|
|
110337
|
+
if (cached.files_count !== void 0) result.files_count = cached.files_count;
|
|
110338
|
+
if (cached.folders_count !== void 0) result.folders_count = cached.folders_count;
|
|
110339
|
+
if (cached.available_files_count !== void 0) result.available_files_count = cached.available_files_count;
|
|
110340
|
+
if (cached.available_folders_count !== void 0) {
|
|
110341
|
+
result.available_folders_count = cached.available_folders_count;
|
|
110342
|
+
}
|
|
110343
|
+
return result;
|
|
110344
|
+
}
|
|
110345
|
+
return { ...folder, type: "folder" };
|
|
110346
|
+
});
|
|
110463
110347
|
} else if (!hasMetadataFilters && !useAppStore$4().isLocalSearch.value) {
|
|
110464
110348
|
console.error(
|
|
110465
110349
|
"Failed to fetch folders:",
|
|
@@ -120940,7 +120824,7 @@ const _sfc_main$4k = /* @__PURE__ */ defineComponent({
|
|
|
120940
120824
|
|
|
120941
120825
|
function useCanvasContext() {
|
|
120942
120826
|
const { activeCanvas, isPrintDisplayMode, builderCache } = useCanvas$1();
|
|
120943
|
-
const {
|
|
120827
|
+
const { getDefaultCrmShape } = useCrmShape();
|
|
120944
120828
|
const myUser = inject(
|
|
120945
120829
|
"myUser",
|
|
120946
120830
|
computed(() => null)
|
|
@@ -120972,21 +120856,14 @@ function useCanvasContext() {
|
|
|
120972
120856
|
builderCache.value[sectionOverrideKey] = mergedCtx;
|
|
120973
120857
|
return mergedCtx;
|
|
120974
120858
|
};
|
|
120975
|
-
const
|
|
120859
|
+
const crmShape = computed(() => getDefaultCrmShape({ myUser: myUser.value }));
|
|
120860
|
+
const crmShapeWithSectionCtx = computed(() => {
|
|
120976
120861
|
const mergedCtx = getSectionCtx();
|
|
120977
|
-
|
|
120978
|
-
myUser: myUser.value,
|
|
120979
|
-
showDefault: true
|
|
120980
|
-
});
|
|
120981
|
-
return mergeWith({}, defaultShape, crmShape.value ?? {}, mergedCtx, (_objValue, srcValue) => {
|
|
120982
|
-
if (Array.isArray(srcValue)) {
|
|
120983
|
-
return srcValue;
|
|
120984
|
-
}
|
|
120985
|
-
return void 0;
|
|
120986
|
-
});
|
|
120862
|
+
return !isEmpty(crmShape.value) ? { ...mergedCtx, ...crmShape.value } : mergedCtx;
|
|
120987
120863
|
});
|
|
120988
120864
|
return {
|
|
120989
|
-
|
|
120865
|
+
getSectionCtx,
|
|
120866
|
+
crmShapeWithSectionCtx
|
|
120990
120867
|
};
|
|
120991
120868
|
}
|
|
120992
120869
|
|
|
@@ -121032,10 +120909,10 @@ const _sfc_main$4j = /* @__PURE__ */ defineComponent({
|
|
|
121032
120909
|
__name: "SelectionPanel",
|
|
121033
120910
|
setup(__props) {
|
|
121034
120911
|
useCssVars((_ctx) => ({
|
|
121035
|
-
"
|
|
121036
|
-
"
|
|
121037
|
-
"
|
|
121038
|
-
"
|
|
120912
|
+
"6fe3245a": unref(themeVars).text,
|
|
120913
|
+
"6fdae5fe": unref(themeVars).base,
|
|
120914
|
+
"85f799be": unref(themeVars).primary6,
|
|
120915
|
+
"85f799c4": unref(themeVars).primary3
|
|
121039
120916
|
}));
|
|
121040
120917
|
const { t } = useI18n();
|
|
121041
120918
|
const { renderContentType, isFileExpired, isFileExpiring } = useFileDisplayHelpers();
|
|
@@ -121057,7 +120934,7 @@ const _sfc_main$4j = /* @__PURE__ */ defineComponent({
|
|
|
121057
120934
|
"launchDarkly",
|
|
121058
120935
|
computed(() => ({}))
|
|
121059
120936
|
);
|
|
121060
|
-
const {
|
|
120937
|
+
const { crmShapeWithSectionCtx } = useCanvasContext();
|
|
121061
120938
|
const isCrmShapeEnabled = computed(() => launchDarkly.value?.enable_crm_shape_for_external_links ?? false);
|
|
121062
120939
|
const draggableItems = computed({
|
|
121063
120940
|
get: () => isDragNDropEnabled.value ? addedItems.value : selectedItems.value,
|
|
@@ -121072,7 +120949,7 @@ const _sfc_main$4j = /* @__PURE__ */ defineComponent({
|
|
|
121072
120949
|
function getParsedUrl(url) {
|
|
121073
120950
|
if (!url || !isCrmShapeEnabled.value) return url;
|
|
121074
120951
|
try {
|
|
121075
|
-
return renderTemplate(url,
|
|
120952
|
+
return renderTemplate(url, crmShapeWithSectionCtx.value);
|
|
121076
120953
|
} catch (error) {
|
|
121077
120954
|
console.warn("Failed to parse template in external URL, using original URL:", error);
|
|
121078
120955
|
return url;
|
|
@@ -121376,7 +121253,7 @@ const _sfc_main$4j = /* @__PURE__ */ defineComponent({
|
|
|
121376
121253
|
}
|
|
121377
121254
|
});
|
|
121378
121255
|
|
|
121379
|
-
const SelectionPanel = /* @__PURE__ */ _export_sfc(_sfc_main$4j, [["__scopeId", "data-v-
|
|
121256
|
+
const SelectionPanel = /* @__PURE__ */ _export_sfc(_sfc_main$4j, [["__scopeId", "data-v-aa03fa77"]]);
|
|
121380
121257
|
|
|
121381
121258
|
const _hoisted_1$3q = { class: "flex justify-between gap-2 items-center truncate py-1" };
|
|
121382
121259
|
const _hoisted_2$2z = {
|
|
@@ -123908,13 +123785,13 @@ const _sfc_main$45 = /* @__PURE__ */ defineComponent({
|
|
|
123908
123785
|
computed(() => ({}))
|
|
123909
123786
|
);
|
|
123910
123787
|
const { crmShape } = useCrmShape();
|
|
123911
|
-
const {
|
|
123788
|
+
const { crmShapeWithSectionCtx } = useCanvasContext();
|
|
123912
123789
|
const isCrmShapeEnabled = computed(() => launchDarkly.value?.enable_crm_shape_for_external_links ?? false);
|
|
123913
123790
|
const parsedUrl = computed(() => {
|
|
123914
123791
|
if (!url.value.trim()) return url.value;
|
|
123915
123792
|
if (!isCrmShapeEnabled.value) return url.value;
|
|
123916
123793
|
try {
|
|
123917
|
-
return renderTemplate(url.value,
|
|
123794
|
+
return renderTemplate(url.value, crmShapeWithSectionCtx.value);
|
|
123918
123795
|
} catch (error) {
|
|
123919
123796
|
console.error("Error parsing URL template:", error);
|
|
123920
123797
|
return url.value;
|
|
@@ -124020,7 +123897,7 @@ const _sfc_main$45 = /* @__PURE__ */ defineComponent({
|
|
|
124020
123897
|
}
|
|
124021
123898
|
});
|
|
124022
123899
|
|
|
124023
|
-
const ExternalLinks = /* @__PURE__ */ _export_sfc(_sfc_main$45, [["__scopeId", "data-v-
|
|
123900
|
+
const ExternalLinks = /* @__PURE__ */ _export_sfc(_sfc_main$45, [["__scopeId", "data-v-1287b675"]]);
|
|
124024
123901
|
|
|
124025
123902
|
const _hoisted_1$3d = { class: "mr-3 h-full" };
|
|
124026
123903
|
const _hoisted_2$2m = { class: "flex flex-col gap-3 mb-3" };
|
|
@@ -148106,7 +147983,7 @@ const _sfc_main$2i = /* @__PURE__ */ defineComponent({
|
|
|
148106
147983
|
} = useCanvas$1();
|
|
148107
147984
|
const { discardOverridesConfirmationOptions, getComponentOverrides } = useCanvasSectionOverrides();
|
|
148108
147985
|
const { getDerivedStyleFromFeatureFlags } = useComponentStyle(componentNode);
|
|
148109
|
-
const {
|
|
147986
|
+
const { crmShapeWithSectionCtx } = useCanvasContext();
|
|
148110
147987
|
const { setContentSelectorMode } = useContentSelector();
|
|
148111
147988
|
const confirmation = useConfirmation();
|
|
148112
147989
|
const themeVars = useThemeVars();
|
|
@@ -148259,7 +148136,7 @@ const _sfc_main$2i = /* @__PURE__ */ defineComponent({
|
|
|
148259
148136
|
try {
|
|
148260
148137
|
return {
|
|
148261
148138
|
...value,
|
|
148262
|
-
external_url: renderTemplate(value.external_url,
|
|
148139
|
+
external_url: renderTemplate(value.external_url, crmShapeWithSectionCtx.value)
|
|
148263
148140
|
};
|
|
148264
148141
|
} catch (error) {
|
|
148265
148142
|
console.warn("Failed to parse template in external URL, using original URL:", error);
|
|
@@ -148777,7 +148654,7 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
|
|
|
148777
148654
|
setCanvasMetadata,
|
|
148778
148655
|
isImpact
|
|
148779
148656
|
} = useCanvas$1();
|
|
148780
|
-
const {
|
|
148657
|
+
const { crmShapeWithSectionCtx } = useCanvasContext();
|
|
148781
148658
|
const { coreRestApiAxios } = useCoreApi();
|
|
148782
148659
|
const { applyPrintModeToElement } = usePrintMode();
|
|
148783
148660
|
const { discardOverridesConfirmationOptions, getComponentOverrides } = useCanvasSectionOverrides();
|
|
@@ -148834,7 +148711,7 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
|
|
|
148834
148711
|
const memoizedModelValue = computed(() => getModelValue(computedTextProps.value.data?.content));
|
|
148835
148712
|
function getModelValue(value = "") {
|
|
148836
148713
|
if (!shouldInterpolate.value || !value.trim()) return value;
|
|
148837
|
-
return renderTemplate(value,
|
|
148714
|
+
return renderTemplate(value, crmShapeWithSectionCtx.value);
|
|
148838
148715
|
}
|
|
148839
148716
|
const debouncedUpdateNodeData = debounce((data2, nodeId, sectionId) => {
|
|
148840
148717
|
return updateNodeData(data2, nodeId, sectionId);
|
|
@@ -148942,7 +148819,7 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
|
|
|
148942
148819
|
);
|
|
148943
148820
|
applyPrintModeToElement(contentElement.value, () => {
|
|
148944
148821
|
const content = computedTextProps.value.data?.content || "";
|
|
148945
|
-
return shouldInterpolate.value ? renderTemplate(content,
|
|
148822
|
+
return shouldInterpolate.value ? renderTemplate(content, crmShapeWithSectionCtx.value) : content;
|
|
148946
148823
|
});
|
|
148947
148824
|
if (enableScaleContent && spanStyles) {
|
|
148948
148825
|
setTimeout(() => {
|
|
@@ -149054,7 +148931,7 @@ const _sfc_main$2h = /* @__PURE__ */ defineComponent({
|
|
|
149054
148931
|
}
|
|
149055
148932
|
});
|
|
149056
148933
|
|
|
149057
|
-
const Text = /* @__PURE__ */ _export_sfc(_sfc_main$2h, [["__scopeId", "data-v-
|
|
148934
|
+
const Text = /* @__PURE__ */ _export_sfc(_sfc_main$2h, [["__scopeId", "data-v-b2424519"]]);
|
|
149058
148935
|
|
|
149059
148936
|
const _hoisted_1$1Q = { class: "absolute top-2 right-2 flex items-center gap-1 z-10" };
|
|
149060
148937
|
const _hoisted_2$1m = { class: "text-xs" };
|
|
@@ -176405,10 +176282,10 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
176405
176282
|
__name: "ActionsToolbar",
|
|
176406
176283
|
setup(__props) {
|
|
176407
176284
|
useCssVars((_ctx) => ({
|
|
176408
|
-
"
|
|
176409
|
-
"
|
|
176410
|
-
"
|
|
176411
|
-
"
|
|
176285
|
+
"6b5e9219": unref(themeVars).primary4,
|
|
176286
|
+
"3d451d7b": unref(themeVars).primary,
|
|
176287
|
+
"6b5e921b": unref(themeVars).primary6,
|
|
176288
|
+
"42dfd1f8": unref(themeVars).base
|
|
176412
176289
|
}));
|
|
176413
176290
|
const {
|
|
176414
176291
|
toggleContentPanel,
|
|
@@ -176636,7 +176513,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
176636
176513
|
return (nameMatch || createdByMatch || tagMatch) && metadataMatch;
|
|
176637
176514
|
});
|
|
176638
176515
|
const folderResults = folders.map((folder) => {
|
|
176639
|
-
|
|
176516
|
+
const result = {
|
|
176640
176517
|
id: folder.id,
|
|
176641
176518
|
name: folder.name,
|
|
176642
176519
|
folder_id: apiState.currentFolderId,
|
|
@@ -176648,6 +176525,11 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
176648
176525
|
file_thumbnail_urls: folder.file_thumbnail_urls,
|
|
176649
176526
|
thumbnail_url: folder.thumbnail_url
|
|
176650
176527
|
};
|
|
176528
|
+
if (folder.files_count !== void 0) result.files_count = folder.files_count;
|
|
176529
|
+
if (folder.folders_count !== void 0) result.folders_count = folder.folders_count;
|
|
176530
|
+
if (folder.available_files_count !== void 0) result.available_files_count = folder.available_files_count;
|
|
176531
|
+
if (folder.available_folders_count !== void 0) result.available_folders_count = folder.available_folders_count;
|
|
176532
|
+
return result;
|
|
176651
176533
|
});
|
|
176652
176534
|
const fileResults = files.map((file) => {
|
|
176653
176535
|
return {
|
|
@@ -176876,7 +176758,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
176876
176758
|
}
|
|
176877
176759
|
});
|
|
176878
176760
|
|
|
176879
|
-
const ActionsToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-
|
|
176761
|
+
const ActionsToolbar = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-41ca4793"]]);
|
|
176880
176762
|
|
|
176881
176763
|
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
176882
176764
|
__name: "FavoritesTable",
|
|
@@ -183798,14 +183680,8 @@ function getEventColor(sfEvent) {
|
|
|
183798
183680
|
} else {
|
|
183799
183681
|
isSubmitted = false;
|
|
183800
183682
|
}
|
|
183801
|
-
const now = /* @__PURE__ */ new Date();
|
|
183802
183683
|
if (isSubmitted) return SfEventColors.SUBMITTED;
|
|
183803
|
-
else if (sfEvent.
|
|
183804
|
-
const endDate = new Date(sfEvent.EndDateTime);
|
|
183805
|
-
const todayStart = startOfDay(now);
|
|
183806
|
-
const endDayStart = startOfDay(endDate);
|
|
183807
|
-
return isAfter$1(todayStart, endDayStart) ? SfEventColors.PAST : SfEventColors.PLANNED;
|
|
183808
|
-
} else if (isAfter$1(now, new Date(sfEvent.EndDateTime))) return SfEventColors.PAST;
|
|
183684
|
+
else if (isAfter$1(/* @__PURE__ */ new Date(), new Date(sfEvent.EndDateTime))) return SfEventColors.PAST;
|
|
183809
183685
|
else return SfEventColors.PLANNED;
|
|
183810
183686
|
}
|
|
183811
183687
|
const minFutureDate = (date = /* @__PURE__ */ new Date()) => add(date, { minutes: MIN_DIFFERENCE_IN_MINUTES });
|