@novely/solid-renderer 0.0.0-alpha → 0.0.0-alpha.10

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/README.md CHANGED
@@ -78,6 +78,9 @@ render(
78
78
  | `--novely-button-hover-background-color` | `#ffffff` |
79
79
  | `--novely-button-hover-border-color` | `#ffc6d8` |
80
80
  | `--novely-button-hover-color` | `#ffb7a2` |
81
+ | `--novely-select-background-color` | `#ffe9f3` |
82
+ | `--novely-select-border-color` | `#ffc7df` |
83
+ | `--novely-select-color` | `#000000` |
81
84
  | `--novely-dialog-color` | `#ffffff` |
82
85
  | `--novely-dialog-border-color` | `#ffffff` |
83
86
  | `--novely-dialog-border-radius` | `14px` |
package/dist/index.css CHANGED
@@ -21,6 +21,9 @@
21
21
  Noto Color Emoji;
22
22
  font-size: 1em;
23
23
  }
24
+ .n-root * {
25
+ box-sizing: border-box;
26
+ }
24
27
 
25
28
  /* esbuild-css-modules-plugin-namespace:./src/styles/button.module.css?esbuild-css-modules-plugin-built */
26
29
  .n-button {
@@ -31,7 +34,7 @@
31
34
  user-select: none;
32
35
  margin: .4em 0;
33
36
  padding: .4em;
34
- font-size: 1.8375em;
37
+ font-size: 1.02em;
35
38
  line-height: 1.2;
36
39
  }
37
40
  .n-button:hover {
@@ -49,21 +52,23 @@
49
52
  padding: .4em .6em;
50
53
  font-size: 1.2375em;
51
54
  }
52
- .n-buttonChoices {
53
- font-size: 1.02em;
54
- }
55
55
  .n-buttonMainMenu,
56
56
  .n-buttonSaves {
57
57
  width: 100%;
58
- font-size: 1.02em;
59
58
  }
60
59
  .n-buttonSavesDelete {
61
60
  margin-left: 1em;
62
- font-size: 1.02em;
63
61
  }
64
62
  .n-buttonSettings {
65
63
  width: 100%;
66
- font-size: 1.02em;
64
+ }
65
+ .n-buttonControlPanel {
66
+ border: 2px solid var(--novely-button-border-color, #ffc7df);
67
+ height: 2em;
68
+ margin: 0;
69
+ padding: .2em .4em;
70
+ font-size: 1em;
71
+ line-height: 1;
67
72
  }
68
73
 
69
74
  /* esbuild-css-modules-plugin-namespace:./src/styles/characters.module.css?esbuild-css-modules-plugin-built */
@@ -73,7 +78,7 @@
73
78
  inset: 0;
74
79
  overflow: hidden;
75
80
  }
