@underverse-ui/underverse 1.0.24 → 1.0.25

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/dist/index.d.cts CHANGED
@@ -2834,6 +2834,12 @@ type UEditorUploadImageForSaveResult = string | ({
2834
2834
  } & Record<string, unknown>);
2835
2835
  type UEditorUploadImageForSave = (file: File) => Promise<UEditorUploadImageForSaveResult>;
2836
2836
  type UEditorPrepareContentUploadMeta = Record<string, unknown>;
2837
+ type UEditorInlineUploadedItem = {
2838
+ index: number;
2839
+ url: string;
2840
+ file?: File;
2841
+ meta?: UEditorPrepareContentUploadMeta;
2842
+ };
2837
2843
  type UEditorPrepareContentForSaveResult = {
2838
2844
  html: string;
2839
2845
  uploaded: Array<{
@@ -2841,6 +2847,8 @@ type UEditorPrepareContentForSaveResult = {
2841
2847
  file?: File;
2842
2848
  meta?: UEditorPrepareContentUploadMeta;
2843
2849
  }>;
2850
+ inlineImageUrls: string[];
2851
+ inlineUploaded: UEditorInlineUploadedItem[];
2844
2852
  errors: Array<{
2845
2853
  index: number;
2846
2854
  reason: string;
@@ -2877,6 +2885,8 @@ type UEditorVariant = NonNullable<UEditorProps["variant"]>;
2877
2885
 
2878
2886
  declare const UEditor: React__default.ForwardRefExoticComponent<UEditorProps & React__default.RefAttributes<UEditorRef>>;
2879
2887
 
2888
+ declare function normalizeImageUrl(url: string): string;
2889
+ declare function extractImageSrcsFromHtml(html: string): string[];
2880
2890
  declare class UEditorPrepareContentForSaveError extends Error {
2881
2891
  readonly result: UEditorPrepareContentForSaveResult;
2882
2892
  constructor(result: UEditorPrepareContentForSaveResult);
@@ -3663,4 +3673,4 @@ declare function getUnderverseMessages(locale?: UnderverseLocale): {
3663
3673
  };
3664
3674
  };
3665
3675
 
3666
- export { AccessDenied, Alert, AreaChart, type AreaChartDataPoint, type AreaChartProps, type AreaChartSeries, Avatar, Badge, Badge as BadgeBase, BarChart, type BarChartDataPoint, type BarChartProps, type BarChartSeries, BatteryProgress, BottomSheet, Breadcrumb, Button, ButtonLoading, type ButtonProps, Calendar, type CalendarEvent, type CalendarProps, CalendarTimeline, type CalendarTimelineDateInput, type CalendarTimelineDayRangeMode, type CalendarTimelineEvent, type CalendarTimelineFormatters, type CalendarTimelineGroup, type CalendarTimelineInteractions, type CalendarTimelineLabels, type CalendarTimelineProps, type CalendarTimelineResource, type CalendarTimelineSize, type CalendarTimelineView, type CalendarTimelineVirtualization, Card, Carousel, CategoryTreeSelect, Checkbox, type CheckboxProps, CircularProgress, ClientOnly, ColorPicker, type ColorPickerProps, Combobox, type ComboboxProps, CompactPagination, type CompactPaginationProps, DataTable, type DataTableColumn, type DataTableDensity, type DataTableQuery, type DataTableSize, DatePicker, type DatePickerProps, DateRangePicker, DateTimePicker, type DateTimePickerProps, date as DateUtils, Drawer, DropdownMenu, DropdownMenuItem, DropdownMenuSeparator, FallingIcons, FileUpload, type FileUploadProps, FloatingContacts, ForceInternalTranslationsProvider, Form, FormActions, FormCheckbox, FormControl, FormDescription, FormField, FormInput, FormItem, FormLabel, FormMessage, FormSubmitButton, GaugeChart, type GaugeChartProps, GlobalLoading, GradientBadge, Grid, GridItem, type GridItemProps, type GridProps, ImageUpload, InlineLoading, Input, type InputProps, InteractiveBadge, Label, type LanguageOption, LanguageSwitcherHeadless as LanguageSwitcher, LanguageSwitcherHeadless, type LanguageSwitcherHeadlessProps, type LanguageSwitcherHeadlessProps as LanguageSwitcherProps, LineChart, type LineChartDataPoint, type LineChartProps, type LineChartSeries, List, ListItem, LoadingBar, LoadingDots, LoadingProgress, LoadingSpinner, type Locale$1 as Locale, MiniProgress, Modal, MonthYearPicker, MonthYearPicker as MonthYearPickerBase, type MonthYearPickerProps, MultiCombobox, type MultiComboboxProps, MusicPlayer, MusicPlayer as MusicPlayerDefault, type MusicPlayerProps, NotificationBadge, NotificationModal, NumberInput, OverlayControls, PageLoading, Pagination, type PaginationProps, PasswordInput, PieChart, type PieChartDataPoint, type PieChartProps, PillTabs, Popover, Progress, PulseBadge, RadarChart, type RadarChartDataPoint, type RadarChartProps, type RadarChartSeries, RadioGroup, RadioGroupItem, SIZE_STYLES_BTN, ScrollArea, SearchInput, Section, SegmentedProgress, SelectDropdown, Sheet, SidebarSheet, SimplePagination, type SimplePaginationProps, SimpleTabs, Skeleton, SkeletonAvatar, SkeletonButton, SkeletonCard, SkeletonList, SkeletonMessage, SkeletonPost, SkeletonTable, SkeletonText, SlideOver, Slider, SmartImage, type Song, type Sorter, Sparkline, type SparklineDataPoint, type SparklineProps, StatusBadge, StepProgress, type SupportedLocale, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TagBadge, TagInput, TagInput as TagInputBase, type TagInputProps, Textarea, type ThemeMode, ThemeToggleHeadless as ThemeToggle, ThemeToggleHeadless, type ThemeToggleHeadlessProps, type ThemeToggleHeadlessProps as ThemeToggleProps, TimePicker, type TimePickerProps, Timeline, TimelineItem, ToastProvider, Tooltip, TranslationProvider, type TranslationProviderProps, type Translations, UEditor, UEditorPrepareContentForSaveError, type UEditorPrepareContentForSaveOptions, type UEditorPrepareContentForSaveResult, type UEditorProps, type UEditorRef, type UEditorUploadImageForSave, type UEditorUploadImageForSaveResult, type UEditorVariant, type UnderverseLocale, UnderverseProvider, type UnderverseProviderProps, type UploadedFile, VARIANT_STYLES_ALERT, VARIANT_STYLES_BTN, VerticalTabs, Watermark, type WatermarkProps, cn$1 as cn, cn as cnLocal, getAnimationStyles, getUnderverseMessages, injectAnimationStyles, prepareUEditorContentForSave, shadcnAnimationStyles, underverseMessages, useFormField, useShadCNAnimations, useSmartLocale, useSmartTranslations, useToast, useTranslations as useUnderverseI18n, useLocale as useUnderverseI18nLocale, useUnderverseLocale, useUnderverseTranslations };
3676
+ export { AccessDenied, Alert, AreaChart, type AreaChartDataPoint, type AreaChartProps, type AreaChartSeries, Avatar, Badge, Badge as BadgeBase, BarChart, type BarChartDataPoint, type BarChartProps, type BarChartSeries, BatteryProgress, BottomSheet, Breadcrumb, Button, ButtonLoading, type ButtonProps, Calendar, type CalendarEvent, type CalendarProps, CalendarTimeline, type CalendarTimelineDateInput, type CalendarTimelineDayRangeMode, type CalendarTimelineEvent, type CalendarTimelineFormatters, type CalendarTimelineGroup, type CalendarTimelineInteractions, type CalendarTimelineLabels, type CalendarTimelineProps, type CalendarTimelineResource, type CalendarTimelineSize, type CalendarTimelineView, type CalendarTimelineVirtualization, Card, Carousel, CategoryTreeSelect, Checkbox, type CheckboxProps, CircularProgress, ClientOnly, ColorPicker, type ColorPickerProps, Combobox, type ComboboxProps, CompactPagination, type CompactPaginationProps, DataTable, type DataTableColumn, type DataTableDensity, type DataTableQuery, type DataTableSize, DatePicker, type DatePickerProps, DateRangePicker, DateTimePicker, type DateTimePickerProps, date as DateUtils, Drawer, DropdownMenu, DropdownMenuItem, DropdownMenuSeparator, FallingIcons, FileUpload, type FileUploadProps, FloatingContacts, ForceInternalTranslationsProvider, Form, FormActions, FormCheckbox, FormControl, FormDescription, FormField, FormInput, FormItem, FormLabel, FormMessage, FormSubmitButton, GaugeChart, type GaugeChartProps, GlobalLoading, GradientBadge, Grid, GridItem, type GridItemProps, type GridProps, ImageUpload, InlineLoading, Input, type InputProps, InteractiveBadge, Label, type LanguageOption, LanguageSwitcherHeadless as LanguageSwitcher, LanguageSwitcherHeadless, type LanguageSwitcherHeadlessProps, type LanguageSwitcherHeadlessProps as LanguageSwitcherProps, LineChart, type LineChartDataPoint, type LineChartProps, type LineChartSeries, List, ListItem, LoadingBar, LoadingDots, LoadingProgress, LoadingSpinner, type Locale$1 as Locale, MiniProgress, Modal, MonthYearPicker, MonthYearPicker as MonthYearPickerBase, type MonthYearPickerProps, MultiCombobox, type MultiComboboxProps, MusicPlayer, MusicPlayer as MusicPlayerDefault, type MusicPlayerProps, NotificationBadge, NotificationModal, NumberInput, OverlayControls, PageLoading, Pagination, type PaginationProps, PasswordInput, PieChart, type PieChartDataPoint, type PieChartProps, PillTabs, Popover, Progress, PulseBadge, RadarChart, type RadarChartDataPoint, type RadarChartProps, type RadarChartSeries, RadioGroup, RadioGroupItem, SIZE_STYLES_BTN, ScrollArea, SearchInput, Section, SegmentedProgress, SelectDropdown, Sheet, SidebarSheet, SimplePagination, type SimplePaginationProps, SimpleTabs, Skeleton, SkeletonAvatar, SkeletonButton, SkeletonCard, SkeletonList, SkeletonMessage, SkeletonPost, SkeletonTable, SkeletonText, SlideOver, Slider, SmartImage, type Song, type Sorter, Sparkline, type SparklineDataPoint, type SparklineProps, StatusBadge, StepProgress, type SupportedLocale, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TagBadge, TagInput, TagInput as TagInputBase, type TagInputProps, Textarea, type ThemeMode, ThemeToggleHeadless as ThemeToggle, ThemeToggleHeadless, type ThemeToggleHeadlessProps, type ThemeToggleHeadlessProps as ThemeToggleProps, TimePicker, type TimePickerProps, Timeline, TimelineItem, ToastProvider, Tooltip, TranslationProvider, type TranslationProviderProps, type Translations, UEditor, type UEditorInlineUploadedItem, UEditorPrepareContentForSaveError, type UEditorPrepareContentForSaveOptions, type UEditorPrepareContentForSaveResult, type UEditorProps, type UEditorRef, type UEditorUploadImageForSave, type UEditorUploadImageForSaveResult, type UEditorVariant, type UnderverseLocale, UnderverseProvider, type UnderverseProviderProps, type UploadedFile, VARIANT_STYLES_ALERT, VARIANT_STYLES_BTN, VerticalTabs, Watermark, type WatermarkProps, cn$1 as cn, cn as cnLocal, extractImageSrcsFromHtml, getAnimationStyles, getUnderverseMessages, injectAnimationStyles, normalizeImageUrl, prepareUEditorContentForSave, shadcnAnimationStyles, underverseMessages, useFormField, useShadCNAnimations, useSmartLocale, useSmartTranslations, useToast, useTranslations as useUnderverseI18n, useLocale as useUnderverseI18nLocale, useUnderverseLocale, useUnderverseTranslations };
package/dist/index.d.ts CHANGED
@@ -2834,6 +2834,12 @@ type UEditorUploadImageForSaveResult = string | ({
2834
2834
  } & Record<string, unknown>);
2835
2835
  type UEditorUploadImageForSave = (file: File) => Promise<UEditorUploadImageForSaveResult>;
2836
2836
  type UEditorPrepareContentUploadMeta = Record<string, unknown>;
2837
+ type UEditorInlineUploadedItem = {
2838
+ index: number;
2839
+ url: string;
2840
+ file?: File;
2841
+ meta?: UEditorPrepareContentUploadMeta;
2842
+ };
2837
2843
  type UEditorPrepareContentForSaveResult = {
2838
2844
  html: string;
2839
2845
  uploaded: Array<{
@@ -2841,6 +2847,8 @@ type UEditorPrepareContentForSaveResult = {
2841
2847
  file?: File;
2842
2848
  meta?: UEditorPrepareContentUploadMeta;
2843
2849
  }>;
2850
+ inlineImageUrls: string[];
2851
+ inlineUploaded: UEditorInlineUploadedItem[];
2844
2852
  errors: Array<{
2845
2853
  index: number;
2846
2854
  reason: string;
@@ -2877,6 +2885,8 @@ type UEditorVariant = NonNullable<UEditorProps["variant"]>;
2877
2885
 
2878
2886
  declare const UEditor: React__default.ForwardRefExoticComponent<UEditorProps & React__default.RefAttributes<UEditorRef>>;
2879
2887
 
2888
+ declare function normalizeImageUrl(url: string): string;
2889
+ declare function extractImageSrcsFromHtml(html: string): string[];
2880
2890
  declare class UEditorPrepareContentForSaveError extends Error {
2881
2891
  readonly result: UEditorPrepareContentForSaveResult;
2882
2892
  constructor(result: UEditorPrepareContentForSaveResult);
@@ -3663,4 +3673,4 @@ declare function getUnderverseMessages(locale?: UnderverseLocale): {
3663
3673
  };
3664
3674
  };
3665
3675
 
3666
- export { AccessDenied, Alert, AreaChart, type AreaChartDataPoint, type AreaChartProps, type AreaChartSeries, Avatar, Badge, Badge as BadgeBase, BarChart, type BarChartDataPoint, type BarChartProps, type BarChartSeries, BatteryProgress, BottomSheet, Breadcrumb, Button, ButtonLoading, type ButtonProps, Calendar, type CalendarEvent, type CalendarProps, CalendarTimeline, type CalendarTimelineDateInput, type CalendarTimelineDayRangeMode, type CalendarTimelineEvent, type CalendarTimelineFormatters, type CalendarTimelineGroup, type CalendarTimelineInteractions, type CalendarTimelineLabels, type CalendarTimelineProps, type CalendarTimelineResource, type CalendarTimelineSize, type CalendarTimelineView, type CalendarTimelineVirtualization, Card, Carousel, CategoryTreeSelect, Checkbox, type CheckboxProps, CircularProgress, ClientOnly, ColorPicker, type ColorPickerProps, Combobox, type ComboboxProps, CompactPagination, type CompactPaginationProps, DataTable, type DataTableColumn, type DataTableDensity, type DataTableQuery, type DataTableSize, DatePicker, type DatePickerProps, DateRangePicker, DateTimePicker, type DateTimePickerProps, date as DateUtils, Drawer, DropdownMenu, DropdownMenuItem, DropdownMenuSeparator, FallingIcons, FileUpload, type FileUploadProps, FloatingContacts, ForceInternalTranslationsProvider, Form, FormActions, FormCheckbox, FormControl, FormDescription, FormField, FormInput, FormItem, FormLabel, FormMessage, FormSubmitButton, GaugeChart, type GaugeChartProps, GlobalLoading, GradientBadge, Grid, GridItem, type GridItemProps, type GridProps, ImageUpload, InlineLoading, Input, type InputProps, InteractiveBadge, Label, type LanguageOption, LanguageSwitcherHeadless as LanguageSwitcher, LanguageSwitcherHeadless, type LanguageSwitcherHeadlessProps, type LanguageSwitcherHeadlessProps as LanguageSwitcherProps, LineChart, type LineChartDataPoint, type LineChartProps, type LineChartSeries, List, ListItem, LoadingBar, LoadingDots, LoadingProgress, LoadingSpinner, type Locale$1 as Locale, MiniProgress, Modal, MonthYearPicker, MonthYearPicker as MonthYearPickerBase, type MonthYearPickerProps, MultiCombobox, type MultiComboboxProps, MusicPlayer, MusicPlayer as MusicPlayerDefault, type MusicPlayerProps, NotificationBadge, NotificationModal, NumberInput, OverlayControls, PageLoading, Pagination, type PaginationProps, PasswordInput, PieChart, type PieChartDataPoint, type PieChartProps, PillTabs, Popover, Progress, PulseBadge, RadarChart, type RadarChartDataPoint, type RadarChartProps, type RadarChartSeries, RadioGroup, RadioGroupItem, SIZE_STYLES_BTN, ScrollArea, SearchInput, Section, SegmentedProgress, SelectDropdown, Sheet, SidebarSheet, SimplePagination, type SimplePaginationProps, SimpleTabs, Skeleton, SkeletonAvatar, SkeletonButton, SkeletonCard, SkeletonList, SkeletonMessage, SkeletonPost, SkeletonTable, SkeletonText, SlideOver, Slider, SmartImage, type Song, type Sorter, Sparkline, type SparklineDataPoint, type SparklineProps, StatusBadge, StepProgress, type SupportedLocale, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TagBadge, TagInput, TagInput as TagInputBase, type TagInputProps, Textarea, type ThemeMode, ThemeToggleHeadless as ThemeToggle, ThemeToggleHeadless, type ThemeToggleHeadlessProps, type ThemeToggleHeadlessProps as ThemeToggleProps, TimePicker, type TimePickerProps, Timeline, TimelineItem, ToastProvider, Tooltip, TranslationProvider, type TranslationProviderProps, type Translations, UEditor, UEditorPrepareContentForSaveError, type UEditorPrepareContentForSaveOptions, type UEditorPrepareContentForSaveResult, type UEditorProps, type UEditorRef, type UEditorUploadImageForSave, type UEditorUploadImageForSaveResult, type UEditorVariant, type UnderverseLocale, UnderverseProvider, type UnderverseProviderProps, type UploadedFile, VARIANT_STYLES_ALERT, VARIANT_STYLES_BTN, VerticalTabs, Watermark, type WatermarkProps, cn$1 as cn, cn as cnLocal, getAnimationStyles, getUnderverseMessages, injectAnimationStyles, prepareUEditorContentForSave, shadcnAnimationStyles, underverseMessages, useFormField, useShadCNAnimations, useSmartLocale, useSmartTranslations, useToast, useTranslations as useUnderverseI18n, useLocale as useUnderverseI18nLocale, useUnderverseLocale, useUnderverseTranslations };
3676
+ export { AccessDenied, Alert, AreaChart, type AreaChartDataPoint, type AreaChartProps, type AreaChartSeries, Avatar, Badge, Badge as BadgeBase, BarChart, type BarChartDataPoint, type BarChartProps, type BarChartSeries, BatteryProgress, BottomSheet, Breadcrumb, Button, ButtonLoading, type ButtonProps, Calendar, type CalendarEvent, type CalendarProps, CalendarTimeline, type CalendarTimelineDateInput, type CalendarTimelineDayRangeMode, type CalendarTimelineEvent, type CalendarTimelineFormatters, type CalendarTimelineGroup, type CalendarTimelineInteractions, type CalendarTimelineLabels, type CalendarTimelineProps, type CalendarTimelineResource, type CalendarTimelineSize, type CalendarTimelineView, type CalendarTimelineVirtualization, Card, Carousel, CategoryTreeSelect, Checkbox, type CheckboxProps, CircularProgress, ClientOnly, ColorPicker, type ColorPickerProps, Combobox, type ComboboxProps, CompactPagination, type CompactPaginationProps, DataTable, type DataTableColumn, type DataTableDensity, type DataTableQuery, type DataTableSize, DatePicker, type DatePickerProps, DateRangePicker, DateTimePicker, type DateTimePickerProps, date as DateUtils, Drawer, DropdownMenu, DropdownMenuItem, DropdownMenuSeparator, FallingIcons, FileUpload, type FileUploadProps, FloatingContacts, ForceInternalTranslationsProvider, Form, FormActions, FormCheckbox, FormControl, FormDescription, FormField, FormInput, FormItem, FormLabel, FormMessage, FormSubmitButton, GaugeChart, type GaugeChartProps, GlobalLoading, GradientBadge, Grid, GridItem, type GridItemProps, type GridProps, ImageUpload, InlineLoading, Input, type InputProps, InteractiveBadge, Label, type LanguageOption, LanguageSwitcherHeadless as LanguageSwitcher, LanguageSwitcherHeadless, type LanguageSwitcherHeadlessProps, type LanguageSwitcherHeadlessProps as LanguageSwitcherProps, LineChart, type LineChartDataPoint, type LineChartProps, type LineChartSeries, List, ListItem, LoadingBar, LoadingDots, LoadingProgress, LoadingSpinner, type Locale$1 as Locale, MiniProgress, Modal, MonthYearPicker, MonthYearPicker as MonthYearPickerBase, type MonthYearPickerProps, MultiCombobox, type MultiComboboxProps, MusicPlayer, MusicPlayer as MusicPlayerDefault, type MusicPlayerProps, NotificationBadge, NotificationModal, NumberInput, OverlayControls, PageLoading, Pagination, type PaginationProps, PasswordInput, PieChart, type PieChartDataPoint, type PieChartProps, PillTabs, Popover, Progress, PulseBadge, RadarChart, type RadarChartDataPoint, type RadarChartProps, type RadarChartSeries, RadioGroup, RadioGroupItem, SIZE_STYLES_BTN, ScrollArea, SearchInput, Section, SegmentedProgress, SelectDropdown, Sheet, SidebarSheet, SimplePagination, type SimplePaginationProps, SimpleTabs, Skeleton, SkeletonAvatar, SkeletonButton, SkeletonCard, SkeletonList, SkeletonMessage, SkeletonPost, SkeletonTable, SkeletonText, SlideOver, Slider, SmartImage, type Song, type Sorter, Sparkline, type SparklineDataPoint, type SparklineProps, StatusBadge, StepProgress, type SupportedLocale, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TagBadge, TagInput, TagInput as TagInputBase, type TagInputProps, Textarea, type ThemeMode, ThemeToggleHeadless as ThemeToggle, ThemeToggleHeadless, type ThemeToggleHeadlessProps, type ThemeToggleHeadlessProps as ThemeToggleProps, TimePicker, type TimePickerProps, Timeline, TimelineItem, ToastProvider, Tooltip, TranslationProvider, type TranslationProviderProps, type Translations, UEditor, type UEditorInlineUploadedItem, UEditorPrepareContentForSaveError, type UEditorPrepareContentForSaveOptions, type UEditorPrepareContentForSaveResult, type UEditorProps, type UEditorRef, type UEditorUploadImageForSave, type UEditorUploadImageForSaveResult, type UEditorVariant, type UnderverseLocale, UnderverseProvider, type UnderverseProviderProps, type UploadedFile, VARIANT_STYLES_ALERT, VARIANT_STYLES_BTN, VerticalTabs, Watermark, type WatermarkProps, cn$1 as cn, cn as cnLocal, extractImageSrcsFromHtml, getAnimationStyles, getUnderverseMessages, injectAnimationStyles, normalizeImageUrl, prepareUEditorContentForSave, shadcnAnimationStyles, underverseMessages, useFormField, useShadCNAnimations, useSmartLocale, useSmartTranslations, useToast, useTranslations as useUnderverseI18n, useLocale as useUnderverseI18nLocale, useUnderverseLocale, useUnderverseTranslations };
package/dist/index.js CHANGED
@@ -24327,6 +24327,34 @@ function getErrorReason(error) {
24327
24327
  if (typeof error === "string" && error.trim()) return error;
24328
24328
  return "Unknown upload error.";
24329
24329
  }
24330
+ function decodeHtmlEntities(value) {
24331
+ return value.replace(/&quot;/gi, '"').replace(/&#39;/gi, "'").replace(/&amp;/gi, "&").replace(/&lt;/gi, "<").replace(/&gt;/gi, ">").replace(/&nbsp;/gi, " ");
24332
+ }
24333
+ function normalizeImageUrl(url) {
24334
+ const input = decodeHtmlEntities(url.trim());
24335
+ if (!input) return "";
24336
+ if (isDataImageUrl(input)) return input;
24337
+ const isAbsolute = /^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(input);
24338
+ if (!isAbsolute) {
24339
+ return input.split("#")[0] ?? input;
24340
+ }
24341
+ try {
24342
+ const parsed = new URL(input);
24343
+ parsed.hash = "";
24344
+ if (parsed.protocol === "http:" || parsed.protocol === "https:") {
24345
+ parsed.hostname = parsed.hostname.toLowerCase();
24346
+ if (parsed.protocol === "http:" && parsed.port === "80" || parsed.protocol === "https:" && parsed.port === "443") {
24347
+ parsed.port = "";
24348
+ }
24349
+ if (parsed.pathname.length > 1 && parsed.pathname.endsWith("/")) {
24350
+ parsed.pathname = parsed.pathname.slice(0, -1);
24351
+ }
24352
+ }
24353
+ return parsed.toString();
24354
+ } catch {
24355
+ return input.split("#")[0] ?? input;
24356
+ }
24357
+ }
24330
24358
  function replaceSrcInTag(match, nextSrc) {
24331
24359
  if (!match.srcAttr) return match.tag;
24332
24360
  const { start, end, quote } = match.srcAttr;
@@ -24360,6 +24388,24 @@ function collectImgTagMatches(html) {
24360
24388
  }
24361
24389
  return matches;
24362
24390
  }
24391
+ function extractImageSrcsFromHtml(html) {
24392
+ if (!html || !html.includes("<img")) return [];
24393
+ return collectImgTagMatches(html).map((match) => decodeHtmlEntities(match.srcAttr?.value.trim() ?? "")).filter(Boolean);
24394
+ }
24395
+ function createResult({
24396
+ html,
24397
+ uploaded,
24398
+ inlineUploaded,
24399
+ errors
24400
+ }) {
24401
+ return {
24402
+ html,
24403
+ uploaded,
24404
+ inlineImageUrls: extractImageSrcsFromHtml(html),
24405
+ inlineUploaded,
24406
+ errors
24407
+ };
24408
+ }
24363
24409
  var UEditorPrepareContentForSaveError = class extends Error {
24364
24410
  constructor(result) {
24365
24411
  super(
@@ -24374,11 +24420,11 @@ async function prepareUEditorContentForSave({
24374
24420
  uploadImageForSave
24375
24421
  }) {
24376
24422
  if (!html || !html.includes("<img")) {
24377
- return { html, uploaded: [], errors: [] };
24423
+ return createResult({ html, uploaded: [], inlineUploaded: [], errors: [] });
24378
24424
  }
24379
24425
  const imgMatches = collectImgTagMatches(html);
24380
24426
  if (imgMatches.length === 0) {
24381
- return { html, uploaded: [], errors: [] };
24427
+ return createResult({ html, uploaded: [], inlineUploaded: [], errors: [] });
24382
24428
  }
24383
24429
  const base64Candidates = [];
24384
24430
  for (const match of imgMatches) {
@@ -24393,19 +24439,21 @@ async function prepareUEditorContentForSave({
24393
24439
  });
24394
24440
  }
24395
24441
  if (base64Candidates.length === 0) {
24396
- return { html, uploaded: [], errors: [] };
24442
+ return createResult({ html, uploaded: [], inlineUploaded: [], errors: [] });
24397
24443
  }
24398
24444
  if (!uploadImageForSave) {
24399
- return {
24445
+ return createResult({
24400
24446
  html,
24401
24447
  uploaded: [],
24448
+ inlineUploaded: [],
24402
24449
  errors: base64Candidates.map((item) => ({
24403
24450
  index: item.index,
24404
24451
  reason: "`uploadImageForSave` is required to transform base64 images before save."
24405
24452
  }))
24406
- };
24453
+ });
24407
24454
  }
24408
24455
  const uploaded = [];
24456
+ const inlineUploaded = [];
24409
24457
  const errors = [];
24410
24458
  const replacements = /* @__PURE__ */ new Map();
24411
24459
  const uploadResults = await Promise.all(
@@ -24434,9 +24482,15 @@ async function prepareUEditorContentForSave({
24434
24482
  file: item.file,
24435
24483
  meta: item.meta
24436
24484
  });
24485
+ inlineUploaded.push({
24486
+ index: item.candidate.index,
24487
+ url: item.url,
24488
+ file: item.file,
24489
+ meta: item.meta
24490
+ });
24437
24491
  }
24438
24492
  if (replacements.size === 0) {
24439
- return { html, uploaded, errors };
24493
+ return createResult({ html, uploaded, inlineUploaded, errors });
24440
24494
  }
24441
24495
  let transformed = "";
24442
24496
  let cursor = 0;
@@ -24448,7 +24502,7 @@ async function prepareUEditorContentForSave({
24448
24502
  cursor = match.end;
24449
24503
  }
24450
24504
  transformed += html.slice(cursor);
24451
- return { html: transformed, uploaded, errors };
24505
+ return createResult({ html: transformed, uploaded, inlineUploaded, errors });
24452
24506
  }
24453
24507
 
24454
24508
  // ../../components/ui/UEditor/UEditor.tsx
@@ -24809,9 +24863,11 @@ export {
24809
24863
  Watermark_default as Watermark,
24810
24864
  cn,
24811
24865
  cn2 as cnLocal,
24866
+ extractImageSrcsFromHtml,
24812
24867
  getAnimationStyles,
24813
24868
  getUnderverseMessages,
24814
24869
  injectAnimationStyles,
24870
+ normalizeImageUrl,
24815
24871
  prepareUEditorContentForSave,
24816
24872
  shadcnAnimationStyles2 as shadcnAnimationStyles,
24817
24873
  underverseMessages,