@widgetic/design-system 0.3.88 → 0.5.7
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 +122 -690
- package/dist/components/CopyableHeader.svelte +11 -13
- package/dist/components/EmptyState.svelte +4 -2
- package/dist/components/EmptyState.svelte.d.ts +2 -1
- package/dist/components/GenerateLoader.svelte +50 -0
- package/dist/components/GenerateLoader.svelte.d.ts +21 -0
- package/dist/components/PasswordInput.svelte +5 -1
- package/dist/components/WScrollArea.svelte +3 -3
- package/dist/components/debug-grid/DebugGrid.svelte +1 -1
- package/dist/components/ic/browser/BrowserInputController.svelte +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/components/index.js +2 -2
- package/dist/components/modals/BaseModal.svelte +1 -1
- package/dist/components/modals/BaseModal.svelte.d.ts +1 -1
- package/dist/components/modals/NewItemDialog.svelte +1 -1
- package/dist/components/modals/Portal.svelte +14 -15
- package/dist/components/modals/RenameDialog.svelte +7 -6
- package/dist/components/navigation/Breadcrumbs.svelte +65 -39
- package/dist/components/pdf/PDFViewer.svelte +10 -19
- package/dist/components/pdf/PDFViewer.svelte.d.ts +4 -4
- package/dist/components/search-input/SearchInput.svelte +3 -8
- package/dist/components/search-input/index.d.ts +3 -14
- package/dist/components/search-input/index.js +1 -2
- package/dist/components/search-input/index2.d.ts +14 -0
- package/dist/components/shad-editor/README.md +18 -0
- package/dist/components/shad-editor/custom/image-extended-component.svelte +1 -1
- package/dist/components/shad-editor/editor.css +8 -4
- package/dist/components/shad-editor/icons/table.svelte +3 -3
- package/dist/components/shad-editor/icons/text.svelte +1 -1
- package/dist/components/shad-editor/onedark.css +3 -0
- package/dist/components/shad-editor/shad-editor.svelte +1 -1
- package/dist/components/toast/ToasterModal.svelte +15 -9
- package/dist/components/ui/alert/index.d.ts +2 -2
- package/dist/components/ui/badge/badge.svelte +1 -1
- package/dist/components/ui/badge/badge.svelte.d.ts +2 -2
- package/dist/components/ui/button/button.svelte +1 -1
- package/dist/components/ui/calendar/calendar-day.svelte +4 -4
- package/dist/components/ui/card/card.svelte +1 -1
- package/dist/components/ui/checkbox/checkbox.svelte +1 -1
- package/dist/components/ui/collapsible/index.d.ts +1 -12
- package/dist/components/ui/command/command-dialog.svelte +1 -1
- package/dist/components/ui/command/command-input.svelte +1 -1
- package/dist/components/ui/command/command-item.svelte +1 -1
- package/dist/components/ui/command/command-link-item.svelte +1 -1
- package/dist/components/ui/dialog/dialog-content.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +1 -1
- package/dist/components/ui/dropdown-menu/index.d.ts +6 -14
- package/dist/components/ui/hover-card/hover-card-content.svelte +1 -1
- package/dist/components/ui/input/input.svelte +1 -1
- package/dist/components/ui/input-otp/input-otp.svelte +1 -1
- package/dist/components/ui/popover/popover-content.svelte +1 -1
- package/dist/components/ui/radio-group/radio-group-item.svelte +1 -1
- package/dist/components/ui/range-calendar/range-calendar-day.svelte +6 -6
- package/dist/components/ui/select/index.d.ts +1 -1
- package/dist/components/ui/select/select-item.svelte +1 -1
- package/dist/components/ui/select/select-trigger.svelte +1 -1
- package/dist/components/ui/slider/slider.svelte +1 -1
- package/dist/components/ui/sonner/sonner.svelte +12 -2
- package/dist/components/ui/switch/switch.svelte +1 -1
- package/dist/components/ui/tabs/tabs-content.svelte +1 -1
- package/dist/components/ui/tabs/tabs-trigger.svelte +1 -1
- package/dist/components/ui/textarea/textarea.svelte +1 -1
- package/dist/components/ui/toggle/toggle.svelte +1 -1
- package/dist/components/ui/toggle/toggle.svelte.d.ts +2 -2
- package/dist/components/ui/tooltip/index.d.ts +4 -4
- package/dist/components/widget-system/Moveable.svelte +100 -23
- package/dist/components/widget-system/Moveable.svelte.d.ts +3 -1
- package/dist/icons/eye-off.svg +1 -0
- package/dist/icons/eye.svg +1 -0
- package/dist/shad-editor/index.d.ts +1 -0
- package/dist/shad-editor/index.js +1 -0
- package/dist/styles/fonts.css +59 -47
- package/dist/styles/global.css +119 -52
- package/package.json +158 -34
- package/tailwind.config.ts +13 -6
|
@@ -30,8 +30,10 @@ const dispatch = createEventDispatcher();
|
|
|
30
30
|
/**
|
|
31
31
|
* COMPONENT IMPORTS
|
|
32
32
|
*/
|
|
33
|
-
import { toast, Button, Tooltip, Portal } from '@widgetic/design-system/components';
|
|
34
|
-
import {
|
|
33
|
+
// import { toast, Button, Tooltip, Portal } from '@widgetic/design-system/components';
|
|
34
|
+
import { toast, Button, Tooltip, Portal } from './';
|
|
35
|
+
// import { IconCopy, IconHelp } from '@widgetic/design-system/icons';
|
|
36
|
+
import { IconCopy, IconHelp } from '../icons';
|
|
35
37
|
|
|
36
38
|
/**
|
|
37
39
|
* COMPONENT PROPS
|
|
@@ -189,7 +191,7 @@ function showToast(type: 'success' | 'error', message: string, options = {}) {
|
|
|
189
191
|
{#if showHelp && helpUrl}
|
|
190
192
|
<Tooltip.Provider>
|
|
191
193
|
<Tooltip.Root open={showHelpTooltip}>
|
|
192
|
-
<Tooltip.Trigger class="focus:outline-
|
|
194
|
+
<Tooltip.Trigger class="focus:outline-hidden">
|
|
193
195
|
<a
|
|
194
196
|
href={helpUrl}
|
|
195
197
|
target="_blank"
|
|
@@ -218,7 +220,7 @@ function showToast(type: 'success' | 'error', message: string, options = {}) {
|
|
|
218
220
|
<Tooltip.Content
|
|
219
221
|
side="right"
|
|
220
222
|
sideOffset={5}
|
|
221
|
-
class="bg-[hsl(var(--dark))] text-white z-
|
|
223
|
+
class="bg-[hsl(var(--dark))] text-white z-200000 overflow-hidden rounded-md px-2 py-1.5 shadow-md widgetic-colors widgetic-radius"
|
|
222
224
|
>
|
|
223
225
|
<p class="caption text-white">{helpText}</p>
|
|
224
226
|
</Tooltip.Content>
|
|
@@ -231,7 +233,7 @@ function showToast(type: 'success' | 'error', message: string, options = {}) {
|
|
|
231
233
|
{#if showStandaloneCopyButton}
|
|
232
234
|
<Tooltip.Provider>
|
|
233
235
|
<Tooltip.Root open={showCopyTooltip}>
|
|
234
|
-
<Tooltip.Trigger class="focus:outline-
|
|
236
|
+
<Tooltip.Trigger class="focus:outline-hidden">
|
|
235
237
|
<Button
|
|
236
238
|
variant="default"
|
|
237
239
|
class="h-9 w-6 {headerBackgroundColor ? headerBackgroundColor + ' text-[hsl(var(--grey7))]' : buttonClass || 'bg-[hsl(var(--dark))] hover:bg-white text-white rounded-full'} flex items-center justify-center active:scale-95 transition-transform duration-150"
|
|
@@ -256,7 +258,7 @@ function showToast(type: 'success' | 'error', message: string, options = {}) {
|
|
|
256
258
|
<Tooltip.Content
|
|
257
259
|
side="left"
|
|
258
260
|
sideOffset={5}
|
|
259
|
-
class="bg-[hsl(var(--dark))] text-white z-
|
|
261
|
+
class="bg-[hsl(var(--dark))] text-white z-200000 overflow-hidden rounded-md px-3 py-1.5 shadow-md widgetic-colors widgetic-radius"
|
|
260
262
|
>
|
|
261
263
|
<p class="caption text-white">{standaloneCopyButtonText}</p>
|
|
262
264
|
</Tooltip.Content>
|
|
@@ -267,7 +269,7 @@ function showToast(type: 'success' | 'error', message: string, options = {}) {
|
|
|
267
269
|
{:else}
|
|
268
270
|
<Tooltip.Provider>
|
|
269
271
|
<Tooltip.Root open={showCopyTooltip}>
|
|
270
|
-
<Tooltip.Trigger class="focus:outline-
|
|
272
|
+
<Tooltip.Trigger class="focus:outline-hidden">
|
|
271
273
|
<Button
|
|
272
274
|
variant="ghost"
|
|
273
275
|
size="icon"
|
|
@@ -294,7 +296,7 @@ function showToast(type: 'success' | 'error', message: string, options = {}) {
|
|
|
294
296
|
<Tooltip.Content
|
|
295
297
|
side="left"
|
|
296
298
|
sideOffset={5}
|
|
297
|
-
class="bg-[hsl(var(--dark))] text-white z-
|
|
299
|
+
class="bg-[hsl(var(--dark))] text-white z-200000 overflow-hidden rounded-md px-3 py-1.5 shadow-md widgetic-colors widgetic-radius"
|
|
298
300
|
>
|
|
299
301
|
<p class="caption text-white">{standaloneCopyButtonText}</p>
|
|
300
302
|
</Tooltip.Content>
|
|
@@ -339,15 +341,11 @@ function showToast(type: 'success' | 'error', message: string, options = {}) {
|
|
|
339
341
|
.copyable-content-area {
|
|
340
342
|
-webkit-user-select: text !important;
|
|
341
343
|
-moz-user-select: text !important;
|
|
344
|
+
-ms-user-select: text !important;
|
|
342
345
|
user-select: text !important;
|
|
343
346
|
overflow-y: auto !important;
|
|
344
347
|
}
|
|
345
348
|
|
|
346
|
-
.copyable-content-area::-moz-selection {
|
|
347
|
-
background-color: rgba(59, 130, 246, 0.2) !important;
|
|
348
|
-
color: inherit !important;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
349
|
.copyable-content-area::selection {
|
|
352
350
|
background-color: rgba(59, 130, 246, 0.2) !important;
|
|
353
351
|
color: inherit !important;
|
|
@@ -11,8 +11,10 @@
|
|
|
11
11
|
* - Responsive: hides icon when space is limited
|
|
12
12
|
-->
|
|
13
13
|
<script lang="ts">
|
|
14
|
-
import { IconExclamationCircle } from '@widgetic/design-system/icons';
|
|
15
14
|
import { onMount } from 'svelte';
|
|
15
|
+
|
|
16
|
+
// import { IconExclamationCircle } from '@widgetic/design-system/icons';
|
|
17
|
+
import { IconExclamationCircle } from '../icons';
|
|
16
18
|
|
|
17
19
|
/**
|
|
18
20
|
* Component Props
|
|
@@ -116,7 +118,7 @@
|
|
|
116
118
|
|
|
117
119
|
/* Icon container to prevent scaling */
|
|
118
120
|
.icon-container {
|
|
119
|
-
|
|
121
|
+
shrink: 0;
|
|
120
122
|
width: 24px;
|
|
121
123
|
height: 24px;
|
|
122
124
|
display: flex;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import { IconExclamationCircle } from '../icons';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
/**
|
|
@@ -15,7 +16,7 @@ declare const __propDef: {
|
|
|
15
16
|
showIcon?: boolean;
|
|
16
17
|
iconColor?: string;
|
|
17
18
|
textColor?: string;
|
|
18
|
-
icon?:
|
|
19
|
+
icon?: typeof IconExclamationCircle;
|
|
19
20
|
};
|
|
20
21
|
events: {
|
|
21
22
|
[evt: string]: CustomEvent<any>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
GenerateLoader — reusable hourglass loading state for code generation / preview build.
|
|
3
|
+
Change the hourglass emoji or animation here to propagate app-wide.
|
|
4
|
+
-->
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
let className = '';
|
|
7
|
+
export { className as class };
|
|
8
|
+
export let style = '';
|
|
9
|
+
|
|
10
|
+
/** Primary status line */
|
|
11
|
+
export let title = 'Generating code…';
|
|
12
|
+
/** Optional secondary line; pass empty string to hide */
|
|
13
|
+
export let subtitle = 'Preview will appear when done.';
|
|
14
|
+
export let size: 'sm' | 'md' | 'lg' = 'md';
|
|
15
|
+
/** Absolute overlay with light backdrop (e.g. over preview iframe) */
|
|
16
|
+
export let overlay = false;
|
|
17
|
+
|
|
18
|
+
const hourglassSizeClass: Record<typeof size, string> = {
|
|
19
|
+
sm: 'text-2xl',
|
|
20
|
+
md: 'text-3xl',
|
|
21
|
+
lg: 'text-4xl',
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const titleSizeClass: Record<typeof size, string> = {
|
|
25
|
+
sm: 'text-xs',
|
|
26
|
+
md: 'text-sm',
|
|
27
|
+
lg: 'text-lg',
|
|
28
|
+
};
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<div
|
|
32
|
+
class="wc-generate-loader {overlay
|
|
33
|
+
? 'wc-generate-loader-overlay absolute inset-0 z-30 flex flex-col items-center justify-center bg-white/75 pointer-events-none'
|
|
34
|
+
: 'wc-generate-loader-inline flex flex-col items-center justify-center text-center'} {className}"
|
|
35
|
+
style={style}
|
|
36
|
+
role="status"
|
|
37
|
+
aria-live="polite"
|
|
38
|
+
>
|
|
39
|
+
<div class="wc-generate-loader-hourglass animate-spin {hourglassSizeClass[size]} mb-3 text-gray-500"
|
|
40
|
+
aria-hidden="true"
|
|
41
|
+
>
|
|
42
|
+
⏳
|
|
43
|
+
</div>
|
|
44
|
+
{#if title}
|
|
45
|
+
<div class="wc-generate-loader-title font-medium text-gray-700 {titleSizeClass[size]}">{title}</div>
|
|
46
|
+
{/if}
|
|
47
|
+
{#if subtitle}
|
|
48
|
+
<div class="wc-generate-loader-subtitle mt-1 text-xs text-gray-500">{subtitle}</div>
|
|
49
|
+
{/if}
|
|
50
|
+
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
class?: string;
|
|
5
|
+
style?: string;
|
|
6
|
+
/** Primary status line */ title?: string;
|
|
7
|
+
/** Optional secondary line; pass empty string to hide */ subtitle?: string;
|
|
8
|
+
size?: "sm" | "md" | "lg";
|
|
9
|
+
/** Absolute overlay with light backdrop (e.g. over preview iframe) */ overlay?: boolean;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {};
|
|
15
|
+
};
|
|
16
|
+
export type GenerateLoaderProps = typeof __propDef.props;
|
|
17
|
+
export type GenerateLoaderEvents = typeof __propDef.events;
|
|
18
|
+
export type GenerateLoaderSlots = typeof __propDef.slots;
|
|
19
|
+
export default class GenerateLoader extends SvelteComponentTyped<GenerateLoaderProps, GenerateLoaderEvents, GenerateLoaderSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -5,6 +5,10 @@
|
|
|
5
5
|
// SHADCN Imports
|
|
6
6
|
import { Input } from './ui/input';
|
|
7
7
|
|
|
8
|
+
// Import icon URLs
|
|
9
|
+
import eyeIconUrl from '../icons/eye.svg?url';
|
|
10
|
+
import eyeOffIconUrl from '../icons/eye-off.svg?url';
|
|
11
|
+
|
|
8
12
|
// External Props
|
|
9
13
|
export let value = '';
|
|
10
14
|
export let placeholder = 'Enter password';
|
|
@@ -37,7 +41,7 @@
|
|
|
37
41
|
on:click={() => showPassword = !showPassword}
|
|
38
42
|
>
|
|
39
43
|
<img
|
|
40
|
-
src={showPassword ?
|
|
44
|
+
src={showPassword ? eyeOffIconUrl : eyeIconUrl}
|
|
41
45
|
alt={showPassword ? 'Hide password' : 'Show password'}
|
|
42
46
|
class="w-5 h-5"
|
|
43
47
|
/>
|
|
@@ -26,16 +26,16 @@ export let element: HTMLElement | null = null;
|
|
|
26
26
|
<ScrollArea bind:ref={element}
|
|
27
27
|
class={(className ? className + ' ' : '') + "scroll-area-container w-full h-full " +
|
|
28
28
|
"widgetic-radius widgetic-colors select-text " +
|
|
29
|
-
"
|
|
29
|
+
"**:!data-scroll-area-viewport:pr-(--scrollbar-width)"}
|
|
30
30
|
style="{style} {scrollOutside ? `width: calc(100% + ${scrollbarWidth}px) !important;` : ''}
|
|
31
31
|
--scrollbar-width: {scrollbarWidth}px; --scrollbar-padding: {scrollbarWidth/4}px; "
|
|
32
32
|
{orientation}
|
|
33
33
|
{type}
|
|
34
34
|
{scrollHideDelay}
|
|
35
|
-
scrollbarYClasses={scrollbarYClasses + "flex w-[var(--scrollbar-width)] !p-
|
|
35
|
+
scrollbarYClasses={scrollbarYClasses + "flex w-[var(--scrollbar-width)] !p-(--scrollbar-padding) " +
|
|
36
36
|
"!bg-transparent border-none select-none touch-none " +
|
|
37
37
|
"[&>div]:rounded-[var(--radius-pill)] [&>div]:cursor-pointer " +
|
|
38
|
-
"[&>div]:bg-[hsl(var(--grey1))] [&>div]:
|
|
38
|
+
"[&>div]:bg-[hsl(var(--grey1))] hover:[&>div]:bg-[hsl(var(--grey2))] " +
|
|
39
39
|
"[&>div]:transition-colors [&>div]:duration-250"}
|
|
40
40
|
>
|
|
41
41
|
<div class="actual-viewport {viewPortClass ? viewPortClass + ' ' : ''} absolute inset-0 z-[-1]" style="margin-right: {scrollbarWidth}px;">
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
{#if isDashboard && !isMobile}
|
|
164
164
|
<div class="grid-sidebar flex">
|
|
165
165
|
<div class="grid-sidebar-margin-left grid-margin-left" style="width: {marginWidth}px"></div>
|
|
166
|
-
<div class="grid-sidebar-content grid-column
|
|
166
|
+
<div class="grid-sidebar-content grid-column grow"></div>
|
|
167
167
|
<div class="grid-sidebar-margin-right grid-margin-right" style="width: {marginWidth}px"></div>
|
|
168
168
|
</div>
|
|
169
169
|
{/if}
|
|
@@ -333,7 +333,7 @@
|
|
|
333
333
|
<Tooltip.Content
|
|
334
334
|
side="right"
|
|
335
335
|
sideOffset={5}
|
|
336
|
-
class="bg-gray-900 text-white z-
|
|
336
|
+
class="bg-gray-900 text-white z-99999 overflow-hidden rounded-md px-3 py-1.5 text-sm shadow-md"
|
|
337
337
|
style="position: fixed; left: {mouseX + 20}px; top: {mouseY}px; z-index: 999999;"
|
|
338
338
|
>
|
|
339
339
|
<p class="text-sm">{header.helpText}</p>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as CopyableHeader } from './CopyableHeader.svelte';
|
|
2
2
|
export { default as EmptyState } from './EmptyState.svelte';
|
|
3
|
+
export { default as GenerateLoader } from './GenerateLoader.svelte';
|
|
3
4
|
export { default as PasswordInput } from './PasswordInput.svelte';
|
|
4
5
|
export { default as ThumbHashImage } from './ThumbHashImage.svelte';
|
|
5
6
|
export { default as WScrollArea } from './WScrollArea.svelte';
|
|
@@ -12,8 +13,7 @@ export { default as Portal } from './modals/Portal.svelte';
|
|
|
12
13
|
export { default as RenameDialog } from './modals/RenameDialog.svelte';
|
|
13
14
|
export { Breadcrumbs, type BreadcrumbsProps } from './navigation';
|
|
14
15
|
export { default as PDFViewer } from './pdf/PDFViewer.svelte';
|
|
15
|
-
export {
|
|
16
|
-
export { ShadEditor, type TipTapEditor, type TipTapEditorLevel } from './shad-editor';
|
|
16
|
+
export { SearchInput } from './search-input';
|
|
17
17
|
export { ToasterModal, showToast } from './toast';
|
|
18
18
|
export * as Accordion from './ui/accordion';
|
|
19
19
|
export * as Alert from './ui/alert';
|
package/dist/components/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Component exports
|
|
2
2
|
export { default as CopyableHeader } from './CopyableHeader.svelte';
|
|
3
3
|
export { default as EmptyState } from './EmptyState.svelte';
|
|
4
|
+
export { default as GenerateLoader } from './GenerateLoader.svelte';
|
|
4
5
|
export { default as PasswordInput } from './PasswordInput.svelte';
|
|
5
6
|
export { default as ThumbHashImage } from './ThumbHashImage.svelte';
|
|
6
7
|
export { default as WScrollArea } from './WScrollArea.svelte';
|
|
@@ -13,8 +14,7 @@ export { default as Portal } from './modals/Portal.svelte';
|
|
|
13
14
|
export { default as RenameDialog } from './modals/RenameDialog.svelte';
|
|
14
15
|
export { Breadcrumbs } from './navigation';
|
|
15
16
|
export { default as PDFViewer } from './pdf/PDFViewer.svelte';
|
|
16
|
-
export {
|
|
17
|
-
export { ShadEditor } from './shad-editor';
|
|
17
|
+
export { SearchInput } from './search-input';
|
|
18
18
|
export { ToasterModal, showToast } from './toast';
|
|
19
19
|
export * as Accordion from './ui/accordion';
|
|
20
20
|
export * as Alert from './ui/alert';
|
|
@@ -284,7 +284,7 @@
|
|
|
284
284
|
></div>
|
|
285
285
|
|
|
286
286
|
<!-- Close button -->
|
|
287
|
-
<div class="modal-close-bt-container absolute top-4 right-4 z-
|
|
287
|
+
<div class="modal-close-bt-container absolute top-4 right-4 z-1004" transition:fade={{ duration: transitionDuration, easing }}>
|
|
288
288
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
289
289
|
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
290
290
|
<div
|
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
}}
|
|
173
173
|
required
|
|
174
174
|
class="w-full h5 text-[24px] text-[hsl(var(--grey7))] text-center
|
|
175
|
-
bg-transparent border-none focus:outline-
|
|
175
|
+
bg-transparent border-none focus:outline-hidden focus:ring-0
|
|
176
176
|
placeholder:text-[24px] placeholder:text-[hsl(var(--grey3))]
|
|
177
177
|
{currentError ? 'input-error' : ''}"
|
|
178
178
|
placeholder={placeholder}
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
*/
|
|
22
22
|
let host: HTMLElement; // host(target) container of the portal: parent target of the portal
|
|
23
23
|
let portal: HTMLElement; // root portal element
|
|
24
|
+
/** Only remove host on destroy if Portal created it (never remove editor portal slots). */
|
|
25
|
+
let hostCreatedByPortal = false;
|
|
24
26
|
// show logs
|
|
25
27
|
let showLogs = false;
|
|
26
28
|
|
|
@@ -31,23 +33,20 @@
|
|
|
31
33
|
if(showLogs) console.log('DS Portal target is an HTML element:', target);
|
|
32
34
|
host = target;
|
|
33
35
|
} else {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
const targetId = (target || defaultTarget).replace(/^#/, '');
|
|
37
|
+
// Prefer id (props-editor-file-browser-portal), then class, then body fallback
|
|
38
|
+
host = document.getElementById(targetId) as HTMLElement | null;
|
|
39
|
+
if (!host) {
|
|
40
|
+
host = document.querySelector(`.${targetId}`) as HTMLElement | null;
|
|
41
|
+
}
|
|
42
|
+
if(showLogs) console.log('DS Portal host:', host, 'target:', target);
|
|
40
43
|
|
|
41
44
|
// Create host container if it doesn't exist
|
|
42
45
|
if (!host) {
|
|
43
|
-
|
|
46
|
+
hostCreatedByPortal = true;
|
|
44
47
|
host = document.createElement('div');
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
host.classList.add(target || defaultTarget);
|
|
48
|
-
// host.dataset.portal = target;
|
|
49
|
-
|
|
50
|
-
// append the host to the document's body
|
|
48
|
+
host.classList.add(targetId);
|
|
49
|
+
host.id = targetId;
|
|
51
50
|
document.body.appendChild(host);
|
|
52
51
|
}
|
|
53
52
|
}
|
|
@@ -63,8 +62,8 @@
|
|
|
63
62
|
if (portal && host && host.contains(portal)) {
|
|
64
63
|
host.removeChild(portal);
|
|
65
64
|
}
|
|
66
|
-
//
|
|
67
|
-
if (
|
|
65
|
+
// Only remove hosts Portal created on body — never delete editor portal slots
|
|
66
|
+
if (hostCreatedByPortal && host?.parentNode) {
|
|
68
67
|
host.remove();
|
|
69
68
|
}
|
|
70
69
|
});
|
|
@@ -264,7 +264,7 @@
|
|
|
264
264
|
}}
|
|
265
265
|
required
|
|
266
266
|
class="w-full h5 text-[24px] text-[hsl(var(--grey7))] text-center
|
|
267
|
-
bg-transparent border-none focus:outline-
|
|
267
|
+
bg-transparent border-none focus:outline-hidden focus:ring-0
|
|
268
268
|
placeholder:text-[24px] placeholder:text-[hsl(var(--grey3))]
|
|
269
269
|
text-ellipsis-input
|
|
270
270
|
{!isValid && hasAttemptedSubmit ? 'input-error' : ''}"
|
|
@@ -283,16 +283,17 @@
|
|
|
283
283
|
|
|
284
284
|
<!-- Buttons Container -->
|
|
285
285
|
<div class="buttons-container flex justify-center gap-4">
|
|
286
|
+
<!-- Cancel Button -->
|
|
287
|
+
<!-- svelte-ignore a11y-no-static-element-interactions -->
|
|
286
288
|
<Button
|
|
287
|
-
|
|
288
|
-
variant="secondary"
|
|
289
|
-
class="modal-btn-secondary !h-[34px]"
|
|
289
|
+
class="modal-btn-secondary !h-[34px]"
|
|
290
290
|
onclick={handleClose}
|
|
291
291
|
>
|
|
292
292
|
{cancelLabel}
|
|
293
293
|
</Button>
|
|
294
|
-
|
|
295
|
-
|
|
294
|
+
|
|
295
|
+
<!-- Confirm Button -->
|
|
296
|
+
<Button
|
|
296
297
|
class="modal-btn-primary !h-[34px]"
|
|
297
298
|
onclick={handleRename}
|
|
298
299
|
disabled={!isValid}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// Components Imports
|
|
6
6
|
import * as Breadcrumb from "../ui/breadcrumb";
|
|
7
7
|
import * as DropdownMenu from "../ui/dropdown-menu";
|
|
8
|
+
import * as Tooltip from "../ui/tooltip";
|
|
8
9
|
|
|
9
10
|
// Icons Imports
|
|
10
11
|
// import { IconArrowLeft, IconArrowRight } from '@widgetic/design-system/icons';
|
|
@@ -55,6 +56,8 @@
|
|
|
55
56
|
let breadcrumbsContainer: HTMLElement;
|
|
56
57
|
let breadcrumbsPositioned = false;
|
|
57
58
|
let showLogs = false;
|
|
59
|
+
let showBackTooltip = false;
|
|
60
|
+
let showForwardTooltip = false;
|
|
58
61
|
// Calculate how many items we can show based on available width
|
|
59
62
|
// Assuming each item takes roughly 150px on average (including separator)
|
|
60
63
|
$: if (availableWidth > 0) {
|
|
@@ -182,38 +185,61 @@
|
|
|
182
185
|
>
|
|
183
186
|
<!-- NAVIGATION BUTTONS -->
|
|
184
187
|
{#if showNavigationButtons}
|
|
185
|
-
<
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
188
|
+
<Tooltip.Provider delayDuration={300}>
|
|
189
|
+
<div class="nav-buttons flex items-center shrink-0">
|
|
190
|
+
<Tooltip.Root open={showBackTooltip}>
|
|
191
|
+
<Tooltip.Trigger class="inline-flex focus:outline-none">
|
|
192
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
193
|
+
<div
|
|
194
|
+
class="breadcrumbs-nav-button flex items-center justify-center w-6 h-6"
|
|
195
|
+
style="cursor: {canGoBack && !isLoading ? 'pointer' : 'default'};"
|
|
196
|
+
class:opacity-50={!canGoBack || isLoading}
|
|
197
|
+
on:mouseenter={() => { showBackTooltip = true; }}
|
|
198
|
+
on:mouseleave={() => { showBackTooltip = false; }}
|
|
199
|
+
on:click={canGoBack && !isLoading ? onBack : undefined}
|
|
200
|
+
role="button"
|
|
201
|
+
tabindex={canGoBack && !isLoading ? 0 : -1}
|
|
202
|
+
>
|
|
203
|
+
<IconArrowLeft
|
|
204
|
+
class="w-6 h-6 text-[hsl(var(--grey6))]"
|
|
205
|
+
style="min-width: 24px; min-height: 24px;"
|
|
206
|
+
/>
|
|
207
|
+
</div>
|
|
208
|
+
</Tooltip.Trigger>
|
|
209
|
+
{#if showBackTooltip}
|
|
210
|
+
<Tooltip.Content side="bottom" sideOffset={6} class="bg-[hsl(var(--dark))] text-white caption px-2 py-1 rounded-md z-[200000]">
|
|
211
|
+
Back
|
|
212
|
+
</Tooltip.Content>
|
|
213
|
+
{/if}
|
|
214
|
+
</Tooltip.Root>
|
|
215
|
+
|
|
216
|
+
<Tooltip.Root open={showForwardTooltip}>
|
|
217
|
+
<Tooltip.Trigger class="inline-flex focus:outline-none">
|
|
218
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
219
|
+
<div
|
|
220
|
+
class="breadcrumbs-nav-button flex items-center justify-center w-6 h-6 ml-4"
|
|
221
|
+
style="cursor: {canGoForward && !isLoading ? 'pointer' : 'default'};"
|
|
222
|
+
class:opacity-50={!canGoForward || isLoading}
|
|
223
|
+
on:mouseenter={() => { showForwardTooltip = true; }}
|
|
224
|
+
on:mouseleave={() => { showForwardTooltip = false; }}
|
|
225
|
+
on:click={canGoForward && !isLoading ? onForward : undefined}
|
|
226
|
+
role="button"
|
|
227
|
+
tabindex={canGoForward && !isLoading ? 0 : -1}
|
|
228
|
+
>
|
|
229
|
+
<IconArrowRight
|
|
230
|
+
class="w-6 h-6 text-[hsl(var(--grey6))]"
|
|
231
|
+
style="min-width: 24px; min-height: 24px;"
|
|
232
|
+
/>
|
|
233
|
+
</div>
|
|
234
|
+
</Tooltip.Trigger>
|
|
235
|
+
{#if showForwardTooltip}
|
|
236
|
+
<Tooltip.Content side="bottom" sideOffset={6} class="bg-[hsl(var(--dark))] text-white caption px-2 py-1 rounded-md z-[200000]">
|
|
237
|
+
Forward
|
|
238
|
+
</Tooltip.Content>
|
|
239
|
+
{/if}
|
|
240
|
+
</Tooltip.Root>
|
|
215
241
|
</div>
|
|
216
|
-
</
|
|
242
|
+
</Tooltip.Provider>
|
|
217
243
|
{/if}
|
|
218
244
|
|
|
219
245
|
<!-- BREADCRUMBS CONTAINER -->
|
|
@@ -222,7 +248,7 @@
|
|
|
222
248
|
<Breadcrumb.List class="inline-flex items-center min-w-0 breadcrumbs-list">
|
|
223
249
|
<div class="inline-flex items-center min-w-0 min-h-[24px]">
|
|
224
250
|
<!-- Root Breadcrumb Item -->
|
|
225
|
-
<Breadcrumb.Item class="
|
|
251
|
+
<Breadcrumb.Item class="shrink-0">
|
|
226
252
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
227
253
|
<span
|
|
228
254
|
role="link"
|
|
@@ -241,10 +267,10 @@
|
|
|
241
267
|
{#if !isLoading && currentPath.length > 0 && breadcrumbsPositioned}
|
|
242
268
|
{#if shouldShowEllipsis && currentPath.length > itemsToShow}
|
|
243
269
|
<!-- Breadcrumb Separator -->
|
|
244
|
-
<Breadcrumb.Separator class="h5 text-[hsl(var(--grey6))]
|
|
270
|
+
<Breadcrumb.Separator class="h5 text-[hsl(var(--grey6))] shrink-0">/</Breadcrumb.Separator>
|
|
245
271
|
|
|
246
272
|
<!-- Dropdown Menu for Ellipsis -->
|
|
247
|
-
<Breadcrumb.Item class="
|
|
273
|
+
<Breadcrumb.Item class="shrink-0">
|
|
248
274
|
<DropdownMenu.Root>
|
|
249
275
|
<DropdownMenu.Trigger class="flex items-center gap-1 cursor-pointer">
|
|
250
276
|
<span class="h5 text-[hsl(var(--grey6))]">...</span>
|
|
@@ -269,8 +295,8 @@
|
|
|
269
295
|
|
|
270
296
|
<!-- Always show last N segments based on available width -->
|
|
271
297
|
{#each currentPath.slice(-itemsToShow + 1) as _, index}
|
|
272
|
-
<Breadcrumb.Separator class="h5 text-[hsl(var(--grey6))]
|
|
273
|
-
<Breadcrumb.Item class="
|
|
298
|
+
<Breadcrumb.Separator class="h5 text-[hsl(var(--grey6))] shrink-0">/</Breadcrumb.Separator>
|
|
299
|
+
<Breadcrumb.Item class="shrink-0">
|
|
274
300
|
{#if index === itemsToShow - 2}
|
|
275
301
|
<span class="h5 text-[hsl(var(--grey3))]">
|
|
276
302
|
{currentPathNames[currentPath.length - 1]}
|
|
@@ -293,8 +319,8 @@
|
|
|
293
319
|
{/each}
|
|
294
320
|
{:else}
|
|
295
321
|
{#each currentPath as _, index}
|
|
296
|
-
<Breadcrumb.Separator class="h5 text-[hsl(var(--grey6))]
|
|
297
|
-
<Breadcrumb.Item class="
|
|
322
|
+
<Breadcrumb.Separator class="h5 text-[hsl(var(--grey6))] shrink-0">/</Breadcrumb.Separator>
|
|
323
|
+
<Breadcrumb.Item class="shrink-0">
|
|
298
324
|
{#if index === currentPath.length - 1}
|
|
299
325
|
<span class="h5 text-[hsl(var(--grey3))]">
|
|
300
326
|
{currentPathNames[index]}
|
|
@@ -323,7 +349,7 @@
|
|
|
323
349
|
</div>
|
|
324
350
|
|
|
325
351
|
{#if showDebugVisualizer}
|
|
326
|
-
<div class="absolute bottom-1 right-1 text-xs text-blue-600 bg-white px-1 rounded shadow">
|
|
352
|
+
<div class="absolute bottom-1 right-1 text-xs text-blue-600 bg-white px-1 rounded shadow-2xs">
|
|
327
353
|
Available width: {Math.round(availableWidth)}px
|
|
328
354
|
<br>
|
|
329
355
|
Items to show: {itemsToShow}
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
import { onMount, onDestroy, tick, afterUpdate, createEventDispatcher } from 'svelte';
|
|
4
4
|
|
|
5
5
|
// Sveltekit imports
|
|
6
|
-
import { browser } from '$app/environment';
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
// import { browser } from '$app/environment';
|
|
7
|
+
const browser = typeof window !== 'undefined';
|
|
8
|
+
// import { base } from '$app/paths';
|
|
9
|
+
const base = '';
|
|
9
10
|
// Local components imports
|
|
10
11
|
import { WScrollArea } from '../../components';
|
|
11
12
|
|
|
@@ -542,29 +543,19 @@
|
|
|
542
543
|
<!-- Page Navigation Bar -->
|
|
543
544
|
<div class="page-navigation-bar flex items-center justify-center h-[54px] widgetic-colors border-b border-[hsl(var(--grey2))] w-full">
|
|
544
545
|
<div class="flex items-center gap-3 w-full max-w-[200px] justify-between px-0">
|
|
545
|
-
<button
|
|
546
|
-
|
|
547
|
-
onclick={onPrevPage}
|
|
548
|
-
disabled={pageNum <= 1}
|
|
549
|
-
aria-label="Previous page"
|
|
550
|
-
>
|
|
551
|
-
<IconChevronLeft
|
|
546
|
+
<button class="pdf-nav-button h-9 w-9 flex items-center justify-center rounded-small bg-white border-[hsl(var(--grey2))] transition-colors group disabled:cursor-not-allowed" on:click={onPrevPage} disabled={pageNum <= 1}>
|
|
547
|
+
<IconChevronLeft
|
|
552
548
|
class="!text-[hsl(var(--grey5))] group-hover:!text-[hsl(var(--grey7))]"
|
|
553
|
-
style="
|
|
549
|
+
style="height: 20px !important; min-width: 20px !important; max-width: 20px !important; max-height: 20px !important;"
|
|
554
550
|
/>
|
|
555
551
|
</button>
|
|
556
552
|
|
|
557
553
|
<span class="subtext text-[hsl(var(--grey7))]">Page {pageNum} of {pageCount || '?'}</span>
|
|
558
554
|
|
|
559
|
-
<button
|
|
560
|
-
|
|
561
|
-
onclick={onNextPage}
|
|
562
|
-
disabled={pageNum >= pageCount}
|
|
563
|
-
aria-label="Next page"
|
|
564
|
-
>
|
|
565
|
-
<IconChevronRight
|
|
555
|
+
<button class="pdf-nav-button h-9 w-9 flex items-center justify-center rounded-small bg-white border-[hsl(var(--grey2))] transition-colors group disabled:cursor-not-allowed" on:click={onNextPage} disabled={pageNum >= pageCount}>
|
|
556
|
+
<IconChevronRight
|
|
566
557
|
class="!text-[hsl(var(--grey5))] group-hover:!text-[hsl(var(--grey7))]"
|
|
567
|
-
style="
|
|
558
|
+
style="height: 20px !important; min-width: 20px !important; max-width: 20px !important; max-height: 20px !important;"
|
|
568
559
|
/>
|
|
569
560
|
</button>
|
|
570
561
|
</div>
|
|
@@ -20,9 +20,9 @@ declare const __propDef: {
|
|
|
20
20
|
};
|
|
21
21
|
slots: {};
|
|
22
22
|
};
|
|
23
|
-
export type
|
|
24
|
-
export type
|
|
25
|
-
export type
|
|
26
|
-
export default class
|
|
23
|
+
export type PDFViewerProps = typeof __propDef.props;
|
|
24
|
+
export type PDFViewerEvents = typeof __propDef.events;
|
|
25
|
+
export type PDFViewerSlots = typeof __propDef.slots;
|
|
26
|
+
export default class PDFViewer extends SvelteComponentTyped<PDFViewerProps, PDFViewerEvents, PDFViewerSlots> {
|
|
27
27
|
}
|
|
28
28
|
export {};
|