@liwe3/webcomponents-svelte 1.0.1 → 1.0.14

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.
@@ -1,151 +1,212 @@
1
1
  <script lang="ts">
2
- import { onMount } from 'svelte';
3
-
4
- interface Props {
5
- value?: string;
6
- apiKey?: string;
7
- suggestionDelay?: number;
8
- systemPrompt?: string;
9
- apiEndpoint?: string;
10
- modelName?: string;
11
- placeholder?: string;
12
-
13
- onbeforesuggestion?: (data: any) => boolean;
14
- onchange?: (value: string) => void;
15
- }
16
-
17
- let {
18
- value = $bindable(''),
19
- apiKey = '',
20
- suggestionDelay = 3000,
21
- systemPrompt = $bindable(
22
- "You are a helpful writing assistant. Continue the user's text naturally and coherently. Provide 1-3 sentences that would logically follow their writing. Keep the same tone and style. Do not repeat what they've already written."
23
- ),
24
- apiEndpoint = 'https://api.openai.com/v1/chat/completions',
25
- modelName = 'gpt-3.5-turbo',
26
- placeholder = 'Start writing your markdown text here...',
27
-
28
- onbeforesuggestion,
29
- onchange
30
- } = $props();
31
-
32
- let elementRef: HTMLElement;
33
- let webComponent: any;
34
-
35
- /**
36
- * Updates the web component property and syncs with Svelte state
37
- */
38
- const updateWebComponentProperty = (
39
- propertyName: string,
40
- newValue: any,
41
- setterMethod?: string
42
- ) => {
43
- if (!webComponent) return;
44
-
45
- const method =
46
- setterMethod || `set${propertyName.charAt(0).toUpperCase() + propertyName.slice(1)}`;
47
- if (typeof webComponent[method] === 'function') {
48
- webComponent[method](newValue);
49
- } else if (propertyName in webComponent) {
50
- webComponent[propertyName] = newValue;
51
- }
52
- };
53
-
54
- /**
55
- * Syncs all props with the web component
56
- */
57
- const syncAllProps = () => {
58
- if (!webComponent) return;
59
-
60
- updateWebComponentProperty('apiKey', apiKey);
61
- updateWebComponentProperty('suggestionDelay', suggestionDelay);
62
- updateWebComponentProperty('systemPrompt', systemPrompt);
63
- updateWebComponentProperty('apiEndpoint', apiEndpoint);
64
- updateWebComponentProperty('modelName', modelName);
65
-
66
- // Set initial text value
67
- if (value && webComponent.getText() !== value) {
68
- webComponent.setText(value);
69
- }
70
-
71
- // Set placeholder
72
- const textarea = webComponent.shadowRoot?.getElementById('editor');
73
- if (textarea && placeholder) {
74
- textarea.placeholder = placeholder;
75
- }
76
- };
77
-
78
- $effect(() => {
79
- if (webComponent && webComponent.getText() !== value) {
80
- webComponent.setText(value);
81
- }
82
- });
83
-
84
- $effect(() => {
85
- if (webComponent) {
86
- const textarea = webComponent.shadowRoot?.getElementById('editor');
87
- if (textarea && placeholder) {
88
- textarea.placeholder = placeholder;
89
- }
90
- }
91
- });
92
-
93
- onMount(async () => {
94
- // Dynamically import the web component
95
- await import('@liwe3/webcomponents/ai-text-editor');
96
-
97
- // Get reference to the web component
98
- webComponent = elementRef;
99
-
100
- // Sync all initial props
101
- syncAllProps();
102
-
103
- // Listen for changes from the web component
104
- const handleChange = (event: CustomEvent) => {
105
- const newValue = event.detail.value;
106
- if (newValue !== value) {
107
- value = newValue;
108
- onchange?.(newValue);
109
- }
110
- };
111
-
112
- // Forward beforeSuggestion event and allow parent to cancel
113
- const handleBeforeSuggestion = (event: CustomEvent) => {
114
- const cancel = onbeforesuggestion ? onbeforesuggestion(event.detail) : false;
115
-
116
- // propagate cancellation back to the underlying web component
117
- if (cancel) event.preventDefault();
118
- };
119
-
120
- webComponent.addEventListener('change', handleChange);
121
- webComponent.addEventListener('beforeSuggestion', handleBeforeSuggestion as EventListener);
122
-
123
- // Cleanup
124
- return () => {
125
- webComponent?.removeEventListener('change', handleChange);
126
- webComponent?.removeEventListener(
127
- 'beforeSuggestion',
128
- handleBeforeSuggestion as EventListener
129
- );
130
- };
131
- });
132
-
133
- // Public methods to expose web component functionality
134
- export const setText = (text: string) => {
135
- value = text;
136
- webComponent?.setText(text);
137
- };
138
-
139
- // Expose setContext to parent components
140
- export const setContext = (context: string) => {
141
- webComponent?.setContext(context);
142
- };
143
-
144
- // Expose setSystemPrompt to allow changing the system prompt dynamically
145
- export const setSystemPrompt = (prompt: string) => {
146
- systemPrompt = prompt;
147
- webComponent?.setSystemPrompt?.(prompt);
148
- };
2
+ import { onMount } from "svelte";
3
+
4
+ interface Props {
5
+ value?: string;
6
+ apiKey?: string;
7
+ suggestionDelay?: number;
8
+ systemPrompt?: string;
9
+ apiEndpoint?: string;
10
+ modelName?: string;
11
+ placeholder?: string;
12
+
13
+ onbeforesuggestion?: (data: any) => boolean;
14
+ onchange?: (value: string) => void;
15
+ }
16
+
17
+ let {
18
+ value = $bindable(""),
19
+ apiKey = "",
20
+ suggestionDelay = 3000,
21
+ systemPrompt = $bindable(
22
+ "You are a helpful writing assistant. Continue the user's text naturally and coherently. Provide 1-3 sentences that would logically follow their writing. Keep the same tone and style. Do not repeat what they've already written."
23
+ ),
24
+ apiEndpoint = "https://api.openai.com/v1/chat/completions",
25
+ modelName = "gpt-3.5-turbo",
26
+ placeholder = "Start writing your markdown text here...",
27
+
28
+ onbeforesuggestion,
29
+ onchange,
30
+ }: Props = $props();
31
+
32
+ let elementRef: HTMLElement;
33
+ let webComponent: any;
34
+
35
+ /**
36
+ * Updates the web component property and syncs with Svelte state
37
+ */
38
+ const updateWebComponentProperty = (
39
+ propertyName: string,
40
+ newValue: any,
41
+ setterMethod?: string
42
+ ) => {
43
+ if (!webComponent) return;
44
+
45
+ const method =
46
+ setterMethod ||
47
+ `set${propertyName.charAt(0).toUpperCase() + propertyName.slice(1)}`;
48
+ if (typeof webComponent[method] === "function") {
49
+ webComponent[method](newValue);
50
+ } else if (propertyName in webComponent) {
51
+ webComponent[propertyName] = newValue;
52
+ }
53
+ };
54
+
55
+ /**
56
+ * Syncs all props with the web component
57
+ */
58
+ const syncAllProps = () => {
59
+ if (!webComponent) return;
60
+
61
+ updateWebComponentProperty("apiKey", apiKey);
62
+ updateWebComponentProperty("suggestionDelay", suggestionDelay);
63
+ updateWebComponentProperty("systemPrompt", systemPrompt);
64
+ updateWebComponentProperty("apiEndpoint", apiEndpoint);
65
+ updateWebComponentProperty("modelName", modelName);
66
+
67
+ // Set initial text value
68
+ if (value && webComponent.getText() !== value) {
69
+ webComponent.setText(value);
70
+ }
71
+
72
+ // Set placeholder
73
+ const textarea = webComponent.shadowRoot?.getElementById("editor");
74
+ if (textarea && placeholder) {
75
+ textarea.placeholder = placeholder;
76
+ }
77
+ };
78
+
79
+ $effect(() => {
80
+ if (webComponent && webComponent.getText() !== value) {
81
+ webComponent.setText(value);
82
+ }
83
+ });
84
+
85
+ $effect(() => {
86
+ if (webComponent) {
87
+ const textarea = webComponent.shadowRoot?.getElementById("editor");
88
+ if (textarea && placeholder) {
89
+ textarea.placeholder = placeholder;
90
+ }
91
+ }
92
+ });
93
+
94
+ onMount(async (): Promise<any> => {
95
+ // Dynamically import the web component
96
+ await import("@liwe3/webcomponents/ai-text-editor");
97
+
98
+ // Get reference to the web component
99
+ webComponent = elementRef;
100
+
101
+ // Sync all initial props
102
+ syncAllProps();
103
+
104
+ // Listen for changes from the web component
105
+ const handleChange = (event: CustomEvent) => {
106
+ const newValue = event.detail.value;
107
+ if (newValue !== value) {
108
+ value = newValue;
109
+ onchange?.(newValue);
110
+ }
111
+ };
112
+
113
+ // Forward beforeSuggestion event and allow parent to cancel
114
+ const handleBeforeSuggestion = (event: CustomEvent) => {
115
+ const cancel = onbeforesuggestion
116
+ ? onbeforesuggestion(event.detail)
117
+ : false;
118
+
119
+ // propagate cancellation back to the underlying web component
120
+ if (cancel) event.preventDefault();
121
+ };
122
+
123
+ webComponent.addEventListener("change", handleChange);
124
+ webComponent.addEventListener(
125
+ "beforeSuggestion",
126
+ handleBeforeSuggestion as EventListener
127
+ );
128
+
129
+ // Cleanup
130
+ return () => {
131
+ webComponent?.removeEventListener("change", handleChange);
132
+ webComponent?.removeEventListener(
133
+ "beforeSuggestion",
134
+ handleBeforeSuggestion as EventListener
135
+ );
136
+ };
137
+ });
138
+
139
+ // Public methods to expose web component functionality
140
+ export const setText = (text: string) => {
141
+ value = text;
142
+ webComponent?.setText(text);
143
+ };
144
+
145
+ // Expose getText to parent components
146
+ export const getText = (): string => {
147
+ return webComponent?.getText() || "";
148
+ };
149
+
150
+ // Expose setContext to parent components
151
+ export const setContext = (context: string) => {
152
+ webComponent?.setContext(context);
153
+ };
154
+
155
+ // Expose getContext to parent components
156
+ export const getContext = (): string => {
157
+ return webComponent?.getContext() || "";
158
+ };
159
+
160
+ // Expose setSystemPrompt to allow changing the system prompt dynamically
161
+ export const setSystemPrompt = (prompt: string) => {
162
+ systemPrompt = prompt;
163
+ webComponent?.setSystemPrompt?.(prompt);
164
+ };
165
+
166
+ // Expose getSystemPrompt to parent components
167
+ export const getSystemPrompt = (): string => {
168
+ return webComponent?.getSystemPrompt() || systemPrompt;
169
+ };
170
+
171
+ // Expose setApiKey to parent components
172
+ export const setApiKey = (key: string) => {
173
+ webComponent?.setApiKey(key);
174
+ };
175
+
176
+ // Expose getApiKey to parent components
177
+ export const getApiKey = (): string => {
178
+ return webComponent?.getApiKey() || "";
179
+ };
180
+
181
+ // Expose setSuggestionDelay to parent components
182
+ export const setSuggestionDelay = (seconds: number) => {
183
+ webComponent?.setSuggestionDelay(seconds);
184
+ };
185
+
186
+ // Expose getSuggestionDelay to parent components
187
+ export const getSuggestionDelay = (): number => {
188
+ return webComponent?.getSuggestionDelay() || suggestionDelay;
189
+ };
190
+
191
+ // Expose setApiEndpoint to parent components
192
+ export const setApiEndpoint = (endpoint: string) => {
193
+ webComponent?.setApiEndpoint(endpoint);
194
+ };
195
+
196
+ // Expose getApiEndpoint to parent components
197
+ export const getApiEndpoint = (): string => {
198
+ return webComponent?.getApiEndpoint() || apiEndpoint;
199
+ };
200
+
201
+ // Expose setModelName to parent components
202
+ export const setModelName = (model: string) => {
203
+ webComponent?.setModelName(model);
204
+ };
205
+
206
+ // Expose getModelName to parent components
207
+ export const getModelName = (): string => {
208
+ return webComponent?.getModelName() || modelName;
209
+ };
149
210
  </script>
150
211
 
151
212
  <liwe3-ai-text-editor bind:this={elementRef}></liwe3-ai-text-editor>
@@ -1,4 +1,4 @@
1
- declare const AITextEditor: import("svelte").Component<{
1
+ interface Props {
2
2
  value?: string;
3
3
  apiKey?: string;
4
4
  suggestionDelay?: number;
@@ -6,12 +6,24 @@ declare const AITextEditor: import("svelte").Component<{
6
6
  apiEndpoint?: string;
7
7
  modelName?: string;
8
8
  placeholder?: string;
9
- onbeforesuggestion: any;
10
- onchange: any;
11
- }, {
9
+ onbeforesuggestion?: (data: any) => boolean;
10
+ onchange?: (value: string) => void;
11
+ }
12
+ declare const AITextEditor: import("svelte").Component<Props, {
12
13
  setText: (text: string) => void;
14
+ getText: () => string;
13
15
  setContext: (context: string) => void;
16
+ getContext: () => string;
14
17
  setSystemPrompt: (prompt: string) => void;
18
+ getSystemPrompt: () => string;
19
+ setApiKey: (key: string) => void;
20
+ getApiKey: () => string;
21
+ setSuggestionDelay: (seconds: number) => void;
22
+ getSuggestionDelay: () => number;
23
+ setApiEndpoint: (endpoint: string) => void;
24
+ getApiEndpoint: () => string;
25
+ setModelName: (model: string) => void;
26
+ getModelName: () => string;
15
27
  }, "value" | "systemPrompt">;
16
28
  type AITextEditor = ReturnType<typeof AITextEditor>;
17
29
  export default AITextEditor;
@@ -1 +1 @@
1
- {"version":3,"file":"AITextEditor.svelte.d.ts","sourceRoot":"","sources":["../src/lib/AITextEditor.svelte.ts"],"names":[],"mappings":"AA+JA,QAAA,MAAM,YAAY;YA5IqC,MAAM;aAAW,MAAM;sBAAoB,MAAM;mBAAiB,MAAM;kBAAgB,MAAM;gBAAc,MAAM;kBAAgB,MAAM;wBAAsB,GAAG;cAAY,GAAG;;oBAuH9M,MAAM;0BAMA,MAAM;8BAKF,MAAM;4BAUiB,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"AITextEditor.svelte.d.ts","sourceRoot":"","sources":["../src/lib/AITextEditor.svelte.ts"],"names":[],"mappings":"AAME,UAAU,KAAK;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC;IAC5C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACpC;AA4MH,QAAA,MAAM,YAAY;oBA5EQ,MAAM;mBAMT,MAAM;0BAKG,MAAM;sBAKZ,MAAM;8BAKI,MAAM;2BAMX,MAAM;qBAKV,MAAM;qBAKR,MAAM;kCAKS,MAAM;8BAKZ,MAAM;+BAKH,MAAM;0BAKb,MAAM;0BAKJ,MAAM;wBAKV,MAAM;4BASwB,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
@@ -0,0 +1,103 @@
1
+ <script lang="ts">
2
+ import { onMount } from "svelte";
3
+ import type { DateRange } from "@liwe3/webcomponents";
4
+
5
+ interface Props {
6
+ rangeMode?: boolean;
7
+ selectedDate?: string | null;
8
+ selectedRange?: DateRange;
9
+ ondateselected?: (date: string) => void;
10
+ onrangeselected?: (range: DateRange) => void;
11
+ }
12
+
13
+ let {
14
+ rangeMode = false,
15
+ selectedDate = $bindable(null),
16
+ selectedRange = $bindable({ start: null, end: null }),
17
+ ondateselected,
18
+ onrangeselected,
19
+ ...restProps
20
+ }: Props = $props();
21
+
22
+ let dateSelectorElement: HTMLElement;
23
+
24
+ /**
25
+ * Updates the web component's attributes based on props
26
+ */
27
+ const updateAttributes = () => {
28
+ if (!dateSelectorElement) return;
29
+
30
+ // Set boolean attributes
31
+ if (rangeMode) {
32
+ dateSelectorElement.setAttribute("range-mode", "");
33
+ } else {
34
+ dateSelectorElement.removeAttribute("range-mode");
35
+ }
36
+
37
+ // Set selected date in single mode
38
+ if (!rangeMode && selectedDate) {
39
+ (dateSelectorElement as any).setDate(selectedDate);
40
+ }
41
+
42
+ // Set selected range in range mode
43
+ if (rangeMode && selectedRange && selectedRange.start && selectedRange.end) {
44
+ (dateSelectorElement as any).setRange(selectedRange.start, selectedRange.end);
45
+ }
46
+ };
47
+
48
+ /**
49
+ * Binds event listeners to the web component
50
+ */
51
+ const bindEvents = () => {
52
+ if (!dateSelectorElement) return;
53
+
54
+ dateSelectorElement.addEventListener("dateSelected", (event) => {
55
+ const customEvent = event as CustomEvent;
56
+ selectedDate = customEvent.detail.date;
57
+ ondateselected?.(customEvent.detail.date);
58
+ });
59
+
60
+ dateSelectorElement.addEventListener("rangeSelected", (event) => {
61
+ const customEvent = event as CustomEvent;
62
+ selectedRange = {
63
+ start: customEvent.detail.start,
64
+ end: customEvent.detail.end
65
+ };
66
+ onrangeselected?.(selectedRange);
67
+ });
68
+ };
69
+
70
+ onMount(async () => {
71
+ // Dynamically import the web component
72
+ await import("@liwe3/webcomponents/date-selector");
73
+
74
+ updateAttributes();
75
+ bindEvents();
76
+ });
77
+
78
+ /**
79
+ * Expose methods to parent component
80
+ */
81
+ export const setDate = (dateStr: string) => {
82
+ (dateSelectorElement as any)?.setDate(dateStr);
83
+ };
84
+
85
+ export const setRange = (startDate: string, endDate: string) => {
86
+ (dateSelectorElement as any)?.setRange(startDate, endDate);
87
+ };
88
+
89
+ export const getSelectedDate = () => {
90
+ return (dateSelectorElement as any)?.getSelectedDate() || null;
91
+ };
92
+
93
+ export const getSelectedRange = () => {
94
+ return (dateSelectorElement as any)?.getSelectedRange() || { start: null, end: null };
95
+ };
96
+
97
+ export const clear = () => {
98
+ (dateSelectorElement as any)?.clear();
99
+ };
100
+ </script>
101
+
102
+ <!-- svelte-ignore a11y_unknown_aria_attribute -->
103
+ <liwe3-date-selector bind:this={dateSelectorElement} {...restProps}></liwe3-date-selector>
@@ -0,0 +1,20 @@
1
+ import type { DateRange } from "@liwe3/webcomponents";
2
+ interface Props {
3
+ rangeMode?: boolean;
4
+ selectedDate?: string | null;
5
+ selectedRange?: DateRange;
6
+ ondateselected?: (date: string) => void;
7
+ onrangeselected?: (range: DateRange) => void;
8
+ }
9
+ declare const DateSelector: import("svelte").Component<Props, {
10
+ /**
11
+ * Expose methods to parent component
12
+ */ setDate: (dateStr: string) => void;
13
+ setRange: (startDate: string, endDate: string) => void;
14
+ getSelectedDate: () => any;
15
+ getSelectedRange: () => any;
16
+ clear: () => void;
17
+ }, "selectedDate" | "selectedRange">;
18
+ type DateSelector = ReturnType<typeof DateSelector>;
19
+ export default DateSelector;
20
+ //# sourceMappingURL=DateSelector.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateSelector.svelte.d.ts","sourceRoot":"","sources":["../src/lib/DateSelector.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGpD,UAAU,KAAK;IACb,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,eAAe,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;CAC9C;AAuGH,QAAA,MAAM,YAAY;IAHlB;;SAEK,oBA5BwB,MAAM;0BAIH,MAAM,WAAW,MAAM;;;;oCAyBG,CAAC;AAC3D,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AACpD,eAAe,YAAY,CAAC"}
@@ -0,0 +1,86 @@
1
+ <script lang="ts">
2
+ import { onMount } from "svelte";
3
+ import type { PopoverMenuConfig } from "@liwe3/webcomponents";
4
+
5
+ interface Props {
6
+ items?: PopoverMenuConfig[];
7
+ }
8
+
9
+ let {
10
+ items = [],
11
+ ...restProps
12
+ }: Props = $props();
13
+
14
+ let popoverMenuElement: HTMLElement;
15
+ let isReady = $state(false);
16
+
17
+ /**
18
+ * Updates the web component's items based on props
19
+ */
20
+ const updateItems = () => {
21
+ if (!popoverMenuElement || !isReady) return;
22
+
23
+ // Check if setItems method exists
24
+ if (typeof (popoverMenuElement as any).setItems === 'function') {
25
+ (popoverMenuElement as any).setItems(items);
26
+ }
27
+ };
28
+
29
+ onMount(async () => {
30
+ // Dynamically import the web component
31
+ await import("@liwe3/webcomponents/popover-menu");
32
+
33
+ // Wait for the custom element to be defined
34
+ await customElements.whenDefined('liwe3-popover-menu');
35
+
36
+ // Mark as ready
37
+ isReady = true;
38
+
39
+ // Initial update
40
+ updateItems();
41
+ });
42
+
43
+ /**
44
+ * Expose methods to parent component
45
+ */
46
+ export const setItems = (newItems: PopoverMenuConfig[]) => {
47
+ if (typeof (popoverMenuElement as any)?.setItems === 'function') {
48
+ (popoverMenuElement as any).setItems(newItems);
49
+ }
50
+ };
51
+
52
+ export const getItems = (): PopoverMenuConfig[] => {
53
+ if (typeof (popoverMenuElement as any)?.getItems === 'function') {
54
+ return (popoverMenuElement as any).getItems();
55
+ }
56
+ return [];
57
+ };
58
+
59
+ export const addMenuItem = (item: PopoverMenuConfig, index: number | null = null) => {
60
+ if (typeof (popoverMenuElement as any)?.addMenuItem === 'function') {
61
+ (popoverMenuElement as any).addMenuItem(item, index);
62
+ }
63
+ };
64
+
65
+ export const removeMenuItem = (index: number) => {
66
+ if (typeof (popoverMenuElement as any)?.removeMenuItem === 'function') {
67
+ (popoverMenuElement as any).removeMenuItem(index);
68
+ }
69
+ };
70
+
71
+ export const updateMenuItem = (index: number, item: PopoverMenuConfig) => {
72
+ if (typeof (popoverMenuElement as any)?.updateMenuItem === 'function') {
73
+ (popoverMenuElement as any).updateMenuItem(index, item);
74
+ }
75
+ };
76
+
77
+ // Reactively update items when props change (only after component is ready)
78
+ $effect(() => {
79
+ if (isReady) {
80
+ updateItems();
81
+ }
82
+ });
83
+ </script>
84
+
85
+ <!-- svelte-ignore a11y_unknown_aria_attribute -->
86
+ <liwe3-popover-menu bind:this={popoverMenuElement} {...restProps}></liwe3-popover-menu>
@@ -0,0 +1,16 @@
1
+ import type { PopoverMenuConfig } from "@liwe3/webcomponents";
2
+ interface Props {
3
+ items?: PopoverMenuConfig[];
4
+ }
5
+ declare const PopoverMenu: import("svelte").Component<Props, {
6
+ /**
7
+ * Expose methods to parent component
8
+ */ setItems: (newItems: PopoverMenuConfig[]) => void;
9
+ getItems: () => PopoverMenuConfig[];
10
+ addMenuItem: (item: PopoverMenuConfig, index?: number | null) => void;
11
+ removeMenuItem: (index: number) => void;
12
+ updateMenuItem: (index: number, item: PopoverMenuConfig) => void;
13
+ }, "">;
14
+ type PopoverMenu = ReturnType<typeof PopoverMenu>;
15
+ export default PopoverMenu;
16
+ //# sourceMappingURL=PopoverMenu.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PopoverMenu.svelte.d.ts","sourceRoot":"","sources":["../src/lib/PopoverMenu.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG5D,UAAU,KAAK;IACb,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;CAC7B;AA0FH,QAAA,MAAM,WAAW;IAHjB;;SAEK,sBA9C0B,iBAAiB,EAAE;oBAM1B,iBAAiB,EAAE;wBAOb,iBAAiB,UAAS,MAAM,GAAG,IAAI;4BAMnC,MAAM;4BAMN,MAAM,QAAQ,iBAAiB;MAsBR,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
@@ -1,147 +1,144 @@
1
1
  <script lang="ts">
2
- import { onMount } from 'svelte';
3
- import type { SelectOption } from '@liwe3/webcomponents';
4
-
5
- interface Props {
6
- multiple?: boolean;
7
- searchable?: boolean;
8
- placeholder?: string;
9
- disabled?: boolean;
10
- value?: string | string[];
11
- options?: SelectOption[];
12
- onchange?: (value: string | string[] | undefined) => void;
13
- onopen?: (event: CustomEvent) => void;
14
- onclose?: (event: CustomEvent) => void;
15
- onsearch?: (event: CustomEvent) => void;
16
- }
17
-
18
- let {
19
- multiple = false,
20
- searchable = false,
21
- placeholder = 'Select an option',
22
- disabled = false,
23
- value = $bindable(),
24
- options = [],
25
- onchange,
26
- onopen,
27
- onclose,
28
- onsearch,
29
- ...restProps
30
- }: Props = $props();
31
-
32
- let smartSelectElement: HTMLElement;
33
-
34
- /**
35
- * Updates the web component's attributes based on props
36
- */
37
- const updateAttributes = () => {
38
- if (!smartSelectElement) return;
39
-
40
- // Set boolean attributes
41
- if (multiple) {
42
- smartSelectElement.setAttribute('multiple', '');
43
- } else {
44
- smartSelectElement.removeAttribute('multiple');
45
- }
46
-
47
- if (searchable) {
48
- smartSelectElement.setAttribute('searchable', '');
49
- } else {
50
- smartSelectElement.removeAttribute('searchable');
51
- }
52
-
53
- if (disabled) {
54
- smartSelectElement.setAttribute('disabled', '');
55
- } else {
56
- smartSelectElement.removeAttribute('disabled');
57
- }
58
-
59
- // Set string attributes
60
- smartSelectElement.setAttribute('placeholder', placeholder);
61
-
62
- // Set options as JSON string
63
- if (options.length > 0) {
64
- smartSelectElement.setAttribute('options', JSON.stringify(options));
65
- }
66
-
67
- // Set value
68
- if (value !== undefined && value !== null) {
69
- if (Array.isArray(value)) {
70
- (smartSelectElement as any).value = value;
71
- } else {
72
- (smartSelectElement as any).value = value;
73
- }
74
- }
75
- };
76
-
77
- /**
78
- * Binds event listeners to the web component
79
- */
80
- const bindEvents = () => {
81
- if (!smartSelectElement) return;
82
-
83
- smartSelectElement.addEventListener('change', (event) => {
84
- const customEvent = event as CustomEvent;
85
- value = customEvent.detail.value;
86
- onchange?.(value);
87
- });
88
-
89
- smartSelectElement.addEventListener('open', (event) => {
90
- onopen?.(event as CustomEvent);
91
- });
92
-
93
- smartSelectElement.addEventListener('close', (event) => {
94
- onclose?.(event as CustomEvent);
95
- });
96
-
97
- smartSelectElement.addEventListener('search', (event) => {
98
- onsearch?.(event as CustomEvent);
99
- });
100
- };
101
-
102
- onMount(async () => {
103
- // Dynamically import the web component
104
- await import('@liwe3/webcomponents/smart-select');
105
-
106
- updateAttributes();
107
- bindEvents();
108
-
109
- // Watch for prop changes and update attributes
110
- $effect(() => {
111
- updateAttributes();
112
- });
113
- });
114
-
115
- /**
116
- * Expose methods to parent component
117
- */
118
- export const open = () => {
119
- (smartSelectElement as any)?.open();
120
- };
121
-
122
- export const close = () => {
123
- (smartSelectElement as any)?.close();
124
- };
125
-
126
- export const toggle = () => {
127
- (smartSelectElement as any)?.toggle();
128
- };
129
-
130
- export const selectOption = (optionValue: string) => {
131
- (smartSelectElement as any)?.selectOption(optionValue);
132
- };
133
-
134
- export const deselectOption = (optionValue: string) => {
135
- (smartSelectElement as any)?.deselectOption(optionValue);
136
- };
137
-
138
- export const getSelectedOptions = () => {
139
- return (smartSelectElement as any)?.getSelectedOptions() || [];
140
- };
141
-
142
- export const setOptions = (newOptions: SelectOption[]) => {
143
- (smartSelectElement as any)?.setOptions(newOptions);
144
- };
2
+ import { onMount } from "svelte";
3
+ import type { SelectOption } from "@liwe3/webcomponents";
4
+
5
+ interface Props {
6
+ multiple?: boolean;
7
+ searchable?: boolean;
8
+ placeholder?: string;
9
+ disabled?: boolean;
10
+ value?: string | string[];
11
+ options?: SelectOption[];
12
+ onchange?: (value: string | string[] | undefined) => void;
13
+ onsearch?: (value: string) => void;
14
+ onopen?: (event: CustomEvent) => void;
15
+ onclose?: (event: CustomEvent) => void;
16
+ }
17
+
18
+ let {
19
+ multiple = false,
20
+ searchable = false,
21
+ placeholder = "Select an option",
22
+ disabled = false,
23
+ value = $bindable(),
24
+ options = [],
25
+ onchange,
26
+ onopen,
27
+ onclose,
28
+ onsearch,
29
+ ...restProps
30
+ }: Props = $props();
31
+
32
+ let smartSelectElement: HTMLElement;
33
+
34
+ /**
35
+ * Updates the web component's attributes based on props
36
+ */
37
+ const updateAttributes = () => {
38
+ if (!smartSelectElement) return;
39
+
40
+ // Set boolean attributes
41
+ if (multiple) {
42
+ smartSelectElement.setAttribute("multiple", "");
43
+ } else {
44
+ smartSelectElement.removeAttribute("multiple");
45
+ }
46
+
47
+ if (searchable) {
48
+ smartSelectElement.setAttribute("searchable", "");
49
+ } else {
50
+ smartSelectElement.removeAttribute("searchable");
51
+ }
52
+
53
+ if (disabled) {
54
+ smartSelectElement.setAttribute("disabled", "");
55
+ } else {
56
+ smartSelectElement.removeAttribute("disabled");
57
+ }
58
+
59
+ // Set string attributes
60
+ smartSelectElement.setAttribute("placeholder", placeholder);
61
+
62
+ // Set options as JSON string
63
+ if (options.length > 0) {
64
+ smartSelectElement.setAttribute("options", JSON.stringify(options));
65
+ }
66
+
67
+ // Set value
68
+ if (value !== undefined && value !== null) {
69
+ if (Array.isArray(value)) {
70
+ (smartSelectElement as any).value = value;
71
+ } else {
72
+ (smartSelectElement as any).value = value;
73
+ }
74
+ }
75
+ };
76
+
77
+ /**
78
+ * Binds event listeners to the web component
79
+ */
80
+ const bindEvents = () => {
81
+ if (!smartSelectElement) return;
82
+
83
+ smartSelectElement.addEventListener("change", (event) => {
84
+ const customEvent = event as CustomEvent;
85
+ value = customEvent.detail.value;
86
+ onchange?.(value);
87
+ });
88
+
89
+ smartSelectElement.addEventListener("open", (event) => {
90
+ onopen?.(event as CustomEvent);
91
+ });
92
+
93
+ smartSelectElement.addEventListener("close", (event) => {
94
+ onclose?.(event as CustomEvent);
95
+ });
96
+
97
+ smartSelectElement.addEventListener("search", (event) => {
98
+ const customEvent = event as CustomEvent;
99
+ const value = customEvent.detail.query;
100
+ onsearch?.(value);
101
+ });
102
+ };
103
+
104
+ onMount(async () => {
105
+ // Dynamically import the web component
106
+ await import("@liwe3/webcomponents/smart-select");
107
+
108
+ updateAttributes();
109
+ bindEvents();
110
+ });
111
+
112
+ /**
113
+ * Expose methods to parent component
114
+ */
115
+ export const open = () => {
116
+ (smartSelectElement as any)?.open();
117
+ };
118
+
119
+ export const close = () => {
120
+ (smartSelectElement as any)?.close();
121
+ };
122
+
123
+ export const toggle = () => {
124
+ (smartSelectElement as any)?.toggle();
125
+ };
126
+
127
+ export const selectOption = (optionValue: string) => {
128
+ (smartSelectElement as any)?.selectOption(optionValue);
129
+ };
130
+
131
+ export const deselectOption = (optionValue: string) => {
132
+ (smartSelectElement as any)?.deselectOption(optionValue);
133
+ };
134
+
135
+ export const getSelectedOptions = () => {
136
+ return (smartSelectElement as any)?.getSelectedOptions() || [];
137
+ };
138
+
139
+ export const setOptions = (newOptions: SelectOption[]) => {
140
+ (smartSelectElement as any)?.setOptions(newOptions);
141
+ };
145
142
  </script>
146
143
 
147
144
  <!-- svelte-ignore a11y_unknown_aria_attribute -->
@@ -1,4 +1,4 @@
1
- import type { SelectOption } from '@liwe3/webcomponents';
1
+ import type { SelectOption } from "@liwe3/webcomponents";
2
2
  interface Props {
3
3
  multiple?: boolean;
4
4
  searchable?: boolean;
@@ -7,14 +7,14 @@ interface Props {
7
7
  value?: string | string[];
8
8
  options?: SelectOption[];
9
9
  onchange?: (value: string | string[] | undefined) => void;
10
+ onsearch?: (value: string) => void;
10
11
  onopen?: (event: CustomEvent) => void;
11
12
  onclose?: (event: CustomEvent) => void;
12
- onsearch?: (event: CustomEvent) => void;
13
13
  }
14
14
  declare const SmartSelect: import("svelte").Component<Props, {
15
15
  /**
16
- * Expose methods to parent component
17
- */ open: () => void;
16
+ * Expose methods to parent component
17
+ */ open: () => void;
18
18
  close: () => void;
19
19
  toggle: () => void;
20
20
  selectOption: (optionValue: string) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"SmartSelect.svelte.d.ts","sourceRoot":"","sources":["../src/lib/SmartSelect.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGxD,UAAU,KAAK;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,KAAK,IAAI,CAAC;IAC1D,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACvC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;CACxC;AA+IF,QAAA,MAAM,WAAW;IAHjB;;WAEI;;;gCAxBiC,MAAM;kCAIJ,MAAM;;6BAQX,YAAY,EAAE;WAaS,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"SmartSelect.svelte.d.ts","sourceRoot":"","sources":["../src/lib/SmartSelect.svelte.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAGvD,UAAU,KAAK;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC1B,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,KAAK,IAAI,CAAC;IAC1D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;CACxC;AA4IH,QAAA,MAAM,WAAW;IAHjB;;SAEK;;;gCAxBiC,MAAM;kCAIJ,MAAM;;6BAQX,YAAY,EAAE;WAaQ,CAAC;AAC1D,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;AAClD,eAAe,WAAW,CAAC"}
@@ -0,0 +1,64 @@
1
+ <script module lang="ts">
2
+ import type { ToastConfig, ToastElement } from '@liwe3/webcomponents';
3
+
4
+ /**
5
+ * Shows a toast notification with the given configuration.
6
+ *
7
+ * IMPORTANT: Make sure to add the <Toasts /> component to your layout first!
8
+ * The <Toasts /> component initializes the toast web component system.
9
+ *
10
+ * @param config - The toast configuration
11
+ * @returns The toast element instance (or undefined if called during SSR)
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * // In your +layout.svelte
16
+ * import { Toasts } from '@liwe3/webcomponents-svelte';
17
+ * <Toasts />
18
+ *
19
+ * // In any component
20
+ * import { toastAdd } from '@liwe3/webcomponents-svelte';
21
+ *
22
+ * toastAdd({
23
+ * title: 'Success!',
24
+ * text: 'Your changes have been saved.',
25
+ * type: 'success',
26
+ * duration: 5000
27
+ * });
28
+ * ```
29
+ */
30
+ export const toastAdd = (config: ToastConfig): ToastElement | undefined => {
31
+ // Only run on client side
32
+ if (typeof window === 'undefined') {
33
+ return undefined;
34
+ }
35
+
36
+ // Get the toastAdd function from window (set by the web component)
37
+ // The <Toasts /> component should have already loaded the web component
38
+ const globalToastAdd = (window as any).__liwe3_toastAdd;
39
+
40
+ if (!globalToastAdd) {
41
+ console.error(
42
+ 'toastAdd: Toast web component not initialized. Did you forget to add <Toasts /> to your layout?'
43
+ );
44
+ return undefined;
45
+ }
46
+
47
+ return globalToastAdd(config);
48
+ };
49
+ </script>
50
+
51
+ <script lang="ts">
52
+ import { onMount } from 'svelte';
53
+
54
+ onMount(async () => {
55
+ // Only run on the client side (onMount only runs in browser)
56
+ // Import and initialize the Toast web component
57
+ const { toastAdd: coreToastAdd } = await import('@liwe3/webcomponents/toast');
58
+
59
+ // Expose toastAdd on window so the wrapper can access it
60
+ (window as any).__liwe3_toastAdd = coreToastAdd;
61
+ });
62
+ </script>
63
+
64
+ <!-- This component doesn't render anything, it just loads the web component -->
@@ -0,0 +1,47 @@
1
+ import type { ToastConfig, ToastElement } from '@liwe3/webcomponents';
2
+ /**
3
+ * Shows a toast notification with the given configuration.
4
+ *
5
+ * IMPORTANT: Make sure to add the <Toasts /> component to your layout first!
6
+ * The <Toasts /> component initializes the toast web component system.
7
+ *
8
+ * @param config - The toast configuration
9
+ * @returns The toast element instance (or undefined if called during SSR)
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * // In your +layout.svelte
14
+ * import { Toasts } from '@liwe3/webcomponents-svelte';
15
+ * <Toasts />
16
+ *
17
+ * // In any component
18
+ * import { toastAdd } from '@liwe3/webcomponents-svelte';
19
+ *
20
+ * toastAdd({
21
+ * title: 'Success!',
22
+ * text: 'Your changes have been saved.',
23
+ * type: 'success',
24
+ * duration: 5000
25
+ * });
26
+ * ```
27
+ */
28
+ export declare const toastAdd: (config: ToastConfig) => ToastElement | undefined;
29
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
30
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
31
+ $$bindings?: Bindings;
32
+ } & Exports;
33
+ (internal: unknown, props: {
34
+ $$events?: Events;
35
+ $$slots?: Slots;
36
+ }): Exports & {
37
+ $set?: any;
38
+ $on?: any;
39
+ };
40
+ z_$$bindings?: Bindings;
41
+ }
42
+ declare const Toasts: $$__sveltets_2_IsomorphicComponent<Record<string, never>, {
43
+ [evt: string]: CustomEvent<any>;
44
+ }, {}, {}, string>;
45
+ type Toasts = InstanceType<typeof Toasts>;
46
+ export default Toasts;
47
+ //# sourceMappingURL=Toasts.svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Toasts.svelte.d.ts","sourceRoot":"","sources":["../src/lib/Toasts.svelte.ts"],"names":[],"mappings":"AAGC,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,QAAQ,GAAI,QAAQ,WAAW,KAAG,YAAY,GAAG,SAkB7D,CAAC;AAwBH,UAAU,kCAAkC,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,EAAE,OAAO,GAAG,EAAE,EAAE,QAAQ,GAAG,MAAM;IACpM,KAAK,OAAO,EAAE,OAAO,QAAQ,EAAE,2BAA2B,CAAC,KAAK,CAAC,GAAG,OAAO,QAAQ,EAAE,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,QAAQ,CAAA;KAAE,GAAG,OAAO,CAAC;IACjK,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,KAAK,CAAA;KAAC,GAAG,OAAO,GAAG;QAAE,IAAI,CAAC,EAAE,GAAG,CAAC;QAAC,GAAG,CAAC,EAAE,GAAG,CAAA;KAAE,CAAC;IACtG,YAAY,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAKD,QAAA,MAAM,MAAM;;kBAA+E,CAAC;AAC1E,KAAK,MAAM,GAAG,YAAY,CAAC,OAAO,MAAM,CAAC,CAAC;AAC5C,eAAe,MAAM,CAAC"}
package/dist/index.d.ts CHANGED
@@ -2,7 +2,10 @@
2
2
  * @liwe3/webcomponents-svelte
3
3
  * Svelte 5 wrappers for @liwe3/webcomponents
4
4
  */
5
- export type { SelectOption, AITextEditorConfig } from '@liwe3/webcomponents';
5
+ export type { SelectOption, AITextEditorConfig, ToastType, ToastButton, ToastConfig, ToastElement, PopoverMenuItem, PopoverMenuConfig, DateRange } from '@liwe3/webcomponents';
6
6
  export { default as SmartSelect } from './SmartSelect.svelte';
7
7
  export { default as AITextEditor } from './AITextEditor.svelte';
8
+ export { default as PopoverMenu } from './PopoverMenu.svelte';
9
+ export { default as DateSelector } from './DateSelector.svelte';
10
+ export { default as Toasts, toastAdd } from './Toasts.svelte';
8
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG7E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAG/K,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGhE,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -5,3 +5,7 @@
5
5
  // Export Svelte components
6
6
  export { default as SmartSelect } from './SmartSelect.svelte';
7
7
  export { default as AITextEditor } from './AITextEditor.svelte';
8
+ export { default as PopoverMenu } from './PopoverMenu.svelte';
9
+ export { default as DateSelector } from './DateSelector.svelte';
10
+ // Export Toasts component and toastAdd function
11
+ export { default as Toasts, toastAdd } from './Toasts.svelte';
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "@liwe3/webcomponents-svelte",
3
- "version": "1.0.1",
3
+ "version": "1.0.14",
4
4
  "description": "Svelte 5 wrappers for @liwe3/webcomponents",
5
5
  "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
6
8
  "svelte": "./dist/index.js",
7
9
  "types": "./dist/index.d.ts",
8
10
  "exports": {