@djangocfg/ui-tools 2.1.409 → 2.1.412

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.
Files changed (83) hide show
  1. package/package.json +13 -13
  2. package/src/{tools/Chat/highlight → lib/browser-bridge}/README.md +46 -18
  3. package/src/lib/browser-bridge/commands/chat.ts +42 -0
  4. package/src/lib/browser-bridge/commands/highlight.ts +70 -0
  5. package/src/lib/browser-bridge/commands/index.ts +15 -0
  6. package/src/lib/browser-bridge/commands/inspect.ts +31 -0
  7. package/src/lib/browser-bridge/commands/scroll.ts +31 -0
  8. package/src/lib/browser-bridge/commands/write.ts +45 -0
  9. package/src/lib/browser-bridge/directive-bus.ts +120 -0
  10. package/src/lib/browser-bridge/index.ts +56 -0
  11. package/src/lib/browser-bridge/logger.ts +27 -0
  12. package/src/{tools/Chat/highlight → lib/browser-bridge/overlay}/HighlightOverlay.tsx +14 -0
  13. package/src/{tools/Chat/highlight → lib/browser-bridge/overlay}/__tests__/HighlightOverlay.test.tsx +52 -0
  14. package/src/{tools/Chat/highlight → lib/browser-bridge/overlay}/__tests__/resolveRef.test.ts +39 -0
  15. package/src/{tools/Chat/highlight → lib/browser-bridge/overlay}/index.ts +8 -5
  16. package/src/{tools/Chat/highlight → lib/browser-bridge/overlay}/resolveRef.ts +5 -0
  17. package/src/{tools/Chat/highlight → lib/browser-bridge/overlay}/useHighlightTargets.ts +58 -27
  18. package/src/lib/browser-bridge/overlay/waitForVisible.ts +70 -0
  19. package/src/lib/browser-bridge/registry.ts +41 -0
  20. package/src/lib/browser-bridge/setBridgeResolver.ts +42 -0
  21. package/src/lib/browser-bridge/window.ts +76 -0
  22. package/src/lib/page-snapshot/capture/walk.ts +13 -5
  23. package/src/lib/page-snapshot/engine.ts +9 -4
  24. package/src/lib/page-snapshot/index.ts +5 -0
  25. package/src/lib/page-snapshot/react/provider.tsx +70 -3
  26. package/src/lib/page-snapshot/react/use-page-snapshot.ts +10 -0
  27. package/src/lib/page-snapshot/refs/__tests__/locator.test.ts +94 -0
  28. package/src/lib/page-snapshot/refs/__tests__/registry.test.ts +59 -3
  29. package/src/lib/page-snapshot/refs/locator.ts +218 -0
  30. package/src/lib/page-snapshot/refs/registry.ts +29 -14
  31. package/src/tools/Chat/README.md +1 -1
  32. package/src/tools/Chat/composer/AttachContext.tsx +22 -0
  33. package/src/tools/Chat/composer/Composer.tsx +108 -6
  34. package/src/tools/Chat/composer/ComposerMenuButton.tsx +39 -2
  35. package/src/tools/Chat/composer/fileToAttachment.ts +53 -0
  36. package/src/tools/Chat/composer/index.ts +16 -1
  37. package/src/tools/Chat/composer/types.ts +71 -0
  38. package/src/tools/Chat/composer/useComposerAttach.tsx +218 -0
  39. package/src/tools/Chat/constants.ts +24 -1
  40. package/src/tools/Chat/context/ChatProvider.tsx +17 -2
  41. package/src/tools/Chat/core/logger.ts +15 -2
  42. package/src/tools/Chat/hooks/useChat.ts +32 -0
  43. package/src/tools/Chat/hooks/useChatComposer.ts +13 -0
  44. package/src/tools/Chat/index.ts +34 -2
  45. package/src/tools/Chat/launcher/ChatDock.tsx +13 -3
  46. package/src/tools/Chat/launcher/ChatFAB.tsx +4 -2
  47. package/src/tools/Chat/launcher/ChatGreeting.tsx +3 -2
  48. package/src/tools/Chat/launcher/ChatLauncher.tsx +42 -7
  49. package/src/tools/Chat/launcher/ChatUnreadPreview.tsx +3 -2
  50. package/src/tools/Chat/launcher/header/ChatHeader.tsx +2 -0
  51. package/src/tools/Chat/launcher/header/ChatHeaderActionButton.tsx +2 -0
  52. package/src/tools/Chat/launcher/header/ChatHeaderLanguageButton.tsx +2 -2
  53. package/src/tools/Chat/launcher/header/HeaderSlots.tsx +16 -9
  54. package/src/tools/Chat/lazy.tsx +34 -2
  55. package/src/tools/Chat/messages/MessageBubble.tsx +1 -1
  56. package/src/tools/Chat/public.ts +17 -0
  57. package/src/tools/Chat/settings/README.md +87 -0
  58. package/src/tools/Chat/settings/__tests__/useChatSettings.test.tsx +84 -0
  59. package/src/tools/Chat/settings/__tests__/useLocalStorage.test.tsx +138 -0
  60. package/src/tools/Chat/settings/index.ts +23 -0
  61. package/src/tools/Chat/settings/types.ts +108 -0
  62. package/src/tools/Chat/settings/useChatSettings.ts +168 -0
  63. package/src/tools/Chat/types/events.ts +50 -0
  64. package/src/tools/Chat/types/index.ts +1 -1
  65. package/src/tools/Chat/types/message.ts +5 -0
  66. package/src/tools/CronScheduler/CronScheduler.client.tsx +42 -15
  67. package/src/tools/CronScheduler/components/CustomInput.tsx +26 -7
  68. package/src/tools/CronScheduler/components/DayChips.tsx +20 -7
  69. package/src/tools/CronScheduler/components/MonthDayGrid.tsx +35 -10
  70. package/src/tools/CronScheduler/components/SchedulePreview.tsx +8 -5
  71. package/src/tools/CronScheduler/components/ScheduleTypeSelector.tsx +12 -3
  72. package/src/tools/CronScheduler/components/TimeSelector.tsx +36 -13
  73. package/src/tools/CronScheduler/context/CronSchedulerContext.tsx +4 -0
  74. package/src/tools/CronScheduler/context/hooks.ts +8 -0
  75. package/src/tools/CronScheduler/context/index.ts +1 -0
  76. package/src/tools/CronScheduler/index.tsx +2 -0
  77. package/src/tools/CronScheduler/lazy.tsx +1 -0
  78. package/src/tools/CronScheduler/types/index.ts +18 -1
  79. package/src/tools/Map/lazy.tsx +11 -4
  80. package/src/tools/Uploader/hooks/useClipboardPaste.ts +3 -1
  81. package/src/tools/index.ts +2 -0
  82. /package/src/{tools/Chat/highlight → lib/browser-bridge/overlay}/SpotlightCanvas.tsx +0 -0
  83. /package/src/{tools/Chat/highlight → lib/browser-bridge/overlay}/types.ts +0 -0
