@widgetic/editor 4.1.14 → 4.1.15
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 +43 -36
- 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 +4 -4
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
import { createEventDispatcher, onDestroy, onMount, tick } from 'svelte';
|
|
43
43
|
import { get, writable } from 'svelte/store';
|
|
44
44
|
import { createWidgeticMediaLibrary, type MediaLibraryProvider } from '@widgetic/file-browser';
|
|
45
|
+
import { Button } from '@widgetic/design-system/components';
|
|
45
46
|
import type { MessageOverrides } from '@widgetic/design-system/i18n';
|
|
46
47
|
import { shareTextDirection, type TextDirection } from '@widgetic/design-system/components/textDirection';
|
|
47
48
|
import { leftOnThisScreen } from '../../utils/dockPlacement';
|
|
@@ -634,43 +635,46 @@
|
|
|
634
635
|
|
|
635
636
|
{#if state.phase === 'failed' && state.loadError}
|
|
636
637
|
<!-- Nothing can be shown behind this one (no composition, so no editor and no preview), so it sits in the middle. -->
|
|
638
|
+
<!-- The notices of the editor (this one, loading, the schemas and the save error) are the cards of the Figma Composition Pages page: radius 12, 16 padding, a 1px border and no shadow. -->
|
|
637
639
|
<div
|
|
638
640
|
role="alert"
|
|
639
|
-
class="composition-editor-error absolute left-1/2 top-1/2 z-30 flex w-max max-w-sm -translate-x-1/2 -translate-y-1/2 flex-col gap-
|
|
641
|
+
class="composition-editor-error absolute left-1/2 top-1/2 z-30 flex w-max max-w-sm -translate-x-1/2 -translate-y-1/2 flex-col gap-3 rounded-xl border border-border bg-background p-4"
|
|
640
642
|
>
|
|
641
|
-
<p class="text-
|
|
642
|
-
<
|
|
643
|
-
|
|
644
|
-
class="retry-load-btn w-fit
|
|
645
|
-
|
|
643
|
+
<p class="text-body text-destructive">{failureMessage(state.loadError, 'load', $t)}</p>
|
|
644
|
+
<Button
|
|
645
|
+
size="sm"
|
|
646
|
+
class="retry-load-btn w-fit"
|
|
647
|
+
onclick={() => {
|
|
646
648
|
void controller.load();
|
|
647
649
|
}}
|
|
648
650
|
>
|
|
649
651
|
{$t('editor.app.tryAgain')}
|
|
650
|
-
</
|
|
652
|
+
</Button>
|
|
651
653
|
</div>
|
|
652
654
|
{:else if state.phase !== 'ready' || state.schemasLoading}
|
|
653
655
|
<div
|
|
654
656
|
role="status"
|
|
655
|
-
class="composition-editor-loading absolute z-30 rounded-
|
|
657
|
+
class="composition-editor-loading absolute z-30 rounded-xl border border-border bg-background px-4 py-3 text-body text-muted-foreground {loadingCardPosition}"
|
|
656
658
|
>
|
|
657
659
|
{$t('editor.app.loading')}
|
|
658
660
|
</div>
|
|
659
661
|
{:else if state.schemasError}
|
|
660
662
|
<div
|
|
661
663
|
role="alert"
|
|
662
|
-
class="composition-editor-error absolute start-4 top-4 z-30 flex max-w-sm flex-col gap-
|
|
664
|
+
class="composition-editor-error absolute start-4 top-4 z-30 flex max-w-sm flex-col gap-3 rounded-xl border border-border bg-background p-4"
|
|
663
665
|
>
|
|
664
|
-
<span class="text-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
666
|
+
<span class="text-body text-destructive">{state.schemasError}</span>
|
|
667
|
+
<!-- Outline, not the main style: the settings panel (when it is back) has the main action of the editor. -->
|
|
668
|
+
<Button
|
|
669
|
+
size="sm"
|
|
670
|
+
variant="outline"
|
|
671
|
+
class="retry-schemas-btn w-fit"
|
|
672
|
+
onclick={() => {
|
|
669
673
|
void controller.reloadSchemas();
|
|
670
674
|
}}
|
|
671
675
|
>
|
|
672
676
|
{$t('editor.app.retry')}
|
|
673
|
-
</
|
|
677
|
+
</Button>
|
|
674
678
|
</div>
|
|
675
679
|
{:else if schemasAvailable}
|
|
676
680
|
<!--
|
|
@@ -712,13 +716,14 @@
|
|
|
712
716
|
person chooses a version. Each choice says what it does to the other version: keeping the edits replaces the newer one, and
|
|
713
717
|
using the newer one drops the edits. (It takes the place of the save error: no save is made while this is on the screen.)
|
|
714
718
|
-->
|
|
719
|
+
<!-- A "Choice Card" of the Figma Composition Pages page, as the card of a teammate editing (see `EditLeaseNotice`). -->
|
|
715
720
|
<div
|
|
716
721
|
role="alert"
|
|
717
|
-
class="composition-editor-conflict absolute bottom-4 start-4 z-30 flex max-w-sm flex-col gap-3 rounded-
|
|
722
|
+
class="composition-editor-conflict absolute bottom-4 start-4 z-30 flex max-w-sm flex-col gap-3 rounded-xl border border-border bg-background p-4"
|
|
718
723
|
>
|
|
719
724
|
<div class="flex flex-col gap-1">
|
|
720
|
-
<p class="text-
|
|
721
|
-
<p class="text-
|
|
725
|
+
<p class="text-body-medium text-foreground">{$t('editor.conflict.title')}</p>
|
|
726
|
+
<p class="text-body text-muted-foreground">
|
|
722
727
|
{#if state.conflict.lastEditedBy?.name}
|
|
723
728
|
{$t('editor.conflict.bodyNamed', { name: state.conflict.lastEditedBy.name })}
|
|
724
729
|
{:else}
|
|
@@ -727,61 +732,63 @@
|
|
|
727
732
|
</p>
|
|
728
733
|
</div>
|
|
729
734
|
{#if state.conflict.resolveError}
|
|
730
|
-
<p class="composition-editor-conflict-error text-
|
|
735
|
+
<p class="composition-editor-conflict-error text-caption text-destructive">
|
|
731
736
|
{state.conflict.resolveError.sessionEnded
|
|
732
737
|
? failureMessage(state.conflict.resolveError, 'save', $t)
|
|
733
738
|
: $t('editor.conflict.resolveFailed')}
|
|
734
739
|
</p>
|
|
735
740
|
{/if}
|
|
736
741
|
{#if state.conflict.resolving}
|
|
737
|
-
<p role="status" class="composition-editor-conflict-working text-
|
|
742
|
+
<p role="status" class="composition-editor-conflict-working text-caption text-muted-foreground">
|
|
738
743
|
{$t('editor.conflict.working')}
|
|
739
744
|
</p>
|
|
740
745
|
{/if}
|
|
741
|
-
<div class="flex flex-col gap-
|
|
746
|
+
<div class="flex flex-col gap-3">
|
|
742
747
|
<div class="flex flex-col items-start gap-1">
|
|
743
|
-
<
|
|
744
|
-
|
|
748
|
+
<Button
|
|
749
|
+
size="sm"
|
|
750
|
+
class="keep-my-changes-btn"
|
|
745
751
|
disabled={state.conflict.resolving}
|
|
746
|
-
|
|
747
|
-
on:click={() => {
|
|
752
|
+
onclick={() => {
|
|
748
753
|
void controller.keepMyChanges();
|
|
749
754
|
}}
|
|
750
755
|
>
|
|
751
756
|
{$t('editor.conflict.keepMine')}
|
|
752
|
-
</
|
|
753
|
-
<span class="text-
|
|
757
|
+
</Button>
|
|
758
|
+
<span class="text-caption text-muted-foreground">{$t('editor.conflict.keepMineHint')}</span>
|
|
754
759
|
</div>
|
|
755
760
|
<div class="flex flex-col items-start gap-1">
|
|
756
|
-
<
|
|
757
|
-
|
|
761
|
+
<Button
|
|
762
|
+
size="sm"
|
|
763
|
+
variant="outline"
|
|
764
|
+
class="load-latest-btn"
|
|
758
765
|
disabled={state.conflict.resolving}
|
|
759
|
-
|
|
760
|
-
on:click={() => {
|
|
766
|
+
onclick={() => {
|
|
761
767
|
void controller.loadLatestVersion();
|
|
762
768
|
}}
|
|
763
769
|
>
|
|
764
770
|
{$t('editor.conflict.loadLatest')}
|
|
765
|
-
</
|
|
766
|
-
<span class="text-
|
|
771
|
+
</Button>
|
|
772
|
+
<span class="text-caption text-muted-foreground">{$t('editor.conflict.loadLatestHint')}</span>
|
|
767
773
|
</div>
|
|
768
774
|
</div>
|
|
769
775
|
</div>
|
|
770
776
|
{:else if state.phase === 'ready' && state.saveError}
|
|
771
777
|
<div
|
|
772
778
|
role="alert"
|
|
773
|
-
class="composition-editor-save-error absolute bottom-4 start-4 z-30 flex max-w-sm flex-col gap-
|
|
779
|
+
class="composition-editor-save-error absolute bottom-4 start-4 z-30 flex max-w-sm flex-col gap-3 rounded-xl border border-border bg-background p-4"
|
|
774
780
|
>
|
|
775
|
-
<p class="text-
|
|
776
|
-
<
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
781
|
+
<p class="text-body text-destructive">{failureMessage(state.saveError, 'save', $t)}</p>
|
|
782
|
+
<Button
|
|
783
|
+
size="sm"
|
|
784
|
+
variant="outline"
|
|
785
|
+
class="retry-save-btn w-fit"
|
|
786
|
+
onclick={() => {
|
|
780
787
|
void controller.save('manual');
|
|
781
788
|
}}
|
|
782
789
|
>
|
|
783
790
|
{$t('editor.app.tryAgain')}
|
|
784
|
-
</
|
|
791
|
+
</Button>
|
|
785
792
|
</div>
|
|
786
793
|
{/if}
|
|
787
794
|
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* `startEditing`); the editor decides what they do. Every word is in the editor's catalog (`editor.presence.*`).
|
|
14
14
|
*/
|
|
15
15
|
import { createEventDispatcher } from 'svelte';
|
|
16
|
+
import { Button } from '@widgetic/design-system/components';
|
|
16
17
|
import { useEditorLanguage } from '../../i18n/language';
|
|
17
18
|
import type { PresenceState } from '../../composition/editLeaseController.js';
|
|
18
19
|
|
|
@@ -60,91 +61,101 @@
|
|
|
60
61
|
|
|
61
62
|
{#if presence.phase === 'blocked'}
|
|
62
63
|
<!-- A choice is waiting, so the settings and the preview are covered until the person makes it. -->
|
|
64
|
+
<!-- The card is the "Choice Card" of the Composition Pages page in Figma: 384 wide, 16 padding, radius 12, a 1px border and no shadow. -->
|
|
63
65
|
<div
|
|
64
|
-
class="composition-editor-presence-veil absolute inset-0 z-30 flex items-center justify-center bg-
|
|
66
|
+
class="composition-editor-presence-veil absolute inset-0 z-30 flex items-center justify-center bg-background/60 p-4"
|
|
65
67
|
>
|
|
66
68
|
<div
|
|
67
69
|
role="alert"
|
|
68
|
-
class="composition-editor-presence flex w-full max-w-sm flex-col gap-3 rounded-
|
|
70
|
+
class="composition-editor-presence flex w-full max-w-sm flex-col gap-3 rounded-xl border border-border bg-background p-4"
|
|
69
71
|
>
|
|
70
72
|
<div class="flex flex-col gap-1">
|
|
71
|
-
<p class="composition-editor-presence-title break-words text-
|
|
73
|
+
<p class="composition-editor-presence-title break-words text-body-medium text-foreground">
|
|
72
74
|
{cardTitle}
|
|
73
75
|
</p>
|
|
74
|
-
<p class="text-
|
|
76
|
+
<p class="text-body text-muted-foreground">{cardBody}</p>
|
|
75
77
|
</div>
|
|
76
78
|
{#if presence.actionFailed}
|
|
77
|
-
<p class="composition-editor-presence-error text-
|
|
79
|
+
<p class="composition-editor-presence-error text-caption text-destructive">
|
|
78
80
|
{$t('editor.presence.actionFailed')}
|
|
79
81
|
</p>
|
|
80
82
|
{/if}
|
|
81
83
|
{#if presence.working}
|
|
82
|
-
<p
|
|
84
|
+
<p
|
|
85
|
+
role="status"
|
|
86
|
+
class="composition-editor-presence-working text-caption text-muted-foreground"
|
|
87
|
+
>
|
|
83
88
|
{$t('editor.presence.working')}
|
|
84
89
|
</p>
|
|
85
90
|
{/if}
|
|
86
|
-
<div class="flex flex-col gap-
|
|
91
|
+
<div class="flex flex-col gap-3">
|
|
87
92
|
<div class="flex flex-col items-start gap-1">
|
|
88
|
-
<
|
|
89
|
-
|
|
93
|
+
<Button
|
|
94
|
+
size="sm"
|
|
95
|
+
class="take-over-btn"
|
|
90
96
|
disabled={presence.working}
|
|
91
|
-
|
|
92
|
-
on:click={() => dispatch('takeOver')}
|
|
97
|
+
onclick={() => dispatch('takeOver')}
|
|
93
98
|
>
|
|
94
99
|
{$t('editor.presence.takeOver')}
|
|
95
|
-
</
|
|
96
|
-
<span class="text-
|
|
100
|
+
</Button>
|
|
101
|
+
<span class="text-caption text-muted-foreground"
|
|
102
|
+
>{$t('editor.presence.takeOverHint')}</span
|
|
103
|
+
>
|
|
97
104
|
</div>
|
|
98
105
|
<div class="flex flex-col items-start gap-1">
|
|
99
|
-
<
|
|
100
|
-
|
|
106
|
+
<Button
|
|
107
|
+
size="sm"
|
|
108
|
+
variant="outline"
|
|
109
|
+
class="look-only-btn"
|
|
101
110
|
disabled={presence.working}
|
|
102
|
-
|
|
103
|
-
on:click={() => dispatch('lookOnly')}
|
|
111
|
+
onclick={() => dispatch('lookOnly')}
|
|
104
112
|
>
|
|
105
113
|
{$t('editor.presence.lookOnly')}
|
|
106
|
-
</
|
|
107
|
-
<span class="text-
|
|
114
|
+
</Button>
|
|
115
|
+
<span class="text-caption text-muted-foreground"
|
|
116
|
+
>{$t('editor.presence.lookOnlyHint')}</span
|
|
117
|
+
>
|
|
108
118
|
</div>
|
|
109
119
|
</div>
|
|
110
120
|
</div>
|
|
111
121
|
</div>
|
|
112
122
|
{:else if presence.phase === 'readOnly'}
|
|
123
|
+
<!-- The bar is the "Presence Bar" of the Composition Pages page in Figma: radius 12, a 1px border, 16 at the start and 8 at the end. -->
|
|
113
124
|
<div
|
|
114
125
|
role="status"
|
|
115
|
-
class="composition-editor-presence-bar absolute bottom-4 left-1/2 z-30 flex w-max max-w-[calc(100%-2rem)] -translate-x-1/2 flex-wrap items-center justify-center gap-x-3 gap-y-1 rounded-
|
|
126
|
+
class="composition-editor-presence-bar absolute bottom-4 left-1/2 z-30 flex w-max max-w-[calc(100%-2rem)] -translate-x-1/2 flex-wrap items-center justify-center gap-x-3 gap-y-1 rounded-xl border border-border bg-background py-2 pe-2 ps-4"
|
|
116
127
|
>
|
|
117
|
-
<span class="composition-editor-presence-bar-text break-words text-
|
|
128
|
+
<span class="composition-editor-presence-bar-text break-words text-body text-foreground"
|
|
118
129
|
>{barText}</span
|
|
119
130
|
>
|
|
120
131
|
{#if presence.actionFailed}
|
|
121
|
-
<span class="composition-editor-presence-error text-
|
|
132
|
+
<span class="composition-editor-presence-error text-caption text-destructive">
|
|
122
133
|
{$t('editor.presence.actionFailed')}
|
|
123
134
|
</span>
|
|
124
135
|
{/if}
|
|
125
136
|
{#if presence.working}
|
|
126
|
-
<span class="composition-editor-presence-working text-
|
|
137
|
+
<span class="composition-editor-presence-working text-caption text-muted-foreground">
|
|
127
138
|
{$t('editor.presence.working')}
|
|
128
139
|
</span>
|
|
129
140
|
{/if}
|
|
130
141
|
{#if presence.nobodyIsEditing}
|
|
131
|
-
<
|
|
132
|
-
|
|
142
|
+
<Button
|
|
143
|
+
size="sm"
|
|
144
|
+
class="start-editing-btn"
|
|
133
145
|
disabled={presence.working}
|
|
134
|
-
|
|
135
|
-
on:click={() => dispatch('startEditing')}
|
|
146
|
+
onclick={() => dispatch('startEditing')}
|
|
136
147
|
>
|
|
137
148
|
{$t('editor.presence.startEditing')}
|
|
138
|
-
</
|
|
149
|
+
</Button>
|
|
139
150
|
{:else}
|
|
140
|
-
<
|
|
141
|
-
|
|
151
|
+
<Button
|
|
152
|
+
size="sm"
|
|
153
|
+
class="take-over-btn"
|
|
142
154
|
disabled={presence.working}
|
|
143
|
-
|
|
144
|
-
on:click={() => dispatch('takeOver')}
|
|
155
|
+
onclick={() => dispatch('takeOver')}
|
|
145
156
|
>
|
|
146
157
|
{$t('editor.presence.takeOver')}
|
|
147
|
-
</
|
|
158
|
+
</Button>
|
|
148
159
|
{/if}
|
|
149
160
|
</div>
|
|
150
161
|
{/if}
|