intelligent-system-design-language 0.3.21 → 0.3.23

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.
Files changed (116) hide show
  1. package/.claude/agents/langium-language-designer.md +38 -38
  2. package/.claude/agents/typescript-vscode-expert.md +29 -29
  3. package/.claude/agents/ui-ux-designer.md +36 -36
  4. package/.claude/settings.local.json +33 -33
  5. package/.idea/inspectionProfiles/Project_Default.xml +6 -6
  6. package/.idea/isdl.iml +13 -13
  7. package/.idea/modules.xml +8 -8
  8. package/.idea/vcs.xml +6 -6
  9. package/.idea/watcherTasks.xml +3 -3
  10. package/.vscodeignore +18 -18
  11. package/LICENSE +673 -673
  12. package/README.md +86 -86
  13. package/bin/cli.js +4 -4
  14. package/bin/lsp.js +8 -8
  15. package/out/_backgrounds.scss +91 -91
  16. package/out/_handlebars.scss +497 -497
  17. package/out/_isdlStyles.scss +1444 -1381
  18. package/out/_vuetifyOverrides.scss +425 -425
  19. package/out/_vuetifyStyles.scss +31957 -31957
  20. package/out/cli/components/_backgrounds.scss +91 -91
  21. package/out/cli/components/_handlebars.scss +497 -497
  22. package/out/cli/components/_isdlStyles.scss +1444 -1381
  23. package/out/cli/components/_vuetifyOverrides.scss +425 -425
  24. package/out/cli/components/_vuetifyStyles.scss +31957 -31957
  25. package/out/cli/components/active-effect-sheet-generator.js +453 -453
  26. package/out/cli/components/chat-card-generator.js +654 -651
  27. package/out/cli/components/chat-card-generator.js.map +1 -1
  28. package/out/cli/components/css-generator.js +4 -4
  29. package/out/cli/components/damage-roll-generator.js +160 -160
  30. package/out/cli/components/datamodel-generator.js +264 -257
  31. package/out/cli/components/datamodel-generator.js.map +1 -1
  32. package/out/cli/components/derived-data-generator.js +923 -923
  33. package/out/cli/components/hotbar-drop-hook-generator.js +82 -82
  34. package/out/cli/components/init-hook-generator.js +495 -495
  35. package/out/cli/components/language-generator.js +1 -1
  36. package/out/cli/components/language-generator.js.map +1 -1
  37. package/out/cli/components/measured-template-preview.js +221 -221
  38. package/out/cli/components/method-generator.js +979 -887
  39. package/out/cli/components/method-generator.js.map +1 -1
  40. package/out/cli/components/ready-hook-generator.js +404 -404
  41. package/out/cli/components/token-generator.js +116 -116
  42. package/out/cli/components/vue/base-components/vue-attribute.js +138 -138
  43. package/out/cli/components/vue/base-components/vue-boolean.js +64 -64
  44. package/out/cli/components/vue/base-components/vue-calculator.js +93 -93
  45. package/out/cli/components/vue/base-components/vue-damage-application.js +356 -356
  46. package/out/cli/components/vue/base-components/vue-damage-bonuses.js +165 -165
  47. package/out/cli/components/vue/base-components/vue-damage-resistances.js +196 -196
  48. package/out/cli/components/vue/base-components/vue-damage-track.js +121 -121
  49. package/out/cli/components/vue/base-components/vue-date-time.js +42 -42
  50. package/out/cli/components/vue/base-components/vue-dice.js +98 -98
  51. package/out/cli/components/vue/base-components/vue-die.js +73 -73
  52. package/out/cli/components/vue/base-components/vue-document-choice.js +149 -149
  53. package/out/cli/components/vue/base-components/vue-document-choices.js +179 -179
  54. package/out/cli/components/vue/base-components/vue-document-link.js +60 -60
  55. package/out/cli/components/vue/base-components/vue-extended-choice.js +88 -88
  56. package/out/cli/components/vue/base-components/vue-inventory.js +519 -519
  57. package/out/cli/components/vue/base-components/vue-macro-choice.js +138 -138
  58. package/out/cli/components/vue/base-components/vue-measured-template.js +530 -530
  59. package/out/cli/components/vue/base-components/vue-money.js +483 -483
  60. package/out/cli/components/vue/base-components/vue-number.js +174 -174
  61. package/out/cli/components/vue/base-components/vue-paperdoll.js +43 -43
  62. package/out/cli/components/vue/base-components/vue-parent-property-reference.js +76 -76
  63. package/out/cli/components/vue/base-components/vue-prosemirror.js +18 -18
  64. package/out/cli/components/vue/base-components/vue-resource.js +136 -136
  65. package/out/cli/components/vue/base-components/vue-roll-visualizer.js +286 -109
  66. package/out/cli/components/vue/base-components/vue-roll-visualizer.js.map +1 -1
  67. package/out/cli/components/vue/base-components/vue-self-property-reference.js +62 -62
  68. package/out/cli/components/vue/base-components/vue-string-choice.js +98 -98
  69. package/out/cli/components/vue/base-components/vue-string-choices.js +203 -203
  70. package/out/cli/components/vue/base-components/vue-string.js +60 -60
  71. package/out/cli/components/vue/base-components/vue-text-field.js +53 -53
  72. package/out/cli/components/vue/base-components/vue-tracker.js +431 -431
  73. package/out/cli/components/vue/vue-action-component-generator.js +64 -64
  74. package/out/cli/components/vue/vue-active-effect-sheet-generator.js +856 -856
  75. package/out/cli/components/vue/vue-datatable-sheet-class-generator.js +292 -292
  76. package/out/cli/components/vue/vue-datatable2-component-generator.js +824 -824
  77. package/out/cli/components/vue/vue-document-creation-app.js +121 -121
  78. package/out/cli/components/vue/vue-document-creation-sheet.js +94 -94
  79. package/out/cli/components/vue/vue-generator.js +40 -40
  80. package/out/cli/components/vue/vue-mixin.js +296 -296
  81. package/out/cli/components/vue/vue-pinned-datatable-component-generator.js +260 -260
  82. package/out/cli/components/vue/vue-prompt-generator.js +91 -76
  83. package/out/cli/components/vue/vue-prompt-generator.js.map +1 -1
  84. package/out/cli/components/vue/vue-prompt-sheet-class-generator.js +317 -317
  85. package/out/cli/components/vue/vue-sheet-application-generator.js +1177 -1167
  86. package/out/cli/components/vue/vue-sheet-application-generator.js.map +1 -1
  87. package/out/cli/components/vue/vue-sheet-class-generator.js +510 -510
  88. package/out/cli/generator.js +438 -433
  89. package/out/cli/generator.js.map +1 -1
  90. package/out/extension/github/githubAuthProvider.js +71 -29
  91. package/out/extension/github/githubAuthProvider.js.map +1 -1
  92. package/out/extension/github/githubGistManager.js +4 -3
  93. package/out/extension/github/githubGistManager.js.map +1 -1
  94. package/out/extension/github/githubManager.js +40 -38
  95. package/out/extension/github/githubManager.js.map +1 -1
  96. package/out/extension/github/githubQuickActions.js +120 -120
  97. package/out/extension/github/system-workflow.yml +47 -47
  98. package/out/extension/main.cjs +909 -532
  99. package/out/extension/main.cjs.map +3 -3
  100. package/out/extension/package.json +419 -419
  101. package/out/language/generated/ast.js +51 -2
  102. package/out/language/generated/ast.js.map +1 -1
  103. package/out/language/generated/grammar.js +14240 -13991
  104. package/out/language/generated/grammar.js.map +1 -1
  105. package/out/language/intelligent-system-design-language-validator.js +32 -2
  106. package/out/language/intelligent-system-design-language-validator.js.map +1 -1
  107. package/out/language/isdl-scope-provider.js +14 -1
  108. package/out/language/isdl-scope-provider.js.map +1 -1
  109. package/out/language/main.cjs +913 -569
  110. package/out/language/main.cjs.map +3 -3
  111. package/out/package.json +419 -419
  112. package/out/progressbar.min.js +6 -6
  113. package/out/styles.scss +762 -747
  114. package/out/test/validating/diagnostics.test.js +40 -0
  115. package/out/test/validating/diagnostics.test.js.map +1 -1
  116. package/package.json +419 -419
