intelligent-system-design-language 0.3.13
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/.claude/agents/langium-language-designer.md +38 -0
- package/.claude/agents/typescript-vscode-expert.md +29 -0
- package/.claude/agents/ui-ux-designer.md +36 -0
- package/.claude/settings.local.json +33 -0
- package/.idea/inspectionProfiles/Project_Default.xml +7 -0
- package/.idea/isdl.iml +14 -0
- package/.idea/modules.xml +9 -0
- package/.idea/vcs.xml +7 -0
- package/.idea/watcherTasks.xml +4 -0
- package/.vscodeignore +18 -0
- package/LICENSE +674 -0
- package/README.md +86 -0
- package/bin/cli.js +4 -0
- package/bin/lsp.js +8 -0
- package/isdl.png +0 -0
- package/out/_backgrounds.scss +91 -0
- package/out/_handlebars.scss +505 -0
- package/out/_isdlStyles.scss +1357 -0
- package/out/_vuetifyOverrides.scss +425 -0
- package/out/_vuetifyStyles.scss +31957 -0
- package/out/cli/cli-util.js +39 -0
- package/out/cli/cli-util.js.map +1 -0
- package/out/cli/components/_backgrounds.scss +91 -0
- package/out/cli/components/_handlebars.scss +505 -0
- package/out/cli/components/_isdlStyles.scss +1357 -0
- package/out/cli/components/_vuetifyOverrides.scss +425 -0
- package/out/cli/components/_vuetifyStyles.scss +31957 -0
- package/out/cli/components/active-effect-sheet-generator.js +643 -0
- package/out/cli/components/active-effect-sheet-generator.js.map +1 -0
- package/out/cli/components/base-actor-sheet-generator.js +125 -0
- package/out/cli/components/base-actor-sheet-generator.js.map +1 -0
- package/out/cli/components/base-sheet-generator.js +525 -0
- package/out/cli/components/base-sheet-generator.js.map +1 -0
- package/out/cli/components/chat-card-generator.js +683 -0
- package/out/cli/components/chat-card-generator.js.map +1 -0
- package/out/cli/components/css-generator.js +58 -0
- package/out/cli/components/css-generator.js.map +1 -0
- package/out/cli/components/damage-roll-generator.js +173 -0
- package/out/cli/components/damage-roll-generator.js.map +1 -0
- package/out/cli/components/datamodel-generator.js +672 -0
- package/out/cli/components/datamodel-generator.js.map +1 -0
- package/out/cli/components/derived-data-generator.js +1340 -0
- package/out/cli/components/derived-data-generator.js.map +1 -0
- package/out/cli/components/hotbar-drop-hook-generator.js +95 -0
- package/out/cli/components/hotbar-drop-hook-generator.js.map +1 -0
- package/out/cli/components/init-hook-generator.js +597 -0
- package/out/cli/components/init-hook-generator.js.map +1 -0
- package/out/cli/components/keywords-generator.js +220 -0
- package/out/cli/components/keywords-generator.js.map +1 -0
- package/out/cli/components/language-generator.js +110 -0
- package/out/cli/components/language-generator.js.map +1 -0
- package/out/cli/components/measured-template-preview.js +234 -0
- package/out/cli/components/measured-template-preview.js.map +1 -0
- package/out/cli/components/method-generator.js +1812 -0
- package/out/cli/components/method-generator.js.map +1 -0
- package/out/cli/components/ready-hook-generator.js +448 -0
- package/out/cli/components/ready-hook-generator.js.map +1 -0
- package/out/cli/components/token-generator.js +138 -0
- package/out/cli/components/token-generator.js.map +1 -0
- package/out/cli/components/utils.js +176 -0
- package/out/cli/components/utils.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-attribute.js +148 -0
- package/out/cli/components/vue/base-components/vue-attribute.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-boolean.js +77 -0
- package/out/cli/components/vue/base-components/vue-boolean.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-calculator.js +106 -0
- package/out/cli/components/vue/base-components/vue-calculator.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-damage-application.js +369 -0
- package/out/cli/components/vue/base-components/vue-damage-application.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-damage-bonuses.js +225 -0
- package/out/cli/components/vue/base-components/vue-damage-bonuses.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-damage-resistances.js +256 -0
- package/out/cli/components/vue/base-components/vue-damage-resistances.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-damage-track.js +134 -0
- package/out/cli/components/vue/base-components/vue-damage-track.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-date-time.js +55 -0
- package/out/cli/components/vue/base-components/vue-date-time.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-dice.js +111 -0
- package/out/cli/components/vue/base-components/vue-dice.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-die.js +86 -0
- package/out/cli/components/vue/base-components/vue-die.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-document-choice.js +172 -0
- package/out/cli/components/vue/base-components/vue-document-choice.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-document-choices.js +203 -0
- package/out/cli/components/vue/base-components/vue-document-choices.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-document-link.js +73 -0
- package/out/cli/components/vue/base-components/vue-document-link.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-extended-choice.js +101 -0
- package/out/cli/components/vue/base-components/vue-extended-choice.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-inventory.js +532 -0
- package/out/cli/components/vue/base-components/vue-inventory.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-macro-choice.js +150 -0
- package/out/cli/components/vue/base-components/vue-macro-choice.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-measured-template.js +543 -0
- package/out/cli/components/vue/base-components/vue-measured-template.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-money.js +496 -0
- package/out/cli/components/vue/base-components/vue-money.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-number.js +184 -0
- package/out/cli/components/vue/base-components/vue-number.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-paperdoll.js +56 -0
- package/out/cli/components/vue/base-components/vue-paperdoll.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-parent-property-reference.js +89 -0
- package/out/cli/components/vue/base-components/vue-parent-property-reference.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-prosemirror.js +31 -0
- package/out/cli/components/vue/base-components/vue-prosemirror.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-resource.js +149 -0
- package/out/cli/components/vue/base-components/vue-resource.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-roll-visualizer.js +121 -0
- package/out/cli/components/vue/base-components/vue-roll-visualizer.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-self-property-reference.js +75 -0
- package/out/cli/components/vue/base-components/vue-self-property-reference.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-string-choice.js +111 -0
- package/out/cli/components/vue/base-components/vue-string-choice.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-string-choices.js +216 -0
- package/out/cli/components/vue/base-components/vue-string-choices.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-string.js +73 -0
- package/out/cli/components/vue/base-components/vue-string.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-text-field.js +66 -0
- package/out/cli/components/vue/base-components/vue-text-field.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-tracker.js +444 -0
- package/out/cli/components/vue/base-components/vue-tracker.js.map +1 -0
- package/out/cli/components/vue/vue-action-component-generator.js +88 -0
- package/out/cli/components/vue/vue-action-component-generator.js.map +1 -0
- package/out/cli/components/vue/vue-active-effect-sheet-generator.js +1016 -0
- package/out/cli/components/vue/vue-active-effect-sheet-generator.js.map +1 -0
- package/out/cli/components/vue/vue-base-components-generator.js +59 -0
- package/out/cli/components/vue/vue-base-components-generator.js.map +1 -0
- package/out/cli/components/vue/vue-datatable-component-generator.js +307 -0
- package/out/cli/components/vue/vue-datatable-component-generator.js.map +1 -0
- package/out/cli/components/vue/vue-datatable-sheet-class-generator.js +342 -0
- package/out/cli/components/vue/vue-datatable-sheet-class-generator.js.map +1 -0
- package/out/cli/components/vue/vue-datatable2-component-generator.js +939 -0
- package/out/cli/components/vue/vue-datatable2-component-generator.js.map +1 -0
- package/out/cli/components/vue/vue-document-creation-app.js +140 -0
- package/out/cli/components/vue/vue-document-creation-app.js.map +1 -0
- package/out/cli/components/vue/vue-document-creation-sheet.js +105 -0
- package/out/cli/components/vue/vue-document-creation-sheet.js.map +1 -0
- package/out/cli/components/vue/vue-generator.js +240 -0
- package/out/cli/components/vue/vue-generator.js.map +1 -0
- package/out/cli/components/vue/vue-mixin.js +338 -0
- package/out/cli/components/vue/vue-mixin.js.map +1 -0
- package/out/cli/components/vue/vue-pinned-datatable-component-generator.js +306 -0
- package/out/cli/components/vue/vue-pinned-datatable-component-generator.js.map +1 -0
- package/out/cli/components/vue/vue-prompt-generator.js +201 -0
- package/out/cli/components/vue/vue-prompt-generator.js.map +1 -0
- package/out/cli/components/vue/vue-prompt-sheet-class-generator.js +252 -0
- package/out/cli/components/vue/vue-prompt-sheet-class-generator.js.map +1 -0
- package/out/cli/components/vue/vue-sheet-application-generator.js +2008 -0
- package/out/cli/components/vue/vue-sheet-application-generator.js.map +1 -0
- package/out/cli/components/vue/vue-sheet-class-generator.js +484 -0
- package/out/cli/components/vue/vue-sheet-class-generator.js.map +1 -0
- package/out/cli/generator.js +659 -0
- package/out/cli/generator.js.map +1 -0
- package/out/cli/main.js +43 -0
- package/out/cli/main.js.map +1 -0
- package/out/datatables.min.css +54 -0
- package/out/datatables.min.js +178 -0
- package/out/extension/github/githubAuthProvider.js +345 -0
- package/out/extension/github/githubAuthProvider.js.map +1 -0
- package/out/extension/github/githubConfig.js +132 -0
- package/out/extension/github/githubConfig.js.map +1 -0
- package/out/extension/github/githubGistActions.js +251 -0
- package/out/extension/github/githubGistActions.js.map +1 -0
- package/out/extension/github/githubGistManager.js +255 -0
- package/out/extension/github/githubGistManager.js.map +1 -0
- package/out/extension/github/githubManager.js +1735 -0
- package/out/extension/github/githubManager.js.map +1 -0
- package/out/extension/github/githubQuickActions.js +659 -0
- package/out/extension/github/githubQuickActions.js.map +1 -0
- package/out/extension/github/githubTreeProvider.js +181 -0
- package/out/extension/github/githubTreeProvider.js.map +1 -0
- package/out/extension/github/system-workflow.yml +48 -0
- package/out/extension/main.cjs +70315 -0
- package/out/extension/main.cjs.map +7 -0
- package/out/extension/main.js +237 -0
- package/out/extension/main.js.map +1 -0
- package/out/extension/package.json +426 -0
- package/out/isdl.png +0 -0
- package/out/language/generated/ast.js +2992 -0
- package/out/language/generated/ast.js.map +1 -0
- package/out/language/generated/grammar.js +13970 -0
- package/out/language/generated/grammar.js.map +1 -0
- package/out/language/generated/module.js +20 -0
- package/out/language/generated/module.js.map +1 -0
- package/out/language/intelligent-system-design-language-formatter.js +85 -0
- package/out/language/intelligent-system-design-language-formatter.js.map +1 -0
- package/out/language/intelligent-system-design-language-module.js +69 -0
- package/out/language/intelligent-system-design-language-module.js.map +1 -0
- package/out/language/intelligent-system-design-language-quickfixes.js +37 -0
- package/out/language/intelligent-system-design-language-quickfixes.js.map +1 -0
- package/out/language/intelligent-system-design-language-validator.js +515 -0
- package/out/language/intelligent-system-design-language-validator.js.map +1 -0
- package/out/language/isdl-hover-provider.js +77 -0
- package/out/language/isdl-hover-provider.js.map +1 -0
- package/out/language/isdl-scope-provider.js +149 -0
- package/out/language/isdl-scope-provider.js.map +1 -0
- package/out/language/main.cjs +47655 -0
- package/out/language/main.cjs.map +7 -0
- package/out/language/main.js +11 -0
- package/out/language/main.js.map +1 -0
- package/out/missing-character.png +0 -0
- package/out/package.json +426 -0
- package/out/paperdoll_default.png +0 -0
- package/out/progressbar.min.js +7 -0
- package/out/styles.scss +722 -0
- package/out/test/formatting/formatter.test.js +46 -0
- package/out/test/formatting/formatter.test.js.map +1 -0
- package/out/vuetify.esm.js +30279 -0
- package/package.json +426 -0
|
@@ -0,0 +1,1016 @@
|
|
|
1
|
+
import { isActor, isAttributeExp, isBooleanExp, isDateExp, isDateTimeExp, isDiceField, isDieField, isDocumentFields, isHookHandler, isHtmlExp, isInitiativeProperty, isMeasuredTemplateField, isNumberExp, isProperty, isResourceExp, isStatusProperty, isStringChoiceField, isStringExp, isTableField, isTimeExp, isTrackerExp, isDamageTypeChoiceField, isStringParamChoices } from "../../../language/generated/ast.js";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import { expandToNode, joinToNode, toString } from "langium/generate";
|
|
5
|
+
import { getAllOfType } from "../utils.js";
|
|
6
|
+
export function generateActiveEffectVueSheet(entry, id, destination) {
|
|
7
|
+
const generatedFileDir = path.join(destination, "system", "templates", "vue");
|
|
8
|
+
const generatedFilePath = path.join(generatedFileDir, `active-effect-app.vue`);
|
|
9
|
+
if (!fs.existsSync(generatedFileDir)) {
|
|
10
|
+
fs.mkdirSync(generatedFileDir, { recursive: true });
|
|
11
|
+
}
|
|
12
|
+
const documents = entry.documents.filter(isActor);
|
|
13
|
+
// Collect all damage types from the entry
|
|
14
|
+
function collectDamageTypes(entry) {
|
|
15
|
+
var _a;
|
|
16
|
+
const damageTypes = new Set();
|
|
17
|
+
// Search through all documents for damage type choice fields
|
|
18
|
+
for (const document of entry.documents) {
|
|
19
|
+
const damageTypeFields = getAllOfType(document.body, isDamageTypeChoiceField);
|
|
20
|
+
for (const field of damageTypeFields) {
|
|
21
|
+
const damageField = field; // Cast to access params
|
|
22
|
+
const choicesParam = (_a = damageField.params) === null || _a === void 0 ? void 0 : _a.find((p) => isStringParamChoices(p));
|
|
23
|
+
if (choicesParam && choicesParam.choices) {
|
|
24
|
+
for (const choice of choicesParam.choices) {
|
|
25
|
+
// Handle simple string choices like "None"
|
|
26
|
+
if (typeof choice.value === 'string') {
|
|
27
|
+
damageTypes.add(choice.value);
|
|
28
|
+
}
|
|
29
|
+
// Handle extended choices like { label: "🔥Fire", value: "Fire", ... }
|
|
30
|
+
else if (choice.value && typeof choice.value === 'object') {
|
|
31
|
+
const extendedChoice = choice.value;
|
|
32
|
+
// Try direct access to value property first
|
|
33
|
+
if (extendedChoice.value && typeof extendedChoice.value === 'string') {
|
|
34
|
+
damageTypes.add(extendedChoice.value);
|
|
35
|
+
}
|
|
36
|
+
// Try properties array access
|
|
37
|
+
else if (extendedChoice.properties && Array.isArray(extendedChoice.properties)) {
|
|
38
|
+
// Based on the ISDL syntax { label: "🔥Fire", value: "Fire", icon: "...", color: "...", ... }
|
|
39
|
+
// Property 0 = label, Property 1 = value, Property 2 = icon, Property 3 = color, rest = custom
|
|
40
|
+
if (extendedChoice.properties.length > 1 && extendedChoice.properties[1].value) {
|
|
41
|
+
const damageTypeValue = extendedChoice.properties[1].value;
|
|
42
|
+
damageTypes.add(damageTypeValue);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return Array.from(damageTypes).sort();
|
|
51
|
+
}
|
|
52
|
+
const fileNode = expandToNode `
|
|
53
|
+
${generateVueComponentScript(entry, id, destination)}
|
|
54
|
+
${generateVueComponentTemplate(id)}
|
|
55
|
+
`.appendNewLineIfNotEmpty();
|
|
56
|
+
fs.writeFileSync(generatedFilePath, toString(fileNode));
|
|
57
|
+
function generateVueComponentScript(entry, id, destination) {
|
|
58
|
+
return expandToNode `
|
|
59
|
+
<script setup>
|
|
60
|
+
import { ref, inject, onMounted, computed } from 'vue';
|
|
61
|
+
|
|
62
|
+
const document = inject('rawDocument');
|
|
63
|
+
const props = defineProps(['context']);
|
|
64
|
+
console.log("Vue AE context", props.context);
|
|
65
|
+
|
|
66
|
+
// Colors
|
|
67
|
+
const primaryColor = ref('#1565c0');
|
|
68
|
+
const secondaryColor = ref('#4db6ac');
|
|
69
|
+
const tertiaryColor = ref('#ffb74d');
|
|
70
|
+
|
|
71
|
+
const drawer = ref(false);
|
|
72
|
+
const page = ref('details');
|
|
73
|
+
const tab = ref('description');
|
|
74
|
+
|
|
75
|
+
// Available fields for each document type
|
|
76
|
+
const availableFields = ref({});
|
|
77
|
+
const selectedFields = ref({});
|
|
78
|
+
|
|
79
|
+
// Create field name mapping for each document
|
|
80
|
+
const createFieldMapping = () => {
|
|
81
|
+
const mapping = {};
|
|
82
|
+
const damageTypes = [${collectDamageTypes(entry).map(type => `'${type}'`).join(', ')}];
|
|
83
|
+
|
|
84
|
+
${joinToNode(documents, document => {
|
|
85
|
+
const fields = getAllOfType(document.body, isProperty, false).filter(property => !isInitiativeProperty(property) &&
|
|
86
|
+
!isStatusProperty(property) &&
|
|
87
|
+
!isHookHandler(property) &&
|
|
88
|
+
!isTableField(property) &&
|
|
89
|
+
!isDocumentFields(property) &&
|
|
90
|
+
!isHtmlExp(property) &&
|
|
91
|
+
property.modifier !== "locked");
|
|
92
|
+
return expandToNode `
|
|
93
|
+
mapping['${document.name}'] = {
|
|
94
|
+
${joinToNode(fields, field => `'${field.name.toLowerCase()}': '${field.name}'`, { separator: ',\n ' })}${fields.length > 0 ? ',' : ''}
|
|
95
|
+
// Auto-generated damage type fields
|
|
96
|
+
${collectDamageTypes(entry).map((damageType) => {
|
|
97
|
+
const safeTypeName = damageType.toLowerCase().replace(/[^a-z0-9]/g, '');
|
|
98
|
+
return [
|
|
99
|
+
`'${safeTypeName}bonusdamage': '${damageType} Bonus Damage'`,
|
|
100
|
+
`'${safeTypeName}damageresistanceflat': '${damageType} Damage Resistance (Flat)'`,
|
|
101
|
+
`'${safeTypeName}damageresistancepercent': '${damageType} Damage Resistance (%)'`
|
|
102
|
+
].join(',\n ');
|
|
103
|
+
}).join(',\n ')}
|
|
104
|
+
};
|
|
105
|
+
`;
|
|
106
|
+
}, { appendNewLineIfNotEmpty: true })}
|
|
107
|
+
return mapping;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
// Helper method to get change value from the changes array
|
|
111
|
+
const getChangeValue = (key) => {
|
|
112
|
+
const change = props.context?.document?.changes?.find(x => x.key === key);
|
|
113
|
+
return change?.value || '';
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
// Helper method to get numeric change value from the changes array
|
|
117
|
+
const getChangeNumberValue = (key) => {
|
|
118
|
+
const change = props.context?.document?.changes?.find(x => x.key === key);
|
|
119
|
+
if (!change?.value) return 0;
|
|
120
|
+
const num = Number(change.value);
|
|
121
|
+
return isNaN(num) ? 0 : num;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
// Helper method to get change type from the changes array
|
|
125
|
+
const getChangeMode = (key) => {
|
|
126
|
+
const change = props.context?.document?.changes?.find(x => x.key === key);
|
|
127
|
+
return change?.type || 'add';
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
// Initialize selectedFields from existing changes
|
|
131
|
+
const initializeSelectedFields = () => {
|
|
132
|
+
if (!props.context?.document?.changes) return;
|
|
133
|
+
|
|
134
|
+
const fieldMapping = createFieldMapping();
|
|
135
|
+
|
|
136
|
+
console.log(fieldMapping, props.context.document.changes);
|
|
137
|
+
for (const change of props.context.document.changes) {
|
|
138
|
+
// Parse the key to extract document name and field name
|
|
139
|
+
// Format: "hero.system.availableskilllevels" or "hero.system.resourcefield.value"
|
|
140
|
+
const parts = change.key.split('.');
|
|
141
|
+
if (parts.length >= 3) {
|
|
142
|
+
const documentName = parts[0];
|
|
143
|
+
const fieldNameLower = parts[2];
|
|
144
|
+
|
|
145
|
+
// Convert document name to proper case (e.g., "hero" -> "Hero")
|
|
146
|
+
const docName = documentName.charAt(0).toUpperCase() + documentName.slice(1);
|
|
147
|
+
|
|
148
|
+
// Look up the proper field name from our mapping
|
|
149
|
+
const properFieldName = fieldMapping[docName]?.[fieldNameLower];
|
|
150
|
+
console.log(properFieldName);
|
|
151
|
+
|
|
152
|
+
if (properFieldName) {
|
|
153
|
+
if (!selectedFields.value[docName]) {
|
|
154
|
+
selectedFields.value[docName] = [];
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
if (!selectedFields.value[docName].includes(properFieldName)) {
|
|
158
|
+
selectedFields.value[docName].push(properFieldName);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
// Generate a summary of current changes
|
|
166
|
+
const changesSummary = computed(() => {
|
|
167
|
+
if (!props.context?.document?.changes || props.context.document.changes.length === 0) {
|
|
168
|
+
return 'No changes configured';
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const changes = props.context.document.changes.filter(change => {
|
|
172
|
+
// Skip zero values for numbers
|
|
173
|
+
const numValue = Number(change.value);
|
|
174
|
+
return !((!isNaN(numValue) && numValue === 0) || change.value === '' || change.value === null);
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
if (changes.length === 0) {
|
|
178
|
+
return 'No changes configured';
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Group changes by document type
|
|
182
|
+
const groupedChanges = {};
|
|
183
|
+
changes.forEach(change => {
|
|
184
|
+
const parts = change.key.split('.');
|
|
185
|
+
if (parts.length >= 3) {
|
|
186
|
+
const documentName = parts[0].charAt(0).toUpperCase() + parts[0].slice(1); // Capitalize
|
|
187
|
+
const fieldPath = parts.slice(2).join('.');
|
|
188
|
+
|
|
189
|
+
if (!groupedChanges[documentName]) {
|
|
190
|
+
groupedChanges[documentName] = [];
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
console.log(change.key, fieldPath, parts);
|
|
194
|
+
|
|
195
|
+
// Convert field names to human readable
|
|
196
|
+
let step1 = fieldPath.replaceAll('.', ' ');
|
|
197
|
+
let step2 = step1.replace(/([a-z])([A-Z])/g, '$1 $2');
|
|
198
|
+
let step3 = step2.replace(/\b\w/g, l => l.toUpperCase());
|
|
199
|
+
//console.log("Debug steps:", fieldPath, "->", step1, "->", step2, "->", step3);
|
|
200
|
+
|
|
201
|
+
const humanFieldName = step3;
|
|
202
|
+
|
|
203
|
+
// Format the mode symbol
|
|
204
|
+
const modeSymbol = change.type === 'multiply' ? ' × ' :
|
|
205
|
+
change.type === 'add' ? ' + ' :
|
|
206
|
+
change.type === 'downgrade' ? ' ↓ ' :
|
|
207
|
+
change.type === 'upgrade' ? ' ↑ ' :
|
|
208
|
+
change.type === 'custom' ? ' (Once) + ' : ' ';
|
|
209
|
+
|
|
210
|
+
//console.log("Human Field Name:", humanFieldName, "Mode Symbol:", modeSymbol);
|
|
211
|
+
groupedChanges[documentName].push(humanFieldName + modeSymbol + change.value);
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
// Format as "Document: change1, change2"
|
|
216
|
+
const documentSummaries = Object.entries(groupedChanges).map(([docName, changes]) => {
|
|
217
|
+
return docName + ': ' + changes.join(', ');
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
return documentSummaries.join(' | ');
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
// Initialize on component mount
|
|
224
|
+
onMounted(() => {
|
|
225
|
+
initializeSelectedFields();
|
|
226
|
+
});
|
|
227
|
+
</script>
|
|
228
|
+
`;
|
|
229
|
+
}
|
|
230
|
+
function generateVueComponentTemplate(id) {
|
|
231
|
+
return expandToNode `
|
|
232
|
+
<template>
|
|
233
|
+
<v-app>
|
|
234
|
+
<!-- App Bar -->
|
|
235
|
+
<v-app-bar :color="primaryColor" density="comfortable">
|
|
236
|
+
<v-app-bar-nav-icon @click="drawer = !drawer"></v-app-bar-nav-icon>
|
|
237
|
+
<v-text-field name="name" v-model="context.document.name" variant="outlined" class="document-name" density="compact"></v-text-field>
|
|
238
|
+
</v-app-bar>
|
|
239
|
+
|
|
240
|
+
<!-- Navigation Drawer -->
|
|
241
|
+
<v-navigation-drawer v-model="drawer" temporary style="background-color: #dddddd">
|
|
242
|
+
<v-img :src="context.document.img" style="background-color: lightgray" data-edit='img' data-action='onEditImage'>
|
|
243
|
+
<template #error>
|
|
244
|
+
<v-img src="/systems/${id}/img/missing-character.png" data-edit='img' data-action='onEditImage'></v-img>
|
|
245
|
+
</template>
|
|
246
|
+
</v-img>
|
|
247
|
+
<v-tabs v-model="page" direction="vertical">
|
|
248
|
+
<v-tab value="details" prepend-icon="fa-solid fa-book">Details</v-tab>
|
|
249
|
+
<!-- <v-tab value="duration" prepend-icon="fa-solid fa-clock">Duration</v-tab>-->
|
|
250
|
+
${joinToNode(documents, generateNavListItem, { appendNewLineIfNotEmpty: true })}
|
|
251
|
+
</v-tabs>
|
|
252
|
+
</v-navigation-drawer>
|
|
253
|
+
|
|
254
|
+
<!-- Main Content -->
|
|
255
|
+
<v-main class="d-flex">
|
|
256
|
+
<v-container class="topography" fluid>
|
|
257
|
+
<v-tabs-window v-model="page">
|
|
258
|
+
<v-tabs-window-item value="details" data-tab="details">
|
|
259
|
+
<v-col cols="12" style="padding: 0">
|
|
260
|
+
<v-switch
|
|
261
|
+
:model-value="!context.document.disabled"
|
|
262
|
+
@update:model-value="context.document.disabled = !$event"
|
|
263
|
+
name="enabled"
|
|
264
|
+
:color="primaryColor"
|
|
265
|
+
label="Enabled">
|
|
266
|
+
</v-switch>
|
|
267
|
+
<v-switch
|
|
268
|
+
v-if="context.isItemEffect"
|
|
269
|
+
:model-value="context.document.transfer"
|
|
270
|
+
name="transfer"
|
|
271
|
+
:color="secondaryColor"
|
|
272
|
+
label="Active on parent Actor">
|
|
273
|
+
</v-switch>
|
|
274
|
+
<v-text-field
|
|
275
|
+
v-if="context.originLink"
|
|
276
|
+
:model-value="context.originLink"
|
|
277
|
+
label="Origin"
|
|
278
|
+
:disabled="true"
|
|
279
|
+
>
|
|
280
|
+
</v-text-field>
|
|
281
|
+
<v-card class="mt-3 mb-3" variant="outlined">
|
|
282
|
+
<v-card-title class="text-body-2">
|
|
283
|
+
<v-icon icon="fa-solid fa-magic" class="mr-2"></v-icon>
|
|
284
|
+
Current Changes
|
|
285
|
+
</v-card-title>
|
|
286
|
+
<v-card-text class="pt-2">
|
|
287
|
+
<div class="text-body-2 text-medium-emphasis">
|
|
288
|
+
{{ changesSummary }}
|
|
289
|
+
</div>
|
|
290
|
+
</v-card-text>
|
|
291
|
+
</v-card>
|
|
292
|
+
<i-prosemirror
|
|
293
|
+
label="Description"
|
|
294
|
+
icon="fa-solid fa-file-lines"
|
|
295
|
+
:field="context.editors['description']"
|
|
296
|
+
class="mt-2"
|
|
297
|
+
>
|
|
298
|
+
</i-prosemirror>
|
|
299
|
+
</v-col>
|
|
300
|
+
</v-tabs-window-item>
|
|
301
|
+
<v-tabs-window-item value="duration" data-tab="duration">
|
|
302
|
+
<v-col cols="12" style="padding: 0">
|
|
303
|
+
<v-label>Duration Settings</v-label>
|
|
304
|
+
<!-- Add duration content here -->
|
|
305
|
+
</v-col>
|
|
306
|
+
</v-tabs-window-item>
|
|
307
|
+
${joinToNode(documents, generateDocumentPage, { appendNewLineIfNotEmpty: true })}
|
|
308
|
+
</v-tabs-window>
|
|
309
|
+
</v-container>
|
|
310
|
+
</v-main>
|
|
311
|
+
</v-app>
|
|
312
|
+
</template>
|
|
313
|
+
`;
|
|
314
|
+
}
|
|
315
|
+
function generateNavListItem(document) {
|
|
316
|
+
return expandToNode `
|
|
317
|
+
<v-tab value="${document.name}" prepend-icon="fa-solid fa-pen-to-square">${document.name} Changes</v-tab>
|
|
318
|
+
`;
|
|
319
|
+
}
|
|
320
|
+
function generateDocumentPage(document) {
|
|
321
|
+
const fields = getAllOfType(document.body, isProperty, false).filter(property => !isInitiativeProperty(property) &&
|
|
322
|
+
!isStatusProperty(property) &&
|
|
323
|
+
!isHookHandler(property) &&
|
|
324
|
+
!isTableField(property) &&
|
|
325
|
+
!isDocumentFields(property) &&
|
|
326
|
+
!isHtmlExp(property) &&
|
|
327
|
+
property.modifier !== "locked");
|
|
328
|
+
const damageTypes = collectDamageTypes(entry);
|
|
329
|
+
const damageTypeFields = damageTypes.map((damageType) => {
|
|
330
|
+
return [
|
|
331
|
+
`{title: '${damageType} Bonus Damage', value: '${damageType} Bonus Damage'}`,
|
|
332
|
+
`{title: '${damageType} Damage Resistance (Flat)', value: '${damageType} Damage Resistance (Flat)'}`,
|
|
333
|
+
`{title: '${damageType} Damage Resistance (%)', value: '${damageType} Damage Resistance (%)'}`
|
|
334
|
+
];
|
|
335
|
+
}).flat().join(', ');
|
|
336
|
+
return expandToNode `
|
|
337
|
+
<v-tabs-window-item value="${document.name}" data-tab="${document.name}">
|
|
338
|
+
<v-col cols="12" style="padding: 0">
|
|
339
|
+
<v-card class="mb-4">
|
|
340
|
+
<v-card-title>Available Fields</v-card-title>
|
|
341
|
+
<v-card-text>
|
|
342
|
+
<v-autocomplete
|
|
343
|
+
label="Add Field to Change"
|
|
344
|
+
:items="[${joinToNode(fields, (property) => `{title: '${property.name}', value: '${property.name}'}`, { separator: ', ' })}${fields.length > 0 && damageTypeFields ? ', ' : ''}${damageTypeFields}]"
|
|
345
|
+
item-title="title"
|
|
346
|
+
item-value="value"
|
|
347
|
+
v-model="selectedFields['${document.name}']"
|
|
348
|
+
:color="primaryColor"
|
|
349
|
+
variant="outlined"
|
|
350
|
+
density="compact"
|
|
351
|
+
multiple
|
|
352
|
+
chips
|
|
353
|
+
closable-chips>
|
|
354
|
+
<template #chip="{ props, item }">
|
|
355
|
+
<v-chip v-bind="props" :text="item.title" closable></v-chip>
|
|
356
|
+
</template>
|
|
357
|
+
</v-autocomplete>
|
|
358
|
+
</v-card-text>
|
|
359
|
+
</v-card>
|
|
360
|
+
|
|
361
|
+
<div v-for="fieldName in selectedFields['${document.name}'] || []" :key="fieldName">
|
|
362
|
+
${joinToNode(fields, (property) => generateConditionalField(document, property), { appendNewLineIfNotEmpty: true })}
|
|
363
|
+
${generateDamageTypeConditionalFields(document, damageTypes)}
|
|
364
|
+
</div>
|
|
365
|
+
</v-col>
|
|
366
|
+
</v-tabs-window-item>
|
|
367
|
+
`;
|
|
368
|
+
}
|
|
369
|
+
function generateConditionalField(document, property) {
|
|
370
|
+
return expandToNode `
|
|
371
|
+
<div v-if="fieldName === '${property.name}'">
|
|
372
|
+
${generateField(document, property)}
|
|
373
|
+
</div>
|
|
374
|
+
`;
|
|
375
|
+
}
|
|
376
|
+
function generateDamageTypeConditionalFields(document, damageTypes) {
|
|
377
|
+
if (damageTypes.length === 0) {
|
|
378
|
+
return expandToNode ``;
|
|
379
|
+
}
|
|
380
|
+
return joinToNode(damageTypes, damageType => {
|
|
381
|
+
const safeTypeName = damageType.toLowerCase().replace(/[^a-z0-9]/g, '');
|
|
382
|
+
return expandToNode `
|
|
383
|
+
<!-- ${damageType} Bonus Damage -->
|
|
384
|
+
<div v-if="fieldName === '${damageType} Bonus Damage'">
|
|
385
|
+
<v-card class="mb-4">
|
|
386
|
+
<v-card-title>
|
|
387
|
+
${damageType} Bonus Damage
|
|
388
|
+
<v-btn
|
|
389
|
+
icon="fa-solid fa-xmark"
|
|
390
|
+
size="small"
|
|
391
|
+
variant="text"
|
|
392
|
+
@click="selectedFields['${document.name}'] = selectedFields['${document.name}'].filter(f => f !== '${damageType} Bonus Damage')"
|
|
393
|
+
style="float: right;">
|
|
394
|
+
</v-btn>
|
|
395
|
+
</v-card-title>
|
|
396
|
+
<v-card-text>
|
|
397
|
+
<v-row>
|
|
398
|
+
<v-select
|
|
399
|
+
name="${document.name.toLowerCase()}.system.${safeTypeName}bonusdamage-type"
|
|
400
|
+
:model-value="getChangeMode('${document.name.toLowerCase()}.system.${safeTypeName}bonusdamage')"
|
|
401
|
+
label="Mode"
|
|
402
|
+
:color="primaryColor"
|
|
403
|
+
:items="context.basicNumberModes"
|
|
404
|
+
item-title="label"
|
|
405
|
+
item-value="value"
|
|
406
|
+
variant="outlined"
|
|
407
|
+
density="compact">
|
|
408
|
+
</v-select>
|
|
409
|
+
<v-number-input
|
|
410
|
+
name="${document.name.toLowerCase()}.system.${safeTypeName}bonusdamage"
|
|
411
|
+
:model-value="getChangeNumberValue('${document.name.toLowerCase()}.system.${safeTypeName}bonusdamage')"
|
|
412
|
+
label="Bonus Damage"
|
|
413
|
+
:color="primaryColor"
|
|
414
|
+
variant="outlined"
|
|
415
|
+
density="compact">
|
|
416
|
+
</v-number-input>
|
|
417
|
+
</v-row>
|
|
418
|
+
</v-card-text>
|
|
419
|
+
</v-card>
|
|
420
|
+
</div>
|
|
421
|
+
|
|
422
|
+
<!-- ${damageType} Damage Resistance (Flat) -->
|
|
423
|
+
<div v-if="fieldName === '${damageType} Damage Resistance (Flat)'">
|
|
424
|
+
<v-card class="mb-4">
|
|
425
|
+
<v-card-title>
|
|
426
|
+
${damageType} Damage Resistance (Flat)
|
|
427
|
+
<v-btn
|
|
428
|
+
icon="fa-solid fa-xmark"
|
|
429
|
+
size="small"
|
|
430
|
+
variant="text"
|
|
431
|
+
@click="selectedFields['${document.name}'] = selectedFields['${document.name}'].filter(f => f !== '${damageType} Damage Resistance (Flat)')"
|
|
432
|
+
style="float: right;">
|
|
433
|
+
</v-btn>
|
|
434
|
+
</v-card-title>
|
|
435
|
+
<v-card-text>
|
|
436
|
+
<v-row>
|
|
437
|
+
<v-select
|
|
438
|
+
name="${document.name.toLowerCase()}.system.${safeTypeName}damageresistanceflat-type"
|
|
439
|
+
:model-value="getChangeMode('${document.name.toLowerCase()}.system.${safeTypeName}damageresistanceflat')"
|
|
440
|
+
label="Mode"
|
|
441
|
+
:color="primaryColor"
|
|
442
|
+
:items="context.basicNumberModes"
|
|
443
|
+
item-title="label"
|
|
444
|
+
item-value="value"
|
|
445
|
+
variant="outlined"
|
|
446
|
+
density="compact">
|
|
447
|
+
</v-select>
|
|
448
|
+
<v-number-input
|
|
449
|
+
name="${document.name.toLowerCase()}.system.${safeTypeName}damageresistanceflat"
|
|
450
|
+
:model-value="getChangeNumberValue('${document.name.toLowerCase()}.system.${safeTypeName}damageresistanceflat')"
|
|
451
|
+
label="Flat Resistance"
|
|
452
|
+
:color="primaryColor"
|
|
453
|
+
variant="outlined"
|
|
454
|
+
density="compact">
|
|
455
|
+
</v-number-input>
|
|
456
|
+
</v-row>
|
|
457
|
+
</v-card-text>
|
|
458
|
+
</v-card>
|
|
459
|
+
</div>
|
|
460
|
+
|
|
461
|
+
<!-- ${damageType} Damage Resistance (%) -->
|
|
462
|
+
<div v-if="fieldName === '${damageType} Damage Resistance (%)'">
|
|
463
|
+
<v-card class="mb-4">
|
|
464
|
+
<v-card-title>
|
|
465
|
+
${damageType} Damage Resistance (%)
|
|
466
|
+
<v-btn
|
|
467
|
+
icon="fa-solid fa-xmark"
|
|
468
|
+
size="small"
|
|
469
|
+
variant="text"
|
|
470
|
+
@click="selectedFields['${document.name}'] = selectedFields['${document.name}'].filter(f => f !== '${damageType} Damage Resistance (%)')"
|
|
471
|
+
style="float: right;">
|
|
472
|
+
</v-btn>
|
|
473
|
+
</v-card-title>
|
|
474
|
+
<v-card-text>
|
|
475
|
+
<v-row>
|
|
476
|
+
<v-select
|
|
477
|
+
name="${document.name.toLowerCase()}.system.${safeTypeName}damageresistancepercent-type"
|
|
478
|
+
:model-value="getChangeMode('${document.name.toLowerCase()}.system.${safeTypeName}damageresistancepercent')"
|
|
479
|
+
label="Mode"
|
|
480
|
+
:color="primaryColor"
|
|
481
|
+
:items="context.basicNumberModes"
|
|
482
|
+
item-title="label"
|
|
483
|
+
item-value="value"tec
|
|
484
|
+
variant="outlined"
|
|
485
|
+
density="compact">
|
|
486
|
+
</v-select>
|
|
487
|
+
<v-number-input
|
|
488
|
+
name="${document.name.toLowerCase()}.system.${safeTypeName}damageresistancepercent"
|
|
489
|
+
:model-value="getChangeNumberValue('${document.name.toLowerCase()}.system.${safeTypeName}damageresistancepercent')"
|
|
490
|
+
label="Percent Resistance (0-100)"
|
|
491
|
+
:min="0"
|
|
492
|
+
:max="100"
|
|
493
|
+
:color="primaryColor"
|
|
494
|
+
variant="outlined"
|
|
495
|
+
density="compact">
|
|
496
|
+
</v-number-input>
|
|
497
|
+
</v-row>
|
|
498
|
+
</v-card-text>
|
|
499
|
+
</v-card>
|
|
500
|
+
</div>
|
|
501
|
+
`;
|
|
502
|
+
}, { appendNewLineIfNotEmpty: true });
|
|
503
|
+
}
|
|
504
|
+
function generateRemoveButton(document, property) {
|
|
505
|
+
return expandToNode `
|
|
506
|
+
<v-btn
|
|
507
|
+
icon="fa-solid fa-xmark"
|
|
508
|
+
size="small"
|
|
509
|
+
variant="text"
|
|
510
|
+
@click="selectedFields['${document.name}'] = selectedFields['${document.name}'].filter(f => f !== '${property.name}')"
|
|
511
|
+
style="float: right;">
|
|
512
|
+
</v-btn>
|
|
513
|
+
`;
|
|
514
|
+
}
|
|
515
|
+
function generateField(document, property) {
|
|
516
|
+
if (isInitiativeProperty(property) || isStatusProperty(property) || isHookHandler(property) || !isProperty(property) || isTableField(property) || isDocumentFields(property) || isHtmlExp(property))
|
|
517
|
+
return;
|
|
518
|
+
if (property.modifier == "locked")
|
|
519
|
+
return;
|
|
520
|
+
if (isNumberExp(property)) {
|
|
521
|
+
return expandToNode `
|
|
522
|
+
<v-card class="mb-4">
|
|
523
|
+
<v-card-title>
|
|
524
|
+
${property.name}
|
|
525
|
+
${generateRemoveButton(document, property)}
|
|
526
|
+
</v-card-title>
|
|
527
|
+
<v-card-text>
|
|
528
|
+
<v-row>
|
|
529
|
+
<v-select
|
|
530
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}-type"
|
|
531
|
+
:model-value="getChangeMode('${document.name.toLowerCase()}.system.${property.name.toLowerCase()}')"
|
|
532
|
+
label="Mode"
|
|
533
|
+
:color="primaryColor"
|
|
534
|
+
:items="context.numberModes"
|
|
535
|
+
item-title="label"
|
|
536
|
+
item-value="value"
|
|
537
|
+
variant="outlined"
|
|
538
|
+
density="compact">
|
|
539
|
+
</v-select>
|
|
540
|
+
<v-number-input
|
|
541
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}"
|
|
542
|
+
:model-value="getChangeNumberValue('${document.name.toLowerCase()}.system.${property.name.toLowerCase()}')"
|
|
543
|
+
label="Value"
|
|
544
|
+
:color="primaryColor"
|
|
545
|
+
variant="outlined"
|
|
546
|
+
density="compact">
|
|
547
|
+
</v-number-input>
|
|
548
|
+
</v-row>
|
|
549
|
+
</v-card-text>
|
|
550
|
+
</v-card>
|
|
551
|
+
`;
|
|
552
|
+
}
|
|
553
|
+
if (isAttributeExp(property)) {
|
|
554
|
+
return expandToNode `
|
|
555
|
+
<v-card class="mb-4">
|
|
556
|
+
<v-card-title>
|
|
557
|
+
${property.name}
|
|
558
|
+
${generateRemoveButton(document, property)}
|
|
559
|
+
</v-card-title>
|
|
560
|
+
<v-card-text>
|
|
561
|
+
<v-row>
|
|
562
|
+
<v-select
|
|
563
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.value-mode"
|
|
564
|
+
:model-value="getChangeMode('${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.value')"
|
|
565
|
+
label="Mode"
|
|
566
|
+
:items="context.numberModes"
|
|
567
|
+
item-title="label"
|
|
568
|
+
item-value="value"
|
|
569
|
+
:color="primaryColor"
|
|
570
|
+
variant="outlined"
|
|
571
|
+
density="compact">
|
|
572
|
+
</v-select>
|
|
573
|
+
<v-number-input
|
|
574
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.value"
|
|
575
|
+
:model-value="getChangeNumberValue('${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.value')"
|
|
576
|
+
label="Value"
|
|
577
|
+
:color="primaryColor"
|
|
578
|
+
variant="outlined"
|
|
579
|
+
density="compact">
|
|
580
|
+
</v-number-input>
|
|
581
|
+
</v-row>
|
|
582
|
+
</v-card-text>
|
|
583
|
+
</v-card>
|
|
584
|
+
`;
|
|
585
|
+
}
|
|
586
|
+
if (isResourceExp(property)) {
|
|
587
|
+
// Resource has both a current and max that can be changed
|
|
588
|
+
return expandToNode `
|
|
589
|
+
<v-card class="mb-4">
|
|
590
|
+
<v-card-title>
|
|
591
|
+
${property.name}
|
|
592
|
+
${generateRemoveButton(document, property)}
|
|
593
|
+
</v-card-title>
|
|
594
|
+
<v-card-text>
|
|
595
|
+
<v-label>Resource Current</v-label>
|
|
596
|
+
<v-row>
|
|
597
|
+
<v-select
|
|
598
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.value-mode"
|
|
599
|
+
:model-value="getChangeMode('${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.value')"
|
|
600
|
+
label="Mode"
|
|
601
|
+
:items="context.numberModes"
|
|
602
|
+
item-title="label"
|
|
603
|
+
item-value="value"
|
|
604
|
+
:color="primaryColor"
|
|
605
|
+
variant="outlined"
|
|
606
|
+
density="compact">
|
|
607
|
+
</v-select>
|
|
608
|
+
<v-number-input
|
|
609
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.value"
|
|
610
|
+
:model-value="getChangeNumberValue('${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.value')"
|
|
611
|
+
label="Current Value"
|
|
612
|
+
:color="primaryColor"
|
|
613
|
+
variant="outlined"
|
|
614
|
+
density="compact">
|
|
615
|
+
</v-number-input>
|
|
616
|
+
</v-row>
|
|
617
|
+
<v-label class="mt-2">Resource Max</v-label>
|
|
618
|
+
<v-row>
|
|
619
|
+
<v-select
|
|
620
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.max-mode"
|
|
621
|
+
:model-value="getChangeMode('${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.max')"
|
|
622
|
+
label="Mode"
|
|
623
|
+
:items="context.numberModes"
|
|
624
|
+
item-title="label"
|
|
625
|
+
item-value="value"
|
|
626
|
+
:color="primaryColor"
|
|
627
|
+
variant="outlined"
|
|
628
|
+
density="compact">
|
|
629
|
+
</v-select>
|
|
630
|
+
<v-number-input
|
|
631
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.max"
|
|
632
|
+
:model-value="getChangeNumberValue('${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.max')"
|
|
633
|
+
label="Max Value"
|
|
634
|
+
:color="primaryColor"
|
|
635
|
+
variant="outlined"
|
|
636
|
+
density="compact">
|
|
637
|
+
</v-number-input>
|
|
638
|
+
</v-row>
|
|
639
|
+
</v-card-text>
|
|
640
|
+
</v-card>
|
|
641
|
+
`;
|
|
642
|
+
}
|
|
643
|
+
if (isStringExp(property)) {
|
|
644
|
+
return expandToNode `
|
|
645
|
+
<v-card class="mb-4">
|
|
646
|
+
<v-card-title>
|
|
647
|
+
${property.name}
|
|
648
|
+
${generateRemoveButton(document, property)}
|
|
649
|
+
</v-card-title>
|
|
650
|
+
<v-card-text>
|
|
651
|
+
<v-row>
|
|
652
|
+
<v-select
|
|
653
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}-type"
|
|
654
|
+
:model-value="getChangeMode('${document.name.toLowerCase()}.system.${property.name.toLowerCase()}')"
|
|
655
|
+
label="Mode"
|
|
656
|
+
:items="context.stringModes"
|
|
657
|
+
item-title="label"
|
|
658
|
+
item-value="value"
|
|
659
|
+
:color="primaryColor"
|
|
660
|
+
variant="outlined"
|
|
661
|
+
density="compact">
|
|
662
|
+
</v-select>
|
|
663
|
+
<v-text-field
|
|
664
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}"
|
|
665
|
+
:model-value="getChangeValue('${document.name.toLowerCase()}.system.${property.name.toLowerCase()}')"
|
|
666
|
+
label="Text Value"
|
|
667
|
+
:color="primaryColor"
|
|
668
|
+
variant="outlined"
|
|
669
|
+
density="compact">
|
|
670
|
+
</v-text-field>
|
|
671
|
+
</v-row>
|
|
672
|
+
</v-card-text>
|
|
673
|
+
</v-card>
|
|
674
|
+
`;
|
|
675
|
+
}
|
|
676
|
+
if (isBooleanExp(property)) {
|
|
677
|
+
return expandToNode `
|
|
678
|
+
<v-card class="mb-4">
|
|
679
|
+
<v-card-title>
|
|
680
|
+
${property.name}
|
|
681
|
+
${generateRemoveButton(document, property)}
|
|
682
|
+
</v-card-title>
|
|
683
|
+
<v-card-text>
|
|
684
|
+
<v-row>
|
|
685
|
+
<v-select
|
|
686
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}-type"
|
|
687
|
+
:model-value="getChangeMode('${document.name.toLowerCase()}.system.${property.name.toLowerCase()}')"
|
|
688
|
+
label="Mode"
|
|
689
|
+
:items="context.booleanModes"
|
|
690
|
+
item-title="label"
|
|
691
|
+
item-value="value"
|
|
692
|
+
:color="primaryColor"
|
|
693
|
+
variant="outlined"
|
|
694
|
+
density="compact">
|
|
695
|
+
</v-select>
|
|
696
|
+
<v-switch
|
|
697
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}"
|
|
698
|
+
:model-value="getChangeValue('${document.name.toLowerCase()}.system.${property.name.toLowerCase()}')"
|
|
699
|
+
label="Boolean Value"
|
|
700
|
+
:color="primaryColor"
|
|
701
|
+
variant="outlined"
|
|
702
|
+
density="compact">
|
|
703
|
+
</v-switch>
|
|
704
|
+
</v-row>
|
|
705
|
+
</v-card-text>
|
|
706
|
+
</v-card>
|
|
707
|
+
`;
|
|
708
|
+
}
|
|
709
|
+
if (isStringChoiceField(property)) {
|
|
710
|
+
return expandToNode `
|
|
711
|
+
<v-card class="mb-4">
|
|
712
|
+
<v-card-title>
|
|
713
|
+
${property.name}
|
|
714
|
+
${generateRemoveButton(document, property)}
|
|
715
|
+
</v-card-title>
|
|
716
|
+
<v-card-text>
|
|
717
|
+
<v-row>
|
|
718
|
+
<v-select
|
|
719
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}-type"
|
|
720
|
+
label="Mode"
|
|
721
|
+
:items="context.choiceModes"
|
|
722
|
+
item-title="label"
|
|
723
|
+
item-value="value"
|
|
724
|
+
:color="primaryColor"
|
|
725
|
+
variant="outlined"
|
|
726
|
+
density="compact">
|
|
727
|
+
</v-select>
|
|
728
|
+
<v-select
|
|
729
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}"
|
|
730
|
+
label="Choice Value"
|
|
731
|
+
:items="[]"
|
|
732
|
+
:color="primaryColor"
|
|
733
|
+
variant="outlined"
|
|
734
|
+
density="compact">
|
|
735
|
+
</v-select>
|
|
736
|
+
</v-row>
|
|
737
|
+
</v-card-text>
|
|
738
|
+
</v-card>
|
|
739
|
+
`;
|
|
740
|
+
}
|
|
741
|
+
if (isTrackerExp(property)) {
|
|
742
|
+
return expandToNode `
|
|
743
|
+
<v-card class="mb-4">
|
|
744
|
+
<v-card-title>
|
|
745
|
+
${property.name}
|
|
746
|
+
${generateRemoveButton(document, property)}
|
|
747
|
+
</v-card-title>
|
|
748
|
+
<v-card-text>
|
|
749
|
+
<v-label class="">Tracker Value</v-label>
|
|
750
|
+
<v-row>
|
|
751
|
+
<v-select
|
|
752
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}-type"
|
|
753
|
+
label="Mode"
|
|
754
|
+
:items="context.numberModes"
|
|
755
|
+
item-title="label"
|
|
756
|
+
item-value="value"
|
|
757
|
+
:color="primaryColor"
|
|
758
|
+
variant="outlined"
|
|
759
|
+
density="compact">
|
|
760
|
+
</v-select>
|
|
761
|
+
<v-number-input
|
|
762
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.value"
|
|
763
|
+
:model-value="getChangeNumberValue('${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.value')"
|
|
764
|
+
label="Current Value"
|
|
765
|
+
:color="primaryColor"
|
|
766
|
+
variant="outlined"
|
|
767
|
+
density="compact">
|
|
768
|
+
</v-number-input>
|
|
769
|
+
</v-row>
|
|
770
|
+
<v-label class="mt-2">Tracker Max</v-label>
|
|
771
|
+
<v-row>
|
|
772
|
+
<v-select
|
|
773
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.max-mode"
|
|
774
|
+
:model-value="getChangeMode('${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.max')"
|
|
775
|
+
label="Mode"
|
|
776
|
+
:items="context.numberModes"
|
|
777
|
+
item-title="label"
|
|
778
|
+
item-value="value"
|
|
779
|
+
:color="primaryColor"
|
|
780
|
+
variant="outlined"
|
|
781
|
+
density="compact">
|
|
782
|
+
</v-select>
|
|
783
|
+
<v-number-input
|
|
784
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.max"
|
|
785
|
+
:model-value="getChangeNumberValue('${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.max')"
|
|
786
|
+
label="Max Value"
|
|
787
|
+
:color="primaryColor"
|
|
788
|
+
variant="outlined"
|
|
789
|
+
density="compact">
|
|
790
|
+
</v-number-input>
|
|
791
|
+
</v-row>
|
|
792
|
+
</v-card-text>
|
|
793
|
+
</v-card>
|
|
794
|
+
`;
|
|
795
|
+
}
|
|
796
|
+
if (isDateExp(property)) {
|
|
797
|
+
return expandToNode `
|
|
798
|
+
<v-card class="mb-4">
|
|
799
|
+
<v-card-title>
|
|
800
|
+
${property.name}
|
|
801
|
+
${generateRemoveButton(document, property)}
|
|
802
|
+
</v-card-title>
|
|
803
|
+
<v-card-text>
|
|
804
|
+
<v-row>
|
|
805
|
+
<v-select
|
|
806
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}-type"
|
|
807
|
+
label="Mode"
|
|
808
|
+
:items="context.dateModes"
|
|
809
|
+
item-title="label"
|
|
810
|
+
item-value="value"
|
|
811
|
+
:color="primaryColor"
|
|
812
|
+
variant="outlined"
|
|
813
|
+
density="compact">
|
|
814
|
+
</v-select>
|
|
815
|
+
<v-text-field
|
|
816
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}"
|
|
817
|
+
label="Date Value"
|
|
818
|
+
type="date"
|
|
819
|
+
:color="primaryColor"
|
|
820
|
+
variant="outlined"
|
|
821
|
+
density="compact">
|
|
822
|
+
</v-text-field>
|
|
823
|
+
</v-row>
|
|
824
|
+
</v-card-text>
|
|
825
|
+
</v-card>
|
|
826
|
+
`;
|
|
827
|
+
}
|
|
828
|
+
if (isTimeExp(property)) {
|
|
829
|
+
return expandToNode `
|
|
830
|
+
<v-card class="mb-4">
|
|
831
|
+
<v-card-title>
|
|
832
|
+
${property.name}
|
|
833
|
+
${generateRemoveButton(document, property)}
|
|
834
|
+
</v-card-title>
|
|
835
|
+
<v-card-text>
|
|
836
|
+
<v-row>
|
|
837
|
+
<v-select
|
|
838
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}-type"
|
|
839
|
+
label="Mode"
|
|
840
|
+
:items="context.timeModes"
|
|
841
|
+
item-title="label"
|
|
842
|
+
item-value="value"
|
|
843
|
+
:color="primaryColor"
|
|
844
|
+
variant="outlined"
|
|
845
|
+
density="compact">
|
|
846
|
+
</v-select>
|
|
847
|
+
<v-text-field
|
|
848
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}"
|
|
849
|
+
label="Time Value"
|
|
850
|
+
type="time"
|
|
851
|
+
:color="primaryColor"
|
|
852
|
+
variant="outlined"
|
|
853
|
+
density="compact">
|
|
854
|
+
</v-text-field>
|
|
855
|
+
</v-row>
|
|
856
|
+
</v-card-text>
|
|
857
|
+
</v-card>
|
|
858
|
+
`;
|
|
859
|
+
}
|
|
860
|
+
if (isDateTimeExp(property)) {
|
|
861
|
+
return expandToNode `
|
|
862
|
+
<v-card class="mb-4">
|
|
863
|
+
<v-card-title>
|
|
864
|
+
${property.name}
|
|
865
|
+
${generateRemoveButton(document, property)}
|
|
866
|
+
</v-card-title>
|
|
867
|
+
<v-card-text>
|
|
868
|
+
<v-row>
|
|
869
|
+
<v-select
|
|
870
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}-type"
|
|
871
|
+
label="Mode"
|
|
872
|
+
:items="context.dateTimeModes"
|
|
873
|
+
item-title="label"
|
|
874
|
+
item-value="value"
|
|
875
|
+
:color="primaryColor"
|
|
876
|
+
variant="outlined"
|
|
877
|
+
density="compact">
|
|
878
|
+
</v-select>
|
|
879
|
+
<v-text-field
|
|
880
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}"
|
|
881
|
+
label="DateTime Value"
|
|
882
|
+
type="datetime-local"
|
|
883
|
+
:color="primaryColor"
|
|
884
|
+
variant="outlined"
|
|
885
|
+
density="compact">
|
|
886
|
+
</v-text-field>
|
|
887
|
+
</v-row>
|
|
888
|
+
</v-card-text>
|
|
889
|
+
</v-card>
|
|
890
|
+
`;
|
|
891
|
+
}
|
|
892
|
+
if (isDieField(property)) {
|
|
893
|
+
return expandToNode `
|
|
894
|
+
<v-card class="mb-4">
|
|
895
|
+
<v-card-title>
|
|
896
|
+
${property.name}
|
|
897
|
+
${generateRemoveButton(document, property)}
|
|
898
|
+
</v-card-title>
|
|
899
|
+
<v-card-text>
|
|
900
|
+
<v-row>
|
|
901
|
+
<v-select
|
|
902
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}-type"
|
|
903
|
+
label="Mode"
|
|
904
|
+
:items="context.dieModes"
|
|
905
|
+
item-title="label"
|
|
906
|
+
item-value="value"
|
|
907
|
+
:color="primaryColor"
|
|
908
|
+
variant="outlined"
|
|
909
|
+
density="compact">
|
|
910
|
+
</v-select>
|
|
911
|
+
<v-select
|
|
912
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}"
|
|
913
|
+
label="Die Type"
|
|
914
|
+
:items="context.dieTypes"
|
|
915
|
+
item-title="label"
|
|
916
|
+
item-value="value"
|
|
917
|
+
:color="primaryColor"
|
|
918
|
+
variant="outlined"
|
|
919
|
+
density="compact">
|
|
920
|
+
</v-select>
|
|
921
|
+
</v-row>
|
|
922
|
+
</v-card-text>
|
|
923
|
+
</v-card>
|
|
924
|
+
`;
|
|
925
|
+
}
|
|
926
|
+
if (isDiceField(property)) {
|
|
927
|
+
return expandToNode `
|
|
928
|
+
<v-card class="mb-4">
|
|
929
|
+
<v-card-title>
|
|
930
|
+
${property.name}
|
|
931
|
+
${generateRemoveButton(document, property)}
|
|
932
|
+
</v-card-title>
|
|
933
|
+
<v-card-text>
|
|
934
|
+
<v-row>
|
|
935
|
+
<v-select
|
|
936
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}-type"
|
|
937
|
+
:model-value="getChangeMode('${document.name.toLowerCase()}.system.${property.name.toLowerCase()}')"
|
|
938
|
+
label="Mode"
|
|
939
|
+
:items="context.diceModes"
|
|
940
|
+
item-title="label"
|
|
941
|
+
item-value="value"
|
|
942
|
+
:color="primaryColor"
|
|
943
|
+
variant="outlined"
|
|
944
|
+
density="compact">
|
|
945
|
+
</v-select>
|
|
946
|
+
<v-number-input
|
|
947
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.number"
|
|
948
|
+
:model-value="getChangeNumberValue('${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.number')"
|
|
949
|
+
label="Number of Dice"
|
|
950
|
+
:color="primaryColor"
|
|
951
|
+
variant="outlined"
|
|
952
|
+
density="compact">
|
|
953
|
+
</v-number-input>
|
|
954
|
+
<v-select
|
|
955
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.die"
|
|
956
|
+
:model-value="getChangeValue('${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.die')"
|
|
957
|
+
label="Die Type"
|
|
958
|
+
:items="context.dieTypes"
|
|
959
|
+
item-title="label"
|
|
960
|
+
item-value="value"
|
|
961
|
+
:color="primaryColor"
|
|
962
|
+
variant="outlined"
|
|
963
|
+
density="compact">
|
|
964
|
+
</v-select>
|
|
965
|
+
</v-row>
|
|
966
|
+
</v-card-text>
|
|
967
|
+
</v-card>
|
|
968
|
+
`;
|
|
969
|
+
}
|
|
970
|
+
if (isMeasuredTemplateField(property)) {
|
|
971
|
+
return expandToNode `
|
|
972
|
+
<v-card class="mb-4">
|
|
973
|
+
<v-card-title>
|
|
974
|
+
${property.name}
|
|
975
|
+
${generateRemoveButton(document, property)}
|
|
976
|
+
</v-card-title>
|
|
977
|
+
<v-card-text>
|
|
978
|
+
<v-row>
|
|
979
|
+
<v-select
|
|
980
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}-type"
|
|
981
|
+
label="Mode"
|
|
982
|
+
:items="context.templateModes"
|
|
983
|
+
item-title="label"
|
|
984
|
+
item-value="value"
|
|
985
|
+
:color="primaryColor"
|
|
986
|
+
variant="outlined"
|
|
987
|
+
density="compact">
|
|
988
|
+
</v-select>
|
|
989
|
+
<v-text-field
|
|
990
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.distance"
|
|
991
|
+
label="Distance"
|
|
992
|
+
:color="primaryColor"
|
|
993
|
+
variant="outlined"
|
|
994
|
+
density="compact">
|
|
995
|
+
</v-text-field>
|
|
996
|
+
<v-select
|
|
997
|
+
name="${document.name.toLowerCase()}.system.${property.name.toLowerCase()}.type"
|
|
998
|
+
label="Template Type"
|
|
999
|
+
:items="context.templateTypes"
|
|
1000
|
+
item-title="label"
|
|
1001
|
+
item-value="value"
|
|
1002
|
+
:color="primaryColor"
|
|
1003
|
+
variant="outlined"
|
|
1004
|
+
density="compact">
|
|
1005
|
+
</v-select>
|
|
1006
|
+
</v-row>
|
|
1007
|
+
</v-card-text>
|
|
1008
|
+
</v-card>
|
|
1009
|
+
`;
|
|
1010
|
+
}
|
|
1011
|
+
return expandToNode `
|
|
1012
|
+
<v-alert text="Unknown Property ${property.name} (${property.$type})" type="warning" density="compact" class="ga-2 ma-1" variant="outlined"></v-alert>
|
|
1013
|
+
`;
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
//# sourceMappingURL=vue-active-effect-sheet-generator.js.map
|