Add chance simulator toolbox and refine checklist interactions
All checks were successful
Deploy Sokko G / deploy (push) Successful in 17s
All checks were successful
Deploy Sokko G / deploy (push) Successful in 17s
This commit is contained in:
parent
35fe877d58
commit
6b85e58765
25 changed files with 1518 additions and 18 deletions
|
|
@ -16,6 +16,7 @@ export { hostnameFromUrl, normalizeLinksData, normalizeUrl } from "./modules/lin
|
|||
export { normalizeMemosData } from "./modules/memos.js";
|
||||
export { normalizeNotepadData, sanitizeNotepadHtml } from "./modules/notepad.js";
|
||||
export { normalizeRandomizerData } from "./modules/randomizer.js";
|
||||
export { normalizeRngSimulatorData } from "./modules/rngSimulator.js";
|
||||
export { uid } from "./modules/shared.js";
|
||||
export { normalizeTableData } from "./modules/table.js";
|
||||
export { normalizeTaskPlannerData } from "./modules/taskPlanner.js";
|
||||
|
|
@ -238,6 +239,16 @@ function remapModuleDataForExport(type, data, nextId) {
|
|||
return remapped;
|
||||
}
|
||||
|
||||
if (type === "rngSimulator") {
|
||||
const remapped = { ...compact };
|
||||
if (compact.rates) remapped.rates = compact.rates.map((rate) => ({ ...rate, id: nextId("rng") }));
|
||||
if (compact.activeRateId && compact.rates) {
|
||||
const activeIndex = compact.rates.findIndex((rate) => rate.id === compact.activeRateId);
|
||||
remapped.activeRateId = activeIndex >= 0 ? remapped.rates[activeIndex].id : "";
|
||||
}
|
||||
return remapped;
|
||||
}
|
||||
|
||||
if (type === "memos") {
|
||||
const remapped = {};
|
||||
if (compact.tickerEnabled === false) remapped.tickerEnabled = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue