@dsh-agentic-roleplay/core 0.3.1 → 0.3.2
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/lib/authoring.js +2 -2
- package/lib/client.js +1299 -375
- package/lib/client.js.map +1 -1
- package/lib/compaction.js +1 -1
- package/lib/{deliver-BDW5WZvc.js → deliver-BSsDtF6X.js} +1198 -17
- package/lib/{documents-DtlY2IRt.js → documents-B5XAdfo2.js} +141 -8
- package/lib/{gallery-DACG5eh2.js → gallery-DS5-qH9F.js} +2 -2
- package/lib/{generator-DGYcLMp7.js → generator-BzeepLd2.js} +2 -2
- package/lib/images.js +3 -3
- package/lib/index.js +178 -10
- package/lib/narration-DK2kiIjE.js +141 -0
- package/lib/orchestration.js +684 -1456
- package/lib/{packs-CkRZDCsV.js → packs-BCGK9KZV.js} +3 -3
- package/lib/{presenter-agent-PK9JYExk.js → presenter-agent-Cp-J0onD.js} +3 -3
- package/lib/{narration-5ig7Dg28.js → settings-CA6icLL_.js} +156 -141
- package/package.json +2 -2
- package/prompts/en/roleplay/dice.md +7 -0
- package/prompts/en/roleplay/game-master.md +2 -0
- package/prompts/en/roleplay/reflection.md +3 -1
- package/prompts/zh/roleplay/dice.md +7 -0
- package/prompts/zh/roleplay/game-master.md +2 -0
- package/prompts/zh/roleplay/reflection.md +3 -1
- package/lib/src-CWTNeL6Y.js +0 -128
package/lib/client.js
CHANGED
|
@@ -26,19 +26,19 @@ window.__ModuleLoader__.load({
|
|
|
26
26
|
}
|
|
27
27
|
//#endregion
|
|
28
28
|
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/panel/PageTabs.module.css.mjs
|
|
29
|
-
const css$
|
|
30
|
-
const key$
|
|
31
|
-
let tag$
|
|
32
|
-
if (tag$
|
|
33
|
-
tag$
|
|
34
|
-
tag$
|
|
35
|
-
tag$
|
|
36
|
-
document.head.appendChild(tag$
|
|
37
|
-
}
|
|
38
|
-
tag$
|
|
29
|
+
const css$26 = ".rp_Poldga_tabs{scrollbar-width:none;gap:24px;margin-bottom:-1px;display:flex;overflow-x:auto}.rp_Poldga_tabs::-webkit-scrollbar{display:none}.rp_Poldga_tab{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;white-space:nowrap;background:0 0;border:0;margin:0;padding:8px 0;font-size:13px;line-height:20px;box-shadow:inset 0 -2px #0000}.rp_Poldga_tab:hover{color:var(--dsw-alias-label-primary)}.rp_Poldga_tab[aria-selected=true]{color:var(--dsw-alias-state-business-primary);font-weight:500;box-shadow:inset 0 -2px}.rp_Poldga_tab:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px;border-radius:var(--dsw-radius-xs)}";
|
|
30
|
+
const key$26 = "src/client/panel/PageTabs.module.css";
|
|
31
|
+
let tag$26 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$26) + "]");
|
|
32
|
+
if (tag$26 === null) {
|
|
33
|
+
tag$26 = document.createElement("style");
|
|
34
|
+
tag$26.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
35
|
+
tag$26.dataset.pluginCss = key$26;
|
|
36
|
+
document.head.appendChild(tag$26);
|
|
37
|
+
}
|
|
38
|
+
tag$26.textContent = css$26;
|
|
39
39
|
var PageTabs_module_css_default = {
|
|
40
|
-
"
|
|
41
|
-
"
|
|
40
|
+
"tabs": "rp_Poldga_tabs",
|
|
41
|
+
"tab": "rp_Poldga_tab"
|
|
42
42
|
};
|
|
43
43
|
//#endregion
|
|
44
44
|
//#region src/client/panel/PageTabs.tsx
|
|
@@ -82,21 +82,21 @@ window.__ModuleLoader__.load({
|
|
|
82
82
|
}
|
|
83
83
|
//#endregion
|
|
84
84
|
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/panel/RoleplayPanel.module.css.mjs
|
|
85
|
-
const css$
|
|
86
|
-
const key$
|
|
87
|
-
let tag$
|
|
88
|
-
if (tag$
|
|
89
|
-
tag$
|
|
90
|
-
tag$
|
|
91
|
-
tag$
|
|
92
|
-
document.head.appendChild(tag$
|
|
85
|
+
const css$25 = ".rp_ua5gBa_panel{min-height:0;color:var(--dsw-alias-label-primary);flex-direction:column;flex:1 1 0;display:flex}.rp_ua5gBa_header{border-bottom:.5px solid var(--dsw-alias-border-l2);flex:none;padding:12px 24px 0}.rp_ua5gBa_title{margin:0 0 4px;font-size:14px;font-weight:500;line-height:22px}.rp_ua5gBa_body{flex-direction:column;flex:1 1 0;min-height:0;padding:12px 24px 16px;display:flex}@media (width<=640px){.rp_ua5gBa_header,.rp_ua5gBa_body{padding-inline:16px}}";
|
|
86
|
+
const key$25 = "src/client/panel/RoleplayPanel.module.css";
|
|
87
|
+
let tag$25 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$25) + "]");
|
|
88
|
+
if (tag$25 === null) {
|
|
89
|
+
tag$25 = document.createElement("style");
|
|
90
|
+
tag$25.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
91
|
+
tag$25.dataset.pluginCss = key$25;
|
|
92
|
+
document.head.appendChild(tag$25);
|
|
93
93
|
}
|
|
94
|
-
tag$
|
|
94
|
+
tag$25.textContent = css$25;
|
|
95
95
|
var RoleplayPanel_module_css_default = {
|
|
96
|
-
"body": "rp_ua5gBa_body",
|
|
97
96
|
"title": "rp_ua5gBa_title",
|
|
98
|
-
"
|
|
99
|
-
"panel": "rp_ua5gBa_panel"
|
|
97
|
+
"body": "rp_ua5gBa_body",
|
|
98
|
+
"panel": "rp_ua5gBa_panel",
|
|
99
|
+
"header": "rp_ua5gBa_header"
|
|
100
100
|
};
|
|
101
101
|
//#endregion
|
|
102
102
|
//#region src/client/panel/RoleplayPanel.tsx
|
|
@@ -143,7 +143,7 @@ window.__ModuleLoader__.load({
|
|
|
143
143
|
}
|
|
144
144
|
//#endregion
|
|
145
145
|
//#region src/client/panel/locales.ts
|
|
146
|
-
const dictionaries$
|
|
146
|
+
const dictionaries$15 = {
|
|
147
147
|
en: {
|
|
148
148
|
label: "Role Play",
|
|
149
149
|
heading: "DSH Agentic Role Play",
|
|
@@ -204,7 +204,7 @@ window.__ModuleLoader__.load({
|
|
|
204
204
|
/** Adds the Role Play entry to the sidebar and the main panel it opens. */
|
|
205
205
|
function registerPanel(ctx) {
|
|
206
206
|
const t = ctx.locale.bind(NAMESPACE$10);
|
|
207
|
-
ctx.effect(() => ctx.locale.register(NAMESPACE$10, dictionaries$
|
|
207
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$10, dictionaries$15), "roleplay: panel dictionaries");
|
|
208
208
|
const pages = createPagesSource(ctx);
|
|
209
209
|
ctx.effect(() => pages.start(), "roleplay: page list");
|
|
210
210
|
const handle = createPanelStore();
|
|
@@ -734,51 +734,51 @@ window.__ModuleLoader__.load({
|
|
|
734
734
|
const isDirty = (character, draft) => Object.keys(editOf$1(character, draft)).length > 0;
|
|
735
735
|
//#endregion
|
|
736
736
|
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/world-editor/CharactersPanel.module.css.mjs
|
|
737
|
-
const css$
|
|
738
|
-
const key$
|
|
739
|
-
let tag$
|
|
740
|
-
if (tag$
|
|
741
|
-
tag$
|
|
742
|
-
tag$
|
|
743
|
-
tag$
|
|
744
|
-
document.head.appendChild(tag$
|
|
737
|
+
const css$24 = ".rp_5ZMIxq_panel{flex-direction:column;flex:1 1 0;min-height:0;display:flex}.rp_5ZMIxq_tabs{border-bottom:.5px solid var(--dsw-alias-border-l2);flex:none;gap:4px;padding:0 24px;display:flex;overflow-x:auto}.rp_5ZMIxq_tab{font:inherit;white-space:nowrap;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-bottom:2px solid #0000;flex:none;margin-bottom:-1px;padding:12px 10px 10px;font-size:13px;line-height:20px}.rp_5ZMIxq_tabOn{color:var(--dsw-alias-state-business-primary);border-bottom-color:var(--dsw-alias-state-business-primary);font-weight:500}.rp_5ZMIxq_body{flex:1 1 0;min-height:0;overflow-y:auto}.rp_5ZMIxq_sheet{box-sizing:border-box;flex-direction:column;gap:20px;max-width:760px;padding:24px 24px 240px;display:flex}.rp_5ZMIxq_head{align-items:flex-start;gap:20px;display:flex}.rp_5ZMIxq_portrait{aspect-ratio:3/4;object-fit:cover;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);width:150px;height:auto;display:block}.rp_5ZMIxq_portraitBox{border-radius:var(--dsw-radius-lg);width:150px;height:200px;color:inherit;font:inherit;cursor:pointer;background:0 0;border:0;flex:0 0 150px;padding:0;display:block;position:relative}.rp_5ZMIxq_portraitBox:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}.rp_5ZMIxq_portraitBox:disabled{cursor:not-allowed}.rp_5ZMIxq_portraitAction{box-sizing:border-box;border-radius:0 0 var(--dsw-radius-lg) var(--dsw-radius-lg);color:#fff;text-align:center;opacity:0;background:#0000009e;padding:7px 6px;font-size:12px;line-height:16px;transition:opacity .12s;position:absolute;bottom:1px;left:1px;right:1px}.rp_5ZMIxq_portraitBox:hover .rp_5ZMIxq_portraitAction,.rp_5ZMIxq_portraitBox:focus-visible .rp_5ZMIxq_portraitAction,.rp_5ZMIxq_portraitBox:disabled .rp_5ZMIxq_portraitAction{opacity:1}.rp_5ZMIxq_portraitError,.rp_5ZMIxq_portraitHint{margin:12px 24px 0;font-size:12px}.rp_5ZMIxq_portraitError{color:var(--dsw-alias-state-danger-primary)}.rp_5ZMIxq_portraitHint{color:var(--dsw-alias-label-secondary)}.rp_5ZMIxq_placeholder{box-sizing:border-box;color:var(--dsw-alias-label-secondary);flex-direction:column;justify-content:center;align-items:center;gap:8px;display:flex}.rp_5ZMIxq_initial{opacity:.6;font-size:48px;font-weight:500;line-height:1}.rp_5ZMIxq_missing{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_5ZMIxq_meta{flex-direction:column;flex:1 1 0;gap:10px;min-width:0;display:flex}.rp_5ZMIxq_section{border-top:.5px solid var(--dsw-alias-border-l4);flex-direction:column;gap:6px;padding-top:16px;display:flex}.rp_5ZMIxq_sectionTitle{color:var(--dsw-alias-label-primary);margin:0;font-size:13px;font-weight:500;line-height:20px}.rp_5ZMIxq_empty{color:var(--dsw-alias-label-tertiary);margin:0;padding:0 24px;font-size:13px}.rp_5ZMIxq_section .rp_5ZMIxq_empty{padding:0}.rp_5ZMIxq_tabsSpace{flex:auto}.rp_5ZMIxq_voiceInline{min-width:220px;color:var(--dsw-alias-label-tertiary);align-items:center;gap:6px;font-size:12px;display:flex}.rp_5ZMIxq_bar{border-bottom:.5px solid var(--dsw-alias-border-l4);background:var(--dsw-alias-bg-layer-2);flex:none;justify-content:flex-end;align-items:center;gap:8px;padding:6px 24px;display:flex}.rp_5ZMIxq_barText{color:var(--dsw-alias-label-secondary);margin-right:auto;font-size:12px}.rp_5ZMIxq_nameInput{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:32px;color:var(--dsw-alias-label-primary);font:inherit;padding:4px 8px;font-size:14px;line-height:22px}.rp_5ZMIxq_row{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.rp_5ZMIxq_grid{grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));gap:10px 12px;display:grid}.rp_5ZMIxq_field{flex-direction:column;gap:4px;min-width:0;display:flex}.rp_5ZMIxq_wide{grid-column:1/-1}.rp_5ZMIxq_label,.rp_5ZMIxq_help{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_5ZMIxq_error{color:var(--dsw-alias-state-error-primary);font-size:12px}.rp_5ZMIxq_select{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:32px;color:inherit;font:inherit;padding:4px 8px;font-size:13px}.rp_5ZMIxq_area{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:96px;color:inherit;font:inherit;resize:vertical;padding:6px 8px;font-size:13px;line-height:20px}.rp_5ZMIxq_goal{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-lg);flex-direction:column;gap:8px;padding:10px;display:flex}.rp_5ZMIxq_row>.rp_5ZMIxq_select{width:auto;min-width:110px}.rp_5ZMIxq_select:focus-visible,.rp_5ZMIxq_area:focus-visible,.rp_5ZMIxq_nameInput:focus-visible{border-color:var(--dsw-alias-state-business-primary);outline:none}@media (width<=640px){.rp_5ZMIxq_sheet{padding-inline:16px}.rp_5ZMIxq_head{flex-direction:column}.rp_5ZMIxq_portraitBox,.rp_5ZMIxq_portrait{width:120px}.rp_5ZMIxq_portraitBox{flex-basis:120px;height:160px}.rp_5ZMIxq_bar{flex-wrap:wrap;padding-inline:16px}.rp_5ZMIxq_voiceInline{width:100%;min-width:0}}";
|
|
738
|
+
const key$24 = "src/client/world-editor/CharactersPanel.module.css";
|
|
739
|
+
let tag$24 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$24) + "]");
|
|
740
|
+
if (tag$24 === null) {
|
|
741
|
+
tag$24 = document.createElement("style");
|
|
742
|
+
tag$24.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
743
|
+
tag$24.dataset.pluginCss = key$24;
|
|
744
|
+
document.head.appendChild(tag$24);
|
|
745
745
|
}
|
|
746
|
-
tag$
|
|
746
|
+
tag$24.textContent = css$24;
|
|
747
747
|
var CharactersPanel_module_css_default = {
|
|
748
|
-
"tabs": "rp_5ZMIxq_tabs",
|
|
749
|
-
"body": "rp_5ZMIxq_body",
|
|
750
|
-
"portraitHint": "rp_5ZMIxq_portraitHint",
|
|
751
|
-
"empty": "rp_5ZMIxq_empty",
|
|
752
748
|
"voiceInline": "rp_5ZMIxq_voiceInline",
|
|
753
|
-
"sectionTitle": "rp_5ZMIxq_sectionTitle",
|
|
754
|
-
"meta": "rp_5ZMIxq_meta",
|
|
755
|
-
"portrait": "rp_5ZMIxq_portrait",
|
|
756
749
|
"help": "rp_5ZMIxq_help",
|
|
757
|
-
"grid": "rp_5ZMIxq_grid",
|
|
758
|
-
"initial": "rp_5ZMIxq_initial",
|
|
759
750
|
"field": "rp_5ZMIxq_field",
|
|
760
|
-
"placeholder": "rp_5ZMIxq_placeholder",
|
|
761
|
-
"nameInput": "rp_5ZMIxq_nameInput",
|
|
762
|
-
"bar": "rp_5ZMIxq_bar",
|
|
763
|
-
"label": "rp_5ZMIxq_label",
|
|
764
|
-
"portraitBox": "rp_5ZMIxq_portraitBox",
|
|
765
751
|
"tabsSpace": "rp_5ZMIxq_tabsSpace",
|
|
766
|
-
"area": "rp_5ZMIxq_area",
|
|
767
|
-
"panel": "rp_5ZMIxq_panel",
|
|
768
|
-
"row": "rp_5ZMIxq_row",
|
|
769
752
|
"error": "rp_5ZMIxq_error",
|
|
753
|
+
"empty": "rp_5ZMIxq_empty",
|
|
754
|
+
"grid": "rp_5ZMIxq_grid",
|
|
755
|
+
"head": "rp_5ZMIxq_head",
|
|
756
|
+
"row": "rp_5ZMIxq_row",
|
|
757
|
+
"portraitError": "rp_5ZMIxq_portraitError",
|
|
770
758
|
"sheet": "rp_5ZMIxq_sheet",
|
|
759
|
+
"portraitBox": "rp_5ZMIxq_portraitBox",
|
|
760
|
+
"placeholder": "rp_5ZMIxq_placeholder",
|
|
761
|
+
"portraitAction": "rp_5ZMIxq_portraitAction",
|
|
771
762
|
"wide": "rp_5ZMIxq_wide",
|
|
772
|
-
"
|
|
773
|
-
"
|
|
763
|
+
"panel": "rp_5ZMIxq_panel",
|
|
764
|
+
"initial": "rp_5ZMIxq_initial",
|
|
765
|
+
"section": "rp_5ZMIxq_section",
|
|
766
|
+
"sectionTitle": "rp_5ZMIxq_sectionTitle",
|
|
774
767
|
"goal": "rp_5ZMIxq_goal",
|
|
775
|
-
"missing": "rp_5ZMIxq_missing",
|
|
776
768
|
"barText": "rp_5ZMIxq_barText",
|
|
769
|
+
"nameInput": "rp_5ZMIxq_nameInput",
|
|
777
770
|
"tabOn": "rp_5ZMIxq_tabOn",
|
|
778
|
-
"
|
|
779
|
-
"
|
|
780
|
-
"
|
|
781
|
-
"
|
|
771
|
+
"area": "rp_5ZMIxq_area",
|
|
772
|
+
"tab": "rp_5ZMIxq_tab",
|
|
773
|
+
"missing": "rp_5ZMIxq_missing",
|
|
774
|
+
"bar": "rp_5ZMIxq_bar",
|
|
775
|
+
"select": "rp_5ZMIxq_select",
|
|
776
|
+
"meta": "rp_5ZMIxq_meta",
|
|
777
|
+
"portrait": "rp_5ZMIxq_portrait",
|
|
778
|
+
"body": "rp_5ZMIxq_body",
|
|
779
|
+
"label": "rp_5ZMIxq_label",
|
|
780
|
+
"tabs": "rp_5ZMIxq_tabs",
|
|
781
|
+
"portraitHint": "rp_5ZMIxq_portraitHint"
|
|
782
782
|
};
|
|
783
783
|
//#endregion
|
|
784
784
|
//#region src/client/world-editor/EditorTabs.tsx
|
|
@@ -2379,50 +2379,50 @@ window.__ModuleLoader__.load({
|
|
|
2379
2379
|
}
|
|
2380
2380
|
//#endregion
|
|
2381
2381
|
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/world-editor/RelationsPanel.module.css.mjs
|
|
2382
|
-
const css$
|
|
2383
|
-
const key$
|
|
2384
|
-
let tag$
|
|
2385
|
-
if (tag$
|
|
2386
|
-
tag$
|
|
2387
|
-
tag$
|
|
2388
|
-
tag$
|
|
2389
|
-
document.head.appendChild(tag$
|
|
2382
|
+
const css$23 = ".rp_7pEHTW_panel{flex-direction:column;flex:1 1 0;min-height:0;display:flex;position:relative}.rp_7pEHTW_toolbar{border-bottom:.5px solid var(--dsw-alias-border-l2);flex-wrap:wrap;align-items:center;gap:4px;padding:8px 16px;display:flex}.rp_7pEHTW_filter{border-radius:var(--dsw-radius-sm);min-height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;padding:4px 10px}.rp_7pEHTW_filterOn{color:var(--dsw-alias-state-business-primary);background:var(--dsw-alias-bg-layer-2)}.rp_7pEHTW_filter:focus-visible,.rp_7pEHTW_edge:focus-visible,.rp_7pEHTW_graphEdge:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:-2px}.rp_7pEHTW_space{flex:1}.rp_7pEHTW_perspective{color:var(--dsw-alias-label-tertiary);align-items:center;gap:6px;font-size:12px;display:flex}.rp_7pEHTW_perspective select{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);max-width:180px;min-height:32px;color:inherit;padding:4px 8px}.rp_7pEHTW_workspace{flex:1 1 0;grid-template-columns:minmax(220px,34%) minmax(320px,1fr);min-height:0;display:grid}.rp_7pEHTW_list{border-right:.5px solid var(--dsw-alias-border-l3);overflow-y:auto}.rp_7pEHTW_edge{border:0;border-bottom:.5px solid var(--dsw-alias-border-l4);width:100%;min-height:48px;color:inherit;text-align:left;cursor:pointer;background:0 0;flex-direction:column;gap:2px;padding:8px 16px;display:flex}.rp_7pEHTW_edgeOn{background:var(--dsw-alias-bg-layer-2)}.rp_7pEHTW_edgeTitle{text-overflow:ellipsis;white-space:nowrap;font-size:13px;overflow:hidden}.rp_7pEHTW_edgeKind{color:var(--dsw-alias-label-tertiary);font-size:11px}.rp_7pEHTW_empty{color:var(--dsw-alias-label-tertiary);padding:20px}.rp_7pEHTW_inspector{min-width:0;padding:24px 24px 240px;overflow-y:auto}.rp_7pEHTW_head h2{margin:0 0 8px;font-size:17px}.rp_7pEHTW_entities{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;align-items:center;gap:6px;display:flex}.rp_7pEHTW_notice{color:var(--dsw-alias-label-secondary);margin:24px 0}.rp_7pEHTW_form{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:24px;display:grid}.rp_7pEHTW_form label{color:var(--dsw-alias-label-tertiary);flex-direction:column;gap:5px;font-size:12px;display:flex}.rp_7pEHTW_form select,.rp_7pEHTW_form textarea{box-sizing:border-box;border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);width:100%;min-height:32px;color:inherit;font:inherit;padding:6px 8px}.rp_7pEHTW_form textarea{resize:vertical;min-height:96px}.rp_7pEHTW_form select:focus-visible,.rp_7pEHTW_form textarea:focus-visible{border-color:var(--dsw-alias-state-business-primary);outline:none}.rp_7pEHTW_wide{grid-column:1/-1}.rp_7pEHTW_metrics{grid-column:1/-1;grid-template-columns:repeat(4,minmax(90px,1fr));gap:10px;display:grid}.rp_7pEHTW_check{align-self:end;align-items:center;min-height:32px;flex-direction:row!important}.rp_7pEHTW_actions{border-top:.5px solid var(--dsw-alias-border-l4);flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;margin-top:28px;padding-top:12px;display:flex}.rp_7pEHTW_status{color:var(--dsw-alias-label-secondary);margin-right:auto}.rp_7pEHTW_error{color:var(--dsw-alias-state-error-primary);margin-right:auto}.rp_7pEHTW_graph{background:radial-gradient(circle, var(--dsw-alias-bg-layer-2), transparent 70%);flex:1 1 0;min-height:360px;position:relative;overflow:hidden}.rp_7pEHTW_graph svg{width:100%;height:100%;min-height:520px}.rp_7pEHTW_graphEdge{cursor:pointer;stroke:var(--dsw-alias-border-l1);stroke-width:2px}.rp_7pEHTW_graphEdge:hover,.rp_7pEHTW_graphEdgeOn{stroke:var(--dsw-alias-state-business-primary);stroke-width:4px}.rp_7pEHTW_node circle{fill:var(--dsw-alias-bg-layer-1);stroke:var(--dsw-alias-border-l1);stroke-width:2px}.rp_7pEHTW_node_character circle{fill:color-mix(in srgb, var(--dsw-alias-state-business-primary) 18%, var(--dsw-alias-bg-layer-1))}.rp_7pEHTW_node_location circle{fill:color-mix(in srgb, #4a9 20%, var(--dsw-alias-bg-layer-1))}.rp_7pEHTW_node_item circle{fill:color-mix(in srgb, #c90 20%, var(--dsw-alias-bg-layer-1))}.rp_7pEHTW_node_faction circle{fill:color-mix(in srgb, #96c 20%, var(--dsw-alias-bg-layer-1))}.rp_7pEHTW_node text{fill:var(--dsw-alias-label-primary);pointer-events:none;font-size:11px}.rp_7pEHTW_graphInspector{box-sizing:border-box;border-radius:var(--dsw-radius-panel);background:var(--dsw-alias-bg-layer-1);width:min(480px,100% - 40px);max-height:62%;box-shadow:var(--dsw-elevation-panel);border:0;padding:18px;position:absolute;bottom:20px;right:20px;overflow-y:auto}@media (width<=760px){.rp_7pEHTW_workspace{grid-template-columns:1fr}.rp_7pEHTW_list{border-right:0;border-bottom:.5px solid var(--dsw-alias-border-l3);max-height:220px}.rp_7pEHTW_inspector{padding-inline:16px}.rp_7pEHTW_form{grid-template-columns:1fr}.rp_7pEHTW_wide,.rp_7pEHTW_metrics{grid-column:1}.rp_7pEHTW_metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.rp_7pEHTW_graphInspector{width:calc(100% - 24px);bottom:12px;right:12px}}@media (pointer:coarse){.rp_7pEHTW_filter{min-height:44px}}";
|
|
2383
|
+
const key$23 = "src/client/world-editor/RelationsPanel.module.css";
|
|
2384
|
+
let tag$23 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$23) + "]");
|
|
2385
|
+
if (tag$23 === null) {
|
|
2386
|
+
tag$23 = document.createElement("style");
|
|
2387
|
+
tag$23.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
2388
|
+
tag$23.dataset.pluginCss = key$23;
|
|
2389
|
+
document.head.appendChild(tag$23);
|
|
2390
2390
|
}
|
|
2391
|
-
tag$
|
|
2391
|
+
tag$23.textContent = css$23;
|
|
2392
2392
|
var RelationsPanel_module_css_default = {
|
|
2393
|
-
"graphInspector": "rp_7pEHTW_graphInspector",
|
|
2394
|
-
"head": "rp_7pEHTW_head",
|
|
2395
2393
|
"space": "rp_7pEHTW_space",
|
|
2394
|
+
"head": "rp_7pEHTW_head",
|
|
2395
|
+
"edge": "rp_7pEHTW_edge",
|
|
2396
2396
|
"filter": "rp_7pEHTW_filter",
|
|
2397
|
-
"
|
|
2398
|
-
"
|
|
2397
|
+
"edgeTitle": "rp_7pEHTW_edgeTitle",
|
|
2398
|
+
"edgeOn": "rp_7pEHTW_edgeOn",
|
|
2399
2399
|
"form": "rp_7pEHTW_form",
|
|
2400
|
-
"
|
|
2401
|
-
"
|
|
2402
|
-
"
|
|
2403
|
-
"
|
|
2400
|
+
"wide": "rp_7pEHTW_wide",
|
|
2401
|
+
"notice": "rp_7pEHTW_notice",
|
|
2402
|
+
"graph": "rp_7pEHTW_graph",
|
|
2403
|
+
"node": "rp_7pEHTW_node",
|
|
2404
|
+
"panel": "rp_7pEHTW_panel",
|
|
2404
2405
|
"graphEdgeOn": "rp_7pEHTW_graphEdgeOn",
|
|
2405
|
-
"
|
|
2406
|
+
"node_character": "rp_7pEHTW_node_character",
|
|
2407
|
+
"error": "rp_7pEHTW_error",
|
|
2408
|
+
"toolbar": "rp_7pEHTW_toolbar",
|
|
2406
2409
|
"entities": "rp_7pEHTW_entities",
|
|
2407
|
-
"
|
|
2410
|
+
"node_faction": "rp_7pEHTW_node_faction",
|
|
2411
|
+
"perspective": "rp_7pEHTW_perspective",
|
|
2412
|
+
"workspace": "rp_7pEHTW_workspace",
|
|
2413
|
+
"actions": "rp_7pEHTW_actions",
|
|
2414
|
+
"status": "rp_7pEHTW_status",
|
|
2415
|
+
"empty": "rp_7pEHTW_empty",
|
|
2408
2416
|
"filterOn": "rp_7pEHTW_filterOn",
|
|
2409
|
-
"graphEdge": "rp_7pEHTW_graphEdge",
|
|
2410
2417
|
"list": "rp_7pEHTW_list",
|
|
2411
|
-
"edgeKind": "rp_7pEHTW_edgeKind",
|
|
2412
|
-
"actions": "rp_7pEHTW_actions",
|
|
2413
|
-
"error": "rp_7pEHTW_error",
|
|
2414
|
-
"wide": "rp_7pEHTW_wide",
|
|
2415
2418
|
"node_location": "rp_7pEHTW_node_location",
|
|
2416
|
-
"edgeTitle": "rp_7pEHTW_edgeTitle",
|
|
2417
|
-
"workspace": "rp_7pEHTW_workspace",
|
|
2418
|
-
"edgeOn": "rp_7pEHTW_edgeOn",
|
|
2419
|
-
"perspective": "rp_7pEHTW_perspective",
|
|
2420
|
-
"node_faction": "rp_7pEHTW_node_faction",
|
|
2421
|
-
"empty": "rp_7pEHTW_empty",
|
|
2422
|
-
"panel": "rp_7pEHTW_panel",
|
|
2423
2419
|
"inspector": "rp_7pEHTW_inspector",
|
|
2424
|
-
"
|
|
2425
|
-
"
|
|
2420
|
+
"edgeKind": "rp_7pEHTW_edgeKind",
|
|
2421
|
+
"check": "rp_7pEHTW_check",
|
|
2422
|
+
"node_item": "rp_7pEHTW_node_item",
|
|
2423
|
+
"graphInspector": "rp_7pEHTW_graphInspector",
|
|
2424
|
+
"metrics": "rp_7pEHTW_metrics",
|
|
2425
|
+
"graphEdge": "rp_7pEHTW_graphEdge"
|
|
2426
2426
|
};
|
|
2427
2427
|
//#endregion
|
|
2428
2428
|
//#region src/client/world-editor/RelationsPanel.tsx
|
|
@@ -3739,23 +3739,23 @@ window.__ModuleLoader__.load({
|
|
|
3739
3739
|
};
|
|
3740
3740
|
//#endregion
|
|
3741
3741
|
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/pack-frame/PackFrame.module.css.mjs
|
|
3742
|
-
const css$
|
|
3743
|
-
const key$
|
|
3744
|
-
let tag$
|
|
3745
|
-
if (tag$
|
|
3746
|
-
tag$
|
|
3747
|
-
tag$
|
|
3748
|
-
tag$
|
|
3749
|
-
document.head.appendChild(tag$
|
|
3742
|
+
const css$22 = ".rp_h_sbFq_frame{background:0 0;border:0;width:100%;display:block}.rp_h_sbFq_fill{height:100%;min-height:0}.rp_h_sbFq_message{color:var(--dsw-alias-label-secondary);margin:0;padding:16px 24px;font-size:13px;line-height:20px}.rp_h_sbFq_problems{color:var(--dsw-alias-label-tertiary);margin:8px 0 0;padding-left:18px;font-size:12px}.rp_h_sbFq_hud{box-sizing:border-box;width:min(800px,100%);margin:0 auto 8px;padding:0 16px}.rp_h_sbFq_tab{flex-direction:column;flex:1 1 0;width:100%;min-height:0;display:flex}";
|
|
3743
|
+
const key$22 = "src/client/widgets/pack-frame/PackFrame.module.css";
|
|
3744
|
+
let tag$22 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$22) + "]");
|
|
3745
|
+
if (tag$22 === null) {
|
|
3746
|
+
tag$22 = document.createElement("style");
|
|
3747
|
+
tag$22.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
3748
|
+
tag$22.dataset.pluginCss = key$22;
|
|
3749
|
+
document.head.appendChild(tag$22);
|
|
3750
3750
|
}
|
|
3751
|
-
tag$
|
|
3751
|
+
tag$22.textContent = css$22;
|
|
3752
3752
|
var PackFrame_module_css_default = {
|
|
3753
|
-
"fill": "rp_h_sbFq_fill",
|
|
3754
|
-
"problems": "rp_h_sbFq_problems",
|
|
3755
3753
|
"message": "rp_h_sbFq_message",
|
|
3756
|
-
"tab": "rp_h_sbFq_tab",
|
|
3757
3754
|
"frame": "rp_h_sbFq_frame",
|
|
3758
|
-
"
|
|
3755
|
+
"problems": "rp_h_sbFq_problems",
|
|
3756
|
+
"hud": "rp_h_sbFq_hud",
|
|
3757
|
+
"fill": "rp_h_sbFq_fill",
|
|
3758
|
+
"tab": "rp_h_sbFq_tab"
|
|
3759
3759
|
};
|
|
3760
3760
|
//#endregion
|
|
3761
3761
|
//#region src/client/widgets/pack-frame/theme.ts
|
|
@@ -3979,6 +3979,8 @@ window.__ModuleLoader__.load({
|
|
|
3979
3979
|
};
|
|
3980
3980
|
const loadRoutines = async (world, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/routines?${query(world)}`, init("GET", signal)));
|
|
3981
3981
|
const saveRoutine = async (world, key, windows, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/routines/item?${query(world)}&key=${encodeURIComponent(key)}`, init("PUT", signal, { windows })));
|
|
3982
|
+
const loadDice = async (world, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/dice?${query(world)}`, init("GET", signal)));
|
|
3983
|
+
const saveDice = async (world, dice, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/dice?${query(world)}`, init("PUT", signal, dice)));
|
|
3982
3984
|
const loadCalendar = async (world, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/calendar?${query(world)}`, init("GET", signal)));
|
|
3983
3985
|
const saveCalendar = async (world, calendar, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/calendar?${query(world)}`, init("PUT", signal, calendar)));
|
|
3984
3986
|
const loadVariables = async (world, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/variables?${query(world)}`, init("GET", signal)));
|
|
@@ -3987,24 +3989,24 @@ window.__ModuleLoader__.load({
|
|
|
3987
3989
|
const loadPackPreview = async (world, pack, signal) => await read$2(await fetch(`${API_PREFIX}/worlds/interface/preview?${query(world)}&pack=${encodeURIComponent(pack)}`, init("GET", signal)));
|
|
3988
3990
|
//#endregion
|
|
3989
3991
|
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/world-editor/PacksPanel.module.css.mjs
|
|
3990
|
-
const css$
|
|
3991
|
-
const key$
|
|
3992
|
-
let tag$
|
|
3993
|
-
if (tag$
|
|
3994
|
-
tag$
|
|
3995
|
-
tag$
|
|
3996
|
-
tag$
|
|
3997
|
-
document.head.appendChild(tag$
|
|
3992
|
+
const css$21 = ".rp_FLaP7q_controls{flex-wrap:wrap;align-items:center;gap:8px 16px;margin:8px 0;display:flex}.rp_FLaP7q_group{color:var(--dsw-alias-label-tertiary);align-items:center;gap:4px;font-size:12px;display:inline-flex}.rp_FLaP7q_stage{border:1px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-sm);background:var(--dsw-alias-bg-base);max-width:100%;overflow:hidden}.rp_FLaP7q_stageTall{height:420px}.rp_FLaP7q_log{color:var(--dsw-alias-label-secondary);margin:4px 0 0;padding-left:16px;font-size:12px}.rp_FLaP7q_files{columns:2 220px;margin:4px 0 0;padding-left:16px;font-size:12px}.rp_FLaP7q_note{color:var(--dsw-alias-label-tertiary);font-size:12px}";
|
|
3993
|
+
const key$21 = "src/client/world-editor/PacksPanel.module.css";
|
|
3994
|
+
let tag$21 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$21) + "]");
|
|
3995
|
+
if (tag$21 === null) {
|
|
3996
|
+
tag$21 = document.createElement("style");
|
|
3997
|
+
tag$21.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
3998
|
+
tag$21.dataset.pluginCss = key$21;
|
|
3999
|
+
document.head.appendChild(tag$21);
|
|
3998
4000
|
}
|
|
3999
|
-
tag$
|
|
4001
|
+
tag$21.textContent = css$21;
|
|
4000
4002
|
var PacksPanel_module_css_default = {
|
|
4001
|
-
"group": "rp_FLaP7q_group",
|
|
4002
|
-
"controls": "rp_FLaP7q_controls",
|
|
4003
4003
|
"note": "rp_FLaP7q_note",
|
|
4004
|
-
"
|
|
4004
|
+
"group": "rp_FLaP7q_group",
|
|
4005
4005
|
"stage": "rp_FLaP7q_stage",
|
|
4006
|
+
"controls": "rp_FLaP7q_controls",
|
|
4006
4007
|
"stageTall": "rp_FLaP7q_stageTall",
|
|
4007
|
-
"log": "rp_FLaP7q_log"
|
|
4008
|
+
"log": "rp_FLaP7q_log",
|
|
4009
|
+
"files": "rp_FLaP7q_files"
|
|
4008
4010
|
};
|
|
4009
4011
|
//#endregion
|
|
4010
4012
|
//#region src/client/world-editor/PacksPanel.tsx
|
|
@@ -4443,7 +4445,7 @@ window.__ModuleLoader__.load({
|
|
|
4443
4445
|
}
|
|
4444
4446
|
//#endregion
|
|
4445
4447
|
//#region src/client/world-editor/InfoPanel.tsx
|
|
4446
|
-
const draftOf$
|
|
4448
|
+
const draftOf$3 = (info) => ({
|
|
4447
4449
|
name: info.name,
|
|
4448
4450
|
description: info.description,
|
|
4449
4451
|
tags: info.tags.join(", "),
|
|
@@ -4490,8 +4492,8 @@ window.__ModuleLoader__.load({
|
|
|
4490
4492
|
const abort = new AbortController();
|
|
4491
4493
|
loadInfo(worldId, abort.signal).then((value) => {
|
|
4492
4494
|
setInfo(value);
|
|
4493
|
-
setSaved(draftOf$
|
|
4494
|
-
setDraft(draftOf$
|
|
4495
|
+
setSaved(draftOf$3(value));
|
|
4496
|
+
setDraft(draftOf$3(value));
|
|
4495
4497
|
}, (failure) => {
|
|
4496
4498
|
if (!abort.signal.aborted) setStatus({
|
|
4497
4499
|
state: "failed",
|
|
@@ -4527,8 +4529,8 @@ window.__ModuleLoader__.load({
|
|
|
4527
4529
|
setStatus({ state: "saving" });
|
|
4528
4530
|
saveInfo(worldId, edit, new AbortController().signal).then((value) => {
|
|
4529
4531
|
setInfo(value);
|
|
4530
|
-
setSaved(draftOf$
|
|
4531
|
-
setDraft(draftOf$
|
|
4532
|
+
setSaved(draftOf$3(value));
|
|
4533
|
+
setDraft(draftOf$3(value));
|
|
4532
4534
|
setStatus({ state: "saved" });
|
|
4533
4535
|
onSaved();
|
|
4534
4536
|
}, (failure) => {
|
|
@@ -5253,7 +5255,7 @@ window.__ModuleLoader__.load({
|
|
|
5253
5255
|
}
|
|
5254
5256
|
//#endregion
|
|
5255
5257
|
//#region src/client/world-editor/CalendarPanel.tsx
|
|
5256
|
-
const draftOf$
|
|
5258
|
+
const draftOf$2 = (calendar) => ({
|
|
5257
5259
|
hemisphere: calendar.hemisphere,
|
|
5258
5260
|
holidays: calendar.holidays.map((holiday) => ({
|
|
5259
5261
|
id: holiday.id,
|
|
@@ -5261,7 +5263,7 @@ window.__ModuleLoader__.load({
|
|
|
5261
5263
|
on: holiday.on.join(", ")
|
|
5262
5264
|
}))
|
|
5263
5265
|
});
|
|
5264
|
-
const documentOf = (draft) => ({
|
|
5266
|
+
const documentOf$1 = (draft) => ({
|
|
5265
5267
|
hemisphere: draft.hemisphere,
|
|
5266
5268
|
holidays: draft.holidays.map((holiday) => ({
|
|
5267
5269
|
id: holiday.id.trim(),
|
|
@@ -5280,7 +5282,7 @@ window.__ModuleLoader__.load({
|
|
|
5280
5282
|
(0, react.useEffect)(() => {
|
|
5281
5283
|
const abort = new AbortController();
|
|
5282
5284
|
loadCalendar(worldId, abort.signal).then((value) => {
|
|
5283
|
-
const next = draftOf$
|
|
5285
|
+
const next = draftOf$2(value);
|
|
5284
5286
|
setSaved(next);
|
|
5285
5287
|
setDraft(next);
|
|
5286
5288
|
}, (failure) => {
|
|
@@ -5298,7 +5300,7 @@ window.__ModuleLoader__.load({
|
|
|
5298
5300
|
role: status.state === "failed" ? "alert" : void 0,
|
|
5299
5301
|
children: status.state === "failed" ? t("saveFailed", { message: status.message ?? "" }) : t("editorLoading")
|
|
5300
5302
|
});
|
|
5301
|
-
const dirty = JSON.stringify(documentOf(draft)) !== JSON.stringify(documentOf(saved));
|
|
5303
|
+
const dirty = JSON.stringify(documentOf$1(draft)) !== JSON.stringify(documentOf$1(saved));
|
|
5302
5304
|
const change = (next) => {
|
|
5303
5305
|
setDraft(next);
|
|
5304
5306
|
setStatus({ state: "idle" });
|
|
@@ -5314,8 +5316,8 @@ window.__ModuleLoader__.load({
|
|
|
5314
5316
|
};
|
|
5315
5317
|
const save = () => {
|
|
5316
5318
|
setStatus({ state: "saving" });
|
|
5317
|
-
saveCalendar(worldId, documentOf(draft), new AbortController().signal).then((value) => {
|
|
5318
|
-
const next = draftOf$
|
|
5319
|
+
saveCalendar(worldId, documentOf$1(draft), new AbortController().signal).then((value) => {
|
|
5320
|
+
const next = draftOf$2(value);
|
|
5319
5321
|
setSaved(next);
|
|
5320
5322
|
setDraft(next);
|
|
5321
5323
|
setStatus({ state: "saved" });
|
|
@@ -5460,82 +5462,762 @@ window.__ModuleLoader__.load({
|
|
|
5460
5462
|
});
|
|
5461
5463
|
}
|
|
5462
5464
|
//#endregion
|
|
5463
|
-
//#region src/client/
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
subject: "character",
|
|
5470
|
-
visibility: "public",
|
|
5471
|
-
description: "",
|
|
5472
|
-
min: "",
|
|
5473
|
-
max: "",
|
|
5474
|
-
integer: false,
|
|
5475
|
-
baseline: false,
|
|
5476
|
-
always: false,
|
|
5477
|
-
default: "",
|
|
5478
|
-
only: "",
|
|
5479
|
-
options: "",
|
|
5480
|
-
bands: ""
|
|
5481
|
-
};
|
|
5482
|
-
const draftOf = (value) => ({
|
|
5483
|
-
key: value.key,
|
|
5484
|
-
name: value.name,
|
|
5485
|
-
kind: value.kind,
|
|
5486
|
-
subject: value.subject,
|
|
5487
|
-
visibility: value.visibility,
|
|
5488
|
-
description: value.description ?? "",
|
|
5489
|
-
min: value.min === void 0 ? "" : String(value.min),
|
|
5490
|
-
max: value.max === void 0 ? "" : String(value.max),
|
|
5491
|
-
integer: value.integer === true,
|
|
5492
|
-
baseline: value.baseline === true,
|
|
5493
|
-
always: value.always === true,
|
|
5494
|
-
default: value.default === void 0 ? "" : String(value.default),
|
|
5495
|
-
only: (value.only ?? []).join(", "),
|
|
5496
|
-
options: (value.options ?? []).join(", "),
|
|
5497
|
-
bands: (value.bands ?? []).map((band) => `${band.up_to}: ${band.label}`).join("\n")
|
|
5498
|
-
});
|
|
5499
|
-
/** The declaration as it will be sent: a default is a number, true/false or text according to the kind; bands are `up to: label` lines. */
|
|
5500
|
-
function declarationOf(draft) {
|
|
5501
|
-
const number = (text) => text.trim() === "" || !Number.isFinite(Number(text)) ? void 0 : Number(text);
|
|
5502
|
-
const defaultValue = draft.default.trim() === "" ? void 0 : draft.kind === "number" ? number(draft.default) ?? draft.default.trim() : draft.kind === "flag" ? draft.default.trim() === "true" : draft.default.trim();
|
|
5503
|
-
const bands = draft.bands.split("\n").flatMap((line) => {
|
|
5504
|
-
const at = line.indexOf(":");
|
|
5505
|
-
const upTo = at < 0 ? void 0 : number(line.slice(0, at));
|
|
5506
|
-
return upTo === void 0 ? [] : [{
|
|
5507
|
-
up_to: upTo,
|
|
5508
|
-
label: line.slice(at + 1).trim()
|
|
5509
|
-
}];
|
|
5465
|
+
//#region src/client/widgets/tool-switches/tools-api.ts
|
|
5466
|
+
/** The tools other plugins registered for everyone (a file or shell tool, an MCP server's), which an agent can be given. */
|
|
5467
|
+
async function loadExternalTools(signal) {
|
|
5468
|
+
const response = await fetch(`${API_PREFIX}/tools`, {
|
|
5469
|
+
credentials: "same-origin",
|
|
5470
|
+
signal
|
|
5510
5471
|
});
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
number(draft.max),
|
|
5514
|
-
list(draft.only),
|
|
5515
|
-
list(draft.options)
|
|
5516
|
-
];
|
|
5517
|
-
return {
|
|
5518
|
-
key: draft.key.trim(),
|
|
5519
|
-
name: draft.name.trim(),
|
|
5520
|
-
kind: draft.kind,
|
|
5521
|
-
subject: draft.subject,
|
|
5522
|
-
visibility: draft.visibility,
|
|
5523
|
-
...draft.description.trim() === "" ? {} : { description: draft.description.trim() },
|
|
5524
|
-
...draft.kind === "number" && min !== void 0 ? { min } : {},
|
|
5525
|
-
...draft.kind === "number" && max !== void 0 ? { max } : {},
|
|
5526
|
-
...draft.kind === "number" && draft.integer ? { integer: true } : {},
|
|
5527
|
-
...draft.baseline ? { baseline: true } : {},
|
|
5528
|
-
...draft.always ? { always: true } : {},
|
|
5529
|
-
...defaultValue === void 0 ? {} : { default: defaultValue },
|
|
5530
|
-
...only.length === 0 ? {} : { only },
|
|
5531
|
-
...draft.kind === "choice" && options.length > 0 ? { options } : {},
|
|
5532
|
-
...draft.kind === "number" && bands.length > 0 ? { bands } : {}
|
|
5533
|
-
};
|
|
5472
|
+
if (!response.ok) throw new Error(`${response.status} ${response.statusText}`.trim());
|
|
5473
|
+
return (await response.json()).tools ?? [];
|
|
5534
5474
|
}
|
|
5535
5475
|
//#endregion
|
|
5536
|
-
//#region src/
|
|
5537
|
-
/**
|
|
5538
|
-
|
|
5476
|
+
//#region src/shared/tools.ts
|
|
5477
|
+
/** The kinds of agent whose tools can be chosen. A character is not one agent but a kind: the choice is for all of them. */
|
|
5478
|
+
const AGENT_KINDS = [
|
|
5479
|
+
"gameMaster",
|
|
5480
|
+
"characters",
|
|
5481
|
+
"records"
|
|
5482
|
+
];
|
|
5483
|
+
/** What this version can offer. A name in a settings file or a world that is not here is kept and ignored. */
|
|
5484
|
+
const OPTIONAL_TOOLS = [
|
|
5485
|
+
{
|
|
5486
|
+
id: "roll_check",
|
|
5487
|
+
agent: "gameMaster",
|
|
5488
|
+
default: true
|
|
5489
|
+
},
|
|
5490
|
+
{
|
|
5491
|
+
id: "roll_dice",
|
|
5492
|
+
agent: "gameMaster",
|
|
5493
|
+
default: true
|
|
5494
|
+
},
|
|
5495
|
+
{
|
|
5496
|
+
id: "list_checks",
|
|
5497
|
+
agent: "gameMaster",
|
|
5498
|
+
default: true
|
|
5499
|
+
}
|
|
5500
|
+
];
|
|
5501
|
+
/** Whether an agent of this kind has a tool, by what the switches say and, failing that, by default. A tool this version does not offer is never on. */
|
|
5502
|
+
function toolEnabled(board, agent, id) {
|
|
5503
|
+
const offered = OPTIONAL_TOOLS.find((tool) => tool.agent === agent && tool.id === id);
|
|
5504
|
+
if (offered === void 0) return false;
|
|
5505
|
+
return board[agent]?.[id] ?? offered.default;
|
|
5506
|
+
}
|
|
5507
|
+
/** The tools this version offers for each kind of agent, as the switches stand; names it does not know are left out. */
|
|
5508
|
+
function switchesOf(board) {
|
|
5509
|
+
return AGENT_KINDS.map((agent) => ({
|
|
5510
|
+
agent,
|
|
5511
|
+
tools: OPTIONAL_TOOLS.filter((tool) => tool.agent === agent).map((tool) => ({
|
|
5512
|
+
id: tool.id,
|
|
5513
|
+
enabled: toolEnabled(board, agent, tool.id),
|
|
5514
|
+
default: tool.default
|
|
5515
|
+
}))
|
|
5516
|
+
}));
|
|
5517
|
+
}
|
|
5518
|
+
/**
|
|
5519
|
+
* The switches after one is set. Names this version does not know stay as they were, and a switch set to what the tool is by default is dropped,
|
|
5520
|
+
* so that a settings file says only what was chosen.
|
|
5521
|
+
*/
|
|
5522
|
+
function withSwitch(board, agent, id, enabled) {
|
|
5523
|
+
const offered = OPTIONAL_TOOLS.find((tool) => tool.agent === agent && tool.id === id);
|
|
5524
|
+
if (offered === void 0) throw new Error(`there is no tool "${id}" to switch for ${agent}`);
|
|
5525
|
+
const mine = { ...board[agent] };
|
|
5526
|
+
if (enabled === offered.default) delete mine[id];
|
|
5527
|
+
else mine[id] = enabled;
|
|
5528
|
+
const next = {
|
|
5529
|
+
...board,
|
|
5530
|
+
[agent]: mine
|
|
5531
|
+
};
|
|
5532
|
+
if (Object.keys(mine).length === 0) delete next[agent];
|
|
5533
|
+
return next;
|
|
5534
|
+
}
|
|
5535
|
+
/**
|
|
5536
|
+
* Whether an agent of this kind has a tool that is not one of this plugin's own: only when it was switched on. Such tools are off by default, because
|
|
5537
|
+
* they reach beyond the story (files, a shell, the web), and a name that no plugin registers now has no effect.
|
|
5538
|
+
*/
|
|
5539
|
+
function externalEnabled(board, agent, name) {
|
|
5540
|
+
return board[agent]?.[name] === true;
|
|
5541
|
+
}
|
|
5542
|
+
/** The switches after an external tool is switched: only what is on is kept, so that a settings file says only what was chosen. */
|
|
5543
|
+
function withExternal(board, agent, name, enabled) {
|
|
5544
|
+
const mine = { ...board[agent] };
|
|
5545
|
+
if (enabled) mine[name] = true;
|
|
5546
|
+
else delete mine[name];
|
|
5547
|
+
const next = {
|
|
5548
|
+
...board,
|
|
5549
|
+
[agent]: mine
|
|
5550
|
+
};
|
|
5551
|
+
if (Object.keys(mine).length === 0) delete next[agent];
|
|
5552
|
+
return next;
|
|
5553
|
+
}
|
|
5554
|
+
//#endregion
|
|
5555
|
+
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/widgets/tool-switches/ToolSwitches.module.css.mjs
|
|
5556
|
+
const css$20 = ".rp_CjoFLq_root{flex-direction:column;gap:12px;display:flex}.rp_CjoFLq_title{margin:0;font-size:16px;font-weight:500;line-height:24px}.rp_CjoFLq_help{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px}.rp_CjoFLq_agent{border-top:1px solid var(--dsw-alias-border-l3);flex-direction:column;gap:6px;padding:8px 0;display:flex}.rp_CjoFLq_agentName{font-size:14px;font-weight:500}.rp_CjoFLq_hint{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_CjoFLq_tool{cursor:pointer;align-items:flex-start;gap:8px;font-size:13px;display:flex}.rp_CjoFLq_tool input{margin-top:3px}.rp_CjoFLq_toolText{flex-direction:column;display:flex}.rp_CjoFLq_default{color:var(--dsw-alias-label-tertiary);margin-left:6px;font-size:11px}.rp_CjoFLq_error{color:var(--dsw-alias-state-error-primary,#d33);font-size:12px}.rp_CjoFLq_external{flex-direction:column;gap:6px;margin-top:4px;display:flex}.rp_CjoFLq_external>summary{cursor:pointer}";
|
|
5557
|
+
const key$20 = "src/client/widgets/tool-switches/ToolSwitches.module.css";
|
|
5558
|
+
let tag$20 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$20) + "]");
|
|
5559
|
+
if (tag$20 === null) {
|
|
5560
|
+
tag$20 = document.createElement("style");
|
|
5561
|
+
tag$20.dataset.plugin = "@dsh-agentic-roleplay/core";
|
|
5562
|
+
tag$20.dataset.pluginCss = key$20;
|
|
5563
|
+
document.head.appendChild(tag$20);
|
|
5564
|
+
}
|
|
5565
|
+
tag$20.textContent = css$20;
|
|
5566
|
+
var ToolSwitches_module_css_default = {
|
|
5567
|
+
"external": "rp_CjoFLq_external",
|
|
5568
|
+
"title": "rp_CjoFLq_title",
|
|
5569
|
+
"tool": "rp_CjoFLq_tool",
|
|
5570
|
+
"agent": "rp_CjoFLq_agent",
|
|
5571
|
+
"agentName": "rp_CjoFLq_agentName",
|
|
5572
|
+
"toolText": "rp_CjoFLq_toolText",
|
|
5573
|
+
"help": "rp_CjoFLq_help",
|
|
5574
|
+
"hint": "rp_CjoFLq_hint",
|
|
5575
|
+
"root": "rp_CjoFLq_root",
|
|
5576
|
+
"default": "rp_CjoFLq_default",
|
|
5577
|
+
"error": "rp_CjoFLq_error"
|
|
5578
|
+
};
|
|
5579
|
+
//#endregion
|
|
5580
|
+
//#region src/client/widgets/tool-switches/ToolSwitches.tsx
|
|
5581
|
+
/**
|
|
5582
|
+
* The optional tools of each kind of agent, each a switch. It shows only the tools this version offers: names in the board it does not know
|
|
5583
|
+
* stay in it untouched, so that what a world or a settings file carries from another version survives a change made here.
|
|
5584
|
+
*/
|
|
5585
|
+
function ToolSwitches({ board, onChange, disabled, error, external = [], t }) {
|
|
5586
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
5587
|
+
className: ToolSwitches_module_css_default.root,
|
|
5588
|
+
"data-testid": "roleplay-tool-switches",
|
|
5589
|
+
"data-rp": "tool-switches",
|
|
5590
|
+
children: [
|
|
5591
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
5592
|
+
className: ToolSwitches_module_css_default.title,
|
|
5593
|
+
children: t("sw_title")
|
|
5594
|
+
}),
|
|
5595
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5596
|
+
className: ToolSwitches_module_css_default.help,
|
|
5597
|
+
children: t("sw_help")
|
|
5598
|
+
}),
|
|
5599
|
+
error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5600
|
+
className: ToolSwitches_module_css_default.error,
|
|
5601
|
+
role: "alert",
|
|
5602
|
+
children: t("sw_failed", { message: error })
|
|
5603
|
+
}),
|
|
5604
|
+
switchesOf(board).map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5605
|
+
className: ToolSwitches_module_css_default.agent,
|
|
5606
|
+
"data-agent": entry.agent,
|
|
5607
|
+
children: [
|
|
5608
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5609
|
+
className: ToolSwitches_module_css_default.agentName,
|
|
5610
|
+
children: t(`sw_agent_${entry.agent}`)
|
|
5611
|
+
}),
|
|
5612
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5613
|
+
className: ToolSwitches_module_css_default.hint,
|
|
5614
|
+
children: t(`sw_agent_${entry.agent}_hint`)
|
|
5615
|
+
}),
|
|
5616
|
+
entry.tools.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5617
|
+
className: ToolSwitches_module_css_default.hint,
|
|
5618
|
+
children: t("sw_none")
|
|
5619
|
+
}),
|
|
5620
|
+
entry.tools.map((tool) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
5621
|
+
className: ToolSwitches_module_css_default.tool,
|
|
5622
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
5623
|
+
type: "checkbox",
|
|
5624
|
+
checked: tool.enabled,
|
|
5625
|
+
disabled,
|
|
5626
|
+
"data-tool": tool.id,
|
|
5627
|
+
onChange: (event) => {
|
|
5628
|
+
onChange(withSwitch(board, entry.agent, tool.id, event.target.checked));
|
|
5629
|
+
}
|
|
5630
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
5631
|
+
className: ToolSwitches_module_css_default.toolText,
|
|
5632
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [t(`sw_tool_${tool.id}`), tool.default ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5633
|
+
className: ToolSwitches_module_css_default.default,
|
|
5634
|
+
children: t("sw_default")
|
|
5635
|
+
}) : null] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5636
|
+
className: ToolSwitches_module_css_default.hint,
|
|
5637
|
+
children: t(`sw_tool_${tool.id}_hint`)
|
|
5638
|
+
})]
|
|
5639
|
+
})]
|
|
5640
|
+
}, tool.id)),
|
|
5641
|
+
external.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
5642
|
+
className: ToolSwitches_module_css_default.external,
|
|
5643
|
+
"data-testid": "roleplay-external-tools",
|
|
5644
|
+
children: [
|
|
5645
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", {
|
|
5646
|
+
className: ToolSwitches_module_css_default.hint,
|
|
5647
|
+
children: t("sw_external", {
|
|
5648
|
+
count: String(external.length),
|
|
5649
|
+
on: String(external.filter((tool) => externalEnabled(board, entry.agent, tool.name)).length)
|
|
5650
|
+
})
|
|
5651
|
+
}),
|
|
5652
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5653
|
+
className: ToolSwitches_module_css_default.hint,
|
|
5654
|
+
children: t("sw_external_help")
|
|
5655
|
+
}),
|
|
5656
|
+
external.map((tool) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
5657
|
+
className: ToolSwitches_module_css_default.tool,
|
|
5658
|
+
title: tool.description,
|
|
5659
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
5660
|
+
type: "checkbox",
|
|
5661
|
+
checked: externalEnabled(board, entry.agent, tool.name),
|
|
5662
|
+
disabled,
|
|
5663
|
+
"data-external": tool.name,
|
|
5664
|
+
onChange: (event) => {
|
|
5665
|
+
onChange(withExternal(board, entry.agent, tool.name, event.target.checked));
|
|
5666
|
+
}
|
|
5667
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
5668
|
+
className: ToolSwitches_module_css_default.toolText,
|
|
5669
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: tool.name }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5670
|
+
className: ToolSwitches_module_css_default.hint,
|
|
5671
|
+
children: tool.description.length > 140 ? `${tool.description.slice(0, 140)}…` : tool.description
|
|
5672
|
+
})]
|
|
5673
|
+
})]
|
|
5674
|
+
}, tool.name))
|
|
5675
|
+
]
|
|
5676
|
+
})
|
|
5677
|
+
]
|
|
5678
|
+
}, entry.agent)),
|
|
5679
|
+
external.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5680
|
+
className: ToolSwitches_module_css_default.hint,
|
|
5681
|
+
children: t("sw_external_none")
|
|
5682
|
+
})
|
|
5683
|
+
]
|
|
5684
|
+
});
|
|
5685
|
+
}
|
|
5686
|
+
//#endregion
|
|
5687
|
+
//#region src/client/world-editor/ToolsPanel.tsx
|
|
5688
|
+
/** The optional tools the world's agents have, kept in `world.json` and given to every story started from the world; a story can change them for itself later. */
|
|
5689
|
+
function ToolsPanel({ t, worldId, actions }) {
|
|
5690
|
+
const [board, setBoard] = (0, react.useState)();
|
|
5691
|
+
const [external, setExternal] = (0, react.useState)([]);
|
|
5692
|
+
const [busy, setBusy] = (0, react.useState)(false);
|
|
5693
|
+
const [error, setError] = (0, react.useState)();
|
|
5694
|
+
(0, react.useEffect)(() => {
|
|
5695
|
+
const abort = new AbortController();
|
|
5696
|
+
loadInfo(worldId, abort.signal).then((info) => {
|
|
5697
|
+
setBoard(info.tools);
|
|
5698
|
+
}, (failure) => {
|
|
5699
|
+
if (!abort.signal.aborted) setError(failure instanceof Error ? failure.message : String(failure));
|
|
5700
|
+
});
|
|
5701
|
+
loadExternalTools(abort.signal).then(setExternal, () => void 0);
|
|
5702
|
+
return () => {
|
|
5703
|
+
abort.abort();
|
|
5704
|
+
};
|
|
5705
|
+
}, [worldId]);
|
|
5706
|
+
if (board === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5707
|
+
className: CharactersPanel_module_css_default.empty,
|
|
5708
|
+
role: error === void 0 ? void 0 : "alert",
|
|
5709
|
+
children: error === void 0 ? t("editorLoading") : t("saveFailed", { message: error })
|
|
5710
|
+
});
|
|
5711
|
+
const change = (next) => {
|
|
5712
|
+
setBusy(true);
|
|
5713
|
+
setError(void 0);
|
|
5714
|
+
saveInfo(worldId, { tools: next }, new AbortController().signal).then((info) => {
|
|
5715
|
+
setBoard(info.tools);
|
|
5716
|
+
}, (failure) => {
|
|
5717
|
+
setError(failure instanceof Error ? failure.message : String(failure));
|
|
5718
|
+
}).finally(() => {
|
|
5719
|
+
setBusy(false);
|
|
5720
|
+
});
|
|
5721
|
+
};
|
|
5722
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5723
|
+
className: CharactersPanel_module_css_default.panel,
|
|
5724
|
+
"data-testid": "roleplay-world-tools",
|
|
5725
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5726
|
+
className: CharactersPanel_module_css_default.tabs,
|
|
5727
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: CharactersPanel_module_css_default.tabsSpace }), actions]
|
|
5728
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5729
|
+
className: CharactersPanel_module_css_default.body,
|
|
5730
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("article", {
|
|
5731
|
+
className: CharactersPanel_module_css_default.sheet,
|
|
5732
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolSwitches, {
|
|
5733
|
+
board,
|
|
5734
|
+
onChange: change,
|
|
5735
|
+
disabled: busy,
|
|
5736
|
+
external,
|
|
5737
|
+
...error === void 0 ? {} : { error },
|
|
5738
|
+
t
|
|
5739
|
+
})
|
|
5740
|
+
})
|
|
5741
|
+
})]
|
|
5742
|
+
});
|
|
5743
|
+
}
|
|
5744
|
+
//#endregion
|
|
5745
|
+
//#region src/client/world-editor/DicePanel.tsx
|
|
5746
|
+
const draftOf$1 = (dice) => dice.checks.map((check) => ({
|
|
5747
|
+
key: check.key,
|
|
5748
|
+
name: check.name,
|
|
5749
|
+
use: check.use,
|
|
5750
|
+
dice: check.dice,
|
|
5751
|
+
reading: check.reading ?? "total",
|
|
5752
|
+
hit: check.hit === void 0 ? "" : String(check.hit),
|
|
5753
|
+
compare: check.compare ?? "absolute",
|
|
5754
|
+
modifier: check.modifier ?? "",
|
|
5755
|
+
bands: check.bands.map((band) => ({
|
|
5756
|
+
min: band.min === void 0 ? "" : String(band.min),
|
|
5757
|
+
max: band.max === void 0 ? "" : String(band.max),
|
|
5758
|
+
label: band.label,
|
|
5759
|
+
result: band.result,
|
|
5760
|
+
critical: band.critical === true
|
|
5761
|
+
}))
|
|
5762
|
+
}));
|
|
5763
|
+
const number = (text) => text.trim() === "" || !Number.isFinite(Number(text)) ? void 0 : Number(text);
|
|
5764
|
+
const documentOf = (drafts) => ({ checks: drafts.map((check) => ({
|
|
5765
|
+
key: check.key.trim(),
|
|
5766
|
+
name: check.name.trim(),
|
|
5767
|
+
use: check.use.trim(),
|
|
5768
|
+
dice: check.dice.trim(),
|
|
5769
|
+
...check.reading === "total" ? {} : { reading: check.reading },
|
|
5770
|
+
...check.reading === "successes" && number(check.hit) !== void 0 ? { hit: number(check.hit) } : {},
|
|
5771
|
+
...check.compare === "absolute" ? {} : { compare: check.compare },
|
|
5772
|
+
...check.modifier.trim() === "" ? {} : { modifier: check.modifier.trim() },
|
|
5773
|
+
bands: check.bands.map((band) => ({
|
|
5774
|
+
label: band.label.trim(),
|
|
5775
|
+
result: band.result,
|
|
5776
|
+
...number(band.min) === void 0 ? {} : { min: number(band.min) },
|
|
5777
|
+
...number(band.max) === void 0 ? {} : { max: number(band.max) },
|
|
5778
|
+
...band.critical ? { critical: true } : {}
|
|
5779
|
+
}))
|
|
5780
|
+
})) });
|
|
5781
|
+
const blankBand = () => ({
|
|
5782
|
+
min: "",
|
|
5783
|
+
max: "",
|
|
5784
|
+
label: "",
|
|
5785
|
+
result: "succeeded",
|
|
5786
|
+
critical: false
|
|
5787
|
+
});
|
|
5788
|
+
const blankCheck = () => ({
|
|
5789
|
+
key: "",
|
|
5790
|
+
name: "",
|
|
5791
|
+
use: "",
|
|
5792
|
+
dice: "1d20",
|
|
5793
|
+
reading: "total",
|
|
5794
|
+
hit: "",
|
|
5795
|
+
compare: "absolute",
|
|
5796
|
+
modifier: "",
|
|
5797
|
+
bands: [blankBand()]
|
|
5798
|
+
});
|
|
5799
|
+
/** The dice checks of a world: what each is used for, the dice it rolls and the bands that say what a roll means. */
|
|
5800
|
+
function DicePanel({ t, worldId, actions }) {
|
|
5801
|
+
const [saved, setSaved] = (0, react.useState)();
|
|
5802
|
+
const [draft, setDraft] = (0, react.useState)([]);
|
|
5803
|
+
const [status, setStatus] = (0, react.useState)({ state: "idle" });
|
|
5804
|
+
(0, react.useEffect)(() => {
|
|
5805
|
+
const abort = new AbortController();
|
|
5806
|
+
loadDice(worldId, abort.signal).then((value) => {
|
|
5807
|
+
const next = draftOf$1(value);
|
|
5808
|
+
setSaved(next);
|
|
5809
|
+
setDraft(next);
|
|
5810
|
+
}, (failure) => {
|
|
5811
|
+
if (!abort.signal.aborted) setStatus({
|
|
5812
|
+
state: "failed",
|
|
5813
|
+
message: failure instanceof Error ? failure.message : String(failure)
|
|
5814
|
+
});
|
|
5815
|
+
});
|
|
5816
|
+
return () => {
|
|
5817
|
+
abort.abort();
|
|
5818
|
+
};
|
|
5819
|
+
}, [worldId]);
|
|
5820
|
+
if (saved === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
5821
|
+
className: CharactersPanel_module_css_default.empty,
|
|
5822
|
+
role: status.state === "failed" ? "alert" : void 0,
|
|
5823
|
+
children: status.state === "failed" ? t("saveFailed", { message: status.message ?? "" }) : t("editorLoading")
|
|
5824
|
+
});
|
|
5825
|
+
const dirty = JSON.stringify(documentOf(draft)) !== JSON.stringify(documentOf(saved));
|
|
5826
|
+
const change = (next) => {
|
|
5827
|
+
setDraft(next);
|
|
5828
|
+
setStatus({ state: "idle" });
|
|
5829
|
+
};
|
|
5830
|
+
const patch = (index, fields) => {
|
|
5831
|
+
change(draft.map((entry, at) => at === index ? {
|
|
5832
|
+
...entry,
|
|
5833
|
+
...fields
|
|
5834
|
+
} : entry));
|
|
5835
|
+
};
|
|
5836
|
+
const patchBand = (index, band, fields) => {
|
|
5837
|
+
patch(index, { bands: draft[index].bands.map((entry, at) => at === band ? {
|
|
5838
|
+
...entry,
|
|
5839
|
+
...fields
|
|
5840
|
+
} : entry) });
|
|
5841
|
+
};
|
|
5842
|
+
const save = () => {
|
|
5843
|
+
setStatus({ state: "saving" });
|
|
5844
|
+
saveDice(worldId, documentOf(draft), new AbortController().signal).then((value) => {
|
|
5845
|
+
const next = draftOf$1(value);
|
|
5846
|
+
setSaved(next);
|
|
5847
|
+
setDraft(next);
|
|
5848
|
+
setStatus({ state: "saved" });
|
|
5849
|
+
}, (failure) => {
|
|
5850
|
+
setStatus({
|
|
5851
|
+
state: "failed",
|
|
5852
|
+
message: failure instanceof Error ? failure.message : String(failure)
|
|
5853
|
+
});
|
|
5854
|
+
});
|
|
5855
|
+
};
|
|
5856
|
+
const text = (index, key, label, help) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
5857
|
+
className: CharactersPanel_module_css_default.field,
|
|
5858
|
+
children: [
|
|
5859
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5860
|
+
className: CharactersPanel_module_css_default.label,
|
|
5861
|
+
children: t(label)
|
|
5862
|
+
}),
|
|
5863
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
5864
|
+
className: CharactersPanel_module_css_default.nameInput,
|
|
5865
|
+
value: draft[index][key],
|
|
5866
|
+
onChange: (event) => {
|
|
5867
|
+
patch(index, { [key]: event.target.value });
|
|
5868
|
+
}
|
|
5869
|
+
}),
|
|
5870
|
+
help !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5871
|
+
className: CharactersPanel_module_css_default.help,
|
|
5872
|
+
children: t(help)
|
|
5873
|
+
})
|
|
5874
|
+
]
|
|
5875
|
+
});
|
|
5876
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5877
|
+
className: CharactersPanel_module_css_default.panel,
|
|
5878
|
+
"data-testid": "roleplay-dice-editor",
|
|
5879
|
+
children: [
|
|
5880
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5881
|
+
className: CharactersPanel_module_css_default.tabs,
|
|
5882
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: CharactersPanel_module_css_default.tabsSpace }), actions]
|
|
5883
|
+
}),
|
|
5884
|
+
(dirty || status.state !== "idle") && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5885
|
+
className: CharactersPanel_module_css_default.bar,
|
|
5886
|
+
role: "status",
|
|
5887
|
+
children: [
|
|
5888
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5889
|
+
className: status.state === "failed" ? CharactersPanel_module_css_default.error : CharactersPanel_module_css_default.barText,
|
|
5890
|
+
children: status.state === "failed" ? t("saveFailed", { message: status.message ?? "" }) : dirty ? t("unsaved") : t("saved")
|
|
5891
|
+
}),
|
|
5892
|
+
dirty && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
5893
|
+
variant: "ghost",
|
|
5894
|
+
size: "sm",
|
|
5895
|
+
onClick: () => {
|
|
5896
|
+
setDraft(saved);
|
|
5897
|
+
setStatus({ state: "idle" });
|
|
5898
|
+
},
|
|
5899
|
+
children: t("reset")
|
|
5900
|
+
}),
|
|
5901
|
+
dirty && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
5902
|
+
variant: "primary",
|
|
5903
|
+
size: "sm",
|
|
5904
|
+
disabled: status.state === "saving",
|
|
5905
|
+
onClick: save,
|
|
5906
|
+
children: status.state === "saving" ? t("saving") : t("save")
|
|
5907
|
+
})
|
|
5908
|
+
]
|
|
5909
|
+
}),
|
|
5910
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5911
|
+
className: CharactersPanel_module_css_default.body,
|
|
5912
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", {
|
|
5913
|
+
className: CharactersPanel_module_css_default.sheet,
|
|
5914
|
+
children: [
|
|
5915
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5916
|
+
className: CharactersPanel_module_css_default.help,
|
|
5917
|
+
children: t("dice_help")
|
|
5918
|
+
}),
|
|
5919
|
+
draft.map((check, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
5920
|
+
className: CharactersPanel_module_css_default.section,
|
|
5921
|
+
"data-testid": "roleplay-dice-check",
|
|
5922
|
+
children: [
|
|
5923
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5924
|
+
className: CharactersPanel_module_css_default.grid,
|
|
5925
|
+
children: [
|
|
5926
|
+
text(index, "key", "dice_key"),
|
|
5927
|
+
text(index, "name", "dice_name"),
|
|
5928
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
5929
|
+
className: `${CharactersPanel_module_css_default.field} ${CharactersPanel_module_css_default.wide}`,
|
|
5930
|
+
children: [
|
|
5931
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5932
|
+
className: CharactersPanel_module_css_default.label,
|
|
5933
|
+
children: t("dice_use")
|
|
5934
|
+
}),
|
|
5935
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
|
|
5936
|
+
className: CharactersPanel_module_css_default.nameInput,
|
|
5937
|
+
rows: 2,
|
|
5938
|
+
value: check.use,
|
|
5939
|
+
onChange: (event) => {
|
|
5940
|
+
patch(index, { use: event.target.value });
|
|
5941
|
+
}
|
|
5942
|
+
}),
|
|
5943
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5944
|
+
className: CharactersPanel_module_css_default.help,
|
|
5945
|
+
children: t("dice_useHelp")
|
|
5946
|
+
})
|
|
5947
|
+
]
|
|
5948
|
+
}),
|
|
5949
|
+
text(index, "dice", "dice_dice", "dice_diceHelp"),
|
|
5950
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
5951
|
+
className: CharactersPanel_module_css_default.field,
|
|
5952
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5953
|
+
className: CharactersPanel_module_css_default.label,
|
|
5954
|
+
children: t("dice_reading")
|
|
5955
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
5956
|
+
value: check.reading,
|
|
5957
|
+
onChange: (event) => {
|
|
5958
|
+
patch(index, { reading: event.target.value });
|
|
5959
|
+
},
|
|
5960
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
5961
|
+
value: "total",
|
|
5962
|
+
children: t("dice_readTotal")
|
|
5963
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
5964
|
+
value: "successes",
|
|
5965
|
+
children: t("dice_readSuccesses")
|
|
5966
|
+
})]
|
|
5967
|
+
})]
|
|
5968
|
+
}),
|
|
5969
|
+
check.reading === "successes" && text(index, "hit", "dice_hit"),
|
|
5970
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
5971
|
+
className: CharactersPanel_module_css_default.field,
|
|
5972
|
+
children: [
|
|
5973
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5974
|
+
className: CharactersPanel_module_css_default.label,
|
|
5975
|
+
children: t("dice_compare")
|
|
5976
|
+
}),
|
|
5977
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
5978
|
+
value: check.compare,
|
|
5979
|
+
onChange: (event) => {
|
|
5980
|
+
patch(index, { compare: event.target.value });
|
|
5981
|
+
},
|
|
5982
|
+
children: [
|
|
5983
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
5984
|
+
value: "absolute",
|
|
5985
|
+
children: t("dice_compareAbsolute")
|
|
5986
|
+
}),
|
|
5987
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
5988
|
+
value: "over",
|
|
5989
|
+
children: t("dice_compareOver")
|
|
5990
|
+
}),
|
|
5991
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
5992
|
+
value: "under",
|
|
5993
|
+
children: t("dice_compareUnder")
|
|
5994
|
+
})
|
|
5995
|
+
]
|
|
5996
|
+
}),
|
|
5997
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5998
|
+
className: CharactersPanel_module_css_default.help,
|
|
5999
|
+
children: t("dice_compareHelp")
|
|
6000
|
+
})
|
|
6001
|
+
]
|
|
6002
|
+
}),
|
|
6003
|
+
text(index, "modifier", "dice_modifier", "dice_modifierHelp")
|
|
6004
|
+
]
|
|
6005
|
+
}),
|
|
6006
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6007
|
+
className: CharactersPanel_module_css_default.label,
|
|
6008
|
+
children: t("dice_bands")
|
|
6009
|
+
}),
|
|
6010
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6011
|
+
className: CharactersPanel_module_css_default.help,
|
|
6012
|
+
children: t("dice_bandsHelp")
|
|
6013
|
+
}),
|
|
6014
|
+
check.bands.map((band, at) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6015
|
+
className: CharactersPanel_module_css_default.grid,
|
|
6016
|
+
"data-testid": "roleplay-dice-band",
|
|
6017
|
+
children: [
|
|
6018
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
6019
|
+
className: CharactersPanel_module_css_default.field,
|
|
6020
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6021
|
+
className: CharactersPanel_module_css_default.label,
|
|
6022
|
+
children: t("dice_bandMin")
|
|
6023
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
6024
|
+
className: CharactersPanel_module_css_default.nameInput,
|
|
6025
|
+
value: band.min,
|
|
6026
|
+
onChange: (event) => {
|
|
6027
|
+
patchBand(index, at, { min: event.target.value });
|
|
6028
|
+
}
|
|
6029
|
+
})]
|
|
6030
|
+
}),
|
|
6031
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
6032
|
+
className: CharactersPanel_module_css_default.field,
|
|
6033
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6034
|
+
className: CharactersPanel_module_css_default.label,
|
|
6035
|
+
children: t("dice_bandMax")
|
|
6036
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
6037
|
+
className: CharactersPanel_module_css_default.nameInput,
|
|
6038
|
+
value: band.max,
|
|
6039
|
+
onChange: (event) => {
|
|
6040
|
+
patchBand(index, at, { max: event.target.value });
|
|
6041
|
+
}
|
|
6042
|
+
})]
|
|
6043
|
+
}),
|
|
6044
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
6045
|
+
className: CharactersPanel_module_css_default.field,
|
|
6046
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6047
|
+
className: CharactersPanel_module_css_default.label,
|
|
6048
|
+
children: t("dice_bandLabel")
|
|
6049
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
6050
|
+
className: CharactersPanel_module_css_default.nameInput,
|
|
6051
|
+
value: band.label,
|
|
6052
|
+
onChange: (event) => {
|
|
6053
|
+
patchBand(index, at, { label: event.target.value });
|
|
6054
|
+
}
|
|
6055
|
+
})]
|
|
6056
|
+
}),
|
|
6057
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
6058
|
+
className: CharactersPanel_module_css_default.field,
|
|
6059
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6060
|
+
className: CharactersPanel_module_css_default.label,
|
|
6061
|
+
children: t("dice_bandResult")
|
|
6062
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
6063
|
+
value: band.result,
|
|
6064
|
+
onChange: (event) => {
|
|
6065
|
+
patchBand(index, at, { result: event.target.value });
|
|
6066
|
+
},
|
|
6067
|
+
children: [
|
|
6068
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
6069
|
+
value: "succeeded",
|
|
6070
|
+
children: t("dice_resultSucceeded")
|
|
6071
|
+
}),
|
|
6072
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
6073
|
+
value: "partial",
|
|
6074
|
+
children: t("dice_resultPartial")
|
|
6075
|
+
}),
|
|
6076
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
6077
|
+
value: "failed",
|
|
6078
|
+
children: t("dice_resultFailed")
|
|
6079
|
+
})
|
|
6080
|
+
]
|
|
6081
|
+
})]
|
|
6082
|
+
}),
|
|
6083
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
6084
|
+
className: CharactersPanel_module_css_default.field,
|
|
6085
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6086
|
+
className: CharactersPanel_module_css_default.label,
|
|
6087
|
+
children: t("dice_bandCritical")
|
|
6088
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
6089
|
+
type: "checkbox",
|
|
6090
|
+
checked: band.critical,
|
|
6091
|
+
onChange: (event) => {
|
|
6092
|
+
patchBand(index, at, { critical: event.target.checked });
|
|
6093
|
+
}
|
|
6094
|
+
})]
|
|
6095
|
+
}),
|
|
6096
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6097
|
+
variant: "ghost",
|
|
6098
|
+
size: "sm",
|
|
6099
|
+
onClick: () => {
|
|
6100
|
+
patch(index, { bands: check.bands.filter((_, other) => other !== at) });
|
|
6101
|
+
},
|
|
6102
|
+
children: t("dice_bandRemove")
|
|
6103
|
+
})
|
|
6104
|
+
]
|
|
6105
|
+
}, at)),
|
|
6106
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6107
|
+
className: CharactersPanel_module_css_default.grid,
|
|
6108
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6109
|
+
variant: "ghost",
|
|
6110
|
+
size: "sm",
|
|
6111
|
+
onClick: () => {
|
|
6112
|
+
patch(index, { bands: [...check.bands, blankBand()] });
|
|
6113
|
+
},
|
|
6114
|
+
children: t("dice_bandAdd")
|
|
6115
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6116
|
+
variant: "ghost",
|
|
6117
|
+
size: "sm",
|
|
6118
|
+
onClick: () => {
|
|
6119
|
+
change(draft.filter((_, other) => other !== index));
|
|
6120
|
+
},
|
|
6121
|
+
children: t("dice_remove")
|
|
6122
|
+
})]
|
|
6123
|
+
})
|
|
6124
|
+
]
|
|
6125
|
+
}, index)),
|
|
6126
|
+
draft.length === 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
6127
|
+
className: CharactersPanel_module_css_default.empty,
|
|
6128
|
+
children: t("dice_none")
|
|
6129
|
+
}),
|
|
6130
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6131
|
+
variant: "ghost",
|
|
6132
|
+
size: "sm",
|
|
6133
|
+
onClick: () => {
|
|
6134
|
+
change([...draft, blankCheck()]);
|
|
6135
|
+
},
|
|
6136
|
+
children: t("dice_add")
|
|
6137
|
+
})
|
|
6138
|
+
]
|
|
6139
|
+
})
|
|
6140
|
+
})
|
|
6141
|
+
]
|
|
6142
|
+
});
|
|
6143
|
+
}
|
|
6144
|
+
//#endregion
|
|
6145
|
+
//#region src/client/world-editor/variables-draft.ts
|
|
6146
|
+
const list = (value) => value.split(/[,,\n]/).map((entry) => entry.trim()).filter((entry) => entry !== "");
|
|
6147
|
+
const NEW = {
|
|
6148
|
+
key: "",
|
|
6149
|
+
name: "",
|
|
6150
|
+
kind: "number",
|
|
6151
|
+
subject: "character",
|
|
6152
|
+
visibility: "public",
|
|
6153
|
+
description: "",
|
|
6154
|
+
min: "",
|
|
6155
|
+
max: "",
|
|
6156
|
+
integer: false,
|
|
6157
|
+
baseline: false,
|
|
6158
|
+
always: false,
|
|
6159
|
+
default: "",
|
|
6160
|
+
only: "",
|
|
6161
|
+
options: "",
|
|
6162
|
+
bands: ""
|
|
6163
|
+
};
|
|
6164
|
+
const draftOf = (value) => ({
|
|
6165
|
+
key: value.key,
|
|
6166
|
+
name: value.name,
|
|
6167
|
+
kind: value.kind,
|
|
6168
|
+
subject: value.subject,
|
|
6169
|
+
visibility: value.visibility,
|
|
6170
|
+
description: value.description ?? "",
|
|
6171
|
+
min: value.min === void 0 ? "" : String(value.min),
|
|
6172
|
+
max: value.max === void 0 ? "" : String(value.max),
|
|
6173
|
+
integer: value.integer === true,
|
|
6174
|
+
baseline: value.baseline === true,
|
|
6175
|
+
always: value.always === true,
|
|
6176
|
+
default: value.default === void 0 ? "" : String(value.default),
|
|
6177
|
+
only: (value.only ?? []).join(", "),
|
|
6178
|
+
options: (value.options ?? []).join(", "),
|
|
6179
|
+
bands: (value.bands ?? []).map((band) => `${band.up_to}: ${band.label}`).join("\n")
|
|
6180
|
+
});
|
|
6181
|
+
/** The declaration as it will be sent: a default is a number, true/false or text according to the kind; bands are `up to: label` lines. */
|
|
6182
|
+
function declarationOf(draft) {
|
|
6183
|
+
const number = (text) => text.trim() === "" || !Number.isFinite(Number(text)) ? void 0 : Number(text);
|
|
6184
|
+
const defaultValue = draft.default.trim() === "" ? void 0 : draft.kind === "number" ? number(draft.default) ?? draft.default.trim() : draft.kind === "flag" ? draft.default.trim() === "true" : draft.default.trim();
|
|
6185
|
+
const bands = draft.bands.split("\n").flatMap((line) => {
|
|
6186
|
+
const at = line.indexOf(":");
|
|
6187
|
+
const upTo = at < 0 ? void 0 : number(line.slice(0, at));
|
|
6188
|
+
return upTo === void 0 ? [] : [{
|
|
6189
|
+
up_to: upTo,
|
|
6190
|
+
label: line.slice(at + 1).trim()
|
|
6191
|
+
}];
|
|
6192
|
+
});
|
|
6193
|
+
const [min, max, only, options] = [
|
|
6194
|
+
number(draft.min),
|
|
6195
|
+
number(draft.max),
|
|
6196
|
+
list(draft.only),
|
|
6197
|
+
list(draft.options)
|
|
6198
|
+
];
|
|
6199
|
+
return {
|
|
6200
|
+
key: draft.key.trim(),
|
|
6201
|
+
name: draft.name.trim(),
|
|
6202
|
+
kind: draft.kind,
|
|
6203
|
+
subject: draft.subject,
|
|
6204
|
+
visibility: draft.visibility,
|
|
6205
|
+
...draft.description.trim() === "" ? {} : { description: draft.description.trim() },
|
|
6206
|
+
...draft.kind === "number" && min !== void 0 ? { min } : {},
|
|
6207
|
+
...draft.kind === "number" && max !== void 0 ? { max } : {},
|
|
6208
|
+
...draft.kind === "number" && draft.integer ? { integer: true } : {},
|
|
6209
|
+
...draft.baseline ? { baseline: true } : {},
|
|
6210
|
+
...draft.always ? { always: true } : {},
|
|
6211
|
+
...defaultValue === void 0 ? {} : { default: defaultValue },
|
|
6212
|
+
...only.length === 0 ? {} : { only },
|
|
6213
|
+
...draft.kind === "choice" && options.length > 0 ? { options } : {},
|
|
6214
|
+
...draft.kind === "number" && bands.length > 0 ? { bands } : {}
|
|
6215
|
+
};
|
|
6216
|
+
}
|
|
6217
|
+
//#endregion
|
|
6218
|
+
//#region src/client/world-editor/VariablesPanel.tsx
|
|
6219
|
+
/** What the world tracks beyond what every story does: numbers, flags and choices about characters, things, places or the world, with how each is told. */
|
|
6220
|
+
function VariablesPanel({ t, worldId, actions }) {
|
|
5539
6221
|
const [saved, setSaved] = (0, react.useState)();
|
|
5540
6222
|
const [draft, setDraft] = (0, react.useState)([]);
|
|
5541
6223
|
const [status, setStatus] = (0, react.useState)({ state: "idle" });
|
|
@@ -5901,35 +6583,35 @@ window.__ModuleLoader__.load({
|
|
|
5901
6583
|
}
|
|
5902
6584
|
tag$19.textContent = css$19;
|
|
5903
6585
|
var GalleryView_module_css_default = {
|
|
5904
|
-
"
|
|
6586
|
+
"pre": "rp_9pSHmG_pre",
|
|
6587
|
+
"error": "rp_9pSHmG_error",
|
|
5905
6588
|
"large": "rp_9pSHmG_large",
|
|
5906
|
-
"toolbar": "rp_9pSHmG_toolbar",
|
|
5907
|
-
"count": "rp_9pSHmG_count",
|
|
5908
|
-
"editButton": "rp_9pSHmG_editButton",
|
|
5909
|
-
"message": "rp_9pSHmG_message",
|
|
5910
6589
|
"facts": "rp_9pSHmG_facts",
|
|
5911
|
-
"
|
|
5912
|
-
"
|
|
5913
|
-
"
|
|
5914
|
-
"
|
|
5915
|
-
"
|
|
5916
|
-
"
|
|
6590
|
+
"editButton": "rp_9pSHmG_editButton",
|
|
6591
|
+
"editField": "rp_9pSHmG_editField",
|
|
6592
|
+
"cell": "rp_9pSHmG_cell",
|
|
6593
|
+
"editArea": "rp_9pSHmG_editArea",
|
|
6594
|
+
"count": "rp_9pSHmG_count",
|
|
6595
|
+
"thumb": "rp_9pSHmG_thumb",
|
|
5917
6596
|
"editHelp": "rp_9pSHmG_editHelp",
|
|
5918
|
-
"
|
|
6597
|
+
"grid": "rp_9pSHmG_grid",
|
|
6598
|
+
"status": "rp_9pSHmG_status",
|
|
6599
|
+
"open": "rp_9pSHmG_open",
|
|
6600
|
+
"reusable": "rp_9pSHmG_reusable",
|
|
5919
6601
|
"detail": "rp_9pSHmG_detail",
|
|
5920
|
-
"editInput": "rp_9pSHmG_editInput",
|
|
5921
6602
|
"tags": "rp_9pSHmG_tags",
|
|
5922
|
-
"
|
|
5923
|
-
"page": "rp_9pSHmG_page",
|
|
5924
|
-
"grid": "rp_9pSHmG_grid",
|
|
5925
|
-
"thumb": "rp_9pSHmG_thumb",
|
|
5926
|
-
"cell": "rp_9pSHmG_cell",
|
|
6603
|
+
"toolbar": "rp_9pSHmG_toolbar",
|
|
5927
6604
|
"note": "rp_9pSHmG_note",
|
|
5928
|
-
"actions": "rp_9pSHmG_actions",
|
|
5929
|
-
"open": "rp_9pSHmG_open",
|
|
5930
6605
|
"edit": "rp_9pSHmG_edit",
|
|
6606
|
+
"page": "rp_9pSHmG_page",
|
|
6607
|
+
"editLabel": "rp_9pSHmG_editLabel",
|
|
6608
|
+
"message": "rp_9pSHmG_message",
|
|
6609
|
+
"image": "rp_9pSHmG_image",
|
|
6610
|
+
"caption": "rp_9pSHmG_caption",
|
|
6611
|
+
"editInput": "rp_9pSHmG_editInput",
|
|
5931
6612
|
"statusError": "rp_9pSHmG_statusError",
|
|
5932
|
-
"
|
|
6613
|
+
"actions": "rp_9pSHmG_actions",
|
|
6614
|
+
"select": "rp_9pSHmG_select"
|
|
5933
6615
|
};
|
|
5934
6616
|
//#endregion
|
|
5935
6617
|
//#region src/client/widgets/gallery-view/GalleryView.tsx
|
|
@@ -6270,13 +6952,13 @@ window.__ModuleLoader__.load({
|
|
|
6270
6952
|
}
|
|
6271
6953
|
tag$18.textContent = css$18;
|
|
6272
6954
|
var WorldEditor_module_css_default = {
|
|
6955
|
+
"warning": "rp__swA3a_warning",
|
|
6273
6956
|
"drawerItem": "rp__swA3a_drawerItem",
|
|
6274
6957
|
"view": "rp__swA3a_view",
|
|
6958
|
+
"drawer": "rp__swA3a_drawer",
|
|
6275
6959
|
"drawerItemOn": "rp__swA3a_drawerItemOn",
|
|
6276
6960
|
"content": "rp__swA3a_content",
|
|
6277
|
-
"
|
|
6278
|
-
"message": "rp__swA3a_message",
|
|
6279
|
-
"drawer": "rp__swA3a_drawer"
|
|
6961
|
+
"message": "rp__swA3a_message"
|
|
6280
6962
|
};
|
|
6281
6963
|
//#endregion
|
|
6282
6964
|
//#region src/client/world-editor/WorldEditor.tsx
|
|
@@ -6345,6 +7027,18 @@ window.__ModuleLoader__.load({
|
|
|
6345
7027
|
built: true,
|
|
6346
7028
|
ownFiles: true
|
|
6347
7029
|
},
|
|
7030
|
+
{
|
|
7031
|
+
id: "dice",
|
|
7032
|
+
label: "sectionDice",
|
|
7033
|
+
built: true,
|
|
7034
|
+
ownFiles: true
|
|
7035
|
+
},
|
|
7036
|
+
{
|
|
7037
|
+
id: "tools",
|
|
7038
|
+
label: "sectionTools",
|
|
7039
|
+
built: true,
|
|
7040
|
+
ownFiles: true
|
|
7041
|
+
},
|
|
6348
7042
|
{
|
|
6349
7043
|
id: "prompts",
|
|
6350
7044
|
label: "sectionPrompts",
|
|
@@ -6441,10 +7135,33 @@ window.__ModuleLoader__.load({
|
|
|
6441
7135
|
"data-testid": "roleplay-no-playable",
|
|
6442
7136
|
children: t("noPlayableWarning")
|
|
6443
7137
|
}),
|
|
6444
|
-
section === "info" && source.worldId !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoPanel, {
|
|
7138
|
+
section === "info" && source.worldId !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoPanel, {
|
|
7139
|
+
t,
|
|
7140
|
+
worldId: source.worldId,
|
|
7141
|
+
onSaved: refresh,
|
|
7142
|
+
actions: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
7143
|
+
variant: "ghost",
|
|
7144
|
+
size: "sm",
|
|
7145
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutlineRegular, {}),
|
|
7146
|
+
onClick: refresh,
|
|
7147
|
+
children: t("editorRefresh")
|
|
7148
|
+
})
|
|
7149
|
+
}),
|
|
7150
|
+
section === "prompts" && source.worldId !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PromptsPanel, {
|
|
7151
|
+
t,
|
|
7152
|
+
worldId: source.worldId,
|
|
7153
|
+
language: t("language"),
|
|
7154
|
+
actions: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
7155
|
+
variant: "ghost",
|
|
7156
|
+
size: "sm",
|
|
7157
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutlineRegular, {}),
|
|
7158
|
+
onClick: refresh,
|
|
7159
|
+
children: t("editorRefresh")
|
|
7160
|
+
})
|
|
7161
|
+
}),
|
|
7162
|
+
section === "routines" && source.worldId !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RoutinesPanel, {
|
|
6445
7163
|
t,
|
|
6446
7164
|
worldId: source.worldId,
|
|
6447
|
-
onSaved: refresh,
|
|
6448
7165
|
actions: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6449
7166
|
variant: "ghost",
|
|
6450
7167
|
size: "sm",
|
|
@@ -6453,10 +7170,9 @@ window.__ModuleLoader__.load({
|
|
|
6453
7170
|
children: t("editorRefresh")
|
|
6454
7171
|
})
|
|
6455
7172
|
}),
|
|
6456
|
-
section === "
|
|
7173
|
+
section === "calendar" && source.worldId !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CalendarPanel, {
|
|
6457
7174
|
t,
|
|
6458
7175
|
worldId: source.worldId,
|
|
6459
|
-
language: t("language"),
|
|
6460
7176
|
actions: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
6461
7177
|
variant: "ghost",
|
|
6462
7178
|
size: "sm",
|
|
@@ -6465,7 +7181,7 @@ window.__ModuleLoader__.load({
|
|
|
6465
7181
|
children: t("editorRefresh")
|
|
6466
7182
|
})
|
|
6467
7183
|
}),
|
|
6468
|
-
section === "
|
|
7184
|
+
section === "dice" && source.worldId !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DicePanel, {
|
|
6469
7185
|
t,
|
|
6470
7186
|
worldId: source.worldId,
|
|
6471
7187
|
actions: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
@@ -6476,7 +7192,7 @@ window.__ModuleLoader__.load({
|
|
|
6476
7192
|
children: t("editorRefresh")
|
|
6477
7193
|
})
|
|
6478
7194
|
}),
|
|
6479
|
-
section === "
|
|
7195
|
+
section === "tools" && source.worldId !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolsPanel, {
|
|
6480
7196
|
t,
|
|
6481
7197
|
worldId: source.worldId,
|
|
6482
7198
|
actions: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
@@ -6636,27 +7352,27 @@ window.__ModuleLoader__.load({
|
|
|
6636
7352
|
}
|
|
6637
7353
|
tag$17.textContent = css$17;
|
|
6638
7354
|
var AvatarsPage_module_css_default = {
|
|
6639
|
-
"
|
|
7355
|
+
"error": "rp_pQOzEG_error",
|
|
7356
|
+
"actions": "rp_pQOzEG_actions",
|
|
7357
|
+
"placeholder": "rp_pQOzEG_placeholder",
|
|
6640
7358
|
"name": "rp_pQOzEG_name",
|
|
6641
|
-
"editHeader": "rp_pQOzEG_editHeader",
|
|
6642
7359
|
"grid": "rp_pQOzEG_grid",
|
|
6643
|
-
"
|
|
7360
|
+
"editTitle": "rp_pQOzEG_editTitle",
|
|
6644
7361
|
"viewport": "rp_pQOzEG_viewport",
|
|
6645
|
-
"portrait": "rp_pQOzEG_portrait",
|
|
6646
|
-
"page": "rp_pQOzEG_page",
|
|
6647
7362
|
"count": "rp_pQOzEG_count",
|
|
6648
|
-
"message": "rp_pQOzEG_message",
|
|
6649
|
-
"open": "rp_pQOzEG_open",
|
|
6650
|
-
"editTitle": "rp_pQOzEG_editTitle",
|
|
6651
7363
|
"card": "rp_pQOzEG_card",
|
|
7364
|
+
"message": "rp_pQOzEG_message",
|
|
6652
7365
|
"form": "rp_pQOzEG_form",
|
|
6653
|
-
"
|
|
6654
|
-
"
|
|
7366
|
+
"page": "rp_pQOzEG_page",
|
|
7367
|
+
"portrait": "rp_pQOzEG_portrait",
|
|
7368
|
+
"editHeader": "rp_pQOzEG_editHeader",
|
|
6655
7369
|
"label": "rp_pQOzEG_label",
|
|
6656
7370
|
"toolbar": "rp_pQOzEG_toolbar",
|
|
6657
|
-
"
|
|
7371
|
+
"open": "rp_pQOzEG_open",
|
|
7372
|
+
"editBody": "rp_pQOzEG_editBody",
|
|
7373
|
+
"text": "rp_pQOzEG_text",
|
|
6658
7374
|
"summary": "rp_pQOzEG_summary",
|
|
6659
|
-
"
|
|
7375
|
+
"field": "rp_pQOzEG_field"
|
|
6660
7376
|
};
|
|
6661
7377
|
//#endregion
|
|
6662
7378
|
//#region src/client/pages/avatars/AvatarsPage.tsx
|
|
@@ -6938,8 +7654,56 @@ window.__ModuleLoader__.load({
|
|
|
6938
7654
|
return Object.fromEntries(Object.keys(dictionaries).map((locale) => [locale, Object.fromEntries(Object.entries(dictionaries[locale]).map(([key, value]) => [`${prefix}${key}`, value]))]));
|
|
6939
7655
|
}
|
|
6940
7656
|
//#endregion
|
|
7657
|
+
//#region src/client/widgets/tool-switches/locales.ts
|
|
7658
|
+
const dictionaries$14 = {
|
|
7659
|
+
en: {
|
|
7660
|
+
sw_title: "Tools",
|
|
7661
|
+
sw_help: "Which optional tools each kind of agent may use. A choice applies to every agent of that kind, not to one character. Tools this version does not know are left as they are and not shown.",
|
|
7662
|
+
sw_external: "Tools from other plugins: {on} of {count} on",
|
|
7663
|
+
sw_external_help: "Registered by other plugins for everyone (files, a shell, MCP servers such as a search). They are off unless you switch them on, and a tool acts with whatever access its plugin has, so switch on only what this agent should be able to do. A tool that is not registered now is kept here and has no effect.",
|
|
7664
|
+
sw_external_none: "No tools from other plugins are registered right now. Load a plugin that registers tools for everyone (a file or shell tool, an MCP server) and they are offered here.",
|
|
7665
|
+
sw_none: "No optional tools for this agent yet.",
|
|
7666
|
+
sw_default: "default",
|
|
7667
|
+
sw_failed: "Could not change the tools: {message}",
|
|
7668
|
+
sw_agent_gameMaster: "Game master",
|
|
7669
|
+
sw_agent_gameMaster_hint: "Decides what happens and writes the narration.",
|
|
7670
|
+
sw_agent_characters: "Characters",
|
|
7671
|
+
sw_agent_characters_hint: "Every character that is asked to act.",
|
|
7672
|
+
sw_agent_records: "Record keeper",
|
|
7673
|
+
sw_agent_records_hint: "Writes what happened into the story's records in the background.",
|
|
7674
|
+
sw_tool_roll_check: "Roll a check",
|
|
7675
|
+
sw_tool_roll_check_hint: "Rolls one of the world's checks for an uncertain attempt and reads the result with the world's own rules.",
|
|
7676
|
+
sw_tool_roll_dice: "Roll dice",
|
|
7677
|
+
sw_tool_roll_dice_hint: "Rolls plain dice (2d6+1, d100) for what has no check, so that no number is made up.",
|
|
7678
|
+
sw_tool_list_checks: "List checks",
|
|
7679
|
+
sw_tool_list_checks_hint: "Shows the world's checks and when each is used."
|
|
7680
|
+
},
|
|
7681
|
+
zh: {
|
|
7682
|
+
sw_title: "工具",
|
|
7683
|
+
sw_help: "每一类智能体可以使用哪些可选工具。选择对该类的所有智能体生效,而不是只针对某一个角色。此版本不认识的工具保持原样,也不显示。",
|
|
7684
|
+
sw_external: "来自其他插件的工具:{count} 个中开启 {on} 个",
|
|
7685
|
+
sw_external_help: "由其他插件为所有人注册的工具(文件、命令行、搜索之类的 MCP 服务器)。除非你开启,否则它们都是关闭的;工具以其插件所拥有的权限运行,所以只开启这个智能体应该能做的事。当前没有注册的工具会保留在这里,但不起作用。",
|
|
7686
|
+
sw_external_none: "当前没有其他插件注册的工具。加载一个为所有人注册工具的插件(文件或命令行工具、MCP 服务器)后,它们会在这里提供。",
|
|
7687
|
+
sw_none: "该智能体暂时没有可选工具。",
|
|
7688
|
+
sw_default: "默认",
|
|
7689
|
+
sw_failed: "无法更改工具:{message}",
|
|
7690
|
+
sw_agent_gameMaster: "主持人",
|
|
7691
|
+
sw_agent_gameMaster_hint: "决定发生什么,并撰写叙述。",
|
|
7692
|
+
sw_agent_characters: "角色",
|
|
7693
|
+
sw_agent_characters_hint: "每一个被要求行动的角色。",
|
|
7694
|
+
sw_agent_records: "记录员",
|
|
7695
|
+
sw_agent_records_hint: "在后台把发生的事写入故事记录。",
|
|
7696
|
+
sw_tool_roll_check: "进行检定",
|
|
7697
|
+
sw_tool_roll_check_hint: "为不确定的尝试掷出世界定义的检定,并按世界自己的规则解读结果。",
|
|
7698
|
+
sw_tool_roll_dice: "掷骰子",
|
|
7699
|
+
sw_tool_roll_dice_hint: "为没有检定的事掷普通骰子(2d6+1、d100),不让任何数字被编造。",
|
|
7700
|
+
sw_tool_list_checks: "列出检定",
|
|
7701
|
+
sw_tool_list_checks_hint: "显示世界的检定以及各自的使用场合。"
|
|
7702
|
+
}
|
|
7703
|
+
};
|
|
7704
|
+
//#endregion
|
|
6941
7705
|
//#region src/client/widgets/gallery-view/locales.ts
|
|
6942
|
-
const dictionaries$
|
|
7706
|
+
const dictionaries$13 = {
|
|
6943
7707
|
en: {
|
|
6944
7708
|
tab: "Gallery",
|
|
6945
7709
|
notRoleplay: "This chat is not a roleplay session, so it has no gallery.",
|
|
@@ -7017,7 +7781,7 @@ window.__ModuleLoader__.load({
|
|
|
7017
7781
|
cancel: "取消"
|
|
7018
7782
|
}
|
|
7019
7783
|
};
|
|
7020
|
-
const dictionaries$9 = withDictionaries(withDictionaries(withDictionaries({
|
|
7784
|
+
const dictionaries$9 = withDictionaries(withDictionaries(withDictionaries(withDictionaries(withDictionaries({
|
|
7021
7785
|
en: {
|
|
7022
7786
|
language: "en",
|
|
7023
7787
|
sectionInfo: "About",
|
|
@@ -7030,6 +7794,8 @@ window.__ModuleLoader__.load({
|
|
|
7030
7794
|
infoOpening: "Opening message",
|
|
7031
7795
|
infoOpeningHelp: "What the story begins with, before the player says anything. Leave empty for none.",
|
|
7032
7796
|
infoOpeningParts: "This opening has lines spoken by characters, so it cannot be edited here as plain text. Change it in the file, or ask the authoring assistant.",
|
|
7797
|
+
sectionDice: "Dice",
|
|
7798
|
+
sectionTools: "Tools",
|
|
7033
7799
|
sectionCalendar: "Calendar",
|
|
7034
7800
|
calendarHelp: "The seasons follow the hemisphere, and a holiday is told by the days it falls on: a date (09-21), a span (12-20..01-05), a weekday of the month (nth:fri:last), a month or a season. Routines, triggers and the time shown to the models can name a holiday with holiday:<id>.",
|
|
7035
7801
|
calendarHemisphere: "Seasons follow",
|
|
@@ -7301,6 +8067,8 @@ window.__ModuleLoader__.load({
|
|
|
7301
8067
|
infoOpening: "开场白",
|
|
7302
8068
|
infoOpeningHelp: "玩家开口之前故事的开头。留空表示没有。",
|
|
7303
8069
|
infoOpeningParts: "这段开场白含有角色说的话,因此不能在这里按纯文本编辑。请在文件中修改,或请创作助手处理。",
|
|
8070
|
+
sectionDice: "骰子",
|
|
8071
|
+
sectionTools: "工具",
|
|
7304
8072
|
sectionCalendar: "日历",
|
|
7305
8073
|
calendarHelp: "季节随半球而定;节日用它所在的日子来表示:某个日期(09-21)、一段日期(12-20..01-05)、某月的第几个星期几(nth:fri:last)、整个月或某个季节。日常、触发器和提供给模型的时间都可以用 holiday:<id> 引用节日。",
|
|
7306
8074
|
calendarHemisphere: "季节依据",
|
|
@@ -7560,7 +8328,7 @@ window.__ModuleLoader__.load({
|
|
|
7560
8328
|
relationCancel: "取消",
|
|
7561
8329
|
relationCreate: "创建"
|
|
7562
8330
|
}
|
|
7563
|
-
}, prefixed(dictionaries$
|
|
8331
|
+
}, prefixed(dictionaries$13, "gallery_")), prefixed({
|
|
7564
8332
|
en: {
|
|
7565
8333
|
title: "Triggers",
|
|
7566
8334
|
help: "What the world does by itself when something comes true. They are read from triggers.json; ask the authoring assistant to make or change them, or edit the file.",
|
|
@@ -7736,7 +8504,80 @@ window.__ModuleLoader__.load({
|
|
|
7736
8504
|
logOpen: "请求打开:{surface}",
|
|
7737
8505
|
noSurfaces: "这个界面包没有可预览的界面位置。"
|
|
7738
8506
|
}
|
|
7739
|
-
}, "pk_"))
|
|
8507
|
+
}, "pk_")), dictionaries$14), prefixed({
|
|
8508
|
+
en: {
|
|
8509
|
+
help: "How uncertain attempts are settled. The game master rolls one of these checks and is told which band the roll fell in, so no number is ever made up. Each check says when it is used, the dice it rolls and what each result means; the bands together should cover every value the dice can give.",
|
|
8510
|
+
none: "This world has no checks. Its game master can still roll plain dice for things that have none.",
|
|
8511
|
+
add: "Add a check",
|
|
8512
|
+
remove: "Remove this check",
|
|
8513
|
+
checkTitle: "Check",
|
|
8514
|
+
key: "Key",
|
|
8515
|
+
name: "Name",
|
|
8516
|
+
use: "When it is used",
|
|
8517
|
+
useHelp: "Said to the game master in your words: what kind of attempt it is for, and how hard is hard (for example \"target 10 moderate, 15 hard\").",
|
|
8518
|
+
dice: "Dice",
|
|
8519
|
+
diceHelp: "2d6+1, 1d20, 4d6kh3 (keep the highest 3), d100.",
|
|
8520
|
+
reading: "Read as",
|
|
8521
|
+
readTotal: "The total of the dice",
|
|
8522
|
+
readSuccesses: "The number of dice that hit",
|
|
8523
|
+
hit: "A die hits from",
|
|
8524
|
+
compare: "Compared with",
|
|
8525
|
+
compareAbsolute: "Nothing: the value itself",
|
|
8526
|
+
compareOver: "A difficulty to meet or beat",
|
|
8527
|
+
compareUnder: "A skill to roll under",
|
|
8528
|
+
compareHelp: "With a difficulty or a skill, the game master gives the number, and the bands read how far over or under it the roll is.",
|
|
8529
|
+
modifier: "Adds a quality of the character",
|
|
8530
|
+
modifierHelp: "The key of a number about characters declared in Tracked values, or empty.",
|
|
8531
|
+
bands: "Results",
|
|
8532
|
+
bandsHelp: "The first band that holds the value is the result. Leave \"from\" or \"to\" empty for no end.",
|
|
8533
|
+
bandAdd: "Add a result",
|
|
8534
|
+
bandRemove: "Remove",
|
|
8535
|
+
bandMin: "From",
|
|
8536
|
+
bandMax: "To",
|
|
8537
|
+
bandLabel: "Called",
|
|
8538
|
+
bandResult: "Counts as",
|
|
8539
|
+
resultSucceeded: "Success",
|
|
8540
|
+
resultPartial: "Partial",
|
|
8541
|
+
resultFailed: "Failure",
|
|
8542
|
+
bandCritical: "Critical"
|
|
8543
|
+
},
|
|
8544
|
+
zh: {
|
|
8545
|
+
help: "不确定的尝试如何裁定。主持人掷出其中一个检定,并被告知掷出的结果落在哪个区段,因此不会有任何数字被编造。每个检定写明何时使用、掷什么骰子,以及每种结果意味着什么;各区段合起来应覆盖骰子可能给出的每个数值。",
|
|
8546
|
+
none: "这个世界没有检定。它的主持人仍然可以为没有检定的事掷普通骰子。",
|
|
8547
|
+
add: "添加检定",
|
|
8548
|
+
remove: "删除此检定",
|
|
8549
|
+
checkTitle: "检定",
|
|
8550
|
+
key: "标识",
|
|
8551
|
+
name: "名称",
|
|
8552
|
+
use: "何时使用",
|
|
8553
|
+
useHelp: "用你的话告诉主持人:它适用于哪一类尝试,以及怎样算难(例如“目标 10 为中等,15 为困难”)。",
|
|
8554
|
+
dice: "骰子",
|
|
8555
|
+
diceHelp: "2d6+1、1d20、4d6kh3(保留最高的 3 个)、d100。",
|
|
8556
|
+
reading: "读取方式",
|
|
8557
|
+
readTotal: "骰子的总和",
|
|
8558
|
+
readSuccesses: "命中的骰子数",
|
|
8559
|
+
hit: "骰子从多少起算命中",
|
|
8560
|
+
compare: "与什么比较",
|
|
8561
|
+
compareAbsolute: "不比较:直接读取数值",
|
|
8562
|
+
compareOver: "要达到或超过的难度",
|
|
8563
|
+
compareUnder: "要掷低于的技能值",
|
|
8564
|
+
compareHelp: "选择难度或技能值时,由主持人给出该数字,区段读取的是掷出的结果比它高出或低多少。",
|
|
8565
|
+
modifier: "加上角色的某项属性",
|
|
8566
|
+
modifierHelp: "在“追踪数值”中声明的、关于角色的数值的 key;留空为不加。",
|
|
8567
|
+
bands: "结果",
|
|
8568
|
+
bandsHelp: "第一个包含该数值的区段就是结果。“从”或“到”留空表示没有上限或下限。",
|
|
8569
|
+
bandAdd: "添加结果",
|
|
8570
|
+
bandRemove: "删除",
|
|
8571
|
+
bandMin: "从",
|
|
8572
|
+
bandMax: "到",
|
|
8573
|
+
bandLabel: "称为",
|
|
8574
|
+
bandResult: "算作",
|
|
8575
|
+
resultSucceeded: "成功",
|
|
8576
|
+
resultPartial: "部分成功",
|
|
8577
|
+
resultFailed: "失败",
|
|
8578
|
+
bandCritical: "关键"
|
|
8579
|
+
}
|
|
8580
|
+
}, "dice_"));
|
|
7740
8581
|
const dictionaries$8 = withDictionaries({
|
|
7741
8582
|
en: {
|
|
7742
8583
|
nav: "Avatars",
|
|
@@ -7852,8 +8693,8 @@ window.__ModuleLoader__.load({
|
|
|
7852
8693
|
}
|
|
7853
8694
|
tag$16.textContent = css$16;
|
|
7854
8695
|
var Pager_module_css_default = {
|
|
7855
|
-
"
|
|
7856
|
-
"
|
|
8696
|
+
"position": "rp_KBAD0W_position",
|
|
8697
|
+
"pager": "rp_KBAD0W_pager"
|
|
7857
8698
|
};
|
|
7858
8699
|
//#endregion
|
|
7859
8700
|
//#region src/client/widgets/pager/Pager.tsx
|
|
@@ -7926,10 +8767,10 @@ window.__ModuleLoader__.load({
|
|
|
7926
8767
|
}
|
|
7927
8768
|
tag$14.textContent = css$14;
|
|
7928
8769
|
var DeleteSessionDialog_module_css_default = {
|
|
7929
|
-
"
|
|
8770
|
+
"error": "rp_FifHrW_error",
|
|
7930
8771
|
"warning": "rp_FifHrW_warning",
|
|
7931
|
-
"
|
|
7932
|
-
"
|
|
8772
|
+
"question": "rp_FifHrW_question",
|
|
8773
|
+
"body": "rp_FifHrW_body"
|
|
7933
8774
|
};
|
|
7934
8775
|
//#endregion
|
|
7935
8776
|
//#region src/client/pages/sessions/DeleteSessionDialog.tsx
|
|
@@ -8036,28 +8877,28 @@ window.__ModuleLoader__.load({
|
|
|
8036
8877
|
}
|
|
8037
8878
|
tag$13.textContent = css$13;
|
|
8038
8879
|
var SessionsPage_module_css_default = {
|
|
8039
|
-
"actionsColumn": "rp_24z4eW_actionsColumn",
|
|
8040
|
-
"name": "rp_24z4eW_name",
|
|
8041
|
-
"page": "rp_24z4eW_page",
|
|
8042
8880
|
"turnsColumn": "rp_24z4eW_turnsColumn",
|
|
8043
|
-
"
|
|
8044
|
-
"
|
|
8881
|
+
"nameColumn": "rp_24z4eW_nameColumn",
|
|
8882
|
+
"archived": "rp_24z4eW_archived",
|
|
8883
|
+
"notice": "rp_24z4eW_notice",
|
|
8884
|
+
"actionsColumn": "rp_24z4eW_actionsColumn",
|
|
8885
|
+
"actions": "rp_24z4eW_actions",
|
|
8045
8886
|
"spinning": "rp_24z4eW_spinning",
|
|
8887
|
+
"toolbar": "rp_24z4eW_toolbar",
|
|
8046
8888
|
"table": "rp_24z4eW_table",
|
|
8047
|
-
"
|
|
8889
|
+
"viewport": "rp_24z4eW_viewport",
|
|
8890
|
+
"fits": "rp_24z4eW_fits",
|
|
8048
8891
|
"timeColumn": "rp_24z4eW_timeColumn",
|
|
8049
|
-
"archived": "rp_24z4eW_archived",
|
|
8050
8892
|
"scrolls": "rp_24z4eW_scrolls",
|
|
8893
|
+
"badge": "rp_24z4eW_badge",
|
|
8894
|
+
"page": "rp_24z4eW_page",
|
|
8895
|
+
"worldColumn": "rp_24z4eW_worldColumn",
|
|
8896
|
+
"name": "rp_24z4eW_name",
|
|
8051
8897
|
"secondary": "rp_24z4eW_secondary",
|
|
8052
|
-
"
|
|
8898
|
+
"count": "rp_24z4eW_count",
|
|
8053
8899
|
"spin": "rp_24z4eW_spin",
|
|
8054
|
-
"fits": "rp_24z4eW_fits",
|
|
8055
8900
|
"number": "rp_24z4eW_number",
|
|
8056
|
-
"
|
|
8057
|
-
"count": "rp_24z4eW_count",
|
|
8058
|
-
"notice": "rp_24z4eW_notice",
|
|
8059
|
-
"viewport": "rp_24z4eW_viewport",
|
|
8060
|
-
"worldColumn": "rp_24z4eW_worldColumn"
|
|
8901
|
+
"message": "rp_24z4eW_message"
|
|
8061
8902
|
};
|
|
8062
8903
|
//#endregion
|
|
8063
8904
|
//#region src/client/pages/sessions/SessionsPage.tsx
|
|
@@ -8573,16 +9414,16 @@ window.__ModuleLoader__.load({
|
|
|
8573
9414
|
}
|
|
8574
9415
|
tag$12.textContent = css$12;
|
|
8575
9416
|
var WorldCard_module_css_default = {
|
|
8576
|
-
"
|
|
8577
|
-
"tag": "rp_Bvxx5q_tag",
|
|
9417
|
+
"placeholder": "rp_Bvxx5q_placeholder",
|
|
8578
9418
|
"play": "rp_Bvxx5q_play",
|
|
8579
|
-
"
|
|
8580
|
-
"card": "rp_Bvxx5q_card",
|
|
9419
|
+
"openButton": "rp_Bvxx5q_openButton",
|
|
8581
9420
|
"image": "rp_Bvxx5q_image",
|
|
8582
|
-
"
|
|
9421
|
+
"tag": "rp_Bvxx5q_tag",
|
|
9422
|
+
"cover": "rp_Bvxx5q_cover",
|
|
9423
|
+
"card": "rp_Bvxx5q_card",
|
|
8583
9424
|
"tags": "rp_Bvxx5q_tags",
|
|
8584
|
-
"
|
|
8585
|
-
"
|
|
9425
|
+
"info": "rp_Bvxx5q_info",
|
|
9426
|
+
"name": "rp_Bvxx5q_name"
|
|
8586
9427
|
};
|
|
8587
9428
|
//#endregion
|
|
8588
9429
|
//#region src/client/widgets/world-card/WorldCard.tsx
|
|
@@ -8676,9 +9517,9 @@ window.__ModuleLoader__.load({
|
|
|
8676
9517
|
}
|
|
8677
9518
|
tag$11.textContent = css$11;
|
|
8678
9519
|
var AvatarChoices_module_css_default = {
|
|
8679
|
-
"option": "rp_YCstOG_option",
|
|
8680
|
-
"text": "rp_YCstOG_text",
|
|
8681
9520
|
"summary": "rp_YCstOG_summary",
|
|
9521
|
+
"text": "rp_YCstOG_text",
|
|
9522
|
+
"option": "rp_YCstOG_option",
|
|
8682
9523
|
"name": "rp_YCstOG_name"
|
|
8683
9524
|
};
|
|
8684
9525
|
//#endregion
|
|
@@ -8719,18 +9560,18 @@ window.__ModuleLoader__.load({
|
|
|
8719
9560
|
}
|
|
8720
9561
|
tag$10.textContent = css$10;
|
|
8721
9562
|
var StartSessionDialog_module_css_default = {
|
|
8722
|
-
"optionText": "rp_AnbLKG_optionText",
|
|
8723
|
-
"label": "rp_AnbLKG_label",
|
|
8724
9563
|
"message": "rp_AnbLKG_message",
|
|
8725
|
-
"advanced": "rp_AnbLKG_advanced",
|
|
8726
9564
|
"advancedToggle": "rp_AnbLKG_advancedToggle",
|
|
8727
|
-
"
|
|
9565
|
+
"option": "rp_AnbLKG_option",
|
|
9566
|
+
"optionSummary": "rp_AnbLKG_optionSummary",
|
|
9567
|
+
"label": "rp_AnbLKG_label",
|
|
9568
|
+
"optionName": "rp_AnbLKG_optionName",
|
|
8728
9569
|
"advancedBody": "rp_AnbLKG_advancedBody",
|
|
8729
|
-
"
|
|
9570
|
+
"optionText": "rp_AnbLKG_optionText",
|
|
9571
|
+
"form": "rp_AnbLKG_form",
|
|
9572
|
+
"advanced": "rp_AnbLKG_advanced",
|
|
8730
9573
|
"error": "rp_AnbLKG_error",
|
|
8731
|
-
"
|
|
8732
|
-
"option": "rp_AnbLKG_option",
|
|
8733
|
-
"optionSummary": "rp_AnbLKG_optionSummary"
|
|
9574
|
+
"field": "rp_AnbLKG_field"
|
|
8734
9575
|
};
|
|
8735
9576
|
//#endregion
|
|
8736
9577
|
//#region src/client/pages/worlds/AddAvatarsDialog.tsx
|
|
@@ -8845,6 +9686,7 @@ window.__ModuleLoader__.load({
|
|
|
8845
9686
|
kind: "record",
|
|
8846
9687
|
fallback: {}
|
|
8847
9688
|
});
|
|
9689
|
+
const switchboard = () => ({ kind: "switchboard" });
|
|
8848
9690
|
const choice = (options, fallback) => ({
|
|
8849
9691
|
kind: "choice",
|
|
8850
9692
|
options,
|
|
@@ -8958,11 +9800,13 @@ window.__ModuleLoader__.load({
|
|
|
8958
9800
|
interpreterModel: text(200, ""),
|
|
8959
9801
|
captioner: text(200, "")
|
|
8960
9802
|
},
|
|
9803
|
+
dice: { visibility: choice(["hidden", "card"], "card") },
|
|
9804
|
+
tools: switchboard(),
|
|
8961
9805
|
embedding: { options: record() }
|
|
8962
9806
|
};
|
|
8963
9807
|
const isField = (spec) => "kind" in spec && typeof spec["kind"] === "string";
|
|
8964
9808
|
function defaultsOf(spec) {
|
|
8965
|
-
return Object.fromEntries(Object.entries(spec).map(([key, entry]) => [key, isField(entry) ? entry.kind === "record" ? { ...entry.fallback } : entry.fallback : defaultsOf(entry)]));
|
|
9809
|
+
return Object.fromEntries(Object.entries(spec).map(([key, entry]) => [key, isField(entry) ? entry.kind === "record" ? { ...entry.fallback } : entry.kind === "switchboard" ? {} : entry.fallback : defaultsOf(entry)]));
|
|
8966
9810
|
}
|
|
8967
9811
|
const DEFAULT_SETTINGS = defaultsOf(SETTINGS_SPEC);
|
|
8968
9812
|
/** Whether a name is a time zone the runtime knows. */
|
|
@@ -9271,6 +10115,19 @@ window.__ModuleLoader__.load({
|
|
|
9271
10115
|
label: "suggestionsCount",
|
|
9272
10116
|
help: "suggestionsCountHelp"
|
|
9273
10117
|
},
|
|
10118
|
+
{
|
|
10119
|
+
path: ["dice", "visibility"],
|
|
10120
|
+
kind: "choice",
|
|
10121
|
+
label: "diceVisibility",
|
|
10122
|
+
help: "diceVisibilityHelp",
|
|
10123
|
+
choices: [{
|
|
10124
|
+
value: "hidden",
|
|
10125
|
+
label: "diceHidden"
|
|
10126
|
+
}, {
|
|
10127
|
+
value: "card",
|
|
10128
|
+
label: "diceCard"
|
|
10129
|
+
}]
|
|
10130
|
+
},
|
|
9274
10131
|
{
|
|
9275
10132
|
path: ["images", "mode"],
|
|
9276
10133
|
kind: "choice",
|
|
@@ -9587,14 +10444,14 @@ window.__ModuleLoader__.load({
|
|
|
9587
10444
|
}
|
|
9588
10445
|
tag$9.textContent = css$9;
|
|
9589
10446
|
var SettingsFields_module_css_default = {
|
|
9590
|
-
"field": "rp_Rhi3yq_field",
|
|
9591
|
-
"help": "rp_Rhi3yq_help",
|
|
9592
|
-
"groupTitle": "rp_Rhi3yq_groupTitle",
|
|
9593
|
-
"error": "rp_Rhi3yq_error",
|
|
9594
|
-
"group": "rp_Rhi3yq_group",
|
|
9595
10447
|
"row": "rp_Rhi3yq_row",
|
|
9596
10448
|
"label": "rp_Rhi3yq_label",
|
|
9597
|
-
"
|
|
10449
|
+
"error": "rp_Rhi3yq_error",
|
|
10450
|
+
"help": "rp_Rhi3yq_help",
|
|
10451
|
+
"field": "rp_Rhi3yq_field",
|
|
10452
|
+
"area": "rp_Rhi3yq_area",
|
|
10453
|
+
"group": "rp_Rhi3yq_group",
|
|
10454
|
+
"groupTitle": "rp_Rhi3yq_groupTitle"
|
|
9598
10455
|
};
|
|
9599
10456
|
//#endregion
|
|
9600
10457
|
//#region src/client/settings-form/SettingsFields.tsx
|
|
@@ -9849,9 +10706,9 @@ window.__ModuleLoader__.load({
|
|
|
9849
10706
|
}
|
|
9850
10707
|
tag$8.textContent = css$8;
|
|
9851
10708
|
var TranslateBanner_module_css_default = {
|
|
9852
|
-
"
|
|
10709
|
+
"error": "rp_Lx8vJa_error",
|
|
9853
10710
|
"banner": "rp_Lx8vJa_banner",
|
|
9854
|
-
"
|
|
10711
|
+
"text": "rp_Lx8vJa_text"
|
|
9855
10712
|
};
|
|
9856
10713
|
//#endregion
|
|
9857
10714
|
//#region src/client/pages/worlds/TranslateBanner.tsx
|
|
@@ -10324,24 +11181,24 @@ window.__ModuleLoader__.load({
|
|
|
10324
11181
|
}
|
|
10325
11182
|
tag$7.textContent = css$7;
|
|
10326
11183
|
var WorldsPage_module_css_default = {
|
|
10327
|
-
"
|
|
11184
|
+
"scrolls": "rp_FHUyRq_scrolls",
|
|
11185
|
+
"toolbarActions": "rp_FHUyRq_toolbarActions",
|
|
11186
|
+
"count": "rp_FHUyRq_count",
|
|
11187
|
+
"spin": "rp_FHUyRq_spin",
|
|
11188
|
+
"fits": "rp_FHUyRq_fits",
|
|
10328
11189
|
"authorButton": "rp_FHUyRq_authorButton",
|
|
11190
|
+
"toolbar": "rp_FHUyRq_toolbar",
|
|
10329
11191
|
"editHeader": "rp_FHUyRq_editHeader",
|
|
10330
|
-
"
|
|
10331
|
-
"count": "rp_FHUyRq_count",
|
|
10332
|
-
"editTitle": "rp_FHUyRq_editTitle",
|
|
10333
|
-
"editBody": "rp_FHUyRq_editBody",
|
|
10334
|
-
"scrolls": "rp_FHUyRq_scrolls",
|
|
10335
|
-
"grid": "rp_FHUyRq_grid",
|
|
10336
|
-
"starter": "rp_FHUyRq_starter",
|
|
10337
|
-
"page": "rp_FHUyRq_page",
|
|
11192
|
+
"message": "rp_FHUyRq_message",
|
|
10338
11193
|
"cell": "rp_FHUyRq_cell",
|
|
10339
11194
|
"starters": "rp_FHUyRq_starters",
|
|
10340
|
-
"
|
|
10341
|
-
"
|
|
11195
|
+
"editTitle": "rp_FHUyRq_editTitle",
|
|
11196
|
+
"spinning": "rp_FHUyRq_spinning",
|
|
11197
|
+
"page": "rp_FHUyRq_page",
|
|
10342
11198
|
"notice": "rp_FHUyRq_notice",
|
|
10343
|
-
"
|
|
10344
|
-
"
|
|
11199
|
+
"grid": "rp_FHUyRq_grid",
|
|
11200
|
+
"editBody": "rp_FHUyRq_editBody",
|
|
11201
|
+
"starter": "rp_FHUyRq_starter",
|
|
10345
11202
|
"viewport": "rp_FHUyRq_viewport"
|
|
10346
11203
|
};
|
|
10347
11204
|
//#endregion
|
|
@@ -10412,34 +11269,34 @@ window.__ModuleLoader__.load({
|
|
|
10412
11269
|
}
|
|
10413
11270
|
tag$6.textContent = css$6;
|
|
10414
11271
|
var ImportCardPage_module_css_default = {
|
|
10415
|
-
"
|
|
10416
|
-
"
|
|
11272
|
+
"picture": "rp_DmG_oG_picture",
|
|
11273
|
+
"fieldHead": "rp_DmG_oG_fieldHead",
|
|
10417
11274
|
"entryHead": "rp_DmG_oG_entryHead",
|
|
10418
|
-
"
|
|
11275
|
+
"text": "rp_DmG_oG_text",
|
|
10419
11276
|
"page": "rp_DmG_oG_page",
|
|
10420
|
-
"body": "rp_DmG_oG_body",
|
|
10421
|
-
"fieldTitle": "rp_DmG_oG_fieldTitle",
|
|
10422
|
-
"top": "rp_DmG_oG_top",
|
|
10423
|
-
"fieldHead": "rp_DmG_oG_fieldHead",
|
|
10424
|
-
"choice": "rp_DmG_oG_choice",
|
|
10425
|
-
"picture": "rp_DmG_oG_picture",
|
|
10426
|
-
"choiceText": "rp_DmG_oG_choiceText",
|
|
10427
|
-
"preview": "rp_DmG_oG_preview",
|
|
10428
11277
|
"space": "rp_DmG_oG_space",
|
|
10429
|
-
"
|
|
10430
|
-
"
|
|
10431
|
-
"field": "rp_DmG_oG_field",
|
|
10432
|
-
"noPicture": "rp_DmG_oG_noPicture",
|
|
11278
|
+
"entry": "rp_DmG_oG_entry",
|
|
11279
|
+
"fieldTitle": "rp_DmG_oG_fieldTitle",
|
|
10433
11280
|
"entryTitle": "rp_DmG_oG_entryTitle",
|
|
10434
11281
|
"fieldMeta": "rp_DmG_oG_fieldMeta",
|
|
10435
|
-
"text": "rp_DmG_oG_text",
|
|
10436
|
-
"section": "rp_DmG_oG_section",
|
|
10437
11282
|
"tags": "rp_DmG_oG_tags",
|
|
11283
|
+
"note": "rp_DmG_oG_note",
|
|
11284
|
+
"noPicture": "rp_DmG_oG_noPicture",
|
|
11285
|
+
"entryOff": "rp_DmG_oG_entryOff",
|
|
11286
|
+
"error": "rp_DmG_oG_error",
|
|
11287
|
+
"preview": "rp_DmG_oG_preview",
|
|
11288
|
+
"choice": "rp_DmG_oG_choice",
|
|
11289
|
+
"choiceText": "rp_DmG_oG_choiceText",
|
|
11290
|
+
"body": "rp_DmG_oG_body",
|
|
11291
|
+
"top": "rp_DmG_oG_top",
|
|
10438
11292
|
"header": "rp_DmG_oG_header",
|
|
10439
|
-
"label": "rp_DmG_oG_label",
|
|
10440
|
-
"heading": "rp_DmG_oG_heading",
|
|
10441
11293
|
"title": "rp_DmG_oG_title",
|
|
10442
|
-
"
|
|
11294
|
+
"section": "rp_DmG_oG_section",
|
|
11295
|
+
"about": "rp_DmG_oG_about",
|
|
11296
|
+
"heading": "rp_DmG_oG_heading",
|
|
11297
|
+
"label": "rp_DmG_oG_label",
|
|
11298
|
+
"row": "rp_DmG_oG_row",
|
|
11299
|
+
"field": "rp_DmG_oG_field"
|
|
10443
11300
|
};
|
|
10444
11301
|
//#endregion
|
|
10445
11302
|
//#region src/client/pages/worlds/ImportCardPage.tsx
|
|
@@ -11169,6 +12026,10 @@ window.__ModuleLoader__.load({
|
|
|
11169
12026
|
modelsSuggestionsHelp: "As provider/model. Leave empty to use the chat's own model.",
|
|
11170
12027
|
modelsAuthoring: "Model for the world and plot author",
|
|
11171
12028
|
modelsAuthoringHelp: "As provider/model. Leave empty to use the chat's own model. Made-up characters, places and things are only as good as this model.",
|
|
12029
|
+
diceVisibility: "Dice",
|
|
12030
|
+
diceVisibilityHelp: "What the player sees of the dice the game master rolls: a collapsed card under the narration to open when you want to check, or nothing, to stay in the story. The dice are rolled either way.",
|
|
12031
|
+
diceHidden: "Hidden",
|
|
12032
|
+
diceCard: "Collapsed card",
|
|
11172
12033
|
imagesOff: "Off",
|
|
11173
12034
|
imagesManual: "Manual",
|
|
11174
12035
|
imagesEveryTurn: "Every turn",
|
|
@@ -11318,6 +12179,10 @@ window.__ModuleLoader__.load({
|
|
|
11318
12179
|
modelsSuggestionsHelp: "写成 提供方/模型。留空则使用对话自己的模型。",
|
|
11319
12180
|
modelsAuthoring: "世界与剧情作者使用的模型",
|
|
11320
12181
|
modelsAuthoringHelp: "写成 提供方/模型。留空则使用对话自己的模型。新编造的角色、地点和物品的质量取决于这个模型。",
|
|
12182
|
+
diceVisibility: "骰子",
|
|
12183
|
+
diceVisibilityHelp: "玩家能看到主持人掷出的骰子的什么:叙述下方一张折叠的卡片,想核对时可以展开;或什么都不显示,保持沉浸在故事里。无论哪种,骰子都会照常掷出。",
|
|
12184
|
+
diceHidden: "隐藏",
|
|
12185
|
+
diceCard: "折叠卡片",
|
|
11321
12186
|
imagesOff: "关闭",
|
|
11322
12187
|
imagesManual: "手动",
|
|
11323
12188
|
imagesEveryTurn: "每轮",
|
|
@@ -11930,10 +12795,10 @@ window.__ModuleLoader__.load({
|
|
|
11930
12795
|
}
|
|
11931
12796
|
tag$5.textContent = css$5;
|
|
11932
12797
|
var BranchDialog_module_css_default = {
|
|
11933
|
-
"form": "rp_Dy1TaW_form",
|
|
11934
|
-
"field": "rp_Dy1TaW_field",
|
|
11935
12798
|
"error": "rp_Dy1TaW_error",
|
|
11936
|
-
"label": "rp_Dy1TaW_label"
|
|
12799
|
+
"label": "rp_Dy1TaW_label",
|
|
12800
|
+
"form": "rp_Dy1TaW_form",
|
|
12801
|
+
"field": "rp_Dy1TaW_field"
|
|
11937
12802
|
};
|
|
11938
12803
|
//#endregion
|
|
11939
12804
|
//#region src/client/branch/BranchDialog.tsx
|
|
@@ -12076,7 +12941,7 @@ window.__ModuleLoader__.load({
|
|
|
12076
12941
|
/** Adds the Gallery tab beside Chat and World: every image of the session in a grid. */
|
|
12077
12942
|
function registerGallery(ctx) {
|
|
12078
12943
|
const t = ctx.locale.bind(NAMESPACE$5);
|
|
12079
|
-
ctx.effect(() => ctx.locale.register(NAMESPACE$5, dictionaries$
|
|
12944
|
+
ctx.effect(() => ctx.locale.register(NAMESPACE$5, dictionaries$13), "roleplay: gallery dictionaries");
|
|
12080
12945
|
ctx.inject(["uiConversation"], (scope) => {
|
|
12081
12946
|
scope.uiConversation.views.register(galleryTarget);
|
|
12082
12947
|
scope.slots.inject("conversation.view", () => scope.slots.register({
|
|
@@ -12402,17 +13267,17 @@ window.__ModuleLoader__.load({
|
|
|
12402
13267
|
}
|
|
12403
13268
|
tag$4.textContent = css$4;
|
|
12404
13269
|
var SidebarPage_module_css_default = {
|
|
12405
|
-
"
|
|
12406
|
-
"message": "rp_Ptco8a_message",
|
|
12407
|
-
"entry": "rp_Ptco8a_entry",
|
|
13270
|
+
"text": "rp_Ptco8a_text",
|
|
12408
13271
|
"name": "rp_Ptco8a_name",
|
|
12409
13272
|
"icon": "rp_Ptco8a_icon",
|
|
12410
13273
|
"page": "rp_Ptco8a_page",
|
|
12411
|
-
"
|
|
12412
|
-
"text": "rp_Ptco8a_text",
|
|
13274
|
+
"main": "rp_Ptco8a_main",
|
|
12413
13275
|
"content": "rp_Ptco8a_content",
|
|
13276
|
+
"title": "rp_Ptco8a_title",
|
|
13277
|
+
"bar": "rp_Ptco8a_bar",
|
|
12414
13278
|
"description": "rp_Ptco8a_description",
|
|
12415
|
-
"
|
|
13279
|
+
"entry": "rp_Ptco8a_entry",
|
|
13280
|
+
"message": "rp_Ptco8a_message"
|
|
12416
13281
|
};
|
|
12417
13282
|
//#endregion
|
|
12418
13283
|
//#region src/client/interface/SidebarPage.tsx
|
|
@@ -12738,26 +13603,26 @@ window.__ModuleLoader__.load({
|
|
|
12738
13603
|
}
|
|
12739
13604
|
tag$3.textContent = css$3;
|
|
12740
13605
|
var ChatSettingsView_module_css_default = {
|
|
12741
|
-
"
|
|
13606
|
+
"pre": "rp_wLpbxW_pre",
|
|
13607
|
+
"title": "rp_wLpbxW_title",
|
|
13608
|
+
"field": "rp_wLpbxW_field",
|
|
13609
|
+
"link": "rp_wLpbxW_link",
|
|
12742
13610
|
"message": "rp_wLpbxW_message",
|
|
12743
|
-
"actions": "rp_wLpbxW_actions",
|
|
12744
|
-
"saved": "rp_wLpbxW_saved",
|
|
12745
|
-
"activity": "rp_wLpbxW_activity",
|
|
12746
13611
|
"table": "rp_wLpbxW_table",
|
|
12747
|
-
"label": "rp_wLpbxW_label",
|
|
12748
|
-
"description": "rp_wLpbxW_description",
|
|
12749
|
-
"error": "rp_wLpbxW_error",
|
|
12750
13612
|
"run": "rp_wLpbxW_run",
|
|
12751
|
-
"field": "rp_wLpbxW_field",
|
|
12752
13613
|
"list": "rp_wLpbxW_list",
|
|
12753
13614
|
"notice": "rp_wLpbxW_notice",
|
|
12754
|
-
"
|
|
12755
|
-
"
|
|
12756
|
-
"title": "rp_wLpbxW_title",
|
|
12757
|
-
"pre": "rp_wLpbxW_pre",
|
|
12758
|
-
"link": "rp_wLpbxW_link",
|
|
13615
|
+
"label": "rp_wLpbxW_label",
|
|
13616
|
+
"error": "rp_wLpbxW_error",
|
|
12759
13617
|
"help": "rp_wLpbxW_help",
|
|
12760
|
-
"
|
|
13618
|
+
"actions": "rp_wLpbxW_actions",
|
|
13619
|
+
"saved": "rp_wLpbxW_saved",
|
|
13620
|
+
"view": "rp_wLpbxW_view",
|
|
13621
|
+
"row": "rp_wLpbxW_row",
|
|
13622
|
+
"activity": "rp_wLpbxW_activity",
|
|
13623
|
+
"reasons": "rp_wLpbxW_reasons",
|
|
13624
|
+
"select": "rp_wLpbxW_select",
|
|
13625
|
+
"description": "rp_wLpbxW_description"
|
|
12761
13626
|
};
|
|
12762
13627
|
//#endregion
|
|
12763
13628
|
//#region src/client/chat-settings/settings-api.ts
|
|
@@ -13317,7 +14182,16 @@ window.__ModuleLoader__.load({
|
|
|
13317
14182
|
const [saving, setSaving] = (0, react.useState)(false);
|
|
13318
14183
|
const [saved, setSaved] = (0, react.useState)(false);
|
|
13319
14184
|
const [error, setError] = (0, react.useState)();
|
|
14185
|
+
const [toolsError, setToolsError] = (0, react.useState)();
|
|
14186
|
+
const [external, setExternal] = (0, react.useState)([]);
|
|
13320
14187
|
const options = useEmbeddingOptions("all");
|
|
14188
|
+
(0, react.useEffect)(() => {
|
|
14189
|
+
const abort = new AbortController();
|
|
14190
|
+
loadExternalTools(abort.signal).then(setExternal, () => void 0);
|
|
14191
|
+
return () => {
|
|
14192
|
+
abort.abort();
|
|
14193
|
+
};
|
|
14194
|
+
}, []);
|
|
13321
14195
|
(0, react.useEffect)(() => {
|
|
13322
14196
|
if (session === void 0) return void 0;
|
|
13323
14197
|
const abort = new AbortController();
|
|
@@ -13393,6 +14267,24 @@ window.__ModuleLoader__.load({
|
|
|
13393
14267
|
setError(failure instanceof Error ? failure.message : String(failure));
|
|
13394
14268
|
});
|
|
13395
14269
|
};
|
|
14270
|
+
const setTools = (tools) => {
|
|
14271
|
+
if (session === void 0) return;
|
|
14272
|
+
setSaving(true);
|
|
14273
|
+
setToolsError(void 0);
|
|
14274
|
+
saveSettings(session, {
|
|
14275
|
+
...payload.settings,
|
|
14276
|
+
tools
|
|
14277
|
+
}, new AbortController().signal).then((next) => {
|
|
14278
|
+
setLoad({
|
|
14279
|
+
status: "ready",
|
|
14280
|
+
payload: next
|
|
14281
|
+
});
|
|
14282
|
+
}, (failure) => {
|
|
14283
|
+
setToolsError(failure instanceof Error ? failure.message : String(failure));
|
|
14284
|
+
}).finally(() => {
|
|
14285
|
+
setSaving(false);
|
|
14286
|
+
});
|
|
14287
|
+
};
|
|
13396
14288
|
const save = () => {
|
|
13397
14289
|
if (session === void 0 || !changed) return;
|
|
13398
14290
|
setSaving(true);
|
|
@@ -13463,6 +14355,14 @@ window.__ModuleLoader__.load({
|
|
|
13463
14355
|
saved: payload.settings.interface.pack,
|
|
13464
14356
|
disabled: saving
|
|
13465
14357
|
}),
|
|
14358
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ToolSwitches, {
|
|
14359
|
+
board: payload.settings.tools,
|
|
14360
|
+
onChange: setTools,
|
|
14361
|
+
disabled: saving,
|
|
14362
|
+
external,
|
|
14363
|
+
...toolsError === void 0 ? {} : { error: toolsError },
|
|
14364
|
+
t
|
|
14365
|
+
}),
|
|
13466
14366
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ReflectionSection, {
|
|
13467
14367
|
t,
|
|
13468
14368
|
status: payload.reflection,
|
|
@@ -13507,7 +14407,7 @@ window.__ModuleLoader__.load({
|
|
|
13507
14407
|
]
|
|
13508
14408
|
});
|
|
13509
14409
|
}
|
|
13510
|
-
const dictionaries$2 = withDictionaries({
|
|
14410
|
+
const dictionaries$2 = withDictionaries(withDictionaries({
|
|
13511
14411
|
en: {
|
|
13512
14412
|
tab: "Chat settings",
|
|
13513
14413
|
title: "Chat settings",
|
|
@@ -13712,7 +14612,7 @@ window.__ModuleLoader__.load({
|
|
|
13712
14612
|
saved: "已保存。",
|
|
13713
14613
|
saveFailed: "无法保存设置:{message}"
|
|
13714
14614
|
}
|
|
13715
|
-
}, dictionaries$6);
|
|
14615
|
+
}, dictionaries$6), dictionaries$14);
|
|
13716
14616
|
//#endregion
|
|
13717
14617
|
//#region src/client/chat-settings/index.ts
|
|
13718
14618
|
const NAMESPACE$2 = "roleplay.chatSettings";
|
|
@@ -13898,10 +14798,12 @@ window.__ModuleLoader__.load({
|
|
|
13898
14798
|
const ooc = value["ooc"];
|
|
13899
14799
|
const ruled = typeof ooc === "object" && ooc !== null && typeof ooc["legal"] === "boolean" && typeof ooc["note"] === "string" ? ooc : void 0;
|
|
13900
14800
|
const timelineNode = typeof value["timelineNode"] === "string" ? value["timelineNode"] : void 0;
|
|
14801
|
+
const rolls = Array.isArray(value["rolls"]) ? value["rolls"].filter((entry) => typeof entry === "object" && entry !== null && typeof entry.id === "number" && typeof entry.text === "string" && (entry.by === "agent" || entry.by === "player")) : [];
|
|
13901
14802
|
return {
|
|
13902
14803
|
segments,
|
|
13903
14804
|
repaired: value["repaired"],
|
|
13904
14805
|
...ruled === void 0 ? {} : { ooc: ruled },
|
|
14806
|
+
...rolls.length === 0 ? {} : { rolls },
|
|
13905
14807
|
...timelineNode === void 0 ? {} : { timelineNode }
|
|
13906
14808
|
};
|
|
13907
14809
|
} catch {
|
|
@@ -14017,7 +14919,7 @@ window.__ModuleLoader__.load({
|
|
|
14017
14919
|
};
|
|
14018
14920
|
//#endregion
|
|
14019
14921
|
//#region \0css-module:/home/runner/work/dsh-agentic-roleplay/dsh-agentic-roleplay/packages/dsh-agentic-roleplay-core/src/client/transcript/NarrationView.module.css.mjs
|
|
14020
|
-
const css$2 = ".rp_NFPimG_output{flex-direction:column;gap:8px;min-width:0;margin:8px 0;display:flex}.rp_NFPimG_narration{color:var(--dsw-alias-label-primary);white-space:pre-wrap;overflow-wrap:anywhere;margin:0;font-size:13px;line-height:22px}.rp_NFPimG_line{align-items:flex-start;gap:10px;min-width:0;display:flex}.rp_NFPimG_avatar{corner-shape:round;color:#fff;border-radius:14px;flex:none;justify-content:center;align-items:center;width:28px;height:28px;font-size:12px;font-weight:500;display:flex}.rp_NFPimG_speech{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-layer-1);flex-direction:column;gap:2px;min-width:0;max-width:100%;padding:6px 10px;display:flex}.rp_NFPimG_name{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:500;line-height:18px}.rp_NFPimG_words{color:var(--dsw-alias-label-primary);white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:20px}.rp_NFPimG_note{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_NFPimG_preview{opacity:.8}.rp_NFPimG_oocNote,.rp_NFPimG_oocRefused{border-left:2px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);margin:0;padding:6px 10px;font-size:12px;line-height:18px}.rp_NFPimG_oocRefused{border-left-color:var(--dsw-alias-state-error-primary)}.rp_NFPimG_oocLabel{font-weight:500}.rp_NFPimG_images{flex-direction:column;align-items:flex-start;gap:6px;margin:8px 0 12px;display:flex}.rp_NFPimG_sceneImage{object-fit:contain;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);width:auto;max-width:min(100%,480px);height:auto;max-height:50vh;display:block}.rp_NFPimG_imageButton{cursor:zoom-in;background:0 0;border:0;padding:0}.rp_NFPimG_imageStatus,.rp_NFPimG_imageError{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_NFPimG_imageError{color:var(--dsw-alias-state-error-primary)}.rp_NFPimG_playAll,.rp_NFPimG_playLine{color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;justify-content:center;align-items:center}.rp_NFPimG_playAll{float:right;gap:4px;min-height:28px;margin:0 0 8px 12px;padding:2px 4px;font-size:12px;display:inline-flex}.rp_NFPimG_playLine{vertical-align:middle;width:28px;height:28px;margin:-5px -6px -5px 4px;padding:6px;display:inline-flex}.rp_NFPimG_playAll svg,.rp_NFPimG_playLine svg{width:14px;height:14px}.rp_NFPimG_playAll:disabled,.rp_NFPimG_playLine:disabled{cursor:wait;opacity:.5}.rp_NFPimG_playAll:hover,.rp_NFPimG_playLine:hover{color:var(--dsw-alias-label-primary)}.rp_NFPimG_playAll:focus-visible,.rp_NFPimG_playLine:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px;border-radius:var(--dsw-radius-xs)}@media (pointer:coarse){.rp_NFPimG_playAll,.rp_NFPimG_playLine{min-width:44px;min-height:44px}.rp_NFPimG_playLine{width:44px;height:44px;margin-block:-13px}}";
|
|
14922
|
+
const css$2 = ".rp_NFPimG_output{flex-direction:column;gap:8px;min-width:0;margin:8px 0;display:flex}.rp_NFPimG_narration{color:var(--dsw-alias-label-primary);white-space:pre-wrap;overflow-wrap:anywhere;margin:0;font-size:13px;line-height:22px}.rp_NFPimG_line{align-items:flex-start;gap:10px;min-width:0;display:flex}.rp_NFPimG_avatar{corner-shape:round;color:#fff;border-radius:14px;flex:none;justify-content:center;align-items:center;width:28px;height:28px;font-size:12px;font-weight:500;display:flex}.rp_NFPimG_speech{border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);background:var(--dsw-alias-bg-layer-1);flex-direction:column;gap:2px;min-width:0;max-width:100%;padding:6px 10px;display:flex}.rp_NFPimG_name{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:500;line-height:18px}.rp_NFPimG_words{color:var(--dsw-alias-label-primary);white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;line-height:20px}.rp_NFPimG_note{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_NFPimG_preview{opacity:.8}.rp_NFPimG_oocNote,.rp_NFPimG_oocRefused{border-left:2px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);margin:0;padding:6px 10px;font-size:12px;line-height:18px}.rp_NFPimG_oocRefused{border-left-color:var(--dsw-alias-state-error-primary)}.rp_NFPimG_oocLabel{font-weight:500}.rp_NFPimG_images{flex-direction:column;align-items:flex-start;gap:6px;margin:8px 0 12px;display:flex}.rp_NFPimG_sceneImage{object-fit:contain;border:.5px solid var(--dsw-alias-border-l3);border-radius:var(--dsw-radius-lg);width:auto;max-width:min(100%,480px);height:auto;max-height:50vh;display:block}.rp_NFPimG_imageButton{cursor:zoom-in;background:0 0;border:0;padding:0}.rp_NFPimG_imageStatus,.rp_NFPimG_imageError{color:var(--dsw-alias-label-tertiary);font-size:12px}.rp_NFPimG_imageError{color:var(--dsw-alias-state-error-primary)}.rp_NFPimG_playAll,.rp_NFPimG_playLine{color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;justify-content:center;align-items:center}.rp_NFPimG_playAll{float:right;gap:4px;min-height:28px;margin:0 0 8px 12px;padding:2px 4px;font-size:12px;display:inline-flex}.rp_NFPimG_playLine{vertical-align:middle;width:28px;height:28px;margin:-5px -6px -5px 4px;padding:6px;display:inline-flex}.rp_NFPimG_playAll svg,.rp_NFPimG_playLine svg{width:14px;height:14px}.rp_NFPimG_playAll:disabled,.rp_NFPimG_playLine:disabled{cursor:wait;opacity:.5}.rp_NFPimG_playAll:hover,.rp_NFPimG_playLine:hover{color:var(--dsw-alias-label-primary)}.rp_NFPimG_playAll:focus-visible,.rp_NFPimG_playLine:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color);outline-offset:2px;border-radius:var(--dsw-radius-xs)}@media (pointer:coarse){.rp_NFPimG_playAll,.rp_NFPimG_playLine{min-width:44px;min-height:44px}.rp_NFPimG_playLine{width:44px;height:44px;margin-block:-13px}}.rp_NFPimG_dice{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}.rp_NFPimG_diceSummary{cursor:pointer;color:var(--dsw-alias-label-secondary)}.rp_NFPimG_diceList{margin:4px 0 0;padding:0 0 0 18px}";
|
|
14021
14923
|
const key$2 = "src/client/transcript/NarrationView.module.css";
|
|
14022
14924
|
let tag$2 = document.querySelector("style[data-plugin-css=" + JSON.stringify(key$2) + "]");
|
|
14023
14925
|
if (tag$2 === null) {
|
|
@@ -14028,25 +14930,28 @@ window.__ModuleLoader__.load({
|
|
|
14028
14930
|
}
|
|
14029
14931
|
tag$2.textContent = css$2;
|
|
14030
14932
|
var NarrationView_module_css_default = {
|
|
14031
|
-
"
|
|
14032
|
-
"
|
|
14033
|
-
"
|
|
14933
|
+
"sceneImage": "rp_NFPimG_sceneImage",
|
|
14934
|
+
"output": "rp_NFPimG_output",
|
|
14935
|
+
"speech": "rp_NFPimG_speech",
|
|
14936
|
+
"imageButton": "rp_NFPimG_imageButton",
|
|
14937
|
+
"diceList": "rp_NFPimG_diceList",
|
|
14938
|
+
"diceSummary": "rp_NFPimG_diceSummary",
|
|
14939
|
+
"dice": "rp_NFPimG_dice",
|
|
14034
14940
|
"oocRefused": "rp_NFPimG_oocRefused",
|
|
14941
|
+
"note": "rp_NFPimG_note",
|
|
14942
|
+
"preview": "rp_NFPimG_preview",
|
|
14943
|
+
"narration": "rp_NFPimG_narration",
|
|
14944
|
+
"name": "rp_NFPimG_name",
|
|
14945
|
+
"imageStatus": "rp_NFPimG_imageStatus",
|
|
14946
|
+
"imageError": "rp_NFPimG_imageError",
|
|
14947
|
+
"playAll": "rp_NFPimG_playAll",
|
|
14948
|
+
"playLine": "rp_NFPimG_playLine",
|
|
14949
|
+
"words": "rp_NFPimG_words",
|
|
14035
14950
|
"line": "rp_NFPimG_line",
|
|
14036
14951
|
"oocNote": "rp_NFPimG_oocNote",
|
|
14037
14952
|
"images": "rp_NFPimG_images",
|
|
14038
|
-
"sceneImage": "rp_NFPimG_sceneImage",
|
|
14039
|
-
"imageButton": "rp_NFPimG_imageButton",
|
|
14040
|
-
"playLine": "rp_NFPimG_playLine",
|
|
14041
|
-
"playAll": "rp_NFPimG_playAll",
|
|
14042
|
-
"speech": "rp_NFPimG_speech",
|
|
14043
|
-
"preview": "rp_NFPimG_preview",
|
|
14044
14953
|
"avatar": "rp_NFPimG_avatar",
|
|
14045
|
-
"
|
|
14046
|
-
"words": "rp_NFPimG_words",
|
|
14047
|
-
"oocLabel": "rp_NFPimG_oocLabel",
|
|
14048
|
-
"imageStatus": "rp_NFPimG_imageStatus",
|
|
14049
|
-
"imageError": "rp_NFPimG_imageError"
|
|
14954
|
+
"oocLabel": "rp_NFPimG_oocLabel"
|
|
14050
14955
|
};
|
|
14051
14956
|
//#endregion
|
|
14052
14957
|
//#region src/client/transcript/PreviewNode.tsx
|
|
@@ -14177,6 +15082,21 @@ window.__ModuleLoader__.load({
|
|
|
14177
15082
|
})]
|
|
14178
15083
|
})]
|
|
14179
15084
|
}, index)),
|
|
15085
|
+
data.rolls !== void 0 && data.rolls.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("details", {
|
|
15086
|
+
className: NarrationView_module_css_default.dice,
|
|
15087
|
+
"data-testid": "roleplay-dice",
|
|
15088
|
+
"data-rp": "dice",
|
|
15089
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("summary", {
|
|
15090
|
+
className: NarrationView_module_css_default.diceSummary,
|
|
15091
|
+
children: t("diceRolled", { count: String(data.rolls.length) })
|
|
15092
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
15093
|
+
className: NarrationView_module_css_default.diceList,
|
|
15094
|
+
children: data.rolls.map((roll) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
15095
|
+
"data-rp": "roll",
|
|
15096
|
+
children: [roll.by === "player" ? `${t("dicePlayer")} ` : "", roll.text]
|
|
15097
|
+
}, roll.id))
|
|
15098
|
+
})]
|
|
15099
|
+
}),
|
|
14180
15100
|
data.repaired && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
14181
15101
|
className: NarrationView_module_css_default.note,
|
|
14182
15102
|
children: t("repaired")
|
|
@@ -14297,10 +15217,10 @@ window.__ModuleLoader__.load({
|
|
|
14297
15217
|
tag$1.textContent = css$1;
|
|
14298
15218
|
var SuggestionsDock_module_css_default = {
|
|
14299
15219
|
"label": "rp_rWH4DG_label",
|
|
14300
|
-
"card": "rp_rWH4DG_card",
|
|
14301
|
-
"lines": "rp_rWH4DG_lines",
|
|
14302
15220
|
"dock": "rp_rWH4DG_dock",
|
|
14303
|
-
"chip": "rp_rWH4DG_chip"
|
|
15221
|
+
"chip": "rp_rWH4DG_chip",
|
|
15222
|
+
"card": "rp_rWH4DG_card",
|
|
15223
|
+
"lines": "rp_rWH4DG_lines"
|
|
14304
15224
|
};
|
|
14305
15225
|
//#endregion
|
|
14306
15226
|
//#region src/client/transcript/SuggestionsDock.tsx
|
|
@@ -14411,12 +15331,12 @@ window.__ModuleLoader__.load({
|
|
|
14411
15331
|
}
|
|
14412
15332
|
tag.textContent = css;
|
|
14413
15333
|
var TurnsDock_module_css_default = {
|
|
15334
|
+
"button": "rp_f4YLlq_button",
|
|
15335
|
+
"count": "rp_f4YLlq_count",
|
|
14414
15336
|
"select": "rp_f4YLlq_select",
|
|
14415
15337
|
"error": "rp_f4YLlq_error",
|
|
14416
|
-
"dock": "rp_f4YLlq_dock",
|
|
14417
|
-
"button": "rp_f4YLlq_button",
|
|
14418
15338
|
"group": "rp_f4YLlq_group",
|
|
14419
|
-
"
|
|
15339
|
+
"dock": "rp_f4YLlq_dock"
|
|
14420
15340
|
};
|
|
14421
15341
|
//#endregion
|
|
14422
15342
|
//#region src/client/transcript/withdrawn.ts
|
|
@@ -14639,7 +15559,9 @@ window.__ModuleLoader__.load({
|
|
|
14639
15559
|
imageDialog: "Illustration",
|
|
14640
15560
|
imageClose: "Close",
|
|
14641
15561
|
imageReusable: "Reusable",
|
|
14642
|
-
imageUploaded: "Uploaded"
|
|
15562
|
+
imageUploaded: "Uploaded",
|
|
15563
|
+
diceRolled: "Dice rolled: {count}",
|
|
15564
|
+
dicePlayer: "You rolled:"
|
|
14643
15565
|
},
|
|
14644
15566
|
zh: {
|
|
14645
15567
|
speakAll: "播放整段",
|
|
@@ -14676,7 +15598,9 @@ window.__ModuleLoader__.load({
|
|
|
14676
15598
|
imageDialog: "插图",
|
|
14677
15599
|
imageClose: "关闭",
|
|
14678
15600
|
imageReusable: "可复用",
|
|
14679
|
-
imageUploaded: "已上传"
|
|
15601
|
+
imageUploaded: "已上传",
|
|
15602
|
+
diceRolled: "掷骰:{count}",
|
|
15603
|
+
dicePlayer: "你掷出:"
|
|
14680
15604
|
}
|
|
14681
15605
|
};
|
|
14682
15606
|
//#endregion
|