@@ -50,6 +50,7 @@ function CronSchedulerFallback() {
50
50
  // Re-export types
51
51
  export type {
52
52
  CronSchedulerProps,
53
+ CronSchedulerSize,
53
54
  ScheduleType,
54
55
  WeekDay,
55
56
  MonthDay,
@@ -67,6 +68,7 @@ export {
67
68
  useCronMonthDays,
68
69
  useCronCustom,
69
70
  useCronPreview,
71
+ useCronSize,
70
72
  useCronScheduler,
71
73
  } from './context';
72
74
 
@@ -21,6 +21,7 @@ import type { CronSchedulerProps } from './types';
21
21
  // Re-export types
22
22
  export type {
23
23
  CronSchedulerProps,
24
+ CronSchedulerSize,
24
25
  ScheduleType,
25
26
  WeekDay,
26
27
  MonthDay,
@@ -10,6 +10,13 @@
10
10
 
11
11
  export type ScheduleType = 'daily' | 'weekly' | 'monthly' | 'custom';
12
12
 
13
+ /**
14
+ * Visual density of the scheduler fields.
15
+ * - `default` — full-size fields (unchanged).
16
+ * - `sm` — compact fields for narrow side panels / modals (~360-420px).
17
+ */
18
+ export type CronSchedulerSize = 'default' | 'sm';
19
+
13
20
  /** Day of week: 0 = Sunday, 1 = Monday, ..., 6 = Saturday */
14
21
  export type WeekDay = 0 | 1 | 2 | 3 | 4 | 5 | 6;
15
22
 
@@ -79,7 +86,10 @@ export interface CronSchedulerActions {
79
86
  export interface CronSchedulerContextValue
80
87
  extends CronSchedulerState,
81
88
  CronSchedulerComputed,
82
- CronSchedulerActions {}
89
+ CronSchedulerActions {
90
+ /** Visual density of the fields (`default` | `sm`) */
91
+ size: CronSchedulerSize;
92
+ }
83
93
 
84
94
  // ============================================================================
85
95
  // Component Props
@@ -107,6 +117,11 @@ export interface CronSchedulerProps {
107
117
  inline?: boolean;
108
118
  /** Trigger text shown when no schedule is set (compact mode only) */
109
119
  placeholder?: string;
120
+ /**
121
+ * Visual density of the fields. `sm` renders smaller, tighter fields
122
+ * suited for narrow side panels / modals. Default: `default`.
123
+ */
124
+ size?: CronSchedulerSize;
110
125
  /** Additional CSS classes */
111
126
  className?: string;
112
127
  }
@@ -116,4 +131,6 @@ export interface CronSchedulerProviderProps {
116
131
  value?: string;
117
132
  onChange?: (cron: string) => void;
118
133
  defaultType?: ScheduleType;
134
+ /** Visual density propagated to all field components. Default: `default`. */
135
+ size?: CronSchedulerSize;
119
136
  }
@@ -12,6 +12,7 @@
12
12
 
13
13
  import * as React from 'react';
14
14
  import { createLazyComponent, MapLoadingFallback } from '../../components';
15
+ import type { MapContainerProps } from './components';
15
16
 
16
17
  // ============================================================================
17
18
  // Lazy Components
@@ -22,8 +23,11 @@ import { createLazyComponent, MapLoadingFallback } from '../../components';
22
23
  *
23
24
  * Automatically shows loading state while MapLibre GL loads (~800KB)
24
25
  */
25
- export const LazyMapContainer = createLazyComponent(
26
- () => import('./components/MapContainer').then((mod) => ({ default: mod.MapContainer })),
26
+ export const LazyMapContainer = createLazyComponent<MapContainerProps>(
27
+ () =>
28
+ import('./components/MapContainer').then((mod) => ({
29
+ default: mod.MapContainer,
30
+ })),
27
31
  {
28
32
  displayName: 'LazyMapContainer',
29
33
  fallback: <MapLoadingFallback minHeight={400} />,
@@ -33,8 +37,11 @@ export const LazyMapContainer = createLazyComponent(
33
37
  /**
34
38
  * LazyMapView - Lazy-loaded map view (alias for MapContainer)
35
39
  */
36
- export const LazyMapView = createLazyComponent(
37
- () => import('./components/MapContainer').then((mod) => ({ default: mod.MapView })),
40
+ export const LazyMapView = createLazyComponent<Omit<MapContainerProps, 'initialViewport'>>(
41
+ () =>
42
+ import('./components/MapContainer').then((mod) => ({
43
+ default: mod.MapView,
44
+ })),
38
45
  {
39
46
  displayName: 'LazyMapView',
40
47
  fallback: <MapLoadingFallback minHeight={400} />,
@@ -87,7 +87,9 @@ async function resolveClipboardFiles(
87
87
  }
88
88
  return [file];
89
89
  } catch (err) {
90
- logger.warn('Failed to fetch pasted URL', err);
90
+ logger.warn('Failed to fetch pasted URL', {
91
+ error: err instanceof Error ? err.message : String(err),
92
+ });
91
93
  return [];
92
94
  }
93
95
  }
@@ -112,6 +112,7 @@ export {
112
112
  useCronMonthDays,
113
113
  useCronCustom,
114
114
  useCronPreview,
115
+ useCronSize,
115
116
  useCronScheduler,
116
117
  // Utilities
117
118
  buildCron,
@@ -128,6 +129,7 @@ export {
128
129
  } from './CronScheduler';
129
130
  export type {
130
131
  CronSchedulerProps,
132
+ CronSchedulerSize,
131
133
  ScheduleType,
132
134
  WeekDay,
133
135
  MonthDay,