@@ -17,186 +17,186 @@ export function generateDocumentChoicesComponent(entry, id, document, documentCh
17
17
  }
18
18
  const unlocked = documentChoices.modifier === 'unlocked';
19
19
  console.log("Generating document choices component", documentChoices.name);
20
- const fileNode = expandToNode `
21
- <script setup>
22
- import { ref, inject, computed } from "vue";
23
-
24
- const props = defineProps({
25
- context: Object,
26
- editMode: Boolean,
27
- primaryColor: String,
28
- secondaryColor: String
29
- });
30
-
31
- const document = inject('rawDocument');
32
- const unlocked = ${unlocked};
33
-
34
- // Raw value holds the actual UUIDs stored in the document
35
- const rawValue = ref(foundry.utils.getProperty(document, '${getSystemPath(documentChoices)}') || []);
36
- console.log("Raw Value:", rawValue);
37
-
38
- // Computed value maps UUIDs to choice objects for v-model
39
- const value = computed({
40
- get() {
41
- return rawValue.value.map(item => {
42
- let context = {
43
- id: item.uuid,
44
- name: item.name,
45
- image: item.img,
46
- summary: truncate(item.system?.description || '', 50),
47
- description: item.system?.description || ''
48
- };
49
-
50
- if (item.parent) {
51
- context.source = "Self";
52
- context.color = props.primaryColor;
53
- context.icon = 'fa-solid fa-user';
54
- }
55
- else if (item.compendium) {
56
- context.source = \`\${item.compendium.metadata.packageName} - \${item.compendium.title}\`;
57
- context.color = props.secondaryColor;
58
- context.icon = 'fa-solid fa-suitcase';
59
- }
60
- else {
61
- context.source = "World";
62
- context.color = props.secondaryColor;
63
- context.icon = 'fa-solid fa-globe';
64
- }
65
-
66
- return context;
67
- }).filter(Boolean);
68
- },
69
- set(newValue) {
70
- console.log("Updating Document choices to:", newValue);
71
- rawValue.value = newValue;
72
- document.update({ '${getSystemPath(documentChoices)}': newValue });
73
- }
74
- });
75
-
76
- const choices = computed(() => {
77
- let system = props.context.system;
78
- let allChoices = Array.from(document.items);
79
-
20
+ const fileNode = expandToNode `
21
+ <script setup>
22
+ import { ref, inject, computed } from "vue";
23
+
24
+ const props = defineProps({
25
+ context: Object,
26
+ editMode: Boolean,
27
+ primaryColor: String,
28
+ secondaryColor: String
29
+ });
30
+
31
+ const document = inject('rawDocument');
32
+ const unlocked = ${unlocked};
33
+
34
+ // Raw value holds the actual UUIDs stored in the document
35
+ const rawValue = ref(foundry.utils.getProperty(document, '${getSystemPath(documentChoices)}') || []);
36
+ console.log("Raw Value:", rawValue);
37
+
38
+ // Computed value maps UUIDs to choice objects for v-model
39
+ const value = computed({
40
+ get() {
41
+ return rawValue.value.map(item => {
42
+ let context = {
43
+ id: item.uuid,
44
+ name: item.name,
45
+ image: item.img,
46
+ summary: truncate(item.system?.description || '', 50),
47
+ description: item.system?.description || ''
48
+ };
49
+
50
+ if (item.parent) {
51
+ context.source = "Self";
52
+ context.color = props.primaryColor;
53
+ context.icon = 'fa-solid fa-user';
54
+ }
55
+ else if (item.compendium) {
56
+ context.source = \`\${item.compendium.metadata.packageName} - \${item.compendium.title}\`;
57
+ context.color = props.secondaryColor;
58
+ context.icon = 'fa-solid fa-suitcase';
59
+ }
60
+ else {
61
+ context.source = "World";
62
+ context.color = props.secondaryColor;
63
+ context.icon = 'fa-solid fa-globe';
64
+ }
65
+
66
+ return context;
67
+ }).filter(Boolean);
68
+ },
69
+ set(newValue) {
70
+ console.log("Updating Document choices to:", newValue);
71
+ rawValue.value = newValue;
72
+ document.update({ '${getSystemPath(documentChoices)}': newValue });
73
+ }
74
+ });
75
+
76
+ const choices = computed(() => {
77
+ let system = props.context.system;
78
+ let allChoices = Array.from(document.items);
79
+
80
80
  ${globalAllowed ?
81
- `
82
- let gameItems = game.items.filter(item => item.type === '${(_b = documentChoices.document.ref) === null || _b === void 0 ? void 0 : _b.name.toLowerCase()}');
83
- allChoices = allChoices.concat(gameItems);
84
-
85
- let itemPacks = game.packs.filter(pack => pack.documentName === 'Item');
86
- for (let pack of itemPacks) {
87
- const packItems = pack.index.contents;
88
- packItems.forEach(item => {
89
- item.compendium = pack;
90
- });
91
- allChoices = allChoices.concat(packItems);
92
- }
93
- ` : ''}
94
-
95
- allChoices = allChoices.filter(item => {
96
- if (item.type !== '${(_c = documentChoices.document.ref) === null || _c === void 0 ? void 0 : _c.name.toLowerCase()}') return false;
97
- return ${(_e = translateExpression(entry, id, (_d = documentChoices.params.filter((x) => isWhereParam(x))[0]) === null || _d === void 0 ? void 0 : _d.value)) !== null && _e !== void 0 ? _e : true}
98
- });
99
-
100
- if (allChoices.length === 0) return [{
101
- id: null,
102
- name: 'No choices available'
103
- }];
104
-
105
- return allChoices.map(choice => {
106
- let context = {
107
- id: choice.uuid,
108
- name: choice.name,
109
- image: choice.img,
110
- summary: truncate(choice.system.description, 50),
111
- description: choice.system.description
112
- };
113
-
114
- if (choice.parent) {
115
- context.source = "Self";
116
- context.color = props.primaryColor;
117
- context.icon = 'fa-solid fa-user';
118
- }
119
- else if (choice.compendium) {
120
- context.source = \`\${choice.compendium.metadata.packageName} - \${choice.compendium.title}\`;
121
- context.color = props.secondaryColor;
122
- context.icon = 'fa-solid fa-suitcase';
123
- }
124
- else {
125
- context.source = "World";
126
- context.color = props.secondaryColor;
127
- context.icon = 'fa-solid fa-globe';
128
- }
129
-
130
- return context;
131
- });
132
- });
133
-
134
- const truncate = (text, maxLength) => {
135
- if (text.length > maxLength) {
136
- return text.substring(0, maxLength) + '...';
137
- }
138
- return text;
139
- }
140
-
141
- const getLabel = (label, icon) => {
142
- const localized = game.i18n.localize(label);
143
- if (icon) {
144
- return \`<i class="\${icon}"></i> \${localized}\`;
145
- }
146
- return localized;
147
- }
148
- </script>
149
- <template>
150
- <v-autocomplete
151
- clearable
152
- dense
153
- multiple
154
- chips
155
- v-model="value"
156
- :items="choices"
157
- item-title="name"
158
- item-value="id"
159
- density="compact"
160
- variant="outlined"
161
- class="double-wide"
162
- >
163
- <template #label>
164
- <span v-html="getLabel('${document.name}.${documentChoices.name}', ${iconParam ? `'${iconParam.value}'` : undefined})" />
165
- </template>
166
- <template v-slot:item="{ props, item }">
167
- <v-list-item
168
- v-bind="props"
169
- :data-tooltip="item.raw.description"
170
- >
171
- <template v-slot:title>
172
- <div class="flexrow">
173
- <p style="flex: 1">{{ item.raw.name }}</p>
174
- <v-spacer />
175
- <v-chip size="small" label :color="item.raw.color" style="align-self: center; white-space: nowrap; flex: 0; line-height: 26px; display: inline-table;"><v-icon :icon="item.raw.icon" start></v-icon> {{ item.raw.source }}</v-chip>
176
- </div>
177
- </template>
178
- <template v-if="item.raw.image" v-slot:prepend>
179
- <v-avatar rounded="0" :image="item.raw.image">
180
- </v-avatar>
181
- </template>
182
- <template v-slot:subtitle>
183
- <div v-html="item.raw.summary"></div>
184
- </template>
185
- </v-list-item>
186
- </template>
187
- <template v-slot:chip="{ props: chipProps, item }">
188
- <v-chip
189
- label
190
- v-bind="chipProps"
191
- :text="item.title"
192
- >
193
- <template v-slot:prepend v-if="item.raw?.image">
194
- <v-avatar rounded="0" size="small" :image="item.raw.image" style="padding-right: 2px;"></v-avatar>
195
- </template>
196
- </v-chip>
197
- </template>
198
- </v-autocomplete>
199
- </template>
81
+ `
82
+ let gameItems = game.items.filter(item => item.type === '${(_b = documentChoices.document.ref) === null || _b === void 0 ? void 0 : _b.name.toLowerCase()}');
83
+ allChoices = allChoices.concat(gameItems);
84
+
85
+ let itemPacks = game.packs.filter(pack => pack.documentName === 'Item');
86
+ for (let pack of itemPacks) {
87
+ const packItems = pack.index.contents;
88
+ packItems.forEach(item => {
89
+ item.compendium = pack;
90
+ });
91
+ allChoices = allChoices.concat(packItems);
92
+ }
93
+ ` : ''}
94
+
95
+ allChoices = allChoices.filter(item => {
96
+ if (item.type !== '${(_c = documentChoices.document.ref) === null || _c === void 0 ? void 0 : _c.name.toLowerCase()}') return false;
97
+ return ${(_e = translateExpression(entry, id, (_d = documentChoices.params.filter((x) => isWhereParam(x))[0]) === null || _d === void 0 ? void 0 : _d.value)) !== null && _e !== void 0 ? _e : true}
98
+ });
99
+
100
+ if (allChoices.length === 0) return [{
101
+ id: null,
102
+ name: 'No choices available'
103
+ }];
104
+
105
+ return allChoices.map(choice => {
106
+ let context = {
107
+ id: choice.uuid,
108
+ name: choice.name,
109
+ image: choice.img,
110
+ summary: truncate(choice.system.description, 50),
111
+ description: choice.system.description
112
+ };
113
+
114
+ if (choice.parent) {
115
+ context.source = "Self";
116
+ context.color = props.primaryColor;
117
+ context.icon = 'fa-solid fa-user';
118
+ }
119
+ else if (choice.compendium) {
120
+ context.source = \`\${choice.compendium.metadata.packageName} - \${choice.compendium.title}\`;
121
+ context.color = props.secondaryColor;
122
+ context.icon = 'fa-solid fa-suitcase';
123
+ }
124
+ else {
125
+ context.source = "World";
126
+ context.color = props.secondaryColor;
127
+ context.icon = 'fa-solid fa-globe';
128
+ }
129
+
130
+ return context;
131
+ });
132
+ });
133
+
134
+ const truncate = (text, maxLength) => {
135
+ if (text.length > maxLength) {
136
+ return text.substring(0, maxLength) + '...';
137
+ }
138
+ return text;
139
+ }
140
+
141
+ const getLabel = (label, icon) => {
142
+ const localized = game.i18n.localize(label);
143
+ if (icon) {
144
+ return \`<i class="\${icon}"></i> \${localized}\`;
145
+ }
146
+ return localized;
147
+ }
148
+ </script>
149
+ <template>
150
+ <v-autocomplete
151
+ clearable
152
+ dense
153
+ multiple
154
+ chips
155
+ v-model="value"
156
+ :items="choices"
157
+ item-title="name"
158
+ item-value="id"
159
+ density="compact"
160
+ variant="outlined"
161
+ class="double-wide"
162
+ >
163
+ <template #label>
164
+ <span v-html="getLabel('${document.name}.${documentChoices.name}', ${iconParam ? `'${iconParam.value}'` : undefined})" />
165
+ </template>
166
+ <template v-slot:item="{ props, item }">
167
+ <v-list-item
168
+ v-bind="props"
169
+ :data-tooltip="item.raw.description"
170
+ >
171
+ <template v-slot:title>
172
+ <div class="flexrow">
173
+ <p style="flex: 1">{{ item.raw.name }}</p>
174
+ <v-spacer />
175
+ <v-chip size="small" label :color="item.raw.color" style="align-self: center; white-space: nowrap; flex: 0; line-height: 26px; display: inline-table;"><v-icon :icon="item.raw.icon" start></v-icon> {{ item.raw.source }}</v-chip>
176
+ </div>
177
+ </template>
178
+ <template v-if="item.raw.image" v-slot:prepend>
179
+ <v-avatar rounded="0" :image="item.raw.image">
180
+ </v-avatar>
181
+ </template>
182
+ <template v-slot:subtitle>
183
+ <div v-html="item.raw.summary"></div>
184
+ </template>
185
+ </v-list-item>
186
+ </template>
187
+ <template v-slot:chip="{ props: chipProps, item }">
188
+ <v-chip
189
+ label
190
+ v-bind="chipProps"
191
+ :text="item.title"
192
+ >
193
+ <template v-slot:prepend v-if="item.raw?.image">
194
+ <v-avatar rounded="0" size="small" :image="item.raw.image" style="padding-right: 2px;"></v-avatar>
195
+ </template>
196
+ </v-chip>
197
+ </template>
198
+ </v-autocomplete>
199
+ </template>
200
200
  `;
201
201
  fs.writeFileSync(generatedFilePath, toString(fileNode));
202
202
  }
@@ -7,66 +7,66 @@ export default function generateDocumentLinkComponent(destination) {
7
7
  if (!fs.existsSync(generatedFileDir)) {
8
8
  fs.mkdirSync(generatedFileDir, { recursive: true });
9
9
  }
10
- const fileNode = expandToNode `
11
- <script setup>
12
- import { ref, computed, inject } from "vue";
13
-
14
- const props = defineProps({
15
- label: String,
16
- systemPath: String,
17
- context: Object,
18
- disabled: Boolean,
19
- documentName: String,
20
- secondaryColor: String
21
- });
22
-
23
- const value = computed(() => {
24
- return foundry.utils.getProperty(props.context, props.systemPath);
25
- });
26
-
27
- const image = computed(() => {
28
- return value.value ? value.value.img : null;
29
- });
30
-
31
- const hasLink = computed(() => {
32
- return !!value.value;
33
- });
34
-
35
- const document = inject("rawDocument");
36
-
37
- const open = () => {
38
- const item = fromUuidSync(value.value.uuid);
39
- item.sheet.render(true);
40
- };
41
-
42
- const remove = async () => {
43
- const update = {};
44
- value.value = null;
45
- update[props.systemPath] = null;
46
- await document.update(update);
47
- };
48
- </script>
49
-
50
- <template>
51
- <v-card class="isdl-single-document single-document" :data-type="documentName" :data-name="systemPath">
52
- <v-img v-if="image" :src="image" class="align-end" cover style="background-color: lightgray" >
53
- <template v-slot:error>
54
- <v-img src="/icons/vtt-512.png" class="align-end" cover></v-img>
55
- </template>
56
- </v-img>
57
- <v-img v-else src="/icons/containers/boxes/crates-wooden-stacked.webp" class="align-end" cover></v-img>
58
- <v-card-title>{{ game.i18n.localize(label) }}</v-card-title>
59
- <v-card-subtitle v-if="hasLink">{{ value.name }}</v-card-subtitle>
60
- <v-card-text v-else>{{ game.i18n.localize('NoSingleDocument') }}</v-card-text>
61
- <v-card-actions v-if="hasLink">
62
- <v-btn :color="secondaryColor" @click="open" icon="fa-solid fa-up-right-from-square" size="small">
63
- </v-btn>
64
- <v-spacer></v-spacer>
65
- <v-btn :color="secondaryColor" @click="remove" icon="fa-solid fa-delete-left" size="small">
66
- </v-btn>
67
- </v-card-actions>
68
- </v-card>
69
- </template>
10
+ const fileNode = expandToNode `
11
+ <script setup>
12
+ import { ref, computed, inject } from "vue";
13
+
14
+ const props = defineProps({
15
+ label: String,
16
+ systemPath: String,
17
+ context: Object,
18
+ disabled: Boolean,
19
+ documentName: String,
20
+ secondaryColor: String
21
+ });
22
+
23
+ const value = computed(() => {
24
+ return foundry.utils.getProperty(props.context, props.systemPath);
25
+ });
26
+
27
+ const image = computed(() => {
28
+ return value.value ? value.value.img : null;
29
+ });
30
+
31
+ const hasLink = computed(() => {
32
+ return !!value.value;
33
+ });
34
+
35
+ const document = inject("rawDocument");
36
+
37
+ const open = () => {
38
+ const item = fromUuidSync(value.value.uuid);
39
+ item.sheet.render(true);
40
+ };
41
+
42
+ const remove = async () => {
43
+ const update = {};
44
+ value.value = null;
45
+ update[props.systemPath] = null;
46
+ await document.update(update);
47
+ };
48
+ </script>
49
+
50
+ <template>
51
+ <v-card class="isdl-single-document single-document" :data-type="documentName" :data-name="systemPath">
52
+ <v-img v-if="image" :src="image" class="align-end" cover style="background-color: lightgray" >
53
+ <template v-slot:error>
54
+ <v-img src="/icons/vtt-512.png" class="align-end" cover></v-img>
55
+ </template>
56
+ </v-img>
57
+ <v-img v-else src="/icons/containers/boxes/crates-wooden-stacked.webp" class="align-end" cover></v-img>
58
+ <v-card-title>{{ game.i18n.localize(label) }}</v-card-title>
59
+ <v-card-subtitle v-if="hasLink">{{ value.name }}</v-card-subtitle>
60
+ <v-card-text v-else>{{ game.i18n.localize('NoSingleDocument') }}</v-card-text>
61
+ <v-card-actions v-if="hasLink">
62
+ <v-btn :color="secondaryColor" @click="open" icon="fa-solid fa-up-right-from-square" size="small">
63
+ </v-btn>
64
+ <v-spacer></v-spacer>
65
+ <v-btn :color="secondaryColor" @click="remove" icon="fa-solid fa-delete-left" size="small">
66
+ </v-btn>
67
+ </v-card-actions>
68
+ </v-card>
69
+ </template>
70
70
  `;
71
71
  fs.writeFileSync(generatedFilePath, toString(fileNode));
72
72
  }