@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.
Files changed (76) hide show
  1. package/dist/components/PreviewChromeControls.svelte +15 -21
  2. package/dist/components/WidgetPreview.svelte +136 -105
  3. package/dist/components/color-select/ColorSelect.svelte +203 -224
  4. package/dist/components/color-select/constants.d.ts +4 -2
  5. package/dist/components/color-select/constants.js +4 -2
  6. package/dist/components/color-select/render.js +10 -9
  7. package/dist/components/editors/CompositionEditorApp.svelte +47 -40
  8. package/dist/components/editors/EditLeaseNotice.svelte +44 -33
  9. package/dist/components/editors/EmbedEditor.svelte +133 -259
  10. package/dist/components/editors/PropsEditor.svelte +418 -1338
  11. package/dist/components/editors/props-editor.css +5 -68
  12. package/dist/components/ic/AngleInputController.svelte +202 -277
  13. package/dist/components/ic/BrowserInputController.svelte +813 -803
  14. package/dist/components/ic/CheckboxInputController.svelte +92 -169
  15. package/dist/components/ic/CheckboxInputController.svelte.d.ts +2 -8
  16. package/dist/components/ic/ColorPickerInputController.svelte +1589 -1587
  17. package/dist/components/ic/ColorPickerInputController.svelte.d.ts +3 -3
  18. package/dist/components/ic/DateFieldInputController.svelte +455 -465
  19. package/dist/components/ic/DatePickerInputController.svelte +355 -368
  20. package/dist/components/ic/DatePickerInputController.svelte.d.ts +1 -1
  21. package/dist/components/ic/DropdownInputController.svelte +130 -200
  22. package/dist/components/ic/FixedPositionInputController.svelte +255 -276
  23. package/dist/components/ic/FixedPositionInputController.svelte.d.ts +5 -1
  24. package/dist/components/ic/FontInputController.svelte +2110 -2231
  25. package/dist/components/ic/FontInputController.svelte.d.ts +11 -11
  26. package/dist/components/ic/InputControllerHeader.svelte +141 -147
  27. package/dist/components/ic/InputControllerRow.svelte +74 -0
  28. package/dist/components/ic/InputControllerRow.svelte.d.ts +14 -0
  29. package/dist/components/ic/KnowledgeDocumentsInputController.svelte +84 -47
  30. package/dist/components/ic/KnowledgeTextForm.svelte +35 -33
  31. package/dist/components/ic/NumberControls.svelte +303 -269
  32. package/dist/components/ic/NumberControls.svelte.d.ts +4 -1
  33. package/dist/components/ic/NumberInputController.svelte +361 -301
  34. package/dist/components/ic/NumberInputController.svelte.d.ts +2 -0
  35. package/dist/components/ic/PositionInputController.svelte +253 -176
  36. package/dist/components/ic/PositionInputController.svelte.d.ts +2 -0
  37. package/dist/components/ic/RadioGroupInputController.svelte +71 -137
  38. package/dist/components/ic/RadioGroupInputController.svelte.d.ts +2 -8
  39. package/dist/components/ic/RangeCalendarInputController.svelte +233 -270
  40. package/dist/components/ic/RangeCalendarInputController.svelte.d.ts +2 -2
  41. package/dist/components/ic/RoundedCornersInputController.svelte +412 -435
  42. package/dist/components/ic/RoundedCornersInputController.svelte.d.ts +2 -0
  43. package/dist/components/ic/SliderInputController.svelte +263 -332
  44. package/dist/components/ic/SliderInputController.svelte.d.ts +1 -1
  45. package/dist/components/ic/SliderRangeInputController.svelte +140 -144
  46. package/dist/components/ic/SliderRangeInputController.svelte.d.ts +3 -3
  47. package/dist/components/ic/SwitchInputController.svelte +47 -109
  48. package/dist/components/ic/TagsInputController.svelte +95 -110
  49. package/dist/components/ic/TextAreaInputController.svelte +1794 -1935
  50. package/dist/components/ic/TextAreaPreviewInputController.svelte +436 -438
  51. package/dist/components/ic/TextAreaPreviewInputController.svelte.d.ts +2 -2
  52. package/dist/components/ic/TextInputController.svelte +65 -75
  53. package/dist/components/ic/TextInputController.svelte.d.ts +2 -0
  54. package/dist/components/ic/TimeInputController.svelte +433 -431
  55. package/dist/components/ic/VectorInputController.svelte +1833 -1831
  56. package/dist/components/ic/VectorInputController.svelte.d.ts +10 -10
  57. package/dist/components/ic/index.d.ts +1 -0
  58. package/dist/components/ic/index.js +1 -0
  59. package/dist/components/ic/shared/CategoryTabs.svelte +28 -35
  60. package/dist/components/ic/shared/ItemGrid.svelte +145 -179
  61. package/dist/components/ic/shared/RecentItemsSection.svelte +208 -271
  62. package/dist/components/ic/shared/RecentItemsSection.svelte.d.ts +1 -1
  63. package/dist/components/ui/arrows/OpacitySliderArrows.svelte +23 -38
  64. package/dist/components/ui/arrows/OpacitySliderArrows.svelte.d.ts +1 -4
  65. package/dist/components/ui/calendar-editor-fit/EditorCalendarStyles.svelte +45 -0
  66. package/dist/components/ui/calendar-editor-fit/EditorCalendarStyles.svelte.d.ts +26 -0
  67. package/dist/components/ui/checkerboard-background/CheckerboardBackground.svelte +20 -12
  68. package/dist/components/ui/shadow-picker-host/ShadowPickerHost.svelte +39 -0
  69. package/dist/components/ui/shadow-picker-host/ShadowPickerHost.svelte.d.ts +10 -0
  70. package/dist/i18n/language.d.ts +44 -281
  71. package/dist/i18n/messages.d.ts +41 -34
  72. package/dist/i18n/messages.js +47 -34
  73. package/dist/i18n/translate.d.ts +1 -1
  74. package/dist/utils.d.ts +7 -0
  75. package/dist/utils.js +26 -2
  76. package/package.json +5 -5
