@widgetic/editor 4.1.14 → 4.1.16
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/components/PreviewChromeControls.svelte +15 -21
- package/dist/components/WidgetPreview.svelte +136 -105
- package/dist/components/color-select/ColorSelect.svelte +203 -224
- package/dist/components/color-select/constants.d.ts +4 -2
- package/dist/components/color-select/constants.js +4 -2
- package/dist/components/color-select/render.js +10 -9
- package/dist/components/editors/CompositionEditorApp.svelte +47 -40
- package/dist/components/editors/EditLeaseNotice.svelte +44 -33
- package/dist/components/editors/EmbedEditor.svelte +133 -259
- package/dist/components/editors/PropsEditor.svelte +418 -1338
- package/dist/components/editors/props-editor.css +5 -68
- package/dist/components/ic/AngleInputController.svelte +202 -277
- package/dist/components/ic/BrowserInputController.svelte +813 -803
- package/dist/components/ic/CheckboxInputController.svelte +92 -169
- package/dist/components/ic/CheckboxInputController.svelte.d.ts +2 -8
- package/dist/components/ic/ColorPickerInputController.svelte +1589 -1587
- package/dist/components/ic/ColorPickerInputController.svelte.d.ts +3 -3
- package/dist/components/ic/DateFieldInputController.svelte +455 -465
- package/dist/components/ic/DatePickerInputController.svelte +355 -368
- package/dist/components/ic/DatePickerInputController.svelte.d.ts +1 -1
- package/dist/components/ic/DropdownInputController.svelte +130 -200
- package/dist/components/ic/FixedPositionInputController.svelte +255 -276
- package/dist/components/ic/FixedPositionInputController.svelte.d.ts +5 -1
- package/dist/components/ic/FontInputController.svelte +2110 -2231
- package/dist/components/ic/FontInputController.svelte.d.ts +11 -11
- package/dist/components/ic/InputControllerHeader.svelte +141 -147
- package/dist/components/ic/InputControllerRow.svelte +74 -0
- package/dist/components/ic/InputControllerRow.svelte.d.ts +14 -0
- package/dist/components/ic/KnowledgeDocumentsInputController.svelte +84 -47
- package/dist/components/ic/KnowledgeTextForm.svelte +35 -33
- package/dist/components/ic/NumberControls.svelte +303 -269
- package/dist/components/ic/NumberControls.svelte.d.ts +4 -1
- package/dist/components/ic/NumberInputController.svelte +361 -301
- package/dist/components/ic/NumberInputController.svelte.d.ts +2 -0
- package/dist/components/ic/PositionInputController.svelte +253 -176
- package/dist/components/ic/PositionInputController.svelte.d.ts +2 -0
- package/dist/components/ic/RadioGroupInputController.svelte +71 -137
- package/dist/components/ic/RadioGroupInputController.svelte.d.ts +2 -8
- package/dist/components/ic/RangeCalendarInputController.svelte +233 -270
- package/dist/components/ic/RangeCalendarInputController.svelte.d.ts +2 -2
- package/dist/components/ic/RoundedCornersInputController.svelte +412 -435
- package/dist/components/ic/RoundedCornersInputController.svelte.d.ts +2 -0
- package/dist/components/ic/SliderInputController.svelte +263 -332
- package/dist/components/ic/SliderInputController.svelte.d.ts +1 -1
- package/dist/components/ic/SliderRangeInputController.svelte +140 -144
- package/dist/components/ic/SliderRangeInputController.svelte.d.ts +3 -3
- package/dist/components/ic/SwitchInputController.svelte +47 -109
- package/dist/components/ic/TagsInputController.svelte +95 -110
- package/dist/components/ic/TextAreaInputController.svelte +1794 -1935
- package/dist/components/ic/TextAreaPreviewInputController.svelte +436 -438
- package/dist/components/ic/TextAreaPreviewInputController.svelte.d.ts +2 -2
- package/dist/components/ic/TextInputController.svelte +65 -75
- package/dist/components/ic/TextInputController.svelte.d.ts +2 -0
- package/dist/components/ic/TimeInputController.svelte +433 -431
- package/dist/components/ic/VectorInputController.svelte +1833 -1831
- package/dist/components/ic/VectorInputController.svelte.d.ts +10 -10
- package/dist/components/ic/index.d.ts +1 -0
- package/dist/components/ic/index.js +1 -0
- package/dist/components/ic/shared/CategoryTabs.svelte +28 -35
- package/dist/components/ic/shared/ItemGrid.svelte +145 -179
- package/dist/components/ic/shared/RecentItemsSection.svelte +208 -271
- package/dist/components/ic/shared/RecentItemsSection.svelte.d.ts +1 -1
- package/dist/components/ui/arrows/OpacitySliderArrows.svelte +23 -38
- package/dist/components/ui/arrows/OpacitySliderArrows.svelte.d.ts +1 -4
- package/dist/components/ui/calendar-editor-fit/EditorCalendarStyles.svelte +45 -0
- package/dist/components/ui/calendar-editor-fit/EditorCalendarStyles.svelte.d.ts +26 -0
- package/dist/components/ui/checkerboard-background/CheckerboardBackground.svelte +20 -12
- package/dist/components/ui/shadow-picker-host/ShadowPickerHost.svelte +39 -0
- package/dist/components/ui/shadow-picker-host/ShadowPickerHost.svelte.d.ts +10 -0
- package/dist/i18n/language.d.ts +44 -281
- package/dist/i18n/messages.d.ts +41 -34
- package/dist/i18n/messages.js +47 -34
- package/dist/i18n/translate.d.ts +1 -1
- package/dist/utils.d.ts +7 -0
- package/dist/utils.js +26 -2
- package/package.json +5 -5
|
@@ -36,16 +36,16 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
|
|
|
36
36
|
}
|
|
37
37
|
declare const VectorInputController: $$__sveltets_2_IsomorphicComponent<{
|
|
38
38
|
/**
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
39
|
+
* Component Props
|
|
40
|
+
* @prop {string} label - Display label for the vector selector
|
|
41
|
+
* @prop {string} value - Currently selected vector
|
|
42
|
+
* @prop {Function} onChange - Callback when vector selection changes
|
|
43
|
+
* @prop {string} description - Optional help text
|
|
44
|
+
* @prop {string} controllerId - Unique identifier for this controller
|
|
45
|
+
* @prop {any} openDropdowns - Store tracking open dropdown states
|
|
46
|
+
* @prop {Function} toggleDropdown - Function to toggle dropdown state
|
|
47
|
+
* @prop {Function} onFocus - Optional focus handler
|
|
48
|
+
*/ label: VectorInputControllerProps["label"];
|
|
49
49
|
value?: VectorInputControllerProps["value"];
|
|
50
50
|
onChange?: VectorInputControllerProps["onChange"];
|
|
51
51
|
description?: VectorInputControllerProps["description"];
|
|
@@ -18,6 +18,7 @@ export { default as FixedPositionInputController } from './FixedPositionInputCon
|
|
|
18
18
|
export { default as VectorInputController } from './VectorInputController.svelte';
|
|
19
19
|
export { default as AngleInputController } from './AngleInputController.svelte';
|
|
20
20
|
export { default as InputControllerHeader } from './InputControllerHeader.svelte';
|
|
21
|
+
export { default as InputControllerRow } from './InputControllerRow.svelte';
|
|
21
22
|
export { default as TimeInputController } from './TimeInputController.svelte';
|
|
22
23
|
export { default as RoundedCornersInputController } from './RoundedCornersInputController.svelte';
|
|
23
24
|
export { default as TagsInputController } from './TagsInputController.svelte';
|
|
@@ -18,6 +18,7 @@ export { default as FixedPositionInputController } from './FixedPositionInputCon
|
|
|
18
18
|
export { default as VectorInputController } from './VectorInputController.svelte';
|
|
19
19
|
export { default as AngleInputController } from './AngleInputController.svelte';
|
|
20
20
|
export { default as InputControllerHeader } from './InputControllerHeader.svelte';
|
|
21
|
+
export { default as InputControllerRow } from './InputControllerRow.svelte';
|
|
21
22
|
export { default as TimeInputController } from './TimeInputController.svelte';
|
|
22
23
|
export { default as RoundedCornersInputController } from './RoundedCornersInputController.svelte';
|
|
23
24
|
export { default as TagsInputController } from './TagsInputController.svelte';
|
|
@@ -1,41 +1,34 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
* CategoryTabs
|
|
3
|
-
* A simplified, reusable component for displaying and switching between categories
|
|
4
|
-
*
|
|
5
|
-
* Features:
|
|
6
|
-
* - Displays a list of categories as tabs
|
|
7
|
-
* - Handles category selection
|
|
8
|
-
* - Shows the active category with different styling
|
|
9
|
-
* - Uses Widgetic design system styling
|
|
2
|
+
* CategoryTabs — mirrors Figma "Category Tab" (189:1081) / row of tabs in Font & Vector pickers.
|
|
10
3
|
-->
|
|
11
4
|
<script lang="ts">
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export let filterVisible = true;
|
|
5
|
+
export let categories: any[] = [];
|
|
6
|
+
export let activeCategory: any = null;
|
|
7
|
+
export let onCategorySelect: (category: any) => void;
|
|
8
|
+
export let getCategoryKey: (category: any) => string = (cat) => cat?.toString() || '';
|
|
9
|
+
export let getCategoryLabel: (category: any) => string = (cat) => cat?.toString() || '';
|
|
10
|
+
export let filterVisible = true;
|
|
19
11
|
</script>
|
|
20
12
|
|
|
21
13
|
{#if filterVisible && categories.length > 0}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
14
|
+
<div
|
|
15
|
+
class="category-tabs flex shrink-0 gap-0 overflow-x-auto border-b border-border px-2"
|
|
16
|
+
role="tablist"
|
|
17
|
+
>
|
|
18
|
+
{#each categories as category (getCategoryKey(category))}
|
|
19
|
+
{@const isActive = getCategoryKey(activeCategory) === getCategoryKey(category)}
|
|
20
|
+
<button
|
|
21
|
+
type="button"
|
|
22
|
+
tabindex="-1"
|
|
23
|
+
role="tab"
|
|
24
|
+
aria-selected={isActive}
|
|
25
|
+
class="text-label relative shrink-0 rounded-lg px-2 h-8 transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-popover {isActive
|
|
26
|
+
? 'text-foreground after:absolute after:inset-x-2 after:bottom-0 after:h-0.5 after:rounded-full after:bg-brand'
|
|
27
|
+
: 'text-muted-foreground hover:text-foreground'}"
|
|
28
|
+
onclick={() => onCategorySelect(category)}
|
|
29
|
+
>
|
|
30
|
+
{getCategoryLabel(category)}
|
|
31
|
+
</button>
|
|
32
|
+
{/each}
|
|
33
|
+
</div>
|
|
34
|
+
{/if}
|
|
@@ -1,189 +1,155 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
* ItemGrid
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Features:
|
|
6
|
-
* - Displays a grid of items
|
|
7
|
-
* - Infinite scrolling to load more items
|
|
8
|
-
* - Handles item selection
|
|
9
|
-
* - Supports custom item rendering
|
|
10
|
-
* - Optimized with intersection observer
|
|
11
|
-
*
|
|
12
|
-
* `renderItem` may return a plain string (shown as text) or `{ html }`. The `html` is put on the page as it is, so the
|
|
13
|
-
* function that makes it must escape everything that comes from outside (names, addresses): see escapeHtml.
|
|
2
|
+
* ItemGrid — font rows and vector tiles inside Font / Vector pickers.
|
|
3
|
+
* Scrollable grid/list body; lazy-load hooks via observeItem.
|
|
14
4
|
-->
|
|
15
5
|
<script lang="ts">
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
// Renders picker list rows (font) or tile grid (vector) with selection styling.
|
|
7
|
+
import { IconCheck } from '@widgetic/design-system/icons';
|
|
8
|
+
import { escapeHtml } from '../../../utils/htmlSafety';
|
|
9
|
+
import { useEditorLanguage } from '../../../i18n/language';
|
|
19
10
|
|
|
20
|
-
|
|
21
|
-
const { t } = useEditorLanguage();
|
|
22
|
-
|
|
23
|
-
export let items: any[] = [];
|
|
24
|
-
export let containerRef: (node: HTMLElement) => void;
|
|
25
|
-
export let onItemSelect: (item: any) => void;
|
|
26
|
-
export let isItemSelected: (item: any) => boolean;
|
|
27
|
-
export let renderItem: (item: any) => { html: string } | string;
|
|
28
|
-
export let getItemKey: (item: any) => string;
|
|
29
|
-
export let observeItem: ((node: HTMLElement) => { destroy: () => void }) | undefined = undefined;
|
|
30
|
-
export let loadingMore = false;
|
|
31
|
-
export let hasMoreItems = false;
|
|
32
|
-
export let loadNextBatch: () => void;
|
|
33
|
-
export let layoutClass = "grid-cols-1";
|
|
34
|
-
export let itemType: 'vector' | 'font' = 'vector';
|
|
35
|
-
|
|
36
|
-
// Handle scroll to load more items
|
|
37
|
-
function handleScroll(e: Event) {
|
|
38
|
-
const target = e.target as HTMLElement;
|
|
39
|
-
if (
|
|
40
|
-
!loadingMore &&
|
|
41
|
-
hasMoreItems &&
|
|
42
|
-
target.scrollHeight - target.scrollTop <= target.clientHeight + 200
|
|
43
|
-
) {
|
|
44
|
-
loadNextBatch();
|
|
45
|
-
}
|
|
46
|
-
}
|
|
11
|
+
const { t } = useEditorLanguage();
|
|
47
12
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
13
|
+
export let items: any[] = [];
|
|
14
|
+
export let containerRef: (node: HTMLElement) => void;
|
|
15
|
+
export let onItemSelect: (item: any) => void;
|
|
16
|
+
export let isItemSelected: (item: any) => boolean;
|
|
17
|
+
export let renderItem: (item: any) => { html: string } | string;
|
|
18
|
+
export let getItemKey: (item: any) => string;
|
|
19
|
+
export let observeItem: ((node: HTMLElement) => { destroy: () => void }) | undefined = undefined;
|
|
20
|
+
export let loadingMore = false;
|
|
21
|
+
export let hasMoreItems = false;
|
|
22
|
+
export let loadNextBatch: () => void;
|
|
23
|
+
export let layoutClass = 'grid-cols-6';
|
|
24
|
+
export let itemType: 'vector' | 'font' = 'vector';
|
|
25
|
+
|
|
26
|
+
function handleScroll(e: Event) {
|
|
27
|
+
const target = e.target as HTMLElement;
|
|
28
|
+
if (
|
|
29
|
+
!loadingMore &&
|
|
30
|
+
hasMoreItems &&
|
|
31
|
+
target.scrollHeight - target.scrollTop <= target.clientHeight + 200
|
|
32
|
+
) {
|
|
33
|
+
loadNextBatch();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function renderContent(item: any) {
|
|
38
|
+
const rendered = renderItem(item);
|
|
39
|
+
if (typeof rendered === 'string') {
|
|
40
|
+
return `<span>${escapeHtml(rendered)}</span>`;
|
|
41
|
+
}
|
|
42
|
+
if (rendered && typeof rendered === 'object' && 'html' in rendered) {
|
|
43
|
+
return rendered.html;
|
|
44
|
+
}
|
|
45
|
+
return '';
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const vectorTileClass =
|
|
49
|
+
'vector-tile flex size-[52px] shrink-0 cursor-pointer items-center justify-center rounded-xl border bg-background transition-colors duration-fast focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-popover';
|
|
50
|
+
const fontRowClass =
|
|
51
|
+
'font-grid-row flex h-8 w-full cursor-pointer items-center gap-2 rounded-lg px-2 py-1.5 transition-colors duration-fast';
|
|
61
52
|
</script>
|
|
62
53
|
|
|
63
|
-
<div
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
54
|
+
<div
|
|
55
|
+
class="item-grid-scroll flex-1 overflow-y-auto px-4 pb-4"
|
|
56
|
+
use:containerRef
|
|
57
|
+
onscroll={handleScroll}
|
|
67
58
|
>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
59
|
+
<div class="grid {layoutClass} gap-1.5">
|
|
60
|
+
{#each items as item (getItemKey(item))}
|
|
61
|
+
{@const selected = isItemSelected(item)}
|
|
62
|
+
{#if itemType === 'vector'}
|
|
63
|
+
{#if observeItem}
|
|
64
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
65
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
66
|
+
<div
|
|
67
|
+
class="{vectorTileClass} {selected
|
|
68
|
+
? 'border-2 border-brand bg-brand-subtle'
|
|
69
|
+
: 'border-border hover:bg-accent'}"
|
|
70
|
+
onclick={() => onItemSelect(item)}
|
|
71
|
+
use:observeItem
|
|
72
|
+
data-item={getItemKey(item)}
|
|
73
|
+
data-grid-item
|
|
74
|
+
data-item-type="vector"
|
|
75
|
+
role="option"
|
|
76
|
+
aria-selected={selected}
|
|
77
|
+
tabindex="-1"
|
|
78
|
+
>
|
|
79
|
+
<div class="relative flex size-full items-center justify-center overflow-hidden">
|
|
80
|
+
{@html renderContent(item)}
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
{:else}
|
|
84
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
85
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
86
|
+
<div
|
|
87
|
+
class="{vectorTileClass} {selected
|
|
88
|
+
? 'border-2 border-brand bg-brand-subtle'
|
|
89
|
+
: 'border-border hover:bg-accent'}"
|
|
90
|
+
onclick={() => onItemSelect(item)}
|
|
91
|
+
data-item={getItemKey(item)}
|
|
92
|
+
data-grid-item
|
|
93
|
+
data-item-type="vector"
|
|
94
|
+
role="option"
|
|
95
|
+
aria-selected={selected}
|
|
96
|
+
tabindex="-1"
|
|
97
|
+
>
|
|
98
|
+
<div class="relative flex size-full items-center justify-center overflow-hidden">
|
|
99
|
+
{@html renderContent(item)}
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
{/if}
|
|
103
|
+
{:else if observeItem}
|
|
104
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
105
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
106
|
+
<div
|
|
107
|
+
class="{fontRowClass} col-span-full {selected ? 'bg-brand-subtle' : 'hover:bg-accent'}"
|
|
108
|
+
onclick={() => onItemSelect(item)}
|
|
109
|
+
use:observeItem
|
|
110
|
+
data-item={getItemKey(item)}
|
|
111
|
+
data-item-type="font"
|
|
112
|
+
role="option"
|
|
113
|
+
aria-selected={selected}
|
|
114
|
+
tabindex="-1"
|
|
115
|
+
>
|
|
116
|
+
<IconCheck
|
|
117
|
+
class="size-4 shrink-0 stroke-[1.333] {selected
|
|
118
|
+
? 'text-foreground opacity-100'
|
|
119
|
+
: 'opacity-0'}"
|
|
120
|
+
/>
|
|
121
|
+
<div class="min-w-0 flex-1 overflow-hidden">
|
|
122
|
+
{@html renderContent(item)}
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
{:else}
|
|
126
|
+
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
|
127
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
128
|
+
<div
|
|
129
|
+
class="{fontRowClass} col-span-full {selected ? 'bg-brand-subtle' : 'hover:bg-accent'}"
|
|
130
|
+
onclick={() => onItemSelect(item)}
|
|
131
|
+
data-item={getItemKey(item)}
|
|
132
|
+
data-item-type="font"
|
|
133
|
+
role="option"
|
|
134
|
+
aria-selected={selected}
|
|
135
|
+
tabindex="-1"
|
|
136
|
+
>
|
|
137
|
+
<IconCheck
|
|
138
|
+
class="size-4 shrink-0 stroke-[1.333] {selected
|
|
139
|
+
? 'text-foreground opacity-100'
|
|
140
|
+
: 'opacity-0'}"
|
|
141
|
+
/>
|
|
142
|
+
<div class="min-w-0 flex-1 overflow-hidden">
|
|
143
|
+
{@html renderContent(item)}
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
{/if}
|
|
147
|
+
{/each}
|
|
148
|
+
</div>
|
|
153
149
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
150
|
+
{#if loadingMore}
|
|
151
|
+
<div class="py-4 text-center text-caption text-muted-foreground">
|
|
152
|
+
{$t('editor.list.loadingMore')}
|
|
153
|
+
</div>
|
|
154
|
+
{/if}
|
|
159
155
|
</div>
|
|
160
|
-
|
|
161
|
-
<style>
|
|
162
|
-
/* Prevent hover effect on selected items */
|
|
163
|
-
:global(.selected-item:hover) {
|
|
164
|
-
background-color: hsl(var(--sage-green)) !important;
|
|
165
|
-
color: white !important;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/* Ensure text is white in selected items */
|
|
169
|
-
:global(.selected-item) {
|
|
170
|
-
color: white !important;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/* Keep the grid styling for font items */
|
|
174
|
-
:global([data-item-type="font"]) {
|
|
175
|
-
height: 42px !important;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
/* Specific styling for grid font items */
|
|
179
|
-
:global([data-grid-item][data-item-type="font"]) {
|
|
180
|
-
width: 98px !important;
|
|
181
|
-
height: 42px !important;
|
|
182
|
-
border: 2px solid hsl(var(--grey2)) !important;
|
|
183
|
-
border-radius: var(--radius-large) !important;
|
|
184
|
-
display: flex !important;
|
|
185
|
-
align-items: center !important;
|
|
186
|
-
justify-content: center !important;
|
|
187
|
-
padding: 0 !important;
|
|
188
|
-
}
|
|
189
|
-
</style>
|