@widgetic/creator 0.4.27 → 0.4.29
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/CreatorApp.svelte +314 -80
- package/dist/components/BrandKitPanel.svelte +2 -0
- package/dist/components/DesignQuickEdit.svelte +40 -10
- package/dist/components/HoverTooltip.svelte +1 -1
- package/dist/components/WidgetDetails.svelte +40 -9
- package/dist/components/WidgetElementSelector.svelte +15 -10
- package/dist/components/WidgetShapeLivePreviews.svelte +116 -4
- package/dist/components/WidgetShapeLivePreviews.svelte.d.ts +3 -1
- package/dist/i18n/language.d.ts +5 -4
- package/dist/i18n/messages.d.ts +2 -1
- package/dist/i18n/messages.js +2 -1
- package/dist/i18n/statusText.js +1 -0
- package/dist/utils/failureNotice.d.ts +38 -0
- package/dist/utils/failureNotice.js +45 -0
- package/package.json +1 -1
package/dist/i18n/messages.d.ts
CHANGED
|
@@ -335,6 +335,7 @@ export declare const CREATOR_MESSAGES: {
|
|
|
335
335
|
readonly 'creator.status.preparingCodeGeneration': "Preparing code generation...";
|
|
336
336
|
readonly 'creator.status.ready': "Ready";
|
|
337
337
|
readonly 'creator.status.completedPreviewReady': "Code generation completed! Preview ready.";
|
|
338
|
+
readonly 'creator.status.generationCompletePreviewReady': "Generation complete (100%) · Preview ready";
|
|
338
339
|
readonly 'creator.status.completedAutoSaving': "Code generation completed! Auto-saving...";
|
|
339
340
|
readonly 'creator.status.completedSaved': "Code generation completed! Saved to GitLab.";
|
|
340
341
|
readonly 'creator.status.completedChangesSaved': "Code generation completed! Changes saved to GitLab.";
|
|
@@ -537,7 +538,7 @@ export declare const CREATOR_MESSAGES: {
|
|
|
537
538
|
readonly 'creator.elementSelector.parentChild': "parent/child";
|
|
538
539
|
readonly 'creator.elementSelector.hold': "Hold";
|
|
539
540
|
readonly 'creator.elementSelector.cmdCtrl': "⌘/Ctrl";
|
|
540
|
-
readonly 'creator.elementSelector.toInteract': "to
|
|
541
|
+
readonly 'creator.elementSelector.toInteract': "to move";
|
|
541
542
|
readonly 'creator.elementSelector.esc': "Esc";
|
|
542
543
|
readonly 'creator.elementSelector.done': "done";
|
|
543
544
|
};
|
package/dist/i18n/messages.js
CHANGED
|
@@ -348,6 +348,7 @@ export const CREATOR_MESSAGES = {
|
|
|
348
348
|
'creator.status.preparingCodeGeneration': 'Preparing code generation...',
|
|
349
349
|
'creator.status.ready': 'Ready',
|
|
350
350
|
'creator.status.completedPreviewReady': 'Code generation completed! Preview ready.',
|
|
351
|
+
'creator.status.generationCompletePreviewReady': 'Generation complete (100%) · Preview ready',
|
|
351
352
|
'creator.status.completedAutoSaving': 'Code generation completed! Auto-saving...',
|
|
352
353
|
'creator.status.completedSaved': 'Code generation completed! Saved to GitLab.',
|
|
353
354
|
'creator.status.completedChangesSaved': 'Code generation completed! Changes saved to GitLab.',
|
|
@@ -561,7 +562,7 @@ export const CREATOR_MESSAGES = {
|
|
|
561
562
|
'creator.elementSelector.parentChild': 'parent/child',
|
|
562
563
|
'creator.elementSelector.hold': 'Hold',
|
|
563
564
|
'creator.elementSelector.cmdCtrl': '⌘/Ctrl',
|
|
564
|
-
'creator.elementSelector.toInteract': 'to
|
|
565
|
+
'creator.elementSelector.toInteract': 'to move',
|
|
565
566
|
'creator.elementSelector.esc': 'Esc',
|
|
566
567
|
'creator.elementSelector.done': 'done',
|
|
567
568
|
};
|
package/dist/i18n/statusText.js
CHANGED
|
@@ -3,6 +3,7 @@ const KNOWN_TEXTS = new Map([
|
|
|
3
3
|
['Ready', (t) => t('creator.status.ready')],
|
|
4
4
|
['Missing reference image', (t) => t('creator.codegen.missingReferenceImage')],
|
|
5
5
|
['Code generation completed! Preview ready.', (t) => t('creator.status.completedPreviewReady')],
|
|
6
|
+
['Generation complete (100%) · Preview ready', (t) => t('creator.status.generationCompletePreviewReady')],
|
|
6
7
|
['Code generation completed! Auto-saving...', (t) => t('creator.status.completedAutoSaving')],
|
|
7
8
|
['Code generation completed! Saved to GitLab.', (t) => t('creator.status.completedSaved')],
|
|
8
9
|
['Code generation completed! Changes saved to GitLab.', (t) => t('creator.status.completedChangesSaved')],
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* failureNotice: when the status area of a panel has to be drawn again because a generation failed.
|
|
3
|
+
*
|
|
4
|
+
* A panel draws its status area from a display state that is read again only when `panelDisplayRevision` moves (see
|
|
5
|
+
* `CreatorApp.svelte`). A progress line ("Generating code 40%") is patched in without moving it, on purpose: each tick used to
|
|
6
|
+
* rebuild everything that reads the panel's snapshot, the open chat included. That is right for progress and wrong for the one
|
|
7
|
+
* status that is not progress, the failure notice. A generation that failed, or that the gateway refused (no credits, over the
|
|
8
|
+
* budget), patched `lastGenerationFailed` and `lastGenerationError` the same way, so the screen kept the display state it had:
|
|
9
|
+
* the status line read "Status: ❌ ..." with no "Generation Failed" in red, and the note with the message and its Retry or Upgrade
|
|
10
|
+
* button never came up, although the chat told the visitor the generation had failed. Dismissing the note had the same trouble
|
|
11
|
+
* and moves the revision by hand (the "Dismiss" button); this is the rule for the patches that raise or clear the notice.
|
|
12
|
+
*
|
|
13
|
+
* What counts is what the notice shows, nothing else: a patch moves the revision when it changes the flag or the message, and
|
|
14
|
+
* never for a status text alone, so progress still costs nothing and a patch that repeats what is shown (a new generation
|
|
15
|
+
* clearing a notice that is already clear) does not rebuild anything.
|
|
16
|
+
*
|
|
17
|
+
* Kept free of Svelte and of the page so the rule is testable without a DOM.
|
|
18
|
+
*/
|
|
19
|
+
/** What a panel shows of a failed generation: the red "Generation Failed" line, and the note under it that carries the message. */
|
|
20
|
+
export interface FailureNotice {
|
|
21
|
+
lastGenerationFailed: boolean;
|
|
22
|
+
lastGenerationError: string | null;
|
|
23
|
+
}
|
|
24
|
+
/** A panel's state, or a patch to it, as far as the notice goes: a key that is not there is not said. */
|
|
25
|
+
export type FailureNoticeSource = Partial<{
|
|
26
|
+
lastGenerationFailed: boolean | null;
|
|
27
|
+
lastGenerationError: string | null;
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* The notice a panel state shows. A state with no flag is not failed, and a missing or empty message is no message (an empty
|
|
31
|
+
* note and no note read the same on the screen, so they are the same here).
|
|
32
|
+
*/
|
|
33
|
+
export declare function readFailureNotice(source: FailureNoticeSource | null | undefined): FailureNotice;
|
|
34
|
+
/**
|
|
35
|
+
* Whether applying `patch` to a panel that shows `shown` changes what the notice shows. A key the patch leaves out stays as it
|
|
36
|
+
* is, and a patch with no key of the notice (a progress line) never changes it.
|
|
37
|
+
*/
|
|
38
|
+
export declare function failureNoticeChanges(shown: FailureNoticeSource | null | undefined, patch: FailureNoticeSource): boolean;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* failureNotice: when the status area of a panel has to be drawn again because a generation failed.
|
|
3
|
+
*
|
|
4
|
+
* A panel draws its status area from a display state that is read again only when `panelDisplayRevision` moves (see
|
|
5
|
+
* `CreatorApp.svelte`). A progress line ("Generating code 40%") is patched in without moving it, on purpose: each tick used to
|
|
6
|
+
* rebuild everything that reads the panel's snapshot, the open chat included. That is right for progress and wrong for the one
|
|
7
|
+
* status that is not progress, the failure notice. A generation that failed, or that the gateway refused (no credits, over the
|
|
8
|
+
* budget), patched `lastGenerationFailed` and `lastGenerationError` the same way, so the screen kept the display state it had:
|
|
9
|
+
* the status line read "Status: ❌ ..." with no "Generation Failed" in red, and the note with the message and its Retry or Upgrade
|
|
10
|
+
* button never came up, although the chat told the visitor the generation had failed. Dismissing the note had the same trouble
|
|
11
|
+
* and moves the revision by hand (the "Dismiss" button); this is the rule for the patches that raise or clear the notice.
|
|
12
|
+
*
|
|
13
|
+
* What counts is what the notice shows, nothing else: a patch moves the revision when it changes the flag or the message, and
|
|
14
|
+
* never for a status text alone, so progress still costs nothing and a patch that repeats what is shown (a new generation
|
|
15
|
+
* clearing a notice that is already clear) does not rebuild anything.
|
|
16
|
+
*
|
|
17
|
+
* Kept free of Svelte and of the page so the rule is testable without a DOM.
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* The notice a panel state shows. A state with no flag is not failed, and a missing or empty message is no message (an empty
|
|
21
|
+
* note and no note read the same on the screen, so they are the same here).
|
|
22
|
+
*/
|
|
23
|
+
export function readFailureNotice(source) {
|
|
24
|
+
return {
|
|
25
|
+
lastGenerationFailed: source?.lastGenerationFailed === true,
|
|
26
|
+
lastGenerationError: source?.lastGenerationError ? source.lastGenerationError : null
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Whether applying `patch` to a panel that shows `shown` changes what the notice shows. A key the patch leaves out stays as it
|
|
31
|
+
* is, and a patch with no key of the notice (a progress line) never changes it.
|
|
32
|
+
*/
|
|
33
|
+
export function failureNoticeChanges(shown, patch) {
|
|
34
|
+
const before = readFailureNotice(shown);
|
|
35
|
+
const after = readFailureNotice({
|
|
36
|
+
lastGenerationFailed: patch.lastGenerationFailed === undefined
|
|
37
|
+
? before.lastGenerationFailed
|
|
38
|
+
: patch.lastGenerationFailed,
|
|
39
|
+
lastGenerationError: patch.lastGenerationError === undefined
|
|
40
|
+
? before.lastGenerationError
|
|
41
|
+
: patch.lastGenerationError
|
|
42
|
+
});
|
|
43
|
+
return (before.lastGenerationFailed !== after.lastGenerationFailed ||
|
|
44
|
+
before.lastGenerationError !== after.lastGenerationError);
|
|
45
|
+
}
|