76
- .n-characters > canvas[style] {
81
+ .n-characters > canvas {
77
82
  height: 85vmin;
78
83
  max-height: 70vh;
79
84
  position: absolute;
@@ -82,8 +87,7 @@
82
87
 
83
88
  /* esbuild-css-modules-plugin-namespace:./src/styles/dialog.module.css?esbuild-css-modules-plugin-built */
84
89
  .n-dialog {
85
- min-height: 25vh;
86
- max-height: 30vh;
90
+ min-height: 26vh;
87
91
  width: 75%;
88
92
  z-index: 22;
89
93
  text-align: left;
@@ -98,8 +102,7 @@
98
102
  }
99
103
  .n-dialogContainer {
100
104
  height: 100%;
101
- min-height: 14.5vh;
102
- max-height: 25vh;
105
+ min-height: 18vh;
103
106
  color: var(--novely-dialog-color, #fff);
104
107
  border: 3px solid var(--novely-dialog-border-color, #fff);
105
108
  border-radius: var(--novely-dialog-border-radius, 14px);
@@ -108,16 +111,18 @@
108
111
  background-color: var(--novely-dialog-background-color, #f092b4d8);
109
112
  background-position: var(--novely-dialog-background-position, 0 0, 50px 50px);
110
113
  background-size: var(--novely-dialog-background-size, 100px 100px);
111
- grid-template-rows: auto 1fr;
112
- grid-template-columns: 10vmax 1fr;
114
+ flex-grow: 1;
115
+ grid-template-areas: "n-pers n-text" "n-pers n-text";
116
+ padding-bottom: 2.8em;
113
117
  display: grid;
114
118
  }
115
119
  .n-dialogPerson {
116
120
  max-height: 25vh;
117
121
  max-width: 25vw;
122
+ grid-area: n-pers;
118
123
  }
119
124
  .n-dialogContainerWithPerson[data-no-person=true] {
120
- display: block;
125
+ grid-template-areas: "n-text n-text" "n-text n-text";
121
126
  }
122
127
  .n-dialogContainerWithPerson[data-no-person=true] > .n-dialogPerson {
123
128
  display: none;
@@ -141,10 +146,11 @@
141
146
  .n-dialogContent {
142
147
  width: 100%;
143
148
  text-shadow:
144
- 1px 0 #000,
145
- 0 1px #000,
146
- -1px 0 #000,
147
- 0 -1px #000;
149
+ 1px 1px #000,
150
+ -1px -1px #000,
151
+ 1px -1px #000,
152
+ -1px 1px #000;
153
+ grid-area: n-text;
148
154
  font-size: 2.2375em;
149
155
  line-height: 1.2;
150
156
  }
@@ -159,10 +165,12 @@
159
165
  left: unset;
160
166
  transform: unset;
161
167
  }
162
- .n-dialogName,
163
- .n-dialogContent {
168
+ .n-dialogName {
164
169
  font-size: 1.02em;
165
170
  }
171
+ .n-dialogContent {
172
+ font-size: 1.32em;
173
+ }
166
174
  .n-dialogContainer {
167
175
  border-radius: 14px 14px 0 0;
168
176
  }
@@ -241,9 +249,14 @@
241
249
  flex-direction: column;
242
250
  justify-content: center;
243
251
  align-items: center;
244
- padding-left: 1em;
252
+ padding: 0 1em;
245
253
  display: flex;
246
254
  }
255
+ @media (max-width: 768px) {
256
+ .n-mainMenu > .n-controls {
257
+ width: 100%;
258
+ }
259
+ }
247
260
 
248
261
  /* esbuild-css-modules-plugin-namespace:./src/styles/saves.module.css?esbuild-css-modules-plugin-built */
249
262
  .n-saves {
@@ -259,30 +272,43 @@
259
272
  height: 100%;
260
273
  flex-direction: column;
261
274
  align-items: center;
262
- padding-left: 1em;
275
+ padding: 0 1em;
263
276
  display: flex;
264
277
  }
265
278
  .n-saves > .n-list {
266
279
  width: 100%;
267
280
  height: 100%;
268
281
  flex-direction: column;
269
- flex: 1 1 0;
270
- justify-content: center;
271
282
  align-items: center;
272
- padding-left: 1em;
283
+ padding: 0 1em;
273
284
  list-style: none;
274
285
  display: flex;
286
+ overflow-y: scroll;
275
287
  }
276
288
  .n-saves > .n-list > li {
277
289
  display: flex;
278
290
  }
291
+ @media (max-width: 768px) {
292
+ .n-saves {
293
+ flex-direction: column;
294
+ }
295
+ .n-saves > .n-controls {
296
+ width: auto;
297
+ height: auto;
298
+ }
299
+ .n-saves > .n-list {
300
+ height: auto;
301
+ }
302
+ }
279
303
 
280
304
  /* esbuild-css-modules-plugin-namespace:./src/styles/controlPanel.module.css?esbuild-css-modules-plugin-built */
281
305
  .n-controlPanel {
282
306
  z-index: 23;
307
+ justify-content: end;
308
+ display: flex;
283
309
  position: absolute;
284
310
  bottom: .4em;
285
- right: 0;
311
+ right: .4em;
286
312
  }
287
313
 
288
314
  /* esbuild-css-modules-plugin-namespace:./src/styles/settings.module.css?esbuild-css-modules-plugin-built */
@@ -314,6 +340,23 @@
314
340
  list-style: none;
315
341
  display: flex;
316
342
  }
343
+ .n-settings .n-select {
344
+ flex-direction: column;
345
+ align-items: start;
346
+ display: flex;
347
+ }
348
+ .n-settings .n-select > select {
349
+ background-color: var(--novely-select-background-color, #ffe9f3);
350
+ border: 4px solid var(--novely-select-border-color, #ffc7df);
351
+ color: var(--novely-select-color, #000);
352
+ margin: .4em 0;
353
+ padding: .4em;
354
+ font-size: 1.02em;
355
+ }
356
+ .n-settings .n-select > label {
357
+ color: var(--novely-select-color, #000);
358
+ font-size: 1.42em;
359
+ }
317
360
 
318
361
  /* esbuild-css-modules-plugin-namespace:./src/styles/loading.module.css?esbuild-css-modules-plugin-built */
319
362
  .n-loading {
@@ -381,3 +424,22 @@
381
424
  transform: translate(24px);
382
425
  }
383
426
  }
427
+
428
+ /* esbuild-css-modules-plugin-namespace:./src/styles/fullscreenText.module.css?esbuild-css-modules-plugin-built */
429
+ .n-fullscreenText {
430
+ z-index: 2;
431
+ text-align: center;
432
+ justify-content: center;
433
+ align-items: center;
434
+ font-size: 1.2em;
435
+ display: flex;
436
+ position: absolute;
437
+ inset: 0;
438
+ }
439
+ .n-fullscreenText[data-fullscreen-text-shown=true] {
440
+ color: #fff;
441
+ background: #000;
442
+ }
443
+ .n-fullscreenText[data-fullscreen-text-shown=true] > p {
444
+ cursor: pointer;
445
+ }
package/dist/index.jsx CHANGED
@@ -87,13 +87,13 @@ var M = (h, d, c) => {
87
87
  var root_module_default = { "root": "n-root" };
88
88
 
89
89
  // esbuild-css-modules-plugin-namespace:./src/styles/button.module.css?esbuild-css-modules-plugin-building
90
- var button_module_default = { "button": "n-button", "buttonChoices": "n-buttonChoices", "buttonInputDialogPanel": "n-buttonInputDialogPanel", "buttonMainMenu": "n-buttonMainMenu", "buttonSaves": "n-buttonSaves", "buttonSavesDelete": "n-buttonSavesDelete", "buttonSettings": "n-buttonSettings" };
90
+ var button_module_default = { "button": "n-button", "buttonControlPanel": "n-buttonControlPanel", "buttonInputDialogPanel": "n-buttonInputDialogPanel", "buttonMainMenu": "n-buttonMainMenu", "buttonSaves": "n-buttonSaves", "buttonSavesDelete": "n-buttonSavesDelete", "buttonSettings": "n-buttonSettings" };
91
91
 
92
92
  // esbuild-css-modules-plugin-namespace:./src/styles/characters.module.css?esbuild-css-modules-plugin-building
93
93
  var characters_module_default = { "characters": "n-characters" };
94
94
 
95
95
  // esbuild-css-modules-plugin-namespace:./src/styles/dialog.module.css?esbuild-css-modules-plugin-building
96
- var dialog_module_default = { "dialog": "n-dialog", "dialogContainer": "n-dialogContainer", "dialogContainerWithPerson": "n-dialogContainerWithPerson", "dialogContent": "n-dialogContent", "dialogName": "n-dialogName", "dialogPerson": "n-dialogPerson" };
96
+ var dialog_module_default = { "dialog": "n-dialog", "dialogContainer": "n-dialogContainer", "dialogContainerWithPerson": "n-dialogContainerWithPerson", "dialogContent": "n-dialogContent", "dialogName": "n-dialogName", "dialogPerson": "n-dialogPerson", "pers": "n-pers", "text": "n-text" };
97
97
 
98
98
  // esbuild-css-modules-plugin-namespace:./src/styles/headlessDialog.module.css?esbuild-css-modules-plugin-building
99
99
  var headlessDialog_module_default = { "headlessDialog": "n-headlessDialog", "headlessDialogContainer": "n-headlessDialogContainer", "headlessDialogFix": "n-headlessDialogFix", "headlessDialogPanel": "n-headlessDialogPanel", "inputDialogLabel": "n-inputDialogLabel", "inputDialogPanel": "n-inputDialogPanel" };
@@ -108,13 +108,16 @@ var saves_module_default = { "controls": "n-controls", "list": "n-list", "saves"
108
108
  var controlPanel_module_default = { "controlPanel": "n-controlPanel" };
109
109
 
110
110
  // esbuild-css-modules-plugin-namespace:./src/styles/settings.module.css?esbuild-css-modules-plugin-building
111
- var settings_module_default = { "content": "n-content", "controls": "n-controls", "settings": "n-settings" };
111
+ var settings_module_default = { "content": "n-content", "controls": "n-controls", "select": "n-select", "settings": "n-settings" };
112
112
 
113
113
  // esbuild-css-modules-plugin-namespace:./src/styles/loading.module.css?esbuild-css-modules-plugin-building
114
114
  var loading_module_default = { "ldsEllipsis": "n-lds-ellipsis", "ldsEllipsis1": "n-lds-ellipsis1", "ldsEllipsis2": "n-lds-ellipsis2", "ldsEllipsis3": "n-lds-ellipsis3", "loading": "n-loading" };
115
115
 
116
+ // esbuild-css-modules-plugin-namespace:./src/styles/fullscreenText.module.css?esbuild-css-modules-plugin-building
117
+ var fullscreenText_module_default = { "fullscreenText": "n-fullscreenText" };
118
+
116
119
  // src/styles/styles.ts
117
- Object.assign(root_module_default, button_module_default, characters_module_default, dialog_module_default, headlessDialog_module_default, mainMenu_module_default, saves_module_default, controlPanel_module_default, settings_module_default, loading_module_default);
120
+ Object.assign(root_module_default, button_module_default, characters_module_default, dialog_module_default, headlessDialog_module_default, mainMenu_module_default, saves_module_default, controlPanel_module_default, settings_module_default, loading_module_default, fullscreenText_module_default);
118
121
 
119
122
  // src/screens/game.tsx
120
123
  var Game = (props) => {
@@ -126,14 +129,17 @@ var Game = (props) => {
126
129
  return { "background-image": is ? url(props.state.background) : "", "background-color": is ? void 0 : props.state.background };
127
130
  });
128
131
  const [auto, setAuto] = createSignal(false);
132
+ const getCurrentContent = () => {
133
+ const state = props.state;
134
+ return [state.dialog.content, state.text.content];
135
+ };
129
136
  createEffect(() => {
130
- if (props.state && store.dialogRef) {
131
- writer?.destroy();
132
- writer = M(store.dialogRef, props.state.dialog.content, () => {
133
- if (auto())
134
- onDialogClick();
135
- });
136
- }
137
+ const [dialog, text] = getCurrentContent();
138
+ writer?.destroy();
139
+ writer = M(dialog ? store.dialogRef : store.textRef, dialog || text, () => {
140
+ if (auto())
141
+ clearTypewriterEffect();
142
+ });
137
143
  });
138
144
  const onChoicesButtonClick = ([disabled, i]) => {
139
145
  if (disabled)
@@ -142,10 +148,15 @@ var Game = (props) => {
142
148
  setState("choices", { choices: [], visible: false, resolve: void 0 });
143
149
  resolve?.(i);
144
150
  };
145
- const onDialogClick = () => {
151
+ const clearTypewriterEffect = () => {
146
152
  if (writer && writer.end()) {
147
- const resolve = props.state.dialog.resolve;
148
- setState("dialog", { content: "", character: void 0, emotion: void 0, visible: false, resolve: void 0 });
153
+ const resolve = props.state.dialog.resolve || props.state.text.resolve;
154
+ const [dialog, text] = getCurrentContent();
155
+ if (dialog) {
156
+ setState("dialog", { content: "", character: void 0, emotion: void 0, visible: false, resolve: void 0 });
157
+ } else if (text) {
158
+ setState("text", { content: "", resolve: void 0 });
159
+ }
149
160
  resolve?.();
150
161
  }
151
162
  };
@@ -156,8 +167,9 @@ var Game = (props) => {
156
167
  setState("input", { element: void 0, question: "", visible: false });
157
168
  resolve?.();
158
169
  };
170
+ const layers = () => Object.values(props.state.layers);
159
171
  return <div class={root_module_default.root} style={background()}>
160
- <div class={root_module_default.characters}><For each={Object.entries(props.state.characters)}>{([character, data2]) => <Show when={data2.visible}>{() => {
172
+ <div data-characters={true} class={root_module_default.characters}><For each={Object.entries(props.state.characters)}>{([character, data2]) => <Show when={data2.visible}>{() => {
161
173
  const canvas = store.characters[character].canvas;
162
174
  createEffect(() => {
163
175
  void canvas.offsetWidth;
@@ -171,7 +183,7 @@ var Game = (props) => {
171
183
  <div
172
184
  class={root_module_default.dialog}
173
185
  style={{ display: props.state.dialog.visible ? "flex" : "none" }}
174
- onClick={onDialogClick}
186
+ onClick={clearTypewriterEffect}
175
187
  >
176
188
  {() => {
177
189
  const character = () => props.state.dialog.character;
@@ -249,10 +261,12 @@ var Game = (props) => {
249
261
  >{data.t("Sumbit")}</button>
250
262
  </DialogPanel>
251
263
  </div></Dialog>
252
- <div><For each={Object.values(props.state.layers)}>{(item) => item?.element}</For></div>
264
+ <div data-custom={true}><For each={layers()}>{(value) => value.dom}</For></div>
265
+ <div class={root_module_default.fullscreenText} data-fullscreen-text-shown={Boolean(props.state.text.content)} onClick={clearTypewriterEffect}><p ref={store.textRef}> </p></div>
253
266
  <div class={root_module_default.controlPanel}>
254
267
  <button
255
268
  type="button"
269
+ class={join(root_module_default.button, root_module_default.buttonControlPanel)}
256
270
  onClick={() => {
257
271
  data.options.stack.back();
258
272
  data.options.restore(data.options.stack.value);
@@ -260,26 +274,29 @@ var Game = (props) => {
260
274
  >{data.t("GoBack")}</button>
261
275
  <button
262
276
  type="button"
277
+ class={join(root_module_default.button, root_module_default.buttonControlPanel)}
263
278
  onClick={() => {
264
279
  data.options.save(false, "manual");
265
280
  }}
266
281
  >{data.t("DoSave")}</button>
267
282
  <button
268
283
  type="button"
284
+ class={join(root_module_default.button, root_module_default.buttonControlPanel)}
269
285
  onClick={() => {
270
286
  setAuto((prev) => !prev);
271
287
  }}
272
- >{data.t(auto() ? "Auto" : "Stop")}</button>
288
+ >{data.t(auto() ? "Stop" : "Auto")}</button>
273
289
  <button
274
290
  type="button"
291
+ class={join(root_module_default.button, root_module_default.buttonControlPanel)}
275
292
  onClick={() => {
276
- data.options.save(false, "auto").then(() => {
277
- props.setState("screen", "settings");
278
- });
293
+ data.options.save(false, "auto");
294
+ props.setState("screen", "settings");
279
295
  }}
280
296
  >{data.t("Settings")}</button>
281
297
  <button
282
298
  type="button"
299
+ class={join(root_module_default.button, root_module_default.buttonControlPanel)}
283
300
  onClick={() => {
284
301
  data.options.stack.clear();
285
302
  props.setState("screen", "mainmenu");
@@ -377,10 +394,10 @@ var Settings = (props) => {
377
394
  const languageNames = new Intl.DisplayNames([language()], {
378
395
  type: "language"
379
396
  });
380
- return <div class={root_module_default.content}>
397
+ return <div class={root_module_default.content}><div class={root_module_default.select}>
381
398
  <label for={id}>{data.t("Language")}</label>
382
399
  <select id={id} onChange={onSelect}><For3 each={data.options.languages}>{(lang) => <option value={lang} selected={lang === language()}>{capitalize(languageNames.of(lang) || lang)}</option>}</For3></select>
383
- </div>;
400
+ </div></div>;
384
401
  }}</Show3>
385
402
  </div>;
386
403
  };
@@ -418,6 +435,9 @@ var createSolidRenderer = () => {
418
435
  error: "",
419
436
  visible: false
420
437
  },
438
+ text: {
439
+ content: ""
440
+ },
421
441
  layers: {},
422
442
  screen: "mainmenu"
423
443
  });
@@ -430,6 +450,7 @@ var createSolidRenderer = () => {
430
450
  let characters;
431
451
  let renderer;
432
452
  let options;
453
+ let root;
433
454
  return {
434
455
  createRenderer(init) {
435
456
  options = init, characters = init.characters;
@@ -440,7 +461,7 @@ var createSolidRenderer = () => {
440
461
  character(character) {
441
462
  if (store.characters[character])
442
463
  return store.characters[character];
443
- const canvas = <canvas />;
464
+ const canvas = <canvas data-character={character} />;
444
465
  const ctx = canvas.getContext("2d");
445
466
  return store.characters[character] = {
446
467
  canvas,
@@ -503,11 +524,12 @@ var createSolidRenderer = () => {
503
524
  for (const character of Object.keys(state.characters)) {
504
525
  setState("characters", character, { visible: false });
505
526
  }
506
- for (const layer of Object.values(state.layers)) {
527
+ for (const [id, layer] of Object.entries(state.layers)) {
507
528
  if (!layer)
508
529
  continue;
509
- if (!(goingBack && layer.skipClearOnGoingBack()))
510
- layer.delete();
530
+ if (!(goingBack && layer.fn.skipClearOnGoingBack)) {
531
+ layer.clear(), setState("layers", id, void 0);
532
+ }
511
533
  }
512
534
  resolve();
513
535
  };
@@ -548,42 +570,34 @@ var createSolidRenderer = () => {
548
570
  return store.audio[method] = handle;
549
571
  },
550
572
  custom(fn, goingBack, resolve) {
551
- const get = (id) => {
552
- if (state.layers[id])
553
- return state.layers[id];
554
- const local = {
555
- skipClearOnGoingBack: false,
556
- storage: {},
557
- clear: () => {
558
- }
573
+ const get = (id, insert = true) => {
574
+ const cached = state.layers[id];
575
+ if (cached)
576
+ return cached.value;
577
+ let clear = () => {
559
578
  };
560
- const data = (data2) => {
561
- if (!data2) {
562
- return local.storage;
563
- } else {
564
- local.storage = data2;
565
- }
579
+ let store2 = {};
580
+ const topLevelClear = () => {
581
+ clear(), setState("layers", id, void 0);
566
582
  };
567
- const skipClearOnGoingBack = (value) => {
568
- if (value) {
569
- local.skipClearOnGoingBack = value;
570
- } else {
571
- return local.skipClearOnGoingBack;
583
+ const element = insert ? <div id={id} /> : null;
584
+ setState("layers", id, {
585
+ fn,
586
+ dom: element,
587
+ clear: topLevelClear,
588
+ value: {
589
+ root,
590
+ element,
591
+ delete: topLevelClear,
592
+ data(data) {
593
+ return data ? store2 = data : store2;
594
+ },
595
+ clear(cb) {
596
+ clear = cb;
597
+ }
572
598
  }
573
- };
574
- setState("layers", id, () => ({
575
- element: <div id={id} />,
576
- data,
577
- skipClearOnGoingBack,
578
- clear(fn2) {
579
- local.clear = fn2;
580
- },
581
- delete() {
582
- local.clear();
583
- setState("layers", id, void 0);
584
- }
585
- }));
586
- return state.layers[id];
599
+ });
600
+ return state.layers[id].value;
587
601
  };
588
602
  const result = fn(get, goingBack, fn.requireUserAction ? resolve : () => {
589
603
  });
@@ -591,6 +605,9 @@ var createSolidRenderer = () => {
591
605
  result ? result.then(resolve) : resolve();
592
606
  return result;
593
607
  },
608
+ text(content, resolve) {
609
+ setState("text", { content, resolve });
610
+ },
594
611
  store,
595
612
  ui: {
596
613
  showScreen(name) {
@@ -600,7 +617,7 @@ var createSolidRenderer = () => {
600
617
  };
601
618
  },
602
619
  Novely(props) {
603
- return <div {...props}><Provider storeData={options.$} options={options} renderer={renderer}><Switch fallback={<>No</>}>
620
+ return <div {...props} ref={root}><Provider storeData={options.$} options={options} renderer={renderer}><Switch fallback={<>No</>}>
604
621
  <Match when={state.screen === "game"}><Game state={state} setState={
605
622
  /* @once */
606
623
  setState
@@ -1,4 +1,4 @@
1
- import type { Renderer, RendererInit, RendererStore, ValidAction, CustomHandlerGetResult } from '@novely/core';
1
+ import type { Renderer, RendererInit, RendererStore, ValidAction, CustomHandler, CustomHandlerGetResult } from '@novely/core';
2
2
  import type { JSX } from 'solid-js';
3
3
  interface StateCharacter {
4
4
  /**
@@ -77,7 +77,22 @@ interface StateInput {
77
77
  */
78
78
  error: string;
79
79
  }
80
- type StateLayers = Record<string, CustomHandlerGetResult | undefined>;
80
+ interface StateText {
81
+ /**
82
+ * Текст
83
+ */
84
+ content: string;
85
+ /**
86
+ * Функция `resolve`
87
+ */
88
+ resolve?: () => void;
89
+ }
90
+ type StateLayers = Record<string, {
91
+ value: CustomHandlerGetResult;
92
+ fn: CustomHandler;
93
+ clear: (() => void);
94
+ dom: null | HTMLDivElement;
95
+ } | undefined>;
81
96
  interface State {
82
97
  background: string;
83
98
  characters: Record<string, StateCharacter>;
@@ -85,10 +100,12 @@ interface State {
85
100
  choices: StateChoices;
86
101
  input: StateInput;
87
102
  layers: StateLayers;
103
+ text: StateText;
88
104
  screen: "mainmenu" | "game" | "saves" | "settings" | 'loading';
89
105
  }
90
106
  interface SolidRendererStore extends RendererStore {
91
107
  dialogRef?: HTMLParagraphElement;
108
+ textRef?: HTMLParagraphElement;
92
109
  }
93
110
  declare const createSolidRenderer: () => {
94
111
  createRenderer(init: RendererInit): Renderer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@novely/solid-renderer",
3
- "version": "0.0.0-alpha",
3
+ "version": "0.0.0-alpha.10",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -19,8 +19,8 @@
19
19
  "typescript": "^4.9.5"
20
20
  },
21
21
  "dependencies": {
22
- "@novely/core": "workspace:*",
23
- "@novely/typewriter": "workspace:*",
22
+ "@novely/core": "*",
23
+ "@novely/typewriter": "*",
24
24
  "solid-headless": "^0.13.1",
25
25
  "solid-js": "1.6.10"
26
26
  },