narraleaf-studio 1.8.0 → 1.9.0
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/_api.d.ts +158 -2
- package/dist/plugin.d.ts +2 -0
- package/dist/runtime.d.ts +2 -0
- package/package.json +1 -1
package/dist/_api.d.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import { LucideIcon } from 'lucide-react';
|
|
14
14
|
import React$1 from 'react';
|
|
15
|
-
import { ComponentType, InputHTMLAttributes, ReactElement, ReactNode, RefObject } from 'react';
|
|
15
|
+
import { CSSProperties, ComponentType, InputHTMLAttributes, ReactElement, ReactNode, RefObject } from 'react';
|
|
16
16
|
|
|
17
17
|
declare enum FsRejectErrorCode {
|
|
18
18
|
NOT_FOUND = "NOT_FOUND",
|
|
@@ -1320,6 +1320,13 @@ type StoryTextMarks = {
|
|
|
1320
1320
|
*/
|
|
1321
1321
|
fontSizeStep?: number;
|
|
1322
1322
|
emphasis?: StoryTextEmphasis;
|
|
1323
|
+
/** An inline effect a plugin contributes, such as shaking text. */
|
|
1324
|
+
effect?: StoryTextEffect;
|
|
1325
|
+
};
|
|
1326
|
+
type StoryTextEffectParamValue = number | string | boolean;
|
|
1327
|
+
type StoryTextEffect = {
|
|
1328
|
+
id: string;
|
|
1329
|
+
params?: Record<string, StoryTextEffectParamValue>;
|
|
1323
1330
|
};
|
|
1324
1331
|
type StoryInterpolationRef = {
|
|
1325
1332
|
kind: "variable";
|
|
@@ -2357,6 +2364,10 @@ declare const en: {
|
|
|
2357
2364
|
readonly all: "Show all characters";
|
|
2358
2365
|
};
|
|
2359
2366
|
};
|
|
2367
|
+
readonly groupSubmenus: {
|
|
2368
|
+
readonly label: "Show groups as submenus";
|
|
2369
|
+
readonly description: "In candidate menus, each character group and asset folder is one entry whose contents open in a column beside it.";
|
|
2370
|
+
};
|
|
2360
2371
|
readonly dictionaries: {
|
|
2361
2372
|
readonly label: "Spelling dictionaries";
|
|
2362
2373
|
};
|
|
@@ -3494,6 +3505,7 @@ declare const en: {
|
|
|
3494
3505
|
readonly character_layered_set: "Lay out a layered character";
|
|
3495
3506
|
readonly character_layers_import: "Build a layered character from files";
|
|
3496
3507
|
readonly character_preview: "Preview a character look";
|
|
3508
|
+
readonly character_avatars_autoframe: "Auto-frame dialog avatars";
|
|
3497
3509
|
readonly variables_list: "List variables";
|
|
3498
3510
|
readonly variable_upsert: "Create or update a variable";
|
|
3499
3511
|
readonly variable_delete: "Delete a variable";
|
|
@@ -4539,6 +4551,9 @@ declare const en: {
|
|
|
4539
4551
|
};
|
|
4540
4552
|
readonly sceneActions: "Scene actions";
|
|
4541
4553
|
readonly chapterActions: "Chapter actions";
|
|
4554
|
+
readonly outlineView: "Outline display";
|
|
4555
|
+
readonly showCastAvatars: "Show Cast Avatars";
|
|
4556
|
+
readonly castLabel: "Cast: {names}";
|
|
4542
4557
|
readonly setEntryScene: "Set as Entry Scene";
|
|
4543
4558
|
readonly documentUnavailable: "Story document unavailable.";
|
|
4544
4559
|
readonly newStoryPlaceholder: "Enter story name";
|
|
@@ -5029,6 +5044,11 @@ declare const en: {
|
|
|
5029
5044
|
readonly speedUnit: "cps";
|
|
5030
5045
|
readonly speedPlaceholder: "Line";
|
|
5031
5046
|
};
|
|
5047
|
+
readonly textEffect: {
|
|
5048
|
+
readonly effect: "Effect";
|
|
5049
|
+
readonly none: "None";
|
|
5050
|
+
readonly unavailable: "{id} (not installed)";
|
|
5051
|
+
};
|
|
5032
5052
|
readonly ruby: {
|
|
5033
5053
|
readonly title: "Ruby text";
|
|
5034
5054
|
readonly placeholder: "Reading";
|
|
@@ -5066,6 +5086,8 @@ declare const en: {
|
|
|
5066
5086
|
readonly rubyHint: "Ruby text (select the words to annotate)";
|
|
5067
5087
|
readonly type: "Type";
|
|
5068
5088
|
readonly typeHint: "Type (select the words to set)";
|
|
5089
|
+
readonly effects: "Effects";
|
|
5090
|
+
readonly effectsHint: "Effects (select the words to set)";
|
|
5069
5091
|
readonly tools: "Rich text tools";
|
|
5070
5092
|
readonly pauseClick: "Pause (waits for a click)";
|
|
5071
5093
|
readonly pauseSeconds: "Pause {seconds}s";
|
|
@@ -9207,6 +9229,20 @@ declare const en: {
|
|
|
9207
9229
|
readonly createCharacter: "create character {name}";
|
|
9208
9230
|
readonly editCharacter: "edit character {name}";
|
|
9209
9231
|
readonly deleteGroup: "delete group {name}";
|
|
9232
|
+
readonly autoFrameAvatars: "auto-frame dialog avatars of {name}";
|
|
9233
|
+
};
|
|
9234
|
+
readonly autoFrame: {
|
|
9235
|
+
readonly all: "Auto-frame all dialog avatars";
|
|
9236
|
+
readonly one: "Auto-frame avatar";
|
|
9237
|
+
readonly running: "Auto-framing dialog avatars";
|
|
9238
|
+
readonly consoleChannel: "Avatars";
|
|
9239
|
+
readonly consoleChannelDescription: "Dialog avatars framed on a detected head";
|
|
9240
|
+
readonly started: "Detecting heads to frame dialog avatars";
|
|
9241
|
+
readonly summary: "Framed {framed} \u00B7 No head found {noHead} \u00B7 Kept existing framing {kept}";
|
|
9242
|
+
readonly noHeadLine: "{name}: no head found in {looks}";
|
|
9243
|
+
readonly nothingToDo: "No dialog avatars to frame";
|
|
9244
|
+
readonly noHead: "No head found";
|
|
9245
|
+
readonly failed: "Auto-framing failed: {message}";
|
|
9210
9246
|
};
|
|
9211
9247
|
readonly create: {
|
|
9212
9248
|
readonly nameRequired: "Give the character a name.";
|
|
@@ -9471,7 +9507,7 @@ declare const en: {
|
|
|
9471
9507
|
readonly resetView: "Reset View";
|
|
9472
9508
|
readonly alt: "Variant preview";
|
|
9473
9509
|
readonly setPortrait: "Portrait framing";
|
|
9474
|
-
readonly resetPortrait: "
|
|
9510
|
+
readonly resetPortrait: "Clear framing";
|
|
9475
9511
|
readonly portraitTitle: "Portrait framing";
|
|
9476
9512
|
readonly portraitScoped: "Frame this look only";
|
|
9477
9513
|
};
|
|
@@ -11963,6 +11999,10 @@ declare const en: {
|
|
|
11963
11999
|
readonly one: "{count} action";
|
|
11964
12000
|
readonly other: "{count} actions";
|
|
11965
12001
|
};
|
|
12002
|
+
readonly inlineTextEffect: {
|
|
12003
|
+
readonly one: "{count} text effect";
|
|
12004
|
+
readonly other: "{count} text effects";
|
|
12005
|
+
};
|
|
11966
12006
|
};
|
|
11967
12007
|
};
|
|
11968
12008
|
readonly live: {
|
|
@@ -12294,6 +12334,12 @@ declare const en: {
|
|
|
12294
12334
|
readonly name: "Empty";
|
|
12295
12335
|
readonly description: "Project structure only";
|
|
12296
12336
|
};
|
|
12337
|
+
readonly parts: {
|
|
12338
|
+
readonly label: "Sample content";
|
|
12339
|
+
readonly helper: "Unticked parts are left out of the new project. The screens always come in.";
|
|
12340
|
+
readonly all: "All";
|
|
12341
|
+
readonly none: "No sample content";
|
|
12342
|
+
};
|
|
12297
12343
|
};
|
|
12298
12344
|
readonly project: {
|
|
12299
12345
|
readonly name: "Project Name";
|
|
@@ -14079,6 +14125,12 @@ declare const en: {
|
|
|
14079
14125
|
readonly message: "This line has no text";
|
|
14080
14126
|
readonly help: string;
|
|
14081
14127
|
};
|
|
14128
|
+
readonly textUnknownEffect: {
|
|
14129
|
+
readonly title: "Text effect not installed";
|
|
14130
|
+
readonly description: "A line uses a text effect that no installed plugin provides";
|
|
14131
|
+
readonly message: "The text effect {effect} is not provided by any installed plugin";
|
|
14132
|
+
readonly help: string;
|
|
14133
|
+
};
|
|
14082
14134
|
readonly localizationMissing: {
|
|
14083
14135
|
readonly title: "Missing translation";
|
|
14084
14136
|
readonly description: "A line or interface text with no translation in a target language";
|
|
@@ -16201,6 +16253,15 @@ export type PluginContributes = {
|
|
|
16201
16253
|
blueprintNodes?: string[];
|
|
16202
16254
|
/** Widget element types this plugin provides (editor module + runtime renderer). */
|
|
16203
16255
|
widgets?: string[];
|
|
16256
|
+
/**
|
|
16257
|
+
* Inline text effects this plugin provides (rich text toolbar entry + runtime word renderer).
|
|
16258
|
+
*
|
|
16259
|
+
* An effect is set on a run of dialogue the way bold is, and the run compiles to the engine word
|
|
16260
|
+
* renderer of the same id. The studio entry registers the toolbar entry through
|
|
16261
|
+
* `app.services.richText.registerInlineEffect`; the runtime entry registers the renderer through
|
|
16262
|
+
* `app.game.wordRenderers.register`. Both refuse an id this list does not name.
|
|
16263
|
+
*/
|
|
16264
|
+
inlineTextEffects?: string[];
|
|
16204
16265
|
/** Studio language packs: locales this plugin adds or fills. */
|
|
16205
16266
|
locales?: PluginLocaleContribution[];
|
|
16206
16267
|
/**
|
|
@@ -22058,6 +22119,47 @@ export type RuntimeWidgetRendererDef = {
|
|
|
22058
22119
|
*/
|
|
22059
22120
|
logicApi?: WidgetLogicApi;
|
|
22060
22121
|
};
|
|
22122
|
+
/**
|
|
22123
|
+
* What an inline text effect draws one word of dialogue with. The engine hands these over each time
|
|
22124
|
+
* the word renders: once per character while the line is being typed, and again when it settles.
|
|
22125
|
+
*/
|
|
22126
|
+
export type RuntimeInlineTextEffectRenderProps = {
|
|
22127
|
+
/**
|
|
22128
|
+
* The word as the engine lays it out, with its reading (ruby), vertical writing and upright short
|
|
22129
|
+
* runs applied, and the characters still being revealed fading in. Draw this to keep all of that;
|
|
22130
|
+
* draw `text` instead only to place each character yourself.
|
|
22131
|
+
*/
|
|
22132
|
+
children: React$1.ReactNode;
|
|
22133
|
+
/** The characters revealed so far. Equal to `fullText` once the typewriter has passed the word. */
|
|
22134
|
+
text: string;
|
|
22135
|
+
/** The whole word, revealed or not. */
|
|
22136
|
+
fullText: string;
|
|
22137
|
+
/** Whether every character of the word has been revealed. */
|
|
22138
|
+
revealed: boolean;
|
|
22139
|
+
/** Whether the whole line has finished revealing. */
|
|
22140
|
+
done: boolean;
|
|
22141
|
+
/** The word's resolved style, already applied to the element around it. */
|
|
22142
|
+
style: Readonly<React$1.CSSProperties>;
|
|
22143
|
+
/** Whether the word carries a reading, which `children` draws and `text` does not. */
|
|
22144
|
+
hasRuby: boolean;
|
|
22145
|
+
/** The parameter values the author set on the run. A parameter left at its default is absent. */
|
|
22146
|
+
params: Readonly<Record<string, number | string | boolean>>;
|
|
22147
|
+
};
|
|
22148
|
+
/**
|
|
22149
|
+
* Runtime-side inline text effect: the component that draws a run of dialogue the author set the
|
|
22150
|
+
* effect on. The studio entry registers the toolbar entry under the same id.
|
|
22151
|
+
*/
|
|
22152
|
+
export type RuntimeInlineTextEffectDef = {
|
|
22153
|
+
/** The effect id; must start with the plugin id and be declared in `contributes.inlineTextEffects`. */
|
|
22154
|
+
id: string;
|
|
22155
|
+
render: (props: RuntimeInlineTextEffectRenderProps) => React$1.ReactElement | null;
|
|
22156
|
+
/**
|
|
22157
|
+
* Whether the word takes the player's clicks once it is revealed, instead of letting them advance
|
|
22158
|
+
* the line. Off by default: an effect that only changes how the text looks must not make part of
|
|
22159
|
+
* the dialogue box stop responding.
|
|
22160
|
+
*/
|
|
22161
|
+
interactive?: boolean;
|
|
22162
|
+
};
|
|
22061
22163
|
/** Removes a subscription. Also tracked by the host, so a failed plugin cannot leak listeners. */
|
|
22062
22164
|
export type RuntimePluginCleanup = () => void;
|
|
22063
22165
|
/**
|
|
@@ -22419,6 +22521,17 @@ export type RuntimePluginGame = {
|
|
|
22419
22521
|
register(def: RuntimeWidgetRendererDef): void;
|
|
22420
22522
|
registerMany(defs: RuntimeWidgetRendererDef[]): void;
|
|
22421
22523
|
};
|
|
22524
|
+
/**
|
|
22525
|
+
* Draw the runs of dialogue the author set one of this plugin's inline text effects on. A run
|
|
22526
|
+
* whose effect has no renderer here is drawn as plain text.
|
|
22527
|
+
*
|
|
22528
|
+
* Always present, like `widgets`: a renderer only draws text the author marked with this
|
|
22529
|
+
* plugin's own effect, so it grants nothing an install prompt would have to name.
|
|
22530
|
+
*/
|
|
22531
|
+
inlineTextEffects: {
|
|
22532
|
+
register(def: RuntimeInlineTextEffectDef): void;
|
|
22533
|
+
registerMany(defs: RuntimeInlineTextEffectDef[]): void;
|
|
22534
|
+
};
|
|
22422
22535
|
/**
|
|
22423
22536
|
* What runs when the story reaches a row one of this plugin's story actions inserted. The id is
|
|
22424
22537
|
* the one the studio entry registered the action under; the story waits on the row until `run`
|
|
@@ -22736,6 +22849,38 @@ export interface AssetSelectorProps {
|
|
|
22736
22849
|
onClose: () => void;
|
|
22737
22850
|
onConfirm: (assets: Asset[]) => void;
|
|
22738
22851
|
}
|
|
22852
|
+
/**
|
|
22853
|
+
* One number an inline text effect lets the author set, drawn as a slider in the effect panel.
|
|
22854
|
+
*
|
|
22855
|
+
* Numbers only: a run's parameters are written into the document and into scripts as `key=value`,
|
|
22856
|
+
* and a slider with a range is the one control every effect so far has needed.
|
|
22857
|
+
*/
|
|
22858
|
+
export type PluginInlineTextEffectParamDef = {
|
|
22859
|
+
/** Unique within the effect. Keys the stored value; never displayed. */
|
|
22860
|
+
key: string;
|
|
22861
|
+
/** Author-facing name of the parameter, in the interface language. Read like the effect's. */
|
|
22862
|
+
label: string;
|
|
22863
|
+
min: number;
|
|
22864
|
+
max: number;
|
|
22865
|
+
/** The slider's increment. Defaults to a hundredth of the range. */
|
|
22866
|
+
step?: number;
|
|
22867
|
+
/** The value a run takes when the author has not moved the slider. Not stored. */
|
|
22868
|
+
default: number;
|
|
22869
|
+
};
|
|
22870
|
+
/**
|
|
22871
|
+
* An inline text effect's entry in the dialogue toolbar. The id is the one the runtime entry
|
|
22872
|
+
* registers the renderer under, and the one the run stores.
|
|
22873
|
+
*/
|
|
22874
|
+
export type PluginInlineTextEffectDef = {
|
|
22875
|
+
/** Must start with the plugin id and be declared in `contributes.inlineTextEffects`. */
|
|
22876
|
+
id: string;
|
|
22877
|
+
/**
|
|
22878
|
+
* Author-facing name, in the interface language. Read each time the panel draws, so a getter
|
|
22879
|
+
* over the plugin's translator follows a language switch without registering again.
|
|
22880
|
+
*/
|
|
22881
|
+
label: string;
|
|
22882
|
+
params?: readonly PluginInlineTextEffectParamDef[];
|
|
22883
|
+
};
|
|
22739
22884
|
type ControlSize = "sm" | "md" | "lg";
|
|
22740
22885
|
export type ButtonVariant = "primary" | "secondary" | "ghost" | "danger";
|
|
22741
22886
|
export type ButtonSize = ControlSize;
|
|
@@ -23811,6 +23956,17 @@ export type PluginServices = {
|
|
|
23811
23956
|
list(): PluginWidgetTypeInfo[];
|
|
23812
23957
|
has(type: string): boolean;
|
|
23813
23958
|
};
|
|
23959
|
+
/**
|
|
23960
|
+
* Contribute an inline text effect to the dialogue toolbar; see {@link PluginInlineTextEffectDef}.
|
|
23961
|
+
*
|
|
23962
|
+
* The author selects text in a line of dialogue and picks the effect, the way they pick bold. The
|
|
23963
|
+
* runtime entry draws the result through `app.game.inlineTextEffects` under the same id. The
|
|
23964
|
+
* toolbar shows its effects control only while at least one effect is registered.
|
|
23965
|
+
*/
|
|
23966
|
+
inlineTextEffects: {
|
|
23967
|
+
register(def: PluginInlineTextEffectDef): PluginCleanup;
|
|
23968
|
+
registerMany(defs: PluginInlineTextEffectDef[]): PluginCleanup;
|
|
23969
|
+
};
|
|
23814
23970
|
story: {
|
|
23815
23971
|
/**
|
|
23816
23972
|
* Read-only project catalogue, for a plugin panel that has to let the
|
package/dist/plugin.d.ts
CHANGED
package/dist/runtime.d.ts
CHANGED
package/package.json
CHANGED