@@ -36,17 +36,17 @@ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> =
36
36
  }
37
37
  declare const FontInputController: $$__sveltets_2_IsomorphicComponent<{
38
38
  /**
39
- * Component Props
40
- * @prop {string} label - Display label for the font selector
41
- * @prop {string} value - Currently selected font family
42
- * @prop {Function} onChange - Callback when font selection changes
43
- * @prop {InputControllerConfig} config - Configuration options
44
- * @prop {string} description - Optional help text
45
- * @prop {string} controllerId - Unique identifier for this controller
46
- * @prop {any} openDropdowns - Store tracking open dropdown states
47
- * @prop {Function} toggleDropdown - Function to toggle dropdown state
48
- * @prop {Function} onFocus - Optional focus handler
49
- */ label?: FontInputControllerProps["label"];
39
+ * Component Props
40
+ * @prop {string} label - Display label for the font selector
41
+ * @prop {string} value - Currently selected font family
42
+ * @prop {Function} onChange - Callback when font selection changes
43
+ * @prop {InputControllerConfig} config - Configuration options
44
+ * @prop {string} description - Optional help text
45
+ * @prop {string} controllerId - Unique identifier for this controller
46
+ * @prop {any} openDropdowns - Store tracking open dropdown states
47
+ * @prop {Function} toggleDropdown - Function to toggle dropdown state
48
+ * @prop {Function} onFocus - Optional focus handler
49
+ */ label?: FontInputControllerProps["label"];
50
50
  class?: string;
51
51
  style?: FontInputControllerProps["style"];
52
52
  value?: FontInputControllerProps["value"];
@@ -1,154 +1,148 @@
1
1
  <script lang="ts">
2
- // Svelte imports
3
- import { onDestroy, onMount } from 'svelte';
4
-
5
- // Shared listener for "the user is scrolling" (one per tree, not one per header)
6
- import { onScrollActivity } from '../../utils/scrollActivity';
7
-
8
- // Shadcn UI Components from design-system
9
- import { Tooltip, Portal } from '@widgetic/design-system/components';
10
- // console.log("InputControllerHeader - Tooltip:", Tooltip);
11
-
12
- // Lucide Icons from design-system
13
- import { Info } from '@widgetic/design-system/icons';
14
-
15
- // The way the screen is read: the tip opens at the end of the line, beside the icon
16
- import { sideAtEnd, useTextDirection } from '@widgetic/design-system/components/textDirection';
17
- const textDirection = useTextDirection();
18
-
19
- // Component props
20
- let className = '';
21
- export { className as class };
22
- export let style = '';
23
- //
24
- export let label: string;
25
- export let helpText: string | undefined = undefined;
26
-
27
- let showHelp = false;
28
- let showInfoIcon = false;
29
- let isScrolling = false;
30
- let isHovering = false;
31
- let tooltipTimeout: ReturnType<typeof setTimeout>;
32
-
33
- // Global scroll handler
34
- function handleScroll() {
35
- showHelp = false;
36
- isScrolling = true;
37
- clearTimeout(scrollTimeout);
38
- clearTimeout(tooltipTimeout);
39
- scrollTimeout = setTimeout(() => {
40
- isScrolling = false;
41
- // If we're still hovering when scroll stops, show the tooltip
42
- if (isHovering) {
43
- showHelp = true;
44
- }
45
- }, 150);
46
- }
47
-
48
- let scrollTimeout: ReturnType<typeof setTimeout>;
49
-
50
- function handleMouseEnter() {
51
- isHovering = true;
52
- clearTimeout(tooltipTimeout);
53
-
54
- // Add buffer time for tooltip only
55
- tooltipTimeout = setTimeout(() => {
56
- if (isHovering && !isScrolling) {
57
- showHelp = true;
58
- }
59
- }, 500); // 500ms delay for tooltip
60
- }
61
-
62
- function handleMouseLeave() {
63
- isHovering = false;
64
- showHelp = false;
65
- clearTimeout(tooltipTimeout);
66
- }
67
-
68
- let headerElement: HTMLElement | undefined;
69
- let stopListeningForScrolling: () => void = () => {};
70
-
71
- onMount(() => {
72
- // The listeners for scrolling are shared by all the headers in the same tree (the page or the module's shadow
73
- // root): every header used to add three of its own to the window and the document.
74
- stopListeningForScrolling = onScrollActivity(headerElement, handleScroll);
75
- });
76
-
77
- onDestroy(() => {
78
- stopListeningForScrolling();
79
- clearTimeout(scrollTimeout);
80
- clearTimeout(tooltipTimeout);
81
- });
2
+ // Svelte imports
3
+ import { onDestroy, onMount } from 'svelte';
4
+
5
+ // Shared listener for "the user is scrolling" (one per tree, not one per header)
6
+ import { onScrollActivity } from '../../utils/scrollActivity';
7
+
8
+ // Shadcn UI Components from design-system
9
+ import { Tooltip, Portal } from '@widgetic/design-system/components';
10
+ // console.log("InputControllerHeader - Tooltip:", Tooltip);
11
+
12
+ // Tabler icon from design-system (the Figma Panel rows show a circled question mark next to the label)
13
+ import { IconHelpCircle } from '@widgetic/design-system/icons';
14
+
15
+ // The way the screen is read: the tip opens at the end of the line, beside the icon
16
+ import { sideAtEnd, useTextDirection } from '@widgetic/design-system/components/textDirection';
17
+ const textDirection = useTextDirection();
18
+
19
+ // Component props
20
+ let className = '';
21
+ export { className as class };
22
+ export let style = '';
23
+ //
24
+ export let label: string;
25
+ export let helpText: string | undefined = undefined;
26
+
27
+ let showHelp = false;
28
+ let showInfoIcon = false;
29
+ let isScrolling = false;
30
+ let isHovering = false;
31
+ let tooltipTimeout: ReturnType<typeof setTimeout>;
32
+
33
+ // Global scroll handler
34
+ function handleScroll() {
35
+ showHelp = false;
36
+ isScrolling = true;
37
+ clearTimeout(scrollTimeout);
38
+ clearTimeout(tooltipTimeout);
39
+ scrollTimeout = setTimeout(() => {
40
+ isScrolling = false;
41
+ // If we're still hovering when scroll stops, show the tooltip
42
+ if (isHovering) {
43
+ showHelp = true;
44
+ }
45
+ }, 150);
46
+ }
47
+
48
+ let scrollTimeout: ReturnType<typeof setTimeout>;
49
+
50
+ function handleMouseEnter() {
51
+ isHovering = true;
52
+ clearTimeout(tooltipTimeout);
53
+
54
+ // Add buffer time for tooltip only
55
+ tooltipTimeout = setTimeout(() => {
56
+ if (isHovering && !isScrolling) {
57
+ showHelp = true;
58
+ }
59
+ }, 500); // 500ms delay for tooltip
60
+ }
61
+
62
+ function handleMouseLeave() {
63
+ isHovering = false;
64
+ showHelp = false;
65
+ clearTimeout(tooltipTimeout);
66
+ }
67
+
68
+ let headerElement: HTMLElement | undefined;
69
+ let stopListeningForScrolling: () => void = () => {};
70
+
71
+ onMount(() => {
72
+ // The listeners for scrolling are shared by all the headers in the same tree (the page or the module's shadow
73
+ // root): every header used to add three of its own to the window and the document.
74
+ stopListeningForScrolling = onScrollActivity(headerElement, handleScroll);
75
+ });
76
+
77
+ onDestroy(() => {
78
+ stopListeningForScrolling();
79
+ clearTimeout(scrollTimeout);
80
+ clearTimeout(tooltipTimeout);
81
+ });
82
82
  </script>
83
83
 
84
- <div bind:this={headerElement} class="input-controller-header widgetic-colors {className ? className + ' ' : ''}flex group" {style}>
85
- <div class="header-label-ct flex-1 min-w-0 flex items-center h-full">
86
- <div class="tooltip-group flex items-center max-w-full" style="gap: 8px;">
87
- <span class="subtext cursor-default select-none truncate !text-base" style="color: hsl(var(--grey5));">
88
- {label}
89
- </span>
90
- {#if helpText}
91
- <Tooltip.Provider>
92
- <Tooltip.Root open={showHelp && !isScrolling}>
93
- <Tooltip.Trigger
94
- tabindex={-1}
95
- class="focus:outline-none select-none w-5 cursor-default flex items-center"
96
- >
97
- <!-- svelte-ignore a11y_no_static_element_interactions -->
98
- <span
99
- class="inline-flex items-center transition-opacity duration-500"
100
- class:opacity-0={!isHovering}
101
- class:opacity-100={isHovering}
102
- class:cursor-help={!isScrolling}
103
- onmouseenter={handleMouseEnter}
104
- onmouseleave={handleMouseLeave}
105
- >
106
- <Info class="w-5 h-5 transition-colors" style="color: hsl(var(--sage-green));" />
107
- </span>
108
- </Tooltip.Trigger>
109
-
110
- {#if showHelp && !isScrolling}
111
- <Portal target="editor-tooltips">
112
- <Tooltip.Content
113
- side={sideAtEnd($textDirection)}
114
- sideOffset={5}
115
- align="center"
116
- alignOffset={-1}
117
- class="widgetic-colors tooltip-content fixed rounded-md px-3 py-1.5 shadow-md select-none whitespace-nowrap"
118
- style="background: hsl(var(--dark)); color: white; z-index: 99999;"
119
- >
120
- <p class="caption text-white">{helpText}</p>
121
- </Tooltip.Content>
122
- </Portal>
123
- {/if}
124
- </Tooltip.Root>
125
- </Tooltip.Provider>
126
- {/if}
127
- </div>
128
- </div>
84
+ <!--
85
+ The label of an input controller row (Figma: the label column of the "IC Row" on the Editor page, 185 wide, Body text in
86
+ foreground, with the help icon next to it in muted-foreground). The help icon appears while the label is hovered and
87
+ opens a tip at the end of the line.
88
+ -->
89
+ <div
90
+ bind:this={headerElement}
91
+ class="input-controller-header group flex min-h-9 items-center {className ? className + ' ' : ''}"
92
+ {style}
93
+ >
94
+ <div class="header-label-ct flex h-full min-w-0 flex-1 items-center">
95
+ <div class="tooltip-group flex min-w-0 max-w-full items-center gap-2">
96
+ <span class="subtext text-body text-foreground cursor-default truncate select-none">
97
+ {label}
98
+ </span>
99
+ {#if helpText}
100
+ <Tooltip.Provider>
101
+ <Tooltip.Root open={showHelp && !isScrolling}>
102
+ <Tooltip.Trigger
103
+ tabindex={-1}
104
+ class="flex size-4 shrink-0 cursor-default items-center select-none focus:outline-none"
105
+ >
106
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
107
+ <span
108
+ class="help-icon-reveal inline-flex items-center duration-slow transition-opacity"
109
+ class:opacity-0={!isHovering}
110
+ class:opacity-100={isHovering}
111
+ class:cursor-help={!isScrolling}
112
+ onmouseenter={handleMouseEnter}
113
+ onmouseleave={handleMouseLeave}
114
+ >
115
+ <IconHelpCircle class="size-4 stroke-[1.333] text-muted-foreground" />
116
+ </span>
117
+ </Tooltip.Trigger>
118
+
119
+ {#if showHelp && !isScrolling}
120
+ <Portal target="editor-tooltips">
121
+ <Tooltip.Content
122
+ side={sideAtEnd($textDirection)}
123
+ sideOffset={5}
124
+ align="center"
125
+ alignOffset={-1}
126
+ class="tooltip-content pointer-events-none fixed whitespace-nowrap select-none"
127
+ style="z-index: 99999;"
128
+ >
129
+ <p class="text-caption">{helpText}</p>
130
+ </Tooltip.Content>
131
+ </Portal>
132
+ {/if}
133
+ </Tooltip.Root>
134
+ </Tooltip.Provider>
135
+ {/if}
136
+ </div>
137
+ </div>
129
138
  </div>
130
139
 
131
140
  <style>
132
- /* Ensure consistent height and alignment */
133
- :global(.input-controller-header) {
134
- min-height: 48px !important;
135
- display: flex !important;
136
- align-items: center !important;
137
- }
138
-
139
- :global(.input-controller-header:focus-within), :global(.info-bt:focus-within) {
140
- outline: none !important;
141
- }
142
- .tooltip-group:hover :global(.opacity-0) {
143
- opacity: 1 !important;
144
- }
145
-
146
- /* Simplified tooltip styles */
147
- :global(.tooltip-content) {
148
- background-color: hsl(var(--dark));
149
- color: white;
150
- pointer-events: none;
151
- box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
152
- }
141
+ /* The help icon shows as soon as the pointer is over the label or the icon (the opacity classes above come from the
142
+ hover state of the icon itself, this rule widens it to the whole label group) */
143
+ @media (hover: hover) {
144
+ .tooltip-group:hover .help-icon-reveal {
145
+ opacity: 1;
146
+ }
147
+ }
153
148
  </style>
154
-
@@ -0,0 +1,74 @@
1
+ <!--
2
+ InputControllerRow
3
+
4
+ The row every input controller of the panel sits in. Mirrors the "IC Row" of the Editor page in Figma (node ids in
5
+ /tmp/design-system-state-widgetic-dash-001.json -> editorScreens): label on the left, control on the right, 370 wide
6
+ (label 185 + control 185), controls 36 high on a 48 pitch. A control taller than one line (a text area preview, the
7
+ position pad, a radio group, ...) starts at the top of the row and the label stays centred on its first line.
8
+
9
+ Usage:
10
+ <InputControllerRow {label} {helpText} {description}>
11
+ <Input ... />
12
+ </InputControllerRow>
13
+
14
+ Props
15
+ label the label (already translated). Without a label the row is "headless": only the control is rendered, for a host that
16
+ draws the label itself (the panel does: it passes no label to the controllers)
17
+ helpText optional tip shown from the help icon next to the label
18
+ description optional line under the row (caption, muted)
19
+ class extra classes of the row
20
+ controlClass extra classes of the control column (the column is `w-editor-control`, 185)
21
+ -->
22
+ <script lang="ts">
23
+ import type { Snippet } from 'svelte';
24
+ import InputControllerHeader from './InputControllerHeader.svelte';
25
+
26
+ let {
27
+ label,
28
+ helpText = undefined,
29
+ description = undefined,
30
+ class: className = '',
31
+ headerColumnClass = '',
32
+ controlClass = '',
33
+ dataState = undefined,
34
+ children
35
+ }: {
36
+ label?: string;
37
+ helpText?: string;
38
+ description?: string;
39
+ class?: string;
40
+ headerColumnClass?: string;
41
+ controlClass?: string;
42
+ dataState?: 'open' | 'closed';
43
+ children?: Snippet;
44
+ } = $props();
45
+ </script>
46
+
47
+ {#if label}
48
+ <div
49
+ class="input-controller-row flex w-full flex-col gap-1 py-1.5 {className}"
50
+ data-state={dataState}
51
+ >
52
+ <div class="flex w-full items-start justify-between">
53
+ <div class="ic-header-ct w-editor-control min-w-0 shrink-0 {headerColumnClass}">
54
+ <InputControllerHeader {label} {helpText} class="h-9" />
55
+ </div>
56
+ <div
57
+ class="ic-input-ct input-controller-row-control w-editor-control shrink-0 {controlClass}"
58
+ >
59
+ {@render children?.()}
60
+ </div>
61
+ </div>
62
+ {#if description}
63
+ <p class="text-caption text-muted-foreground">{description}</p>
64
+ {/if}
65
+ </div>
66
+ {:else}
67
+ <!-- Headless: the host (the panel) draws the label column and gives this control its column, so only the control is rendered. -->
68
+ <div class="input-controller-row w-full {className}">
69
+ {@render children?.()}
70
+ {#if description}
71
+ <p class="text-caption text-muted-foreground">{description}</p>
72
+ {/if}
73
+ </div>
74
+ {/if}
@@ -0,0 +1,14 @@
1
+ import type { Snippet } from 'svelte';
2
+ type $$ComponentProps = {
3
+ label?: string;
4
+ helpText?: string;
5
+ description?: string;
6
+ class?: string;
7
+ headerColumnClass?: string;
8
+ controlClass?: string;
9
+ dataState?: 'open' | 'closed';
10
+ children?: Snippet;
11
+ };
12
+ declare const InputControllerRow: import("svelte").Component<$$ComponentProps, {}, "">;
13
+ type InputControllerRow = ReturnType<typeof InputControllerRow>;
14
+ export default InputControllerRow;