@onlive.ai/common-121 0.2.70 → 0.2.163
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/README.md +0 -1
- package/components/asset/asset-modal-portal.cjs +550 -0
- package/components/asset/asset-modal-portal.d.cts +22 -0
- package/components/asset/asset-modal-portal.d.ts +22 -0
- package/components/asset/asset-modal-portal.js +550 -0
- package/components/asset/asset.cjs +3536 -0
- package/components/asset/asset.d.cts +37 -0
- package/components/asset/asset.d.ts +37 -0
- package/components/asset/asset.js +3536 -0
- package/components/asset/asset.loaders.cjs +2 -0
- package/components/asset/asset.loaders.d.cts +17 -0
- package/components/asset/asset.loaders.d.ts +17 -0
- package/components/asset/asset.loaders.js +2 -0
- package/components/asset/asset.renderer.cjs +2292 -0
- package/components/asset/asset.renderer.d.cts +29 -0
- package/components/asset/asset.renderer.d.ts +29 -0
- package/components/asset/asset.renderer.js +2292 -0
- package/components/asset/asset.styles.cjs +683 -0
- package/components/asset/asset.styles.d.cts +6 -0
- package/components/asset/asset.styles.d.ts +6 -0
- package/components/asset/asset.styles.js +683 -0
- package/components/asset/asset.types.cjs +2 -0
- package/components/asset/asset.types.d.cts +103 -0
- package/components/asset/asset.types.d.ts +103 -0
- package/components/asset/asset.types.js +1 -0
- package/components/asset/index.cjs +3536 -0
- package/components/asset/index.d.cts +8 -0
- package/components/asset/index.d.ts +8 -0
- package/components/asset/index.js +3536 -0
- package/components/player/player.cjs +2044 -0
- package/components/player/player.d.cts +25 -0
- package/components/player/player.d.ts +25 -0
- package/components/player/player.js +2044 -0
- package/components/player/player.styles.cjs +16 -0
- package/components/player/player.styles.d.cts +6 -0
- package/components/player/player.styles.d.ts +6 -0
- package/components/player/player.styles.js +16 -0
- package/components/side-bar/index.cjs +3185 -0
- package/components/side-bar/index.d.cts +11 -0
- package/components/side-bar/index.d.ts +11 -0
- package/components/side-bar/index.js +3185 -0
- package/components/side-bar/side-bar.cjs +3185 -0
- package/components/side-bar/side-bar.d.cts +83 -0
- package/components/side-bar/side-bar.d.ts +83 -0
- package/components/side-bar/side-bar.js +3185 -0
- package/components/side-bar/side-bar.styles.cjs +801 -0
- package/components/side-bar/side-bar.styles.d.cts +6 -0
- package/components/side-bar/side-bar.styles.d.ts +6 -0
- package/components/side-bar/side-bar.styles.js +801 -0
- package/components/side-bar/side-bar.types.cjs +2 -0
- package/components/side-bar/side-bar.types.d.cts +105 -0
- package/components/side-bar/side-bar.types.d.ts +105 -0
- package/components/side-bar/side-bar.types.js +2 -0
- package/components/upload/index.cjs +83 -0
- package/components/upload/index.d.cts +4 -0
- package/components/upload/index.d.ts +4 -0
- package/components/upload/index.js +83 -0
- package/components/upload/upload.cjs +83 -0
- package/components/upload/upload.d.cts +28 -0
- package/components/upload/upload.d.ts +28 -0
- package/components/upload/upload.js +83 -0
- package/components/upload/upload.styles.cjs +65 -0
- package/components/upload/upload.styles.d.cts +6 -0
- package/components/upload/upload.styles.d.ts +6 -0
- package/components/upload/upload.styles.js +65 -0
- package/components/upload/upload.types.cjs +2 -0
- package/components/upload/upload.types.d.cts +16 -0
- package/components/upload/upload.types.d.ts +16 -0
- package/components/upload/upload.types.js +1 -0
- package/index.cjs +4677 -0
- package/index.d.cts +338 -0
- package/index.d.ts +338 -0
- package/index.js +4677 -0
- package/package.json +32 -11
- package/react/components/asset/Asset.cjs +2 -0
- package/react/components/asset/Asset.d.cts +33 -0
- package/react/components/asset/Asset.d.ts +33 -0
- package/react/components/asset/Asset.jsx +2 -0
- package/react/components/side-bar/SideBar.cjs +2 -0
- package/react/components/side-bar/SideBar.d.cts +37 -0
- package/react/components/side-bar/SideBar.d.ts +37 -0
- package/react/components/side-bar/SideBar.jsx +2 -0
- package/react/components/upload/Upload.cjs +2 -0
- package/react/components/upload/Upload.d.cts +23 -0
- package/react/components/upload/Upload.d.ts +23 -0
- package/react/components/upload/Upload.jsx +2 -0
- package/services/audio.service.cjs +2 -2
- package/services/audio.service.d.cts +1 -0
- package/services/audio.service.d.ts +1 -0
- package/services/audio.service.js +2 -2
- package/services/conversation/conversation.service.cjs +2 -0
- package/services/conversation/conversation.service.d.cts +533 -0
- package/services/conversation/conversation.service.d.ts +533 -0
- package/services/conversation/conversation.service.js +2 -0
- package/services/conversation/conversation.types.cjs +2 -0
- package/services/conversation/conversation.types.d.cts +519 -0
- package/services/conversation/conversation.types.d.ts +519 -0
- package/services/conversation/conversation.types.js +2 -0
- package/services/conversation/index.cjs +2 -0
- package/services/conversation/index.d.cts +7 -0
- package/services/conversation/index.d.ts +7 -0
- package/services/conversation/index.js +2 -0
- package/services/faqs/faqs.service.cjs +2 -0
- package/services/faqs/faqs.service.d.cts +16 -0
- package/services/faqs/faqs.service.d.ts +16 -0
- package/services/faqs/faqs.service.js +2 -0
- package/services/faqs/faqs.types.cjs +2 -0
- package/services/faqs/faqs.types.d.cts +60 -0
- package/services/faqs/faqs.types.d.ts +60 -0
- package/services/faqs/faqs.types.js +1 -0
- package/services/faqs/index.cjs +2 -0
- package/services/faqs/index.d.cts +3 -0
- package/services/faqs/index.d.ts +3 -0
- package/services/faqs/index.js +2 -0
- package/services/file/file.service.cjs +2 -0
- package/services/file/file.service.d.cts +66 -0
- package/services/file/file.service.d.ts +66 -0
- package/services/file/file.service.js +2 -0
- package/services/file/file.types.cjs +2 -0
- package/services/file/file.types.d.cts +72 -0
- package/services/file/file.types.d.ts +72 -0
- package/services/file/file.types.js +1 -0
- package/services/file/index.cjs +2 -0
- package/services/file/index.d.cts +3 -0
- package/services/file/index.d.ts +3 -0
- package/services/file/index.js +2 -0
- package/services/firebase/firebase-api.cjs +2 -2
- package/services/firebase/firebase-api.d.cts +25 -9
- package/services/firebase/firebase-api.d.ts +25 -9
- package/services/firebase/firebase-api.js +2 -2
- package/services/multimedia/config.example.cjs +2 -0
- package/services/multimedia/config.example.d.cts +13 -0
- package/services/multimedia/config.example.d.ts +13 -0
- package/services/multimedia/config.example.js +2 -0
- package/services/multimedia/index.cjs +2 -0
- package/services/multimedia/index.d.cts +3 -0
- package/services/multimedia/index.d.ts +3 -0
- package/services/multimedia/index.js +2 -0
- package/services/multimedia/multimedia.service.cjs +2 -0
- package/services/multimedia/multimedia.service.d.cts +28 -0
- package/services/multimedia/multimedia.service.d.ts +28 -0
- package/services/multimedia/multimedia.service.js +2 -0
- package/services/multimedia/multimedia.types.cjs +2 -0
- package/services/multimedia/multimedia.types.d.cts +65 -0
- package/services/multimedia/multimedia.types.d.ts +65 -0
- package/services/multimedia/multimedia.types.js +1 -0
- package/services/product/index.cjs +2 -0
- package/services/product/index.d.cts +3 -0
- package/services/product/index.d.ts +3 -0
- package/services/product/index.js +2 -0
- package/services/product/product.service.cjs +2 -0
- package/services/product/product.service.d.cts +19 -0
- package/services/product/product.service.d.ts +19 -0
- package/services/product/product.service.js +2 -0
- package/services/product/product.types.cjs +2 -0
- package/services/product/product.types.d.cts +78 -0
- package/services/product/product.types.d.ts +78 -0
- package/services/product/product.types.js +1 -0
- package/services/request.provider.cjs +1 -1
- package/services/request.provider.d.cts +1 -0
- package/services/request.provider.d.ts +1 -0
- package/services/request.provider.js +1 -1
- package/services/session.service.cjs +2 -0
- package/services/session.service.d.cts +70 -0
- package/services/session.service.d.ts +70 -0
- package/services/session.service.js +2 -0
- package/services/upload/index.cjs +2 -0
- package/services/upload/index.d.cts +2 -0
- package/services/upload/index.d.ts +2 -0
- package/services/upload/index.js +2 -0
- package/services/upload/upload.service.cjs +2 -0
- package/services/upload/upload.service.d.cts +81 -0
- package/services/upload/upload.service.d.ts +81 -0
- package/services/upload/upload.service.js +2 -0
- package/themes/dark.cjs +4 -1
- package/themes/dark.d.cts +1 -0
- package/themes/dark.d.ts +1 -0
- package/themes/dark.js +4 -1
- package/themes/light.cjs +1 -1
- package/themes/light.d.cts +1 -0
- package/themes/light.d.ts +1 -0
- package/themes/light.js +1 -1
- package/types/globals.cjs +2 -0
- package/types/globals.d.cts +39 -0
- package/types/globals.d.ts +39 -0
- package/types/globals.js +1 -0
- package/types/tracking-options.cjs +2 -2
- package/types/tracking-options.d.cts +8 -6
- package/types/tracking-options.d.ts +8 -6
- package/types/tracking-options.js +1 -1
- package/utils/adopt-styles.cjs +2 -2
- package/utils/adopt-styles.d.cts +1 -0
- package/utils/adopt-styles.d.ts +1 -0
- package/utils/adopt-styles.js +2 -2
- package/utils/browser-preferences.cjs +2 -2
- package/utils/browser-preferences.d.cts +1 -0
- package/utils/browser-preferences.d.ts +1 -0
- package/utils/browser-preferences.js +2 -2
- package/utils/classify-media.cjs +1 -1
- package/utils/classify-media.d.cts +1 -0
- package/utils/classify-media.d.ts +1 -0
- package/utils/classify-media.js +1 -1
- package/utils/decorators.cjs +1 -1
- package/utils/decorators.d.cts +1 -0
- package/utils/decorators.d.ts +1 -0
- package/utils/decorators.js +1 -1
- package/utils/detected-lang.cjs +2 -2
- package/utils/detected-lang.d.cts +1 -0
- package/utils/detected-lang.d.ts +1 -0
- package/utils/detected-lang.js +2 -2
- package/utils/fullscreen.cjs +2 -2
- package/utils/fullscreen.d.cts +6 -5
- package/utils/fullscreen.d.ts +6 -5
- package/utils/fullscreen.js +2 -2
- package/utils/insert-script.cjs +1 -1
- package/utils/insert-script.d.cts +1 -0
- package/utils/insert-script.d.ts +1 -0
- package/utils/insert-script.js +1 -1
- package/utils/is-map-compatible.cjs +1 -1
- package/utils/is-map-compatible.d.cts +1 -0
- package/utils/is-map-compatible.d.ts +1 -0
- package/utils/is-map-compatible.js +1 -1
- package/utils/markdown.cjs +2 -2
- package/utils/markdown.d.cts +1 -0
- package/utils/markdown.d.ts +1 -0
- package/utils/markdown.js +2 -2
- package/utils/merge.cjs +2 -2
- package/utils/merge.d.cts +2 -1
- package/utils/merge.d.ts +2 -1
- package/utils/merge.js +2 -2
- package/utils/multiband-track-volume.cjs +2 -2
- package/utils/multiband-track-volume.d.cts +1 -0
- package/utils/multiband-track-volume.d.ts +1 -0
- package/utils/multiband-track-volume.js +2 -2
- package/utils/onlive-url-params.cjs +1 -1
- package/utils/onlive-url-params.d.cts +1 -0
- package/utils/onlive-url-params.d.ts +1 -0
- package/utils/onlive-url-params.js +1 -1
- package/utils/pretty-distance.cjs +2 -2
- package/utils/pretty-distance.d.cts +2 -1
- package/utils/pretty-distance.d.ts +2 -1
- package/utils/pretty-distance.js +2 -2
- package/utils/pretty-time.cjs +2 -0
- package/utils/pretty-time.d.cts +16 -0
- package/utils/pretty-time.d.ts +16 -0
- package/utils/pretty-time.js +2 -0
- package/utils/random-string.cjs +1 -1
- package/utils/random-string.d.cts +1 -0
- package/utils/random-string.d.ts +1 -0
- package/utils/random-string.js +1 -1
- package/utils/resource-type.cjs +1 -1
- package/utils/resource-type.d.cts +1 -0
- package/utils/resource-type.d.ts +1 -0
- package/utils/resource-type.js +1 -1
- package/utils/round-number.cjs +2 -0
- package/utils/round-number.d.cts +30 -0
- package/utils/round-number.d.ts +30 -0
- package/utils/round-number.js +2 -0
- package/utils/safe-html.cjs +2 -2
- package/utils/safe-html.d.cts +4 -3
- package/utils/safe-html.d.ts +4 -3
- package/utils/safe-html.js +2 -2
- package/utils/sanitize.cjs +2 -2
- package/utils/sanitize.d.cts +1 -0
- package/utils/sanitize.d.ts +1 -0
- package/utils/sanitize.js +2 -2
- package/utils/spread.cjs +2 -2
- package/utils/spread.d.cts +1 -0
- package/utils/spread.d.ts +1 -0
- package/utils/spread.js +2 -2
- package/utils/watch.cjs +1 -1
- package/utils/watch.d.cts +1 -0
- package/utils/watch.d.ts +1 -0
- package/utils/watch.js +1 -1
- package/services/firebase/firebase.service.cjs +0 -2
- package/services/firebase/firebase.service.d.cts +0 -40
- package/services/firebase/firebase.service.d.ts +0 -40
- package/services/firebase/firebase.service.js +0 -2
- package/services/livekit.service.cjs +0 -2
- package/services/livekit.service.d.cts +0 -219
- package/services/livekit.service.d.ts +0 -219
- package/services/livekit.service.js +0 -2
- package/types/window-context.cjs +0 -2
- package/types/window-context.d.cts +0 -8
- package/types/window-context.d.ts +0 -8
- package/types/window-context.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
|
|
2
|
+
"use strict";var o=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var g=(t,e)=>{for(var s in e)o(t,s,{get:e[s],enumerable:!0})},p=(t,e,s,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of n(e))!l.call(t,i)&&i!==s&&o(t,i,{get:()=>e[i],enumerable:!(a=r(e,i))||a.enumerable});return t};var c=t=>p(o({},"__esModule",{value:!0}),t);var d={};g(d,{DEFAULT_CATEGORY_CONFIGS:()=>u});module.exports=c(d);var u={products:{label:"PRODUCTS",icon:"shopping-bag",enabled:!0,displayOptions:{showThumbnail:!0,showDescription:!1,showPrice:!0,showTags:!1,thumbnailSize:"small",layout:"grid"}},videos:{label:"VIDEOS",icon:"video",enabled:!0,displayOptions:{showThumbnail:!0,showDescription:!1,showDuration:!0,showSize:!1,thumbnailSize:"small",layout:"grid"}},images:{label:"IMAGES",icon:"image",enabled:!0,displayOptions:{showThumbnail:!0,showDescription:!1,showSize:!1,thumbnailSize:"small",layout:"grid"}},presentations:{label:"PRESENTATIONS",icon:"file-text",enabled:!0,displayOptions:{showThumbnail:!0,showDescription:!1,showSize:!1,thumbnailSize:"small",layout:"grid"}},faqs:{label:"FAQS",icon:"help-circle",enabled:!0,displayOptions:{showThumbnail:!1,showDescription:!0,showSize:!1,thumbnailSize:"small",layout:"list"}},audios:{label:"AUDIOS",icon:"music",enabled:!1,displayOptions:{showThumbnail:!0,showDescription:!1,showDuration:!0,showSize:!1,thumbnailSize:"small",layout:"grid"}},"special-effects":{label:"SPECIAL EFFECTS",icon:"zap",enabled:!1,displayOptions:{showThumbnail:!0,showDescription:!1,showSize:!1,thumbnailSize:"small",layout:"grid"}}};0&&(module.exports={DEFAULT_CATEGORY_CONFIGS});
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
|
|
2
|
+
import { FaqsServiceConfig } from '../../services/faqs/faqs.types.cjs';
|
|
3
|
+
import { FileServiceConfig } from '../../services/file/file.types.cjs';
|
|
4
|
+
import { MultimediaServiceConfig } from '../../services/multimedia/multimedia.types.cjs';
|
|
5
|
+
import { ProductServiceConfig } from '../../services/product/product.types.cjs';
|
|
6
|
+
|
|
7
|
+
type ExtraFilterType = "select" | "multiselect" | "text";
|
|
8
|
+
type ExtraFilterEntity = "all" | "assets" | "faqs" | "products" | "videos" | "images" | "presentations";
|
|
9
|
+
interface ExtraFilter {
|
|
10
|
+
name: string;
|
|
11
|
+
type: ExtraFilterType;
|
|
12
|
+
label: string;
|
|
13
|
+
order: number;
|
|
14
|
+
entity: ExtraFilterEntity;
|
|
15
|
+
values?: string[];
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
}
|
|
19
|
+
interface SidebarSettingsResponse {
|
|
20
|
+
id: string;
|
|
21
|
+
organizationId: string;
|
|
22
|
+
userGroupId?: string | null;
|
|
23
|
+
extraFilters: ExtraFilter[];
|
|
24
|
+
createdAt: string;
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
}
|
|
27
|
+
type ActiveFilters = Record<string, string | string[]>;
|
|
28
|
+
type AssetCategory = "products" | "videos" | "images" | "presentations" | "audios" | "special-effects" | "faqs";
|
|
29
|
+
interface AssetItem {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
url: string;
|
|
34
|
+
thumbnail?: string;
|
|
35
|
+
type: AssetCategory;
|
|
36
|
+
size?: number;
|
|
37
|
+
format?: string;
|
|
38
|
+
duration?: number;
|
|
39
|
+
price?: number;
|
|
40
|
+
currency?: string;
|
|
41
|
+
tags?: string[];
|
|
42
|
+
labels?: string[];
|
|
43
|
+
metadata?: Record<string, any>;
|
|
44
|
+
secureToken?: string;
|
|
45
|
+
}
|
|
46
|
+
interface SidebarConfig {
|
|
47
|
+
multimediaService: MultimediaServiceConfig;
|
|
48
|
+
productService?: ProductServiceConfig;
|
|
49
|
+
faqsService?: FaqsServiceConfig;
|
|
50
|
+
fileService?: FileServiceConfig;
|
|
51
|
+
showSearch?: boolean;
|
|
52
|
+
showAddButton?: boolean;
|
|
53
|
+
itemsPerPage?: number;
|
|
54
|
+
enableInfiniteScroll?: boolean;
|
|
55
|
+
customCategories?: AssetCategory[];
|
|
56
|
+
enableUpload?: boolean;
|
|
57
|
+
enableExtraFilters?: boolean;
|
|
58
|
+
userGroupId?: string;
|
|
59
|
+
}
|
|
60
|
+
interface SearchConfig {
|
|
61
|
+
placeholder?: string;
|
|
62
|
+
debounceMs?: number;
|
|
63
|
+
minLength?: number;
|
|
64
|
+
}
|
|
65
|
+
interface PaginationState {
|
|
66
|
+
page: number;
|
|
67
|
+
limit: number;
|
|
68
|
+
total: number;
|
|
69
|
+
hasMore: boolean;
|
|
70
|
+
loading: boolean;
|
|
71
|
+
}
|
|
72
|
+
interface CategoryState {
|
|
73
|
+
category: AssetCategory;
|
|
74
|
+
items: AssetItem[];
|
|
75
|
+
pagination: PaginationState;
|
|
76
|
+
searchQuery: string;
|
|
77
|
+
loading: boolean;
|
|
78
|
+
error?: string;
|
|
79
|
+
}
|
|
80
|
+
interface SidebarEvents {
|
|
81
|
+
onItemSelect?: (item: AssetItem) => void;
|
|
82
|
+
onItemAdd?: (category: AssetCategory) => void;
|
|
83
|
+
onSearch?: (query: string, category: AssetCategory | "all") => void;
|
|
84
|
+
onLoadMore?: (category: AssetCategory) => void;
|
|
85
|
+
onCategoryChange?: (category: AssetCategory) => void;
|
|
86
|
+
}
|
|
87
|
+
interface AssetItemDisplayOptions {
|
|
88
|
+
showThumbnail?: boolean;
|
|
89
|
+
showDescription?: boolean;
|
|
90
|
+
showPrice?: boolean;
|
|
91
|
+
showDuration?: boolean;
|
|
92
|
+
showSize?: boolean;
|
|
93
|
+
showTags?: boolean;
|
|
94
|
+
thumbnailSize?: "small" | "medium" | "large";
|
|
95
|
+
layout?: "grid" | "list";
|
|
96
|
+
}
|
|
97
|
+
interface CategoryConfig {
|
|
98
|
+
label: string;
|
|
99
|
+
icon: string;
|
|
100
|
+
enabled: boolean;
|
|
101
|
+
displayOptions: AssetItemDisplayOptions;
|
|
102
|
+
}
|
|
103
|
+
declare const DEFAULT_CATEGORY_CONFIGS: Record<AssetCategory, CategoryConfig>;
|
|
104
|
+
|
|
105
|
+
export { type ActiveFilters, type AssetCategory, type AssetItem, type AssetItemDisplayOptions, type CategoryConfig, type CategoryState, DEFAULT_CATEGORY_CONFIGS, type ExtraFilter, type ExtraFilterEntity, type ExtraFilterType, type PaginationState, type SearchConfig, type SidebarConfig, type SidebarEvents, type SidebarSettingsResponse };
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
|
|
2
|
+
import { FaqsServiceConfig } from '../../services/faqs/faqs.types.js';
|
|
3
|
+
import { FileServiceConfig } from '../../services/file/file.types.js';
|
|
4
|
+
import { MultimediaServiceConfig } from '../../services/multimedia/multimedia.types.js';
|
|
5
|
+
import { ProductServiceConfig } from '../../services/product/product.types.js';
|
|
6
|
+
|
|
7
|
+
type ExtraFilterType = "select" | "multiselect" | "text";
|
|
8
|
+
type ExtraFilterEntity = "all" | "assets" | "faqs" | "products" | "videos" | "images" | "presentations";
|
|
9
|
+
interface ExtraFilter {
|
|
10
|
+
name: string;
|
|
11
|
+
type: ExtraFilterType;
|
|
12
|
+
label: string;
|
|
13
|
+
order: number;
|
|
14
|
+
entity: ExtraFilterEntity;
|
|
15
|
+
values?: string[];
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
}
|
|
19
|
+
interface SidebarSettingsResponse {
|
|
20
|
+
id: string;
|
|
21
|
+
organizationId: string;
|
|
22
|
+
userGroupId?: string | null;
|
|
23
|
+
extraFilters: ExtraFilter[];
|
|
24
|
+
createdAt: string;
|
|
25
|
+
updatedAt: string;
|
|
26
|
+
}
|
|
27
|
+
type ActiveFilters = Record<string, string | string[]>;
|
|
28
|
+
type AssetCategory = "products" | "videos" | "images" | "presentations" | "audios" | "special-effects" | "faqs";
|
|
29
|
+
interface AssetItem {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
url: string;
|
|
34
|
+
thumbnail?: string;
|
|
35
|
+
type: AssetCategory;
|
|
36
|
+
size?: number;
|
|
37
|
+
format?: string;
|
|
38
|
+
duration?: number;
|
|
39
|
+
price?: number;
|
|
40
|
+
currency?: string;
|
|
41
|
+
tags?: string[];
|
|
42
|
+
labels?: string[];
|
|
43
|
+
metadata?: Record<string, any>;
|
|
44
|
+
secureToken?: string;
|
|
45
|
+
}
|
|
46
|
+
interface SidebarConfig {
|
|
47
|
+
multimediaService: MultimediaServiceConfig;
|
|
48
|
+
productService?: ProductServiceConfig;
|
|
49
|
+
faqsService?: FaqsServiceConfig;
|
|
50
|
+
fileService?: FileServiceConfig;
|
|
51
|
+
showSearch?: boolean;
|
|
52
|
+
showAddButton?: boolean;
|
|
53
|
+
itemsPerPage?: number;
|
|
54
|
+
enableInfiniteScroll?: boolean;
|
|
55
|
+
customCategories?: AssetCategory[];
|
|
56
|
+
enableUpload?: boolean;
|
|
57
|
+
enableExtraFilters?: boolean;
|
|
58
|
+
userGroupId?: string;
|
|
59
|
+
}
|
|
60
|
+
interface SearchConfig {
|
|
61
|
+
placeholder?: string;
|
|
62
|
+
debounceMs?: number;
|
|
63
|
+
minLength?: number;
|
|
64
|
+
}
|
|
65
|
+
interface PaginationState {
|
|
66
|
+
page: number;
|
|
67
|
+
limit: number;
|
|
68
|
+
total: number;
|
|
69
|
+
hasMore: boolean;
|
|
70
|
+
loading: boolean;
|
|
71
|
+
}
|
|
72
|
+
interface CategoryState {
|
|
73
|
+
category: AssetCategory;
|
|
74
|
+
items: AssetItem[];
|
|
75
|
+
pagination: PaginationState;
|
|
76
|
+
searchQuery: string;
|
|
77
|
+
loading: boolean;
|
|
78
|
+
error?: string;
|
|
79
|
+
}
|
|
80
|
+
interface SidebarEvents {
|
|
81
|
+
onItemSelect?: (item: AssetItem) => void;
|
|
82
|
+
onItemAdd?: (category: AssetCategory) => void;
|
|
83
|
+
onSearch?: (query: string, category: AssetCategory | "all") => void;
|
|
84
|
+
onLoadMore?: (category: AssetCategory) => void;
|
|
85
|
+
onCategoryChange?: (category: AssetCategory) => void;
|
|
86
|
+
}
|
|
87
|
+
interface AssetItemDisplayOptions {
|
|
88
|
+
showThumbnail?: boolean;
|
|
89
|
+
showDescription?: boolean;
|
|
90
|
+
showPrice?: boolean;
|
|
91
|
+
showDuration?: boolean;
|
|
92
|
+
showSize?: boolean;
|
|
93
|
+
showTags?: boolean;
|
|
94
|
+
thumbnailSize?: "small" | "medium" | "large";
|
|
95
|
+
layout?: "grid" | "list";
|
|
96
|
+
}
|
|
97
|
+
interface CategoryConfig {
|
|
98
|
+
label: string;
|
|
99
|
+
icon: string;
|
|
100
|
+
enabled: boolean;
|
|
101
|
+
displayOptions: AssetItemDisplayOptions;
|
|
102
|
+
}
|
|
103
|
+
declare const DEFAULT_CATEGORY_CONFIGS: Record<AssetCategory, CategoryConfig>;
|
|
104
|
+
|
|
105
|
+
export { type ActiveFilters, type AssetCategory, type AssetItem, type AssetItemDisplayOptions, type CategoryConfig, type CategoryState, DEFAULT_CATEGORY_CONFIGS, type ExtraFilter, type ExtraFilterEntity, type ExtraFilterType, type PaginationState, type SearchConfig, type SidebarConfig, type SidebarEvents, type SidebarSettingsResponse };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
|
|
2
|
+
var e={products:{label:"PRODUCTS",icon:"shopping-bag",enabled:!0,displayOptions:{showThumbnail:!0,showDescription:!1,showPrice:!0,showTags:!1,thumbnailSize:"small",layout:"grid"}},videos:{label:"VIDEOS",icon:"video",enabled:!0,displayOptions:{showThumbnail:!0,showDescription:!1,showDuration:!0,showSize:!1,thumbnailSize:"small",layout:"grid"}},images:{label:"IMAGES",icon:"image",enabled:!0,displayOptions:{showThumbnail:!0,showDescription:!1,showSize:!1,thumbnailSize:"small",layout:"grid"}},presentations:{label:"PRESENTATIONS",icon:"file-text",enabled:!0,displayOptions:{showThumbnail:!0,showDescription:!1,showSize:!1,thumbnailSize:"small",layout:"grid"}},faqs:{label:"FAQS",icon:"help-circle",enabled:!0,displayOptions:{showThumbnail:!1,showDescription:!0,showSize:!1,thumbnailSize:"small",layout:"list"}},audios:{label:"AUDIOS",icon:"music",enabled:!1,displayOptions:{showThumbnail:!0,showDescription:!1,showDuration:!0,showSize:!1,thumbnailSize:"small",layout:"grid"}},"special-effects":{label:"SPECIAL EFFECTS",icon:"zap",enabled:!1,displayOptions:{showThumbnail:!0,showDescription:!1,showSize:!1,thumbnailSize:"small",layout:"grid"}}};export{e as DEFAULT_CATEGORY_CONFIGS};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
|
|
2
|
+
"use strict";var p=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var y=(l,t)=>{for(var e in t)p(l,e,{get:t[e],enumerable:!0})},x=(l,t,e,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of h(t))!b.call(l,i)&&i!==e&&p(l,i,{get:()=>t[i],enumerable:!(o=m(t,i))||o.enumerable});return l};var T=l=>x(p({},"__esModule",{value:!0}),l),d=(l,t,e,o)=>{for(var i=o>1?void 0:o?m(t,e):t,s=l.length-1,r;s>=0;s--)(r=l[s])&&(i=(o?r(t,e,i):r(i))||i);return o&&i&&p(t,e,i),i};var C={};y(C,{OSBUpload:()=>n});module.exports=T(C);var j=require("@onlive.ai/ui/dist/components/button/button.js"),z=require("@onlive.ai/ui/dist/components/dropdown/dropdown.js"),A=require("@onlive.ai/ui/dist/components/icon/icon.js"),L=require("@onlive.ai/ui/dist/components/menu-item/menu-item.js"),M=require("@onlive.ai/ui/dist/components/menu/menu.js"),a=require("lit"),c=require("lit/decorators.js");var E=(l,t)=>(customElements.get(l)?console.debug(`Custom element <${l}> is already defined, skipping definition of ${t.name}.`):window.customElements.define(l,t),t),w=(l,t)=>{let{kind:e,elements:o}=t;return{kind:e,elements:o,finisher(i){customElements.get(l)||window.customElements.define(l,i)}}},f=l=>t=>typeof t=="function"?E(l,t):w(l,t);var g=require("lit"),v=g.css`
|
|
3
|
+
:host {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.ol-upload {
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ol-upload--empty {
|
|
12
|
+
padding: 8px 16px;
|
|
13
|
+
background: var(--ol-color-neutral-100, #f3f4f6);
|
|
14
|
+
border: 1px solid var(--ol-color-neutral-300, #d1d5db);
|
|
15
|
+
border-radius: 6px;
|
|
16
|
+
color: var(--ol-color-neutral-600, #4b5563);
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ol-upload__selected-file {
|
|
21
|
+
margin-top: 12px;
|
|
22
|
+
padding: 12px;
|
|
23
|
+
background: var(--ol-color-success-50, #f0fdf4);
|
|
24
|
+
border: 1px solid var(--ol-color-success-200, #bbf7d0);
|
|
25
|
+
border-radius: 8px;
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: space-between;
|
|
29
|
+
gap: 12px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ol-upload__file-info {
|
|
33
|
+
flex: 1;
|
|
34
|
+
font-size: 14px;
|
|
35
|
+
color: var(--ol-color-success-800, #166534);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.ol-upload__file-info strong {
|
|
39
|
+
display: block;
|
|
40
|
+
margin-bottom: 4px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ol-upload__file-info small {
|
|
44
|
+
color: var(--ol-color-success-600, #16a34a);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.ol-upload__clear-btn {
|
|
48
|
+
width: 32px;
|
|
49
|
+
height: 32px;
|
|
50
|
+
border: none;
|
|
51
|
+
background: var(--ol-color-success-200, #bbf7d0);
|
|
52
|
+
color: var(--ol-color-success-700, #15803d);
|
|
53
|
+
border-radius: 50%;
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
transition: all 0.2s ease;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.ol-upload__clear-btn:hover {
|
|
62
|
+
background: var(--ol-color-success-300, #86efac);
|
|
63
|
+
transform: scale(1.1);
|
|
64
|
+
}
|
|
65
|
+
`;var n=class extends a.LitElement{constructor(){super(...arguments);this.defaultConfig={maxFileSize:10*1024*1024,multiple:!1,showImage:!0,showVideo:!0,showDocument:!0}}getAllowedExtensions(e){switch(e){case"image":return[".jpg",".jpeg",".png",".gif",".webp",".svg"];case"video":return[".mp4",".avi",".mov",".wmv",".flv",".webm"];case"document":return[".pdf",".doc",".docx",".txt",".rtf",".odt"];default:return[]}}getAcceptAttribute(e){return this.getAllowedExtensions(e).join(",")}getFileTypeLabel(e){switch(e){case"image":return"Imagen";case"video":return"Video";case"document":return"Documento";default:return"Archivo"}}getAvailableTypes(){let e={...this.defaultConfig,...this.config},o=[];return e.showImage&&o.push("image"),e.showVideo&&o.push("video"),e.showDocument&&o.push("document"),o}onTypeSelect(e){this.openFileDialog(e)}openFileDialog(e){let o=document.createElement("input");o.type="file",o.accept=this.getAcceptAttribute(e),o.multiple=this.config?.multiple||!1,o.onchange=i=>{let s=i.target.files?.[0];s&&this.handleFileSelection(s,e)},o.click()}handleFileSelection(e,o){let i=this.validateFile(e,o);if(!i.valid){this.dispatchEvent(new CustomEvent("osb-upload-error",{detail:{error:i.error},bubbles:!0}));return}this.dispatchEvent(new CustomEvent("osb-file-selected",{detail:{file:e,type:o},bubbles:!0})),this.events?.onFileSelected?.(e,o)}validateFile(e,o){let i={...this.defaultConfig,...this.config};if(i.maxFileSize&&e.size>i.maxFileSize)return{valid:!1,error:`El archivo es demasiado grande. Tama\xF1o m\xE1ximo: ${Math.round(i.maxFileSize/1048576)}MB`};let s=e.name.toLowerCase(),r=this.getAllowedExtensions(o);return r.some(u=>s.endsWith(u.toLowerCase()))?{valid:!0}:{valid:!1,error:`Tipo de archivo no v\xE1lido. Extensiones permitidas: ${r.join(", ")}`}}render(){let e=this.getAvailableTypes();return e.length===0?a.html`<div class="ol-upload ol-upload--empty">No hay tipos de archivo disponibles</div>`:a.html`
|
|
66
|
+
<div class="ol-upload">
|
|
67
|
+
<ol-dropdown placement="bottom-start" distance="8">
|
|
68
|
+
<div slot="trigger">
|
|
69
|
+
<slot>
|
|
70
|
+
</slot>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<ol-menu>
|
|
74
|
+
${e.map(o=>a.html`
|
|
75
|
+
<ol-menu-item @click="${()=>this.onTypeSelect(o)}">
|
|
76
|
+
<ol-icon slot="prefix" name="${this.getIconName(o)}"></ol-icon>
|
|
77
|
+
${this.getFileTypeLabel(o)}
|
|
78
|
+
</ol-menu-item>
|
|
79
|
+
`)}
|
|
80
|
+
</ol-menu>
|
|
81
|
+
</ol-dropdown>
|
|
82
|
+
</div>
|
|
83
|
+
`}getIconName(e){switch(e){case"image":return"image";case"video":return"file-play";case"document":return"file-text";default:return"file"}}};n.styles=[v],d([(0,c.property)({type:Object})],n.prototype,"config",2),d([(0,c.property)({type:Object})],n.prototype,"events",2),n=d([f("osb-upload")],n);0&&(module.exports={OSBUpload});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
|
|
2
|
+
var f=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var a=(l,i,e,o)=>{for(var t=o>1?void 0:o?g(i,e):i,n=l.length-1,r;n>=0;n--)(r=l[n])&&(t=(o?r(i,e,t):r(t))||t);return o&&t&&f(i,e,t),t};import"@onlive.ai/ui/dist/components/button/button.js";import"@onlive.ai/ui/dist/components/dropdown/dropdown.js";import"@onlive.ai/ui/dist/components/icon/icon.js";import"@onlive.ai/ui/dist/components/menu-item/menu-item.js";import"@onlive.ai/ui/dist/components/menu/menu.js";import{html as p,LitElement as y}from"lit";import{property as m}from"lit/decorators.js";var v=(l,i)=>(customElements.get(l)?console.debug(`Custom element <${l}> is already defined, skipping definition of ${i.name}.`):window.customElements.define(l,i),i),h=(l,i)=>{let{kind:e,elements:o}=i;return{kind:e,elements:o,finisher(t){customElements.get(l)||window.customElements.define(l,t)}}},c=l=>i=>typeof i=="function"?v(l,i):h(l,i);import{css as b}from"lit";var u=b`
|
|
3
|
+
:host {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.ol-upload {
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ol-upload--empty {
|
|
12
|
+
padding: 8px 16px;
|
|
13
|
+
background: var(--ol-color-neutral-100, #f3f4f6);
|
|
14
|
+
border: 1px solid var(--ol-color-neutral-300, #d1d5db);
|
|
15
|
+
border-radius: 6px;
|
|
16
|
+
color: var(--ol-color-neutral-600, #4b5563);
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ol-upload__selected-file {
|
|
21
|
+
margin-top: 12px;
|
|
22
|
+
padding: 12px;
|
|
23
|
+
background: var(--ol-color-success-50, #f0fdf4);
|
|
24
|
+
border: 1px solid var(--ol-color-success-200, #bbf7d0);
|
|
25
|
+
border-radius: 8px;
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: space-between;
|
|
29
|
+
gap: 12px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ol-upload__file-info {
|
|
33
|
+
flex: 1;
|
|
34
|
+
font-size: 14px;
|
|
35
|
+
color: var(--ol-color-success-800, #166534);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.ol-upload__file-info strong {
|
|
39
|
+
display: block;
|
|
40
|
+
margin-bottom: 4px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ol-upload__file-info small {
|
|
44
|
+
color: var(--ol-color-success-600, #16a34a);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.ol-upload__clear-btn {
|
|
48
|
+
width: 32px;
|
|
49
|
+
height: 32px;
|
|
50
|
+
border: none;
|
|
51
|
+
background: var(--ol-color-success-200, #bbf7d0);
|
|
52
|
+
color: var(--ol-color-success-700, #15803d);
|
|
53
|
+
border-radius: 50%;
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
transition: all 0.2s ease;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.ol-upload__clear-btn:hover {
|
|
62
|
+
background: var(--ol-color-success-300, #86efac);
|
|
63
|
+
transform: scale(1.1);
|
|
64
|
+
}
|
|
65
|
+
`;var s=class extends y{constructor(){super(...arguments);this.defaultConfig={maxFileSize:10*1024*1024,multiple:!1,showImage:!0,showVideo:!0,showDocument:!0}}getAllowedExtensions(e){switch(e){case"image":return[".jpg",".jpeg",".png",".gif",".webp",".svg"];case"video":return[".mp4",".avi",".mov",".wmv",".flv",".webm"];case"document":return[".pdf",".doc",".docx",".txt",".rtf",".odt"];default:return[]}}getAcceptAttribute(e){return this.getAllowedExtensions(e).join(",")}getFileTypeLabel(e){switch(e){case"image":return"Imagen";case"video":return"Video";case"document":return"Documento";default:return"Archivo"}}getAvailableTypes(){let e={...this.defaultConfig,...this.config},o=[];return e.showImage&&o.push("image"),e.showVideo&&o.push("video"),e.showDocument&&o.push("document"),o}onTypeSelect(e){this.openFileDialog(e)}openFileDialog(e){let o=document.createElement("input");o.type="file",o.accept=this.getAcceptAttribute(e),o.multiple=this.config?.multiple||!1,o.onchange=t=>{let n=t.target.files?.[0];n&&this.handleFileSelection(n,e)},o.click()}handleFileSelection(e,o){let t=this.validateFile(e,o);if(!t.valid){this.dispatchEvent(new CustomEvent("osb-upload-error",{detail:{error:t.error},bubbles:!0}));return}this.dispatchEvent(new CustomEvent("osb-file-selected",{detail:{file:e,type:o},bubbles:!0})),this.events?.onFileSelected?.(e,o)}validateFile(e,o){let t={...this.defaultConfig,...this.config};if(t.maxFileSize&&e.size>t.maxFileSize)return{valid:!1,error:`El archivo es demasiado grande. Tama\xF1o m\xE1ximo: ${Math.round(t.maxFileSize/1048576)}MB`};let n=e.name.toLowerCase(),r=this.getAllowedExtensions(o);return r.some(d=>n.endsWith(d.toLowerCase()))?{valid:!0}:{valid:!1,error:`Tipo de archivo no v\xE1lido. Extensiones permitidas: ${r.join(", ")}`}}render(){let e=this.getAvailableTypes();return e.length===0?p`<div class="ol-upload ol-upload--empty">No hay tipos de archivo disponibles</div>`:p`
|
|
66
|
+
<div class="ol-upload">
|
|
67
|
+
<ol-dropdown placement="bottom-start" distance="8">
|
|
68
|
+
<div slot="trigger">
|
|
69
|
+
<slot>
|
|
70
|
+
</slot>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<ol-menu>
|
|
74
|
+
${e.map(o=>p`
|
|
75
|
+
<ol-menu-item @click="${()=>this.onTypeSelect(o)}">
|
|
76
|
+
<ol-icon slot="prefix" name="${this.getIconName(o)}"></ol-icon>
|
|
77
|
+
${this.getFileTypeLabel(o)}
|
|
78
|
+
</ol-menu-item>
|
|
79
|
+
`)}
|
|
80
|
+
</ol-menu>
|
|
81
|
+
</ol-dropdown>
|
|
82
|
+
</div>
|
|
83
|
+
`}getIconName(e){switch(e){case"image":return"image";case"video":return"file-play";case"document":return"file-text";default:return"file"}}};s.styles=[u],a([m({type:Object})],s.prototype,"config",2),a([m({type:Object})],s.prototype,"events",2),s=a([c("osb-upload")],s);export{s as OSBUpload};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
|
|
2
|
+
"use strict";var c=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var y=(n,o)=>{for(var e in o)c(n,e,{get:o[e],enumerable:!0})},x=(n,o,e,t)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of h(o))!b.call(n,i)&&i!==e&&c(n,i,{get:()=>o[i],enumerable:!(t=m(o,i))||t.enumerable});return n};var T=n=>x(c({},"__esModule",{value:!0}),n),d=(n,o,e,t)=>{for(var i=t>1?void 0:t?m(o,e):o,l=n.length-1,r;l>=0;l--)(r=n[l])&&(i=(t?r(o,e,i):r(i))||i);return t&&i&&c(o,e,i),i};var C={};y(C,{OSBUpload:()=>s});module.exports=T(C);var z=require("@onlive.ai/ui/dist/components/button/button.js"),A=require("@onlive.ai/ui/dist/components/dropdown/dropdown.js"),L=require("@onlive.ai/ui/dist/components/icon/icon.js"),M=require("@onlive.ai/ui/dist/components/menu-item/menu-item.js"),j=require("@onlive.ai/ui/dist/components/menu/menu.js"),a=require("lit"),p=require("lit/decorators.js");var E=(n,o)=>(customElements.get(n)?console.debug(`Custom element <${n}> is already defined, skipping definition of ${o.name}.`):window.customElements.define(n,o),o),w=(n,o)=>{let{kind:e,elements:t}=o;return{kind:e,elements:t,finisher(i){customElements.get(n)||window.customElements.define(n,i)}}},f=n=>o=>typeof o=="function"?E(n,o):w(n,o);var g=require("lit"),v=g.css`
|
|
3
|
+
:host {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.ol-upload {
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ol-upload--empty {
|
|
12
|
+
padding: 8px 16px;
|
|
13
|
+
background: var(--ol-color-neutral-100, #f3f4f6);
|
|
14
|
+
border: 1px solid var(--ol-color-neutral-300, #d1d5db);
|
|
15
|
+
border-radius: 6px;
|
|
16
|
+
color: var(--ol-color-neutral-600, #4b5563);
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ol-upload__selected-file {
|
|
21
|
+
margin-top: 12px;
|
|
22
|
+
padding: 12px;
|
|
23
|
+
background: var(--ol-color-success-50, #f0fdf4);
|
|
24
|
+
border: 1px solid var(--ol-color-success-200, #bbf7d0);
|
|
25
|
+
border-radius: 8px;
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: space-between;
|
|
29
|
+
gap: 12px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ol-upload__file-info {
|
|
33
|
+
flex: 1;
|
|
34
|
+
font-size: 14px;
|
|
35
|
+
color: var(--ol-color-success-800, #166534);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.ol-upload__file-info strong {
|
|
39
|
+
display: block;
|
|
40
|
+
margin-bottom: 4px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ol-upload__file-info small {
|
|
44
|
+
color: var(--ol-color-success-600, #16a34a);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.ol-upload__clear-btn {
|
|
48
|
+
width: 32px;
|
|
49
|
+
height: 32px;
|
|
50
|
+
border: none;
|
|
51
|
+
background: var(--ol-color-success-200, #bbf7d0);
|
|
52
|
+
color: var(--ol-color-success-700, #15803d);
|
|
53
|
+
border-radius: 50%;
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
transition: all 0.2s ease;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.ol-upload__clear-btn:hover {
|
|
62
|
+
background: var(--ol-color-success-300, #86efac);
|
|
63
|
+
transform: scale(1.1);
|
|
64
|
+
}
|
|
65
|
+
`;var s=class extends a.LitElement{constructor(){super(...arguments);this.defaultConfig={maxFileSize:10*1024*1024,multiple:!1,showImage:!0,showVideo:!0,showDocument:!0}}getAllowedExtensions(e){switch(e){case"image":return[".jpg",".jpeg",".png",".gif",".webp",".svg"];case"video":return[".mp4",".avi",".mov",".wmv",".flv",".webm"];case"document":return[".pdf",".doc",".docx",".txt",".rtf",".odt"];default:return[]}}getAcceptAttribute(e){return this.getAllowedExtensions(e).join(",")}getFileTypeLabel(e){switch(e){case"image":return"Imagen";case"video":return"Video";case"document":return"Documento";default:return"Archivo"}}getAvailableTypes(){let e={...this.defaultConfig,...this.config},t=[];return e.showImage&&t.push("image"),e.showVideo&&t.push("video"),e.showDocument&&t.push("document"),t}onTypeSelect(e){this.openFileDialog(e)}openFileDialog(e){let t=document.createElement("input");t.type="file",t.accept=this.getAcceptAttribute(e),t.multiple=this.config?.multiple||!1,t.onchange=i=>{let l=i.target.files?.[0];l&&this.handleFileSelection(l,e)},t.click()}handleFileSelection(e,t){let i=this.validateFile(e,t);if(!i.valid){this.dispatchEvent(new CustomEvent("osb-upload-error",{detail:{error:i.error},bubbles:!0}));return}this.dispatchEvent(new CustomEvent("osb-file-selected",{detail:{file:e,type:t},bubbles:!0})),this.events?.onFileSelected?.(e,t)}validateFile(e,t){let i={...this.defaultConfig,...this.config};if(i.maxFileSize&&e.size>i.maxFileSize)return{valid:!1,error:`El archivo es demasiado grande. Tama\xF1o m\xE1ximo: ${Math.round(i.maxFileSize/1048576)}MB`};let l=e.name.toLowerCase(),r=this.getAllowedExtensions(t);return r.some(u=>l.endsWith(u.toLowerCase()))?{valid:!0}:{valid:!1,error:`Tipo de archivo no v\xE1lido. Extensiones permitidas: ${r.join(", ")}`}}render(){let e=this.getAvailableTypes();return e.length===0?a.html`<div class="ol-upload ol-upload--empty">No hay tipos de archivo disponibles</div>`:a.html`
|
|
66
|
+
<div class="ol-upload">
|
|
67
|
+
<ol-dropdown placement="bottom-start" distance="8">
|
|
68
|
+
<div slot="trigger">
|
|
69
|
+
<slot>
|
|
70
|
+
</slot>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<ol-menu>
|
|
74
|
+
${e.map(t=>a.html`
|
|
75
|
+
<ol-menu-item @click="${()=>this.onTypeSelect(t)}">
|
|
76
|
+
<ol-icon slot="prefix" name="${this.getIconName(t)}"></ol-icon>
|
|
77
|
+
${this.getFileTypeLabel(t)}
|
|
78
|
+
</ol-menu-item>
|
|
79
|
+
`)}
|
|
80
|
+
</ol-menu>
|
|
81
|
+
</ol-dropdown>
|
|
82
|
+
</div>
|
|
83
|
+
`}getIconName(e){switch(e){case"image":return"image";case"video":return"file-play";case"document":return"file-text";default:return"file"}}};s.styles=[v],d([(0,p.property)({type:Object})],s.prototype,"config",2),d([(0,p.property)({type:Object})],s.prototype,"events",2),s=d([f("osb-upload")],s);0&&(module.exports={OSBUpload});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
|
|
2
|
+
import * as lit from 'lit';
|
|
3
|
+
import { LitElement, TemplateResult } from 'lit';
|
|
4
|
+
import { UploadConfig, UploadEvents } from './upload.types.cjs';
|
|
5
|
+
|
|
6
|
+
declare class OSBUpload extends LitElement {
|
|
7
|
+
static styles: lit.CSSResult[];
|
|
8
|
+
config?: UploadConfig;
|
|
9
|
+
events?: UploadEvents;
|
|
10
|
+
private defaultConfig;
|
|
11
|
+
private getAllowedExtensions;
|
|
12
|
+
private getAcceptAttribute;
|
|
13
|
+
private getFileTypeLabel;
|
|
14
|
+
private getAvailableTypes;
|
|
15
|
+
private onTypeSelect;
|
|
16
|
+
private openFileDialog;
|
|
17
|
+
private handleFileSelection;
|
|
18
|
+
private validateFile;
|
|
19
|
+
render(): TemplateResult;
|
|
20
|
+
private getIconName;
|
|
21
|
+
}
|
|
22
|
+
declare global {
|
|
23
|
+
interface HTMLElementTagNameMap {
|
|
24
|
+
"osb-upload": OSBUpload;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { OSBUpload };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
|
|
2
|
+
import * as lit from 'lit';
|
|
3
|
+
import { LitElement, TemplateResult } from 'lit';
|
|
4
|
+
import { UploadConfig, UploadEvents } from './upload.types.js';
|
|
5
|
+
|
|
6
|
+
declare class OSBUpload extends LitElement {
|
|
7
|
+
static styles: lit.CSSResult[];
|
|
8
|
+
config?: UploadConfig;
|
|
9
|
+
events?: UploadEvents;
|
|
10
|
+
private defaultConfig;
|
|
11
|
+
private getAllowedExtensions;
|
|
12
|
+
private getAcceptAttribute;
|
|
13
|
+
private getFileTypeLabel;
|
|
14
|
+
private getAvailableTypes;
|
|
15
|
+
private onTypeSelect;
|
|
16
|
+
private openFileDialog;
|
|
17
|
+
private handleFileSelection;
|
|
18
|
+
private validateFile;
|
|
19
|
+
render(): TemplateResult;
|
|
20
|
+
private getIconName;
|
|
21
|
+
}
|
|
22
|
+
declare global {
|
|
23
|
+
interface HTMLElementTagNameMap {
|
|
24
|
+
"osb-upload": OSBUpload;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { OSBUpload };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/*! @onlive.ai/common-121 v0.2.163 | © 2026 Onlive.ai */
|
|
2
|
+
var f=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var a=(n,i,e,t)=>{for(var o=t>1?void 0:t?g(i,e):i,l=n.length-1,r;l>=0;l--)(r=n[l])&&(o=(t?r(i,e,o):r(o))||o);return t&&o&&f(i,e,o),o};import"@onlive.ai/ui/dist/components/button/button.js";import"@onlive.ai/ui/dist/components/dropdown/dropdown.js";import"@onlive.ai/ui/dist/components/icon/icon.js";import"@onlive.ai/ui/dist/components/menu-item/menu-item.js";import"@onlive.ai/ui/dist/components/menu/menu.js";import{html as c,LitElement as y}from"lit";import{property as m}from"lit/decorators.js";var v=(n,i)=>(customElements.get(n)?console.debug(`Custom element <${n}> is already defined, skipping definition of ${i.name}.`):window.customElements.define(n,i),i),h=(n,i)=>{let{kind:e,elements:t}=i;return{kind:e,elements:t,finisher(o){customElements.get(n)||window.customElements.define(n,o)}}},p=n=>i=>typeof i=="function"?v(n,i):h(n,i);import{css as b}from"lit";var u=b`
|
|
3
|
+
:host {
|
|
4
|
+
display: inline-block;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.ol-upload {
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ol-upload--empty {
|
|
12
|
+
padding: 8px 16px;
|
|
13
|
+
background: var(--ol-color-neutral-100, #f3f4f6);
|
|
14
|
+
border: 1px solid var(--ol-color-neutral-300, #d1d5db);
|
|
15
|
+
border-radius: 6px;
|
|
16
|
+
color: var(--ol-color-neutral-600, #4b5563);
|
|
17
|
+
font-size: 14px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.ol-upload__selected-file {
|
|
21
|
+
margin-top: 12px;
|
|
22
|
+
padding: 12px;
|
|
23
|
+
background: var(--ol-color-success-50, #f0fdf4);
|
|
24
|
+
border: 1px solid var(--ol-color-success-200, #bbf7d0);
|
|
25
|
+
border-radius: 8px;
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: space-between;
|
|
29
|
+
gap: 12px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.ol-upload__file-info {
|
|
33
|
+
flex: 1;
|
|
34
|
+
font-size: 14px;
|
|
35
|
+
color: var(--ol-color-success-800, #166534);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.ol-upload__file-info strong {
|
|
39
|
+
display: block;
|
|
40
|
+
margin-bottom: 4px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.ol-upload__file-info small {
|
|
44
|
+
color: var(--ol-color-success-600, #16a34a);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.ol-upload__clear-btn {
|
|
48
|
+
width: 32px;
|
|
49
|
+
height: 32px;
|
|
50
|
+
border: none;
|
|
51
|
+
background: var(--ol-color-success-200, #bbf7d0);
|
|
52
|
+
color: var(--ol-color-success-700, #15803d);
|
|
53
|
+
border-radius: 50%;
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
transition: all 0.2s ease;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.ol-upload__clear-btn:hover {
|
|
62
|
+
background: var(--ol-color-success-300, #86efac);
|
|
63
|
+
transform: scale(1.1);
|
|
64
|
+
}
|
|
65
|
+
`;var s=class extends y{constructor(){super(...arguments);this.defaultConfig={maxFileSize:10*1024*1024,multiple:!1,showImage:!0,showVideo:!0,showDocument:!0}}getAllowedExtensions(e){switch(e){case"image":return[".jpg",".jpeg",".png",".gif",".webp",".svg"];case"video":return[".mp4",".avi",".mov",".wmv",".flv",".webm"];case"document":return[".pdf",".doc",".docx",".txt",".rtf",".odt"];default:return[]}}getAcceptAttribute(e){return this.getAllowedExtensions(e).join(",")}getFileTypeLabel(e){switch(e){case"image":return"Imagen";case"video":return"Video";case"document":return"Documento";default:return"Archivo"}}getAvailableTypes(){let e={...this.defaultConfig,...this.config},t=[];return e.showImage&&t.push("image"),e.showVideo&&t.push("video"),e.showDocument&&t.push("document"),t}onTypeSelect(e){this.openFileDialog(e)}openFileDialog(e){let t=document.createElement("input");t.type="file",t.accept=this.getAcceptAttribute(e),t.multiple=this.config?.multiple||!1,t.onchange=o=>{let l=o.target.files?.[0];l&&this.handleFileSelection(l,e)},t.click()}handleFileSelection(e,t){let o=this.validateFile(e,t);if(!o.valid){this.dispatchEvent(new CustomEvent("osb-upload-error",{detail:{error:o.error},bubbles:!0}));return}this.dispatchEvent(new CustomEvent("osb-file-selected",{detail:{file:e,type:t},bubbles:!0})),this.events?.onFileSelected?.(e,t)}validateFile(e,t){let o={...this.defaultConfig,...this.config};if(o.maxFileSize&&e.size>o.maxFileSize)return{valid:!1,error:`El archivo es demasiado grande. Tama\xF1o m\xE1ximo: ${Math.round(o.maxFileSize/1048576)}MB`};let l=e.name.toLowerCase(),r=this.getAllowedExtensions(t);return r.some(d=>l.endsWith(d.toLowerCase()))?{valid:!0}:{valid:!1,error:`Tipo de archivo no v\xE1lido. Extensiones permitidas: ${r.join(", ")}`}}render(){let e=this.getAvailableTypes();return e.length===0?c`<div class="ol-upload ol-upload--empty">No hay tipos de archivo disponibles</div>`:c`
|
|
66
|
+
<div class="ol-upload">
|
|
67
|
+
<ol-dropdown placement="bottom-start" distance="8">
|
|
68
|
+
<div slot="trigger">
|
|
69
|
+
<slot>
|
|
70
|
+
</slot>
|
|
71
|
+
</div>
|
|
72
|
+
|
|
73
|
+
<ol-menu>
|
|
74
|
+
${e.map(t=>c`
|
|
75
|
+
<ol-menu-item @click="${()=>this.onTypeSelect(t)}">
|
|
76
|
+
<ol-icon slot="prefix" name="${this.getIconName(t)}"></ol-icon>
|
|
77
|
+
${this.getFileTypeLabel(t)}
|
|
78
|
+
</ol-menu-item>
|
|
79
|
+
`)}
|
|
80
|
+
</ol-menu>
|
|
81
|
+
</ol-dropdown>
|
|
82
|
+
</div>
|
|
83
|
+
`}getIconName(e){switch(e){case"image":return"image";case"video":return"file-play";case"document":return"file-text";default:return"file"}}};s.styles=[u],a([m({type:Object})],s.prototype,"config",2),a([m({type:Object})],s.prototype,"events",2),s=a([p("osb-upload")],s);export{s as OSBUpload};
|