@pitcher/canvas-ui 2025.12.23-94943 → 2025.12.24-95559

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.js CHANGED
@@ -95267,67 +95267,75 @@ const _hoisted_30$4 = {
95267
95267
  };
95268
95268
  const _hoisted_31$4 = { class: "w-full px-0" };
95269
95269
  const _hoisted_32$4 = {
95270
+ key: 0,
95271
+ class: "flex flex-col items-center justify-center text-center p-8 gap-4"
95272
+ };
95273
+ const _hoisted_33$4 = {
95270
95274
  key: 0,
95271
95275
  class: "mb-0"
95272
95276
  };
95273
- const _hoisted_33$4 = { class: "flex items-center px-0 pt-2 pb-1" };
95274
- const _hoisted_34$4 = { class: "text-m font-semibold text-gray-900" };
95275
- const _hoisted_35$4 = { class: "ml-2 text-sm text-gray-500" };
95276
- const _hoisted_36$4 = ["data-result-selected", "onClick"];
95277
- const _hoisted_37$4 = {
95277
+ const _hoisted_34$4 = { class: "flex items-center px-0 pt-2 pb-1" };
95278
+ const _hoisted_35$4 = { class: "text-m font-semibold text-gray-900" };
95279
+ const _hoisted_36$4 = { class: "ml-2 text-sm text-gray-500" };
95280
+ const _hoisted_37$4 = ["data-result-selected", "onClick"];
95281
+ const _hoisted_38$4 = {
95278
95282
  key: 1,
95279
95283
  class: "w-18 h-14 border-rounded-1 mr-4 flex-shrink-0 bg-gray-200 flex items-center justify-center"
95280
95284
  };
95281
- const _hoisted_38$4 = { class: "flex-1 min-w-0" };
95282
- const _hoisted_39$4 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
95283
- const _hoisted_40$4 = ["innerHTML"];
95284
- const _hoisted_41$4 = { class: "text-xs text-gray-500" };
95285
- const _hoisted_42$4 = { class: "text-xs text-gray-400" };
95286
- const _hoisted_43$4 = {
95285
+ const _hoisted_39$4 = { class: "flex-1 min-w-0" };
95286
+ const _hoisted_40$4 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
95287
+ const _hoisted_41$4 = ["innerHTML"];
95288
+ const _hoisted_42$4 = { class: "text-xs text-gray-500" };
95289
+ const _hoisted_43$4 = { class: "text-xs text-gray-400" };
95290
+ const _hoisted_44$4 = {
95287
95291
  key: 0,
95288
95292
  class: "px-0 py-0"
95289
95293
  };
95290
- const _hoisted_44$4 = { key: 1 };
95291
- const _hoisted_45$4 = { class: "flex items-center px-0 pt-2 pb-1" };
95292
- const _hoisted_46$4 = { class: "text-m font-semibold text-gray-900" };
95293
- const _hoisted_47$4 = { class: "ml-2 text-sm text-gray-500" };
95294
- const _hoisted_48$4 = ["data-result-selected", "onClick"];
95295
- const _hoisted_49$4 = { class: "w-18 h-14 border-rounded-1 mr-4 flex-shrink-0 bg-gray-200 flex items-center justify-center" };
95296
- const _hoisted_50$4 = { class: "flex-1 min-w-0" };
95297
- const _hoisted_51$3 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
95298
- const _hoisted_52$3 = { class: "text-xs text-gray-500" };
95299
- const _hoisted_53$3 = { class: "text-xs text-gray-400" };
95300
- const _hoisted_54$2 = {
95294
+ const _hoisted_45$4 = { key: 1 };
95295
+ const _hoisted_46$4 = { class: "flex items-center px-0 pt-2 pb-1" };
95296
+ const _hoisted_47$4 = { class: "text-m font-semibold text-gray-900" };
95297
+ const _hoisted_48$4 = { class: "ml-2 text-sm text-gray-500" };
95298
+ const _hoisted_49$4 = ["data-result-selected", "onClick"];
95299
+ 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" };
95300
+ const _hoisted_51$3 = { class: "flex-1 min-w-0" };
95301
+ const _hoisted_52$3 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
95302
+ const _hoisted_53$3 = { class: "text-xs text-gray-500" };
95303
+ const _hoisted_54$2 = { class: "text-xs text-gray-400" };
95304
+ const _hoisted_55$2 = {
95301
95305
  key: 0,
95302
95306
  class: "px-0 py-0"
95303
95307
  };
95304
- const _hoisted_55$2 = {
95305
- key: 0,
95308
+ const _hoisted_56$2 = {
95309
+ key: 2,
95306
95310
  class: "flex flex-col items-center justify-center text-center p-8 gap-4"
95307
95311
  };
95308
- const _hoisted_56$2 = {
95312
+ const _hoisted_57$2 = {
95309
95313
  key: 2,
95310
95314
  class: "flex-1 overflow-y-auto bg-white w-full"
95311
95315
  };
95312
- const _hoisted_57$2 = { class: "w-full px-0" };
95313
- const _hoisted_58$2 = { class: "flex items-center px-0 pt-2 pb-1" };
95314
- const _hoisted_59$2 = { class: "text-m font-semibold text-gray-900" };
95315
- const _hoisted_60$2 = { class: "ml-2 text-sm text-gray-500" };
95316
- const _hoisted_61$2 = ["data-result-selected", "onClick"];
95317
- const _hoisted_62$2 = {
95316
+ const _hoisted_58$2 = { class: "w-full px-0" };
95317
+ const _hoisted_59$2 = {
95318
+ key: 0,
95319
+ class: "flex flex-col items-center justify-center text-center p-8 gap-4"
95320
+ };
95321
+ const _hoisted_60$2 = { class: "flex items-center px-0 pt-2 pb-1" };
95322
+ const _hoisted_61$2 = { class: "text-m font-semibold text-gray-900" };
95323
+ const _hoisted_62$2 = { class: "ml-2 text-sm text-gray-500" };
95324
+ const _hoisted_63$2 = ["data-result-selected", "onClick"];
95325
+ const _hoisted_64$2 = {
95318
95326
  key: 1,
95319
95327
  class: "w-18 h-14 border-rounded-1 mr-4 flex-shrink-0 bg-gray-200 flex items-center justify-center"
95320
95328
  };
95321
- const _hoisted_63$2 = { class: "flex-1 min-w-0" };
95322
- const _hoisted_64$2 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
95323
- const _hoisted_65$2 = ["innerHTML"];
95324
- const _hoisted_66$2 = { class: "text-xs text-gray-500" };
95325
- const _hoisted_67$2 = { class: "text-xs text-gray-400" };
95326
- const _hoisted_68$2 = {
95329
+ const _hoisted_65$2 = { class: "flex-1 min-w-0" };
95330
+ const _hoisted_66$2 = { class: "text-sm font-bold text-gray-900 truncate mb-1" };
95331
+ const _hoisted_67$2 = ["innerHTML"];
95332
+ const _hoisted_68$2 = { class: "text-xs text-gray-500" };
95333
+ const _hoisted_69$1 = { class: "text-xs text-gray-400" };
95334
+ const _hoisted_70$1 = {
95327
95335
  key: 0,
95328
95336
  class: "flex flex-col items-center justify-center text-center p-8 gap-4"
95329
95337
  };
95330
- const _hoisted_69$1 = {
95338
+ const _hoisted_71$1 = {
95331
95339
  key: 0,
95332
95340
  class: "flex flex-wrap line-height-6 pt-4 pb-2 px-6 border-t border-gray-200 gap-y-4 gap-x-4"
95333
95341
  };
@@ -95357,13 +95365,13 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
95357
95365
  const fileTypeOptions = [
95358
95366
  { label: "Folder", value: "folder" },
95359
95367
  { label: "PDF", value: "pdf" },
95360
- { label: "Image", value: "image" },
95361
- { label: "Audio", value: "audio" },
95362
- { label: "Video", value: "video" },
95363
95368
  { label: "Document", value: "document" },
95364
95369
  { label: "Presentation", value: "presentation" },
95365
95370
  { label: "Spreadsheet", value: "spreadsheet" },
95366
- { label: "Font", value: "font" },
95371
+ { label: "Image", value: "image" },
95372
+ { label: "Video", value: "video" },
95373
+ { label: "Audio", value: "audio" },
95374
+ { label: "AR", value: "ar" },
95367
95375
  { label: "Web", value: "web" }
95368
95376
  ];
95369
95377
  const hasActiveFilters = computed(() => selectedFileTypes.value.length > 0 || selectedCanvasFilters.value.length > 0);
@@ -95372,12 +95380,19 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
95372
95380
  selectedCanvasFilters.value = [];
95373
95381
  debouncedFilterSearch();
95374
95382
  };
95375
- const handleEverywhereClick = () => {
95383
+ const handleEverywhereClick = async () => {
95376
95384
  selectedFileTypes.value = [];
95377
95385
  selectedCanvasFilters.value = [];
95378
95386
  searchType.value = null;
95379
95387
  if (searchQuery.value.trim()) {
95380
- performSearch(searchQuery.value);
95388
+ try {
95389
+ skipNextSuggestionFetch.value = true;
95390
+ await performSearch(searchQuery.value);
95391
+ } catch (error) {
95392
+ console.error("[handleEverywhereClick] Search failed:", error);
95393
+ } finally {
95394
+ skipNextSuggestionFetch.value = false;
95395
+ }
95381
95396
  }
95382
95397
  };
95383
95398
  const recentSearches = ref([]);
@@ -95616,6 +95631,10 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
95616
95631
  isSearching.value = true;
95617
95632
  hasSearchCompleted.value = false;
95618
95633
  searchError.value = null;
95634
+ const shouldSkipSuggestionFetch = skipNextSuggestionFetch.value;
95635
+ if (shouldSkipSuggestionFetch) {
95636
+ skipNextSuggestionFetch.value = false;
95637
+ }
95619
95638
  try {
95620
95639
  const ALLOWED_CANVAS_TYPES = ["saved_canvas", "template", "product_template", "section", "block"];
95621
95640
  const ALLOWED_FILE_TYPES = [
@@ -95625,11 +95644,9 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
95625
95644
  "audio",
95626
95645
  "video",
95627
95646
  "document",
95628
- "docx",
95629
- "pptx",
95630
95647
  "presentation",
95631
95648
  "spreadsheet",
95632
- "font",
95649
+ "ar",
95633
95650
  "web"
95634
95651
  ];
95635
95652
  const validCanvasFilters = selectedCanvasFilters.value.filter((f) => ALLOWED_CANVAS_TYPES.includes(f));
@@ -95669,12 +95686,8 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
95669
95686
  canvasResults.value = results.canvas?.hits || [];
95670
95687
  selectedResultIndex.value = -1;
95671
95688
  searchError.value = null;
95672
- if (query.trim().length >= 2) {
95673
- if (skipNextSuggestionFetch.value) {
95674
- skipNextSuggestionFetch.value = false;
95675
- } else {
95676
- fetchQuerySuggestions(query.trim());
95677
- }
95689
+ if (query.trim().length >= 2 && !shouldSkipSuggestionFetch) {
95690
+ fetchQuerySuggestions(query.trim());
95678
95691
  }
95679
95692
  const totalResults = contentResults.value.length + canvasResults.value.length;
95680
95693
  trackAlgoliaSearchPerformed(query.trim(), totalResults);
@@ -95712,11 +95725,18 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
95712
95725
  const debouncedFilterSearch = () => {
95713
95726
  if (filterChangeTimer) clearTimeout(filterChangeTimer);
95714
95727
  if (searchTimer) clearTimeout(searchTimer);
95715
- filterChangeTimer = setTimeout(() => {
95728
+ filterChangeTimer = setTimeout(async () => {
95716
95729
  if (searchQuery.value.trim() && !showRecentView.value) {
95717
- performSearch(searchQuery.value);
95730
+ try {
95731
+ skipNextSuggestionFetch.value = true;
95732
+ await performSearch(searchQuery.value);
95733
+ } catch (error) {
95734
+ console.error("[debouncedFilterSearch] Search failed:", error);
95735
+ } finally {
95736
+ skipNextSuggestionFetch.value = false;
95737
+ }
95718
95738
  }
95719
- }, 300);
95739
+ }, 500);
95720
95740
  };
95721
95741
  const handleSearchInput = (query) => {
95722
95742
  const validatedQuery = validateSearchInput(query);
@@ -95731,7 +95751,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
95731
95751
  if (searchTimer) clearTimeout(searchTimer);
95732
95752
  searchTimer = setTimeout(() => {
95733
95753
  performSearch(validatedQuery);
95734
- }, 300);
95754
+ }, 500);
95735
95755
  if (saveSearchTimer) clearTimeout(saveSearchTimer);
95736
95756
  saveSearchTimer = setTimeout(() => {
95737
95757
  saveSearchTerm(validatedQuery);
@@ -95769,6 +95789,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
95769
95789
  return;
95770
95790
  }
95771
95791
  try {
95792
+ skipNextSuggestionFetch.value = true;
95772
95793
  searchQuery.value = validatedSearchTerm;
95773
95794
  showRecentView.value = false;
95774
95795
  querySuggestions.value = [];
@@ -95776,6 +95797,8 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
95776
95797
  await performSearch(validatedSearchTerm);
95777
95798
  } catch (error) {
95778
95799
  console.error("[handleRecentSearchClick] Search failed:", error);
95800
+ } finally {
95801
+ skipNextSuggestionFetch.value = false;
95779
95802
  }
95780
95803
  };
95781
95804
  const handleSuggestionClick = async (suggestion) => {
@@ -96221,7 +96244,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
96221
96244
  (openBlock(), createElementBlock(Fragment, null, renderList(fileTypeOptions, (option) => {
96222
96245
  return createElementVNode("div", {
96223
96246
  key: option.value,
96224
- class: "w-full h-8 flex items-center"
96247
+ class: "w-full h-7 flex items-center"
96225
96248
  }, [
96226
96249
  createVNode(unref(NCheckbox), {
96227
96250
  checked: selectedFileTypes.value.includes(option.value),
@@ -96439,30 +96462,185 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
96439
96462
  ], 64)) : createCommentVNode("", true)
96440
96463
  ])) : !searchType.value ? (openBlock(), createElementBlock("div", _hoisted_30$4, [
96441
96464
  createElementVNode("div", _hoisted_31$4, [
96442
- filteredContentFiles.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_32$4, [
96443
- createElementVNode("div", _hoisted_33$4, [
96465
+ isSearching.value ? (openBlock(), createElementBlock("div", _hoisted_32$4, [
96466
+ createVNode(CIcon, {
96467
+ class: "animate-spin text-6xl",
96468
+ color: "var(--p-primary)",
96469
+ icon: "spinner"
96470
+ })
96471
+ ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
96472
+ filteredContentFiles.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_33$4, [
96473
+ createElementVNode("div", _hoisted_34$4, [
96474
+ createVNode(CIcon, {
96475
+ class: "mr-2",
96476
+ color: "var(--p-text2)",
96477
+ icon: "folder",
96478
+ size: "16"
96479
+ }),
96480
+ createElementVNode("span", _hoisted_35$4, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.sections.content")), 1),
96481
+ createElementVNode("span", _hoisted_36$4, "(" + toDisplayString(filteredContentFiles.value.length) + ")", 1)
96482
+ ]),
96483
+ createElementVNode("div", null, [
96484
+ (openBlock(true), createElementBlock(Fragment, null, renderList(filteredContentFiles.value.slice(0, 5), (item) => {
96485
+ return openBlock(), createElementBlock("div", {
96486
+ key: item.id,
96487
+ class: normalizeClass([
96488
+ "flex items-center px-0 cursor-pointer border-b border-gray-100 w-full",
96489
+ _ctx.isAdmin ? "py-3" : "py-0",
96490
+ isResultSelected(item) ? "bg-primary6" : "hover:bg-primary5"
96491
+ ]),
96492
+ "data-result-selected": isResultSelected(item),
96493
+ onClick: ($event) => handleResultClick(item, item.type === "folder" ? "folder" : "file")
96494
+ }, [
96495
+ item.type === "file" ? (openBlock(), createBlock(_sfc_main$6K, {
96496
+ key: 0,
96497
+ class: "w-18 h-14 border-rounded-1 overflow-hidden flex-shrink-0 mr-4",
96498
+ cover: "",
96499
+ "file-data": item,
96500
+ "object-fit": "cover",
96501
+ src: item.picture_url || "",
96502
+ width: "72"
96503
+ }, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div", _hoisted_38$4, [
96504
+ createVNode(CIcon, {
96505
+ color: "var(--p-text2)",
96506
+ icon: "folder",
96507
+ size: "32"
96508
+ })
96509
+ ])),
96510
+ createElementVNode("div", _hoisted_39$4, [
96511
+ createElementVNode("h3", _hoisted_40$4, toDisplayString(item.name), 1),
96512
+ item.type === "file" && getSnippet(item) ? (openBlock(), createElementBlock("p", {
96513
+ key: 0,
96514
+ class: "text-xs text-gray-600 mb-1",
96515
+ innerHTML: getSnippet(item)
96516
+ }, null, 8, _hoisted_41$4)) : createCommentVNode("", true),
96517
+ createElementVNode("p", _hoisted_42$4, toDisplayString(item.type === "folder" ? "Folder" : item.file_category || item.content_type || "File"), 1)
96518
+ ]),
96519
+ createElementVNode("div", _hoisted_43$4, toDisplayString(item.type === "folder" ? item.parent_folder?.name || "" : item.folder?.name || ""), 1)
96520
+ ], 10, _hoisted_37$4);
96521
+ }), 128))
96522
+ ]),
96523
+ filteredContentFiles.value.length > 5 ? (openBlock(), createElementBlock("div", _hoisted_44$4, [
96524
+ createElementVNode("span", {
96525
+ class: "text-sm text-gray-600 hover:text-gray-800 font-bold flex items-center cursor-pointer",
96526
+ onClick: _cache[14] || (_cache[14] = ($event) => searchType.value = "content")
96527
+ }, [
96528
+ createTextVNode(toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.actions.viewAll")) + " ", 1),
96529
+ createVNode(CIcon, {
96530
+ class: "ml-1",
96531
+ icon: "chevron-right",
96532
+ size: "12"
96533
+ })
96534
+ ])
96535
+ ])) : createCommentVNode("", true)
96536
+ ])) : createCommentVNode("", true),
96537
+ filteredCanvasFiles.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_45$4, [
96538
+ createElementVNode("div", _hoisted_46$4, [
96539
+ createVNode(CIcon, {
96540
+ class: "mr-2",
96541
+ color: "var(--p-text2)",
96542
+ icon: "presentation",
96543
+ size: "16"
96544
+ }),
96545
+ createElementVNode("span", _hoisted_47$4, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.sections.pitchDecks")), 1),
96546
+ createElementVNode("span", _hoisted_48$4, "(" + toDisplayString(filteredCanvasFiles.value.length) + ")", 1)
96547
+ ]),
96548
+ createElementVNode("div", null, [
96549
+ (openBlock(true), createElementBlock(Fragment, null, renderList(filteredCanvasFiles.value.slice(0, 5), (item) => {
96550
+ return openBlock(), createElementBlock("div", {
96551
+ key: item.id,
96552
+ class: normalizeClass([
96553
+ "flex items-center px-0 cursor-pointer border-b border-gray-100 w-full",
96554
+ _ctx.isAdmin ? "py-3" : "py-0",
96555
+ isResultSelected(item) ? "bg-primary6" : "hover:bg-primary5"
96556
+ ]),
96557
+ "data-result-selected": isResultSelected(item),
96558
+ onClick: ($event) => handleResultClick(item, "canvas")
96559
+ }, [
96560
+ createElementVNode("div", _hoisted_50$4, [
96561
+ createVNode(CIcon, {
96562
+ color: "var(--p-text2)",
96563
+ icon: "presentation",
96564
+ size: "32"
96565
+ })
96566
+ ]),
96567
+ createElementVNode("div", _hoisted_51$3, [
96568
+ createElementVNode("h3", _hoisted_52$3, toDisplayString(item.name), 1),
96569
+ createElementVNode("p", _hoisted_53$3, toDisplayString(formatCanvasType(item.content_type)), 1)
96570
+ ]),
96571
+ createElementVNode("div", _hoisted_54$2, toDisplayString(item.folder?.name || ""), 1)
96572
+ ], 10, _hoisted_49$4);
96573
+ }), 128))
96574
+ ]),
96575
+ filteredCanvasFiles.value.length > 5 ? (openBlock(), createElementBlock("div", _hoisted_55$2, [
96576
+ createElementVNode("span", {
96577
+ class: "text-sm text-gray-600 hover:text-gray-800 font-bold flex items-center cursor-pointer",
96578
+ onClick: _cache[15] || (_cache[15] = ($event) => searchType.value = "canvases")
96579
+ }, [
96580
+ createTextVNode(toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.actions.viewAll")) + " ", 1),
96581
+ createVNode(CIcon, {
96582
+ class: "ml-1",
96583
+ icon: "chevron-right",
96584
+ size: "12"
96585
+ })
96586
+ ])
96587
+ ])) : createCommentVNode("", true)
96588
+ ])) : createCommentVNode("", true),
96589
+ searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_56$2, [
96444
96590
  createVNode(CIcon, {
96591
+ class: "text-6xl",
96592
+ color: searchError.value ? "var(--p-error)" : "var(--p-text3)",
96593
+ "fa-type": "fal",
96594
+ icon: searchError.value ? "exclamation-triangle" : "radar"
96595
+ }, null, 8, ["color", "icon"]),
96596
+ createElementVNode("p", {
96597
+ class: normalizeClass(searchError.value ? "text-error font-semibold" : "text-text2")
96598
+ }, toDisplayString(searchError.value || unref(t)("canvasUI.CGlobalSearch.noResults")), 3)
96599
+ ])) : createCommentVNode("", true)
96600
+ ], 64))
96601
+ ])
96602
+ ])) : (openBlock(), createElementBlock("div", _hoisted_57$2, [
96603
+ createElementVNode("div", _hoisted_58$2, [
96604
+ isSearching.value ? (openBlock(), createElementBlock("div", _hoisted_59$2, [
96605
+ createVNode(CIcon, {
96606
+ class: "animate-spin text-6xl",
96607
+ color: "var(--p-primary)",
96608
+ icon: "spinner"
96609
+ })
96610
+ ])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
96611
+ createElementVNode("div", _hoisted_60$2, [
96612
+ searchType.value === "content" ? (openBlock(), createBlock(CIcon, {
96613
+ key: 0,
96445
96614
  class: "mr-2",
96446
96615
  color: "var(--p-text2)",
96447
96616
  icon: "folder",
96448
96617
  size: "16"
96449
- }),
96450
- createElementVNode("span", _hoisted_34$4, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.sections.content")), 1),
96451
- createElementVNode("span", _hoisted_35$4, "(" + toDisplayString(filteredContentFiles.value.length) + ")", 1)
96618
+ })) : (openBlock(), createBlock(CIcon, {
96619
+ key: 1,
96620
+ class: "mr-2",
96621
+ color: "var(--p-text2)",
96622
+ icon: "presentation",
96623
+ size: "16"
96624
+ })),
96625
+ createElementVNode("span", _hoisted_61$2, toDisplayString(searchType.value === "content" ? unref(t)("canvasUI.CAlgoliaSearch.sections.content") : unref(t)("canvasUI.CAlgoliaSearch.sections.pitchDecks")), 1),
96626
+ createElementVNode("span", _hoisted_62$2, " (" + toDisplayString(searchType.value === "content" ? filteredContentFiles.value.length : filteredCanvasFiles.value.length) + ") ", 1)
96452
96627
  ]),
96453
96628
  createElementVNode("div", null, [
96454
- (openBlock(true), createElementBlock(Fragment, null, renderList(filteredContentFiles.value.slice(0, 5), (item) => {
96629
+ (openBlock(true), createElementBlock(Fragment, null, renderList(searchType.value === "content" ? filteredContentFiles.value : filteredCanvasFiles.value, (item) => {
96455
96630
  return openBlock(), createElementBlock("div", {
96456
96631
  key: item.id,
96457
96632
  class: normalizeClass([
96458
96633
  "flex items-center px-0 cursor-pointer border-b border-gray-100 w-full",
96459
96634
  _ctx.isAdmin ? "py-3" : "py-0",
96460
- isResultSelected(item) ? "bg-primary6" : "hover:bg-primary5"
96635
+ isResultSelected(item) ? "bg-gray-100" : "hover:bg-gray-50"
96461
96636
  ]),
96462
96637
  "data-result-selected": isResultSelected(item),
96463
- onClick: ($event) => handleResultClick(item, item.type === "folder" ? "folder" : "file")
96638
+ onClick: ($event) => handleResultClick(
96639
+ item,
96640
+ searchType.value === "content" ? item.type === "folder" ? "folder" : "file" : "canvas"
96641
+ )
96464
96642
  }, [
96465
- item.type === "file" ? (openBlock(), createBlock(_sfc_main$6K, {
96643
+ searchType.value === "content" && item.type === "file" ? (openBlock(), createBlock(_sfc_main$6K, {
96466
96644
  key: 0,
96467
96645
  class: "w-18 h-14 border-rounded-1 overflow-hidden flex-shrink-0 mr-4",
96468
96646
  cover: "",
@@ -96470,187 +96648,48 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
96470
96648
  "object-fit": "cover",
96471
96649
  src: item.picture_url || "",
96472
96650
  width: "72"
96473
- }, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div", _hoisted_37$4, [
96474
- createVNode(CIcon, {
96651
+ }, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div", _hoisted_64$2, [
96652
+ searchType.value === "content" ? (openBlock(), createBlock(CIcon, {
96653
+ key: 0,
96475
96654
  color: "var(--p-text2)",
96476
96655
  icon: "folder",
96477
96656
  size: "32"
96478
- })
96657
+ })) : (openBlock(), createBlock(CIcon, {
96658
+ key: 1,
96659
+ color: "var(--p-text2)",
96660
+ icon: "presentation",
96661
+ size: "32"
96662
+ }))
96479
96663
  ])),
96480
- createElementVNode("div", _hoisted_38$4, [
96481
- createElementVNode("h3", _hoisted_39$4, toDisplayString(item.name), 1),
96482
- item.type === "file" && getSnippet(item) ? (openBlock(), createElementBlock("p", {
96664
+ createElementVNode("div", _hoisted_65$2, [
96665
+ createElementVNode("h3", _hoisted_66$2, toDisplayString(item.name), 1),
96666
+ searchType.value === "content" && item.type === "file" && getSnippet(item) ? (openBlock(), createElementBlock("p", {
96483
96667
  key: 0,
96484
96668
  class: "text-xs text-gray-600 mb-1",
96485
96669
  innerHTML: getSnippet(item)
96486
- }, null, 8, _hoisted_40$4)) : createCommentVNode("", true),
96487
- createElementVNode("p", _hoisted_41$4, toDisplayString(item.type === "folder" ? "Folder" : item.file_category || item.content_type || "File"), 1)
96670
+ }, null, 8, _hoisted_67$2)) : createCommentVNode("", true),
96671
+ 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)
96488
96672
  ]),
96489
- createElementVNode("div", _hoisted_42$4, toDisplayString(item.type === "folder" ? item.parent_folder?.name || "" : item.folder?.name || ""), 1)
96490
- ], 10, _hoisted_36$4);
96673
+ createElementVNode("div", _hoisted_69$1, toDisplayString(searchType.value === "content" && item.type === "folder" ? item.parent_folder?.name || "" : item.folder?.name || ""), 1)
96674
+ ], 10, _hoisted_63$2);
96491
96675
  }), 128))
96492
96676
  ]),
96493
- filteredContentFiles.value.length > 5 ? (openBlock(), createElementBlock("div", _hoisted_43$4, [
96494
- createElementVNode("span", {
96495
- class: "text-sm text-gray-600 hover:text-gray-800 font-bold flex items-center cursor-pointer",
96496
- onClick: _cache[14] || (_cache[14] = ($event) => searchType.value = "content")
96497
- }, [
96498
- createTextVNode(toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.actions.viewAll")) + " ", 1),
96499
- createVNode(CIcon, {
96500
- class: "ml-1",
96501
- icon: "chevron-right",
96502
- size: "12"
96503
- })
96504
- ])
96505
- ])) : createCommentVNode("", true)
96506
- ])) : createCommentVNode("", true),
96507
- filteredCanvasFiles.value.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_44$4, [
96508
- createElementVNode("div", _hoisted_45$4, [
96677
+ searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_70$1, [
96509
96678
  createVNode(CIcon, {
96510
- class: "mr-2",
96511
- color: "var(--p-text2)",
96512
- icon: "presentation",
96513
- size: "16"
96514
- }),
96515
- createElementVNode("span", _hoisted_46$4, toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.sections.pitchDecks")), 1),
96516
- createElementVNode("span", _hoisted_47$4, "(" + toDisplayString(filteredCanvasFiles.value.length) + ")", 1)
96517
- ]),
96518
- createElementVNode("div", null, [
96519
- (openBlock(true), createElementBlock(Fragment, null, renderList(filteredCanvasFiles.value.slice(0, 5), (item) => {
96520
- return openBlock(), createElementBlock("div", {
96521
- key: item.id,
96522
- class: normalizeClass([
96523
- "flex items-center px-0 cursor-pointer border-b border-gray-100 w-full",
96524
- _ctx.isAdmin ? "py-3" : "py-0",
96525
- isResultSelected(item) ? "bg-primary6" : "hover:bg-primary5"
96526
- ]),
96527
- "data-result-selected": isResultSelected(item),
96528
- onClick: ($event) => handleResultClick(item, "canvas")
96529
- }, [
96530
- createElementVNode("div", _hoisted_49$4, [
96531
- createVNode(CIcon, {
96532
- color: "var(--p-text2)",
96533
- icon: "presentation",
96534
- size: "32"
96535
- })
96536
- ]),
96537
- createElementVNode("div", _hoisted_50$4, [
96538
- createElementVNode("h3", _hoisted_51$3, toDisplayString(item.name), 1),
96539
- createElementVNode("p", _hoisted_52$3, toDisplayString(formatCanvasType(item.content_type)), 1)
96540
- ]),
96541
- createElementVNode("div", _hoisted_53$3, toDisplayString(item.folder?.name || ""), 1)
96542
- ], 10, _hoisted_48$4);
96543
- }), 128))
96544
- ]),
96545
- filteredCanvasFiles.value.length > 5 ? (openBlock(), createElementBlock("div", _hoisted_54$2, [
96546
- createElementVNode("span", {
96547
- class: "text-sm text-gray-600 hover:text-gray-800 font-bold flex items-center cursor-pointer",
96548
- onClick: _cache[15] || (_cache[15] = ($event) => searchType.value = "canvases")
96549
- }, [
96550
- createTextVNode(toDisplayString(unref(t)("canvasUI.CAlgoliaSearch.actions.viewAll")) + " ", 1),
96551
- createVNode(CIcon, {
96552
- class: "ml-1",
96553
- icon: "chevron-right",
96554
- size: "12"
96555
- })
96556
- ])
96679
+ class: "text-6xl",
96680
+ color: searchError.value ? "var(--p-error)" : "var(--p-text3)",
96681
+ "fa-type": "fal",
96682
+ icon: searchError.value ? "exclamation-triangle" : "radar"
96683
+ }, null, 8, ["color", "icon"]),
96684
+ createElementVNode("p", {
96685
+ class: normalizeClass(searchError.value ? "text-error font-semibold" : "text-text2")
96686
+ }, toDisplayString(searchError.value || unref(t)("canvasUI.CGlobalSearch.noResults")), 3)
96557
96687
  ])) : createCommentVNode("", true)
96558
- ])) : createCommentVNode("", true)
96559
- ]),
96560
- searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_55$2, [
96561
- createVNode(CIcon, {
96562
- class: "text-6xl",
96563
- color: searchError.value ? "var(--p-error)" : "var(--p-text3)",
96564
- "fa-type": "fal",
96565
- icon: searchError.value ? "exclamation-triangle" : "radar"
96566
- }, null, 8, ["color", "icon"]),
96567
- createElementVNode("p", {
96568
- class: normalizeClass(searchError.value ? "text-error font-semibold" : "text-text2")
96569
- }, toDisplayString(searchError.value || unref(t)("canvasUI.CGlobalSearch.noResults")), 3)
96570
- ])) : createCommentVNode("", true)
96571
- ])) : (openBlock(), createElementBlock("div", _hoisted_56$2, [
96572
- createElementVNode("div", _hoisted_57$2, [
96573
- createElementVNode("div", _hoisted_58$2, [
96574
- searchType.value === "content" ? (openBlock(), createBlock(CIcon, {
96575
- key: 0,
96576
- class: "mr-2",
96577
- color: "var(--p-text2)",
96578
- icon: "folder",
96579
- size: "16"
96580
- })) : (openBlock(), createBlock(CIcon, {
96581
- key: 1,
96582
- class: "mr-2",
96583
- color: "var(--p-text2)",
96584
- icon: "presentation",
96585
- size: "16"
96586
- })),
96587
- createElementVNode("span", _hoisted_59$2, toDisplayString(searchType.value === "content" ? unref(t)("canvasUI.CAlgoliaSearch.sections.content") : unref(t)("canvasUI.CAlgoliaSearch.sections.pitchDecks")), 1),
96588
- createElementVNode("span", _hoisted_60$2, " (" + toDisplayString(searchType.value === "content" ? filteredContentFiles.value.length : filteredCanvasFiles.value.length) + ") ", 1)
96589
- ]),
96590
- createElementVNode("div", null, [
96591
- (openBlock(true), createElementBlock(Fragment, null, renderList(searchType.value === "content" ? filteredContentFiles.value : filteredCanvasFiles.value, (item) => {
96592
- return openBlock(), createElementBlock("div", {
96593
- key: item.id,
96594
- class: normalizeClass([
96595
- "flex items-center px-0 cursor-pointer border-b border-gray-100 w-full",
96596
- _ctx.isAdmin ? "py-3" : "py-0",
96597
- isResultSelected(item) ? "bg-gray-100" : "hover:bg-gray-50"
96598
- ]),
96599
- "data-result-selected": isResultSelected(item),
96600
- onClick: ($event) => handleResultClick(
96601
- item,
96602
- searchType.value === "content" ? item.type === "folder" ? "folder" : "file" : "canvas"
96603
- )
96604
- }, [
96605
- searchType.value === "content" && item.type === "file" ? (openBlock(), createBlock(_sfc_main$6K, {
96606
- key: 0,
96607
- class: "w-18 h-14 border-rounded-1 overflow-hidden flex-shrink-0 mr-4",
96608
- cover: "",
96609
- "file-data": item,
96610
- "object-fit": "cover",
96611
- src: item.picture_url || "",
96612
- width: "72"
96613
- }, null, 8, ["file-data", "src"])) : (openBlock(), createElementBlock("div", _hoisted_62$2, [
96614
- searchType.value === "content" ? (openBlock(), createBlock(CIcon, {
96615
- key: 0,
96616
- color: "var(--p-text2)",
96617
- icon: "folder",
96618
- size: "32"
96619
- })) : (openBlock(), createBlock(CIcon, {
96620
- key: 1,
96621
- color: "var(--p-text2)",
96622
- icon: "presentation",
96623
- size: "32"
96624
- }))
96625
- ])),
96626
- createElementVNode("div", _hoisted_63$2, [
96627
- createElementVNode("h3", _hoisted_64$2, toDisplayString(item.name), 1),
96628
- searchType.value === "content" && item.type === "file" && getSnippet(item) ? (openBlock(), createElementBlock("p", {
96629
- key: 0,
96630
- class: "text-xs text-gray-600 mb-1",
96631
- innerHTML: getSnippet(item)
96632
- }, null, 8, _hoisted_65$2)) : createCommentVNode("", true),
96633
- createElementVNode("p", _hoisted_66$2, toDisplayString(searchType.value === "content" ? item.type === "folder" ? "Folder" : item.file_category || item.content_type || "File" : formatCanvasType(item.content_type)), 1)
96634
- ]),
96635
- createElementVNode("div", _hoisted_67$2, toDisplayString(searchType.value === "content" && item.type === "folder" ? item.parent_folder?.name || "" : item.folder?.name || ""), 1)
96636
- ], 10, _hoisted_61$2);
96637
- }), 128))
96638
- ]),
96639
- searchError.value || shouldShowNoResults.value ? (openBlock(), createElementBlock("div", _hoisted_68$2, [
96640
- createVNode(CIcon, {
96641
- class: "text-6xl",
96642
- color: searchError.value ? "var(--p-error)" : "var(--p-text3)",
96643
- "fa-type": "fal",
96644
- icon: searchError.value ? "exclamation-triangle" : "radar"
96645
- }, null, 8, ["color", "icon"]),
96646
- createElementVNode("p", {
96647
- class: normalizeClass(searchError.value ? "text-error font-semibold" : "text-text2")
96648
- }, toDisplayString(searchError.value || unref(t)("canvasUI.CGlobalSearch.noResults")), 3)
96649
- ])) : createCommentVNode("", true)
96688
+ ], 64))
96650
96689
  ])
96651
96690
  ]))
96652
96691
  ]),
96653
- !showRecentView.value ? (openBlock(), createElementBlock("div", _hoisted_69$1, [
96692
+ !showRecentView.value ? (openBlock(), createElementBlock("div", _hoisted_71$1, [
96654
96693
  createVNode(CShortcut, null, {
96655
96694
  default: withCtx(() => [
96656
96695
  createVNode(CShortcutIcon, { icon: "arrow-up" }),
@@ -96692,7 +96731,7 @@ const _sfc_main$5K = /* @__PURE__ */ defineComponent({
96692
96731
  }
96693
96732
  });
96694
96733
 
96695
- const CAlgoliaSearch = /* @__PURE__ */ _export_sfc(_sfc_main$5K, [["__scopeId", "data-v-c5f0443f"]]);
96734
+ const CAlgoliaSearch = /* @__PURE__ */ _export_sfc(_sfc_main$5K, [["__scopeId", "data-v-83ce7699"]]);
96696
96735
 
96697
96736
  const BulletListExtended = BulletList.extend({
96698
96737
  addOptions() {