@widgetic/creator 0.4.49 → 0.4.51
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 +453 -86
- package/dist/CreatorApp.svelte.d.ts +7 -0
- package/dist/agentMascotWarmUp.d.ts +29 -0
- package/dist/agentMascotWarmUp.js +33 -0
- package/dist/agentSound.d.ts +28 -0
- package/dist/agentSound.js +47 -0
- package/dist/chatPeople.d.ts +19 -0
- package/dist/chatPeople.js +44 -0
- package/dist/components/BrandKitPanel.svelte.d.ts +1 -1
- package/dist/components/FileUrlSourceControl.svelte.d.ts +1 -1
- package/dist/components/WidgetDetails.svelte +4 -1
- package/dist/components/WidgetDetails.svelte.d.ts +1 -1
- package/dist/components/WidgetShapeLivePreviews.svelte +1 -1
- package/dist/creator-types.d.ts +24 -0
- package/dist/host/creatorHost.d.ts +5 -0
- package/dist/host/creatorHost.js +5 -0
- package/dist/i18n/language.d.ts +31 -24
- package/dist/i18n/messages.d.ts +7 -9
- package/dist/i18n/messages.js +7 -9
- package/dist/mergeBatchWidgetOntoListRecord.d.ts +16 -0
- package/dist/mergeBatchWidgetOntoListRecord.js +32 -0
- package/dist/sketchBarState.d.ts +10 -3
- package/dist/sketchBarState.js +26 -6
- package/dist/sketchBoardAfterDelete.d.ts +34 -0
- package/dist/sketchBoardAfterDelete.js +20 -0
- package/dist/sketchBoardStatusChip.d.ts +15 -0
- package/dist/sketchBoardStatusChip.js +17 -0
- package/dist/sketchToolbarMode.d.ts +13 -0
- package/dist/sketchToolbarMode.js +13 -0
- package/dist/syncSiteAuth.js +7 -2
- package/package.json +8 -5
|
@@ -69,6 +69,13 @@ declare const CreatorApp: $$__sveltets_2_IsomorphicComponent<{
|
|
|
69
69
|
* its File Browser and rich text editor) reads it from Svelte's context and follows when the page changes `dir`;
|
|
70
70
|
* `textDirection` is the answer, for the creator's own decisions (where a pop-up opens from, which way a divider drags).
|
|
71
71
|
*/ dir?: CreatorAppProps["dir"];
|
|
72
|
+
/**
|
|
73
|
+
* The people and the sound of the chat (see `CreatorAppProps.chatMembers` and `CreatorAppProps.agentSoundEnabled`).
|
|
74
|
+
* The person who is signed in is known from the session; the rest of the team, and whether the agent's mascot makes
|
|
75
|
+
* sound, come from the page.
|
|
76
|
+
*/ chatMembers?: CreatorAppProps["chatMembers"];
|
|
77
|
+
agentSoundEnabled?: CreatorAppProps["agentSoundEnabled"];
|
|
78
|
+
/** Whether the assistant is drawn as the Scribble Mascot, with its sounds (see `CreatorAppProps.agentMascot`). On unless the page says false. */ agentMascot?: CreatorAppProps["agentMascot"];
|
|
72
79
|
publish?: () => Promise<void>;
|
|
73
80
|
flush?: () => Promise<void>;
|
|
74
81
|
setWidgetName?: (name: string, widgetId?: string | null) => Promise<void>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Getting the agent's first mascot ready before the chat asks for it.
|
|
3
|
+
*
|
|
4
|
+
* The first mascot of a page waits for Three.js (a chunk of its own), the WebGL context and the shader, and shows a still
|
|
5
|
+
* picture until they are done. `warmUpMascot` of `@widgetic/brand` does those steps ahead of time, on an idle moment, and keeps
|
|
6
|
+
* the context for the mascot that follows. This is the creator's use of it: once the creator is open and the page wants the
|
|
7
|
+
* mascot at all (`CreatorAppProps.agentMascot`), so the first turn of the agent starts moving at once.
|
|
8
|
+
*/
|
|
9
|
+
import { type MascotWarmUpStatus, type WarmUpMascotOptions } from '@widgetic/brand/mascot';
|
|
10
|
+
/**
|
|
11
|
+
* How long the context is kept warm for the mascot that follows, in milliseconds: two minutes. Long enough for a person who
|
|
12
|
+
* has opened the creator to write a first message, short enough not to hold a GPU context for a creator that is left open in a
|
|
13
|
+
* tab. After that the brand lets go; a chat that is used later starts a little slower (the context and the shader, with
|
|
14
|
+
* Three.js already loaded) and nothing else changes.
|
|
15
|
+
*/
|
|
16
|
+
export declare const AGENT_MASCOT_KEEP_WARM_MILLISECONDS = 120000;
|
|
17
|
+
/** What the warm-up answers: the brand's answer, or `failed` when the call itself broke (the brand never rejects). */
|
|
18
|
+
export type AgentMascotWarmUpStatus = MascotWarmUpStatus | 'failed';
|
|
19
|
+
export interface AgentMascotWarmUpOptions {
|
|
20
|
+
/** How long to keep the context warm. {@link AGENT_MASCOT_KEEP_WARM_MILLISECONDS} by default. */
|
|
21
|
+
keepWarmForMilliseconds?: number;
|
|
22
|
+
/** Does the warm-up. `warmUpMascot` of the brand by default; the tests give a fake one. */
|
|
23
|
+
warmUp?: (options?: WarmUpMascotOptions) => Promise<MascotWarmUpStatus>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Gets the mascot ready (see the top of this file). Safe to call more than once: the brand does the work once and only keeps
|
|
27
|
+
* it warm longer. It never throws and never rejects, so the creator has nothing to catch.
|
|
28
|
+
*/
|
|
29
|
+
export declare function warmUpAgentMascot(options?: AgentMascotWarmUpOptions): Promise<AgentMascotWarmUpStatus>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Getting the agent's first mascot ready before the chat asks for it.
|
|
3
|
+
*
|
|
4
|
+
* The first mascot of a page waits for Three.js (a chunk of its own), the WebGL context and the shader, and shows a still
|
|
5
|
+
* picture until they are done. `warmUpMascot` of `@widgetic/brand` does those steps ahead of time, on an idle moment, and keeps
|
|
6
|
+
* the context for the mascot that follows. This is the creator's use of it: once the creator is open and the page wants the
|
|
7
|
+
* mascot at all (`CreatorAppProps.agentMascot`), so the first turn of the agent starts moving at once.
|
|
8
|
+
*/
|
|
9
|
+
import { warmUpMascot } from '@widgetic/brand/mascot';
|
|
10
|
+
/**
|
|
11
|
+
* How long the context is kept warm for the mascot that follows, in milliseconds: two minutes. Long enough for a person who
|
|
12
|
+
* has opened the creator to write a first message, short enough not to hold a GPU context for a creator that is left open in a
|
|
13
|
+
* tab. After that the brand lets go; a chat that is used later starts a little slower (the context and the shader, with
|
|
14
|
+
* Three.js already loaded) and nothing else changes.
|
|
15
|
+
*/
|
|
16
|
+
export const AGENT_MASCOT_KEEP_WARM_MILLISECONDS = 120_000;
|
|
17
|
+
/**
|
|
18
|
+
* Gets the mascot ready (see the top of this file). Safe to call more than once: the brand does the work once and only keeps
|
|
19
|
+
* it warm longer. It never throws and never rejects, so the creator has nothing to catch.
|
|
20
|
+
*/
|
|
21
|
+
export async function warmUpAgentMascot(options = {}) {
|
|
22
|
+
try {
|
|
23
|
+
const warmUp = options.warmUp ?? warmUpMascot;
|
|
24
|
+
return await warmUp({
|
|
25
|
+
keepWarmForMilliseconds: options.keepWarmForMilliseconds ?? AGENT_MASCOT_KEEP_WARM_MILLISECONDS
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
// The brand answers `unavailable` where it cannot do it, so this is for what is not its doing (a brand without the warm-up)
|
|
30
|
+
console.warn('[CreatorApp] The agent’s mascot could not be warmed up; the first one starts as it always did.', error);
|
|
31
|
+
return 'failed';
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sound of the agent's mascot in the chat.
|
|
3
|
+
*
|
|
4
|
+
* `@widgetic/brand` makes the player but keeps no choice of the person's: the page that owns the settings says whether
|
|
5
|
+
* sound is on (`CreatorAppProps.agentSoundEnabled`) and this keeps the player in step with it. A browser starts audio
|
|
6
|
+
* only from inside a click or a key press, so a player that is on waits for the first one on the page and starts there.
|
|
7
|
+
*/
|
|
8
|
+
import { type MascotSound, type MascotSoundOptions } from '@widgetic/brand/mascot/sound';
|
|
9
|
+
export interface CreatorAgentSound {
|
|
10
|
+
/** The player the chat tells what the agent is doing (the `agentSound` of `Chat`). */
|
|
11
|
+
readonly player: MascotSound;
|
|
12
|
+
/** Follows the page's choice. Turning sound on starts it at the next click or key press (a browser's rule). */
|
|
13
|
+
setEnabled(isEnabled: boolean): void;
|
|
14
|
+
/** Stops waiting for a press and silences the player. For when the creator closes. */
|
|
15
|
+
dispose(): void;
|
|
16
|
+
}
|
|
17
|
+
export interface CreatorAgentSoundOptions {
|
|
18
|
+
/** Whether sound is on from the start. */
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
/** Where the first click or key press is heard. The window by default. */
|
|
21
|
+
gestureTarget?: EventTarget;
|
|
22
|
+
/** Makes the player. `createMascotSound` by default; the tests give a fake one. */
|
|
23
|
+
createPlayer?: (options: MascotSoundOptions) => MascotSound;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The sound the creator gives the chat, or `null` when it cannot be made (the chat then stays silent; this says so once).
|
|
27
|
+
*/
|
|
28
|
+
export declare function createCreatorAgentSound(options: CreatorAgentSoundOptions): CreatorAgentSound | null;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sound of the agent's mascot in the chat.
|
|
3
|
+
*
|
|
4
|
+
* `@widgetic/brand` makes the player but keeps no choice of the person's: the page that owns the settings says whether
|
|
5
|
+
* sound is on (`CreatorAppProps.agentSoundEnabled`) and this keeps the player in step with it. A browser starts audio
|
|
6
|
+
* only from inside a click or a key press, so a player that is on waits for the first one on the page and starts there.
|
|
7
|
+
*/
|
|
8
|
+
import { createMascotSound } from '@widgetic/brand/mascot/sound';
|
|
9
|
+
/**
|
|
10
|
+
* The sound the creator gives the chat, or `null` when it cannot be made (the chat then stays silent; this says so once).
|
|
11
|
+
*/
|
|
12
|
+
export function createCreatorAgentSound(options) {
|
|
13
|
+
try {
|
|
14
|
+
const makePlayer = options.createPlayer ?? createMascotSound;
|
|
15
|
+
const player = makePlayer({ enabled: options.enabled });
|
|
16
|
+
// The first press unlocks audio for a player that is on; a player that is off is left alone
|
|
17
|
+
let stopWaitingForPress = player.enableOnFirstGesture(options.gestureTarget);
|
|
18
|
+
// The sound's material is loaded ahead of that press, so audio can start inside it (Safari needs that)
|
|
19
|
+
if (options.enabled)
|
|
20
|
+
void player.prepare();
|
|
21
|
+
return {
|
|
22
|
+
player,
|
|
23
|
+
setEnabled(isEnabled) {
|
|
24
|
+
if (isEnabled === player.enabled)
|
|
25
|
+
return;
|
|
26
|
+
if (!isEnabled) {
|
|
27
|
+
player.disable();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
// The page changed a setting, which is no press: sound is on from now and starts at the next press
|
|
31
|
+
void player.prepare();
|
|
32
|
+
void player.enable();
|
|
33
|
+
stopWaitingForPress?.();
|
|
34
|
+
stopWaitingForPress = player.enableOnFirstGesture(options.gestureTarget);
|
|
35
|
+
},
|
|
36
|
+
dispose() {
|
|
37
|
+
stopWaitingForPress?.();
|
|
38
|
+
stopWaitingForPress = null;
|
|
39
|
+
player.dispose();
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
console.warn('[CreatorApp] The sound of the agent’s mascot could not be set up; the chat stays silent.', error);
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The people the chat draws faces for.
|
|
3
|
+
*
|
|
4
|
+
* The chat (`@widgetic/chat`) finds who wrote a message by the `userId` the message carries: it looks the id up in the
|
|
5
|
+
* team a page gives it (`members`) and in the person who is signed in (`currentUser`, which also answers for the
|
|
6
|
+
* messages that person has just sent, before the real id is known). The creator knows only the second, from its
|
|
7
|
+
* session; the first comes from the page that mounts the creator (`CreatorAppProps.chatMembers`).
|
|
8
|
+
*/
|
|
9
|
+
import type { ChatMember } from '@widgetic/chat';
|
|
10
|
+
/**
|
|
11
|
+
* The person who is signed in, as the chat knows people. `null` when there is nobody to draw a face for:
|
|
12
|
+
* - nobody is signed in, or the session carries no id;
|
|
13
|
+
* - it is the visitor of a partner's page (`HOST_VISITOR`), who is no one in particular;
|
|
14
|
+
* - the session knows neither a name nor an e-mail, so the face would have no letter to show.
|
|
15
|
+
*
|
|
16
|
+
* A name that is only the session's stand-in (`SIGNED_IN_FALLBACK_NAME`) is not a name: a person with an e-mail but no
|
|
17
|
+
* name gets the initials of the e-mail instead of a "U" for "User".
|
|
18
|
+
*/
|
|
19
|
+
export declare function chatPersonFromSession(sessionUser: unknown): ChatMember | null;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { HOST_VISITOR, SIGNED_IN_FALLBACK_NAME } from './host/creatorHost.js';
|
|
2
|
+
/** The text of a field: trimmed, or null when it is not text or has nothing in it. */
|
|
3
|
+
function readSessionText(fieldValue) {
|
|
4
|
+
if (typeof fieldValue !== 'string')
|
|
5
|
+
return null;
|
|
6
|
+
const trimmedText = fieldValue.trim();
|
|
7
|
+
return trimmedText === '' ? null : trimmedText;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The person who is signed in, as the chat knows people. `null` when there is nobody to draw a face for:
|
|
11
|
+
* - nobody is signed in, or the session carries no id;
|
|
12
|
+
* - it is the visitor of a partner's page (`HOST_VISITOR`), who is no one in particular;
|
|
13
|
+
* - the session knows neither a name nor an e-mail, so the face would have no letter to show.
|
|
14
|
+
*
|
|
15
|
+
* A name that is only the session's stand-in (`SIGNED_IN_FALLBACK_NAME`) is not a name: a person with an e-mail but no
|
|
16
|
+
* name gets the initials of the e-mail instead of a "U" for "User".
|
|
17
|
+
*/
|
|
18
|
+
export function chatPersonFromSession(sessionUser) {
|
|
19
|
+
if (sessionUser === null || typeof sessionUser !== 'object')
|
|
20
|
+
return null;
|
|
21
|
+
const sessionRecord = sessionUser;
|
|
22
|
+
const rawPersonId = sessionRecord.id;
|
|
23
|
+
const personId = typeof rawPersonId === 'string'
|
|
24
|
+
? rawPersonId.trim()
|
|
25
|
+
: typeof rawPersonId === 'number'
|
|
26
|
+
? String(rawPersonId)
|
|
27
|
+
: '';
|
|
28
|
+
if (personId === '' || personId === HOST_VISITOR.id)
|
|
29
|
+
return null;
|
|
30
|
+
const personEmail = readSessionText(sessionRecord.email);
|
|
31
|
+
const givenName = readSessionText(sessionRecord.name);
|
|
32
|
+
const personName = givenName === SIGNED_IN_FALLBACK_NAME ? null : givenName;
|
|
33
|
+
if (personName === null && personEmail === null)
|
|
34
|
+
return null;
|
|
35
|
+
return {
|
|
36
|
+
id: personId,
|
|
37
|
+
name: personName,
|
|
38
|
+
email: personEmail,
|
|
39
|
+
// The site's session calls the picture `avatar`; a record straight from the API calls it `avatar_url`
|
|
40
|
+
avatarUrl: readSessionText(sessionRecord.avatar) ??
|
|
41
|
+
readSessionText(sessionRecord.avatar_url) ??
|
|
42
|
+
readSessionText(sessionRecord.avatarUrl)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -29,6 +29,6 @@ interface Props {
|
|
|
29
29
|
language?: string;
|
|
30
30
|
languageLocked?: boolean;
|
|
31
31
|
}
|
|
32
|
-
declare const BrandKitPanel: import("svelte").Component<Props, {}, "
|
|
32
|
+
declare const BrandKitPanel: import("svelte").Component<Props, {}, "brandKitEnabled" | "librariesEnabled" | "primary" | "secondary" | "title" | "sub" | "fonts" | "libraries" | "libraryGitUrl" | "libraryFileName" | "libraryUploads" | "fontUploads" | "language">;
|
|
33
33
|
type BrandKitPanel = ReturnType<typeof BrandKitPanel>;
|
|
34
34
|
export default BrandKitPanel;
|
|
@@ -10,6 +10,6 @@ interface Props {
|
|
|
10
10
|
urlPlaceholder?: string;
|
|
11
11
|
accept?: string;
|
|
12
12
|
}
|
|
13
|
-
declare const FileUrlSourceControl: import("svelte").Component<Props, {}, "
|
|
13
|
+
declare const FileUrlSourceControl: import("svelte").Component<Props, {}, "fileName" | "fileContent" | "fileEncoding" | "url">;
|
|
14
14
|
type FileUrlSourceControl = ReturnType<typeof FileUrlSourceControl>;
|
|
15
15
|
export default FileUrlSourceControl;
|
|
@@ -3650,7 +3650,7 @@
|
|
|
3650
3650
|
<!-- The docked panel (Figma "Chat panel", 440 wide) draws its 1px stroke inside its box, as a Figma inside stroke does: with a real
|
|
3651
3651
|
border every inset in the panel (the 16px of the messages, the suggestions and the composer) would lose a pixel. -->
|
|
3652
3652
|
<div
|
|
3653
|
-
class="widget-details-floating-panel pointer-events-auto relative flex flex-col h-full w-full {dockRight ? 'min-w-0 rounded-panel border-
|
|
3653
|
+
class="widget-details-floating-panel pointer-events-auto relative flex flex-col h-full w-full {dockRight ? 'min-w-0 rounded-panel border-0 bg-background shadow-none outline-0 max-lg:rounded-none max-lg:border-0 max-lg:outline-0' : 'min-w-[480px]'}
|
|
3654
3654
|
{!dockRight && fillViewport
|
|
3655
3655
|
? 'bg-white rounded-none border-x border-b border-t-0 ring-0 shadow-none overflow-hidden'
|
|
3656
3656
|
: !dockRight
|
|
@@ -3810,7 +3810,10 @@
|
|
|
3810
3810
|
? 'width: auto; flex: 1 1 auto; min-width: 0;'
|
|
3811
3811
|
: `width: ${previewColumnCollapsed ? 100 : leftColPercent}%; flex: 0 0 ${previewColumnCollapsed ? 100 : leftColPercent}%;`}
|
|
3812
3812
|
>
|
|
3813
|
+
<!-- The outline of the left column belongs to the standalone layout only. The docked chat is a rounded card with no stroke (item 12, Figma 524:949). -->
|
|
3814
|
+
{#if !dockRight}
|
|
3813
3815
|
<div class="widget-details-left-border absolute inset-y-0 start-0 end-0 border border-gray-300 rounded-none pointer-events-none z-10"></div>
|
|
3816
|
+
{/if}
|
|
3814
3817
|
|
|
3815
3818
|
{#if selectedWidgetId}
|
|
3816
3819
|
<div class="widget-details-left-stack relative z-0 flex flex-col h-full min-h-0 overflow-hidden {consoleColumnOpen || dockRight ? 'min-w-0' : 'min-w-[460px]'}">
|
|
@@ -100,7 +100,7 @@ declare const WidgetDetails: $$__sveltets_2_IsomorphicComponent<{
|
|
|
100
100
|
/** Stacking order when multiple Widget Details panels are open. */ panelZIndex?: number;
|
|
101
101
|
/** Cascade offset index (0 = centered, 1+ = shifted down-right). */ panelCascadeIndex?: number;
|
|
102
102
|
/** False when another panel has keyboard/chat focus. */ isFocusedPanel?: boolean;
|
|
103
|
-
currentStep?: "
|
|
103
|
+
currentStep?: "create" | "edit" | "embed";
|
|
104
104
|
/**
|
|
105
105
|
* Canvas Creator is code-only (chat + preview). Edit/Embed header steps stay
|
|
106
106
|
* off until composition editing lives on /composition. Keep the Edit/Embed
|
|
@@ -1158,7 +1158,7 @@
|
|
|
1158
1158
|
First click inside the widget selects the shape (ring + chrome) via
|
|
1159
1159
|
focus, while the iframe keeps receiving the pointer events themselves. -->
|
|
1160
1160
|
<iframe
|
|
1161
|
-
class="widget-shape-live-preview-iframe pointer-events-auto absolute border-0 bg-
|
|
1161
|
+
class="widget-shape-live-preview-iframe pointer-events-auto absolute border-0 bg-transparent"
|
|
1162
1162
|
class:pointer-events-none={blockIframePointer || edgeHit || selectedPreviewBlocked || !!resolveSelectorEnabled?.(overlay.widgetId)}
|
|
1163
1163
|
class:opacity-0={selectedPreviewBlocked}
|
|
1164
1164
|
style="left: {IFRAME_INSET_PX}px; top: {IFRAME_INSET_PX}px; right: {IFRAME_INSET_PX}px; /* rtl-ok: the same inset on both sides of the frame */ bottom: {IFRAME_INSET_PX}px; width: calc(100% - {IFRAME_INSET_PX * 2}px); height: calc(100% - {IFRAME_INSET_PX * 2}px);"
|
package/dist/creator-types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { MediaLibraryProvider } from '@widgetic/file-browser';
|
|
2
2
|
import type { TextDirection } from '@widgetic/design-system/components/textDirection';
|
|
3
3
|
import type { ToolbarPosition } from '@widgetic/canvas';
|
|
4
|
+
import type { ChatMember } from '@widgetic/chat';
|
|
4
5
|
import type { LimitNotices, PublishState } from './host/hostControls.js';
|
|
5
6
|
export type { LimitNotices, PublishState };
|
|
6
7
|
/** Why the creator asks the page for a token. */
|
|
@@ -121,6 +122,29 @@ export interface CreatorAppProps {
|
|
|
121
122
|
* the live previews of the widgets and code stay left to right either way. A module sets it from `locale`.
|
|
122
123
|
*/
|
|
123
124
|
dir?: TextDirection;
|
|
125
|
+
/**
|
|
126
|
+
* The people of the project's team, for the faces the chat draws beside what each of them wrote (their picture, or their
|
|
127
|
+
* initials, and the e-mail when the pointer rests on it). Each is found by the `id` the saved messages carry as
|
|
128
|
+
* `userId`. The person who is signed in does not have to be in the list: the creator knows them from the session.
|
|
129
|
+
* Left out, only that person has a face; a message written by someone the creator cannot name has none. Give a new
|
|
130
|
+
* list while the creator is open when the team changes.
|
|
131
|
+
*/
|
|
132
|
+
chatMembers?: ChatMember[] | null;
|
|
133
|
+
/**
|
|
134
|
+
* Whether the agent's mascot makes its small sounds in the chat (a soft cue when it starts to think, to write, and when
|
|
135
|
+
* it is done or fails). On when left out. The creator keeps no choice of the person's: the page owns it (where it keeps
|
|
136
|
+
* the other settings) and gives `false` to mute, `true` to bring the sound back. Audio can only start after a first click
|
|
137
|
+
* or key press on the page, so the sound begins there.
|
|
138
|
+
*/
|
|
139
|
+
agentSoundEnabled?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Whether the assistant of the chat is drawn as the Scribble Mascot, the animated scribble that thinks, writes and ends in
|
|
142
|
+
* its success or error look (and makes the small sounds of `agentSoundEnabled`). On when left out. `false` draws the
|
|
143
|
+
* assistant as a plain round avatar and keeps the chat silent, whatever `agentSoundEnabled` says: the sounds belong to the
|
|
144
|
+
* mascot. Everything else about the chat (the thinking and code cards, the conclusion, the faces) is the same either way.
|
|
145
|
+
* Can change while the creator is open.
|
|
146
|
+
*/
|
|
147
|
+
agentMascot?: boolean;
|
|
124
148
|
canvasId?: string | null;
|
|
125
149
|
projectId?: string | null;
|
|
126
150
|
workspaceType?: 'personal' | 'organization';
|
|
@@ -30,6 +30,11 @@ export declare const HOST_VISITOR: {
|
|
|
30
30
|
readonly id: "00000000-0000-4000-8000-000000000000";
|
|
31
31
|
readonly name: "Visitor";
|
|
32
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* The name the site's session gives a signed-in person whose token carries none (`syncSessionFromSiteAuth`). It stands in
|
|
35
|
+
* for a name: nothing that shows people (the chat's faces) may take it for one.
|
|
36
|
+
*/
|
|
37
|
+
export declare const SIGNED_IN_FALLBACK_NAME = "User";
|
|
33
38
|
/** The three calls the creator makes on the browser's storage, so a stand-in only has to offer these. */
|
|
34
39
|
export type CreatorStorage = Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>;
|
|
35
40
|
/** What the creator tells the page. Every one is optional: a page that does not care leaves them out. */
|
package/dist/host/creatorHost.js
CHANGED
|
@@ -27,6 +27,11 @@
|
|
|
27
27
|
* fail the check.)
|
|
28
28
|
*/
|
|
29
29
|
export const HOST_VISITOR = { id: '00000000-0000-4000-8000-000000000000', name: 'Visitor' };
|
|
30
|
+
/**
|
|
31
|
+
* The name the site's session gives a signed-in person whose token carries none (`syncSessionFromSiteAuth`). It stands in
|
|
32
|
+
* for a name: nothing that shows people (the chat's faces) may take it for one.
|
|
33
|
+
*/
|
|
34
|
+
export const SIGNED_IN_FALLBACK_NAME = 'User';
|
|
30
35
|
const state = {
|
|
31
36
|
partnerMode: false,
|
|
32
37
|
handlers: {},
|