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.
Files changed (209) hide show
  1. package/.claude/agents/langium-language-designer.md +38 -0
  2. package/.claude/agents/typescript-vscode-expert.md +29 -0
  3. package/.claude/agents/ui-ux-designer.md +36 -0
  4. package/.claude/settings.local.json +33 -0
  5. package/.idea/inspectionProfiles/Project_Default.xml +7 -0
  6. package/.idea/isdl.iml +14 -0
  7. package/.idea/modules.xml +9 -0
  8. package/.idea/vcs.xml +7 -0
  9. package/.idea/watcherTasks.xml +4 -0
  10. package/.vscodeignore +18 -0
  11. package/LICENSE +674 -0
  12. package/README.md +86 -0
  13. package/bin/cli.js +4 -0
  14. package/bin/lsp.js +8 -0
  15. package/isdl.png +0 -0
  16. package/out/_backgrounds.scss +91 -0
  17. package/out/_handlebars.scss +505 -0
  18. package/out/_isdlStyles.scss +1357 -0
  19. package/out/_vuetifyOverrides.scss +425 -0
  20. package/out/_vuetifyStyles.scss +31957 -0
  21. package/out/cli/cli-util.js +39 -0
  22. package/out/cli/cli-util.js.map +1 -0
  23. package/out/cli/components/_backgrounds.scss +91 -0
  24. package/out/cli/components/_handlebars.scss +505 -0
  25. package/out/cli/components/_isdlStyles.scss +1357 -0
  26. package/out/cli/components/_vuetifyOverrides.scss +425 -0
  27. package/out/cli/components/_vuetifyStyles.scss +31957 -0
  28. package/out/cli/components/active-effect-sheet-generator.js +643 -0
  29. package/out/cli/components/active-effect-sheet-generator.js.map +1 -0
  30. package/out/cli/components/base-actor-sheet-generator.js +125 -0
  31. package/out/cli/components/base-actor-sheet-generator.js.map +1 -0
  32. package/out/cli/components/base-sheet-generator.js +525 -0
  33. package/out/cli/components/base-sheet-generator.js.map +1 -0
  34. package/out/cli/components/chat-card-generator.js +683 -0
  35. package/out/cli/components/chat-card-generator.js.map +1 -0
  36. package/out/cli/components/css-generator.js +58 -0
  37. package/out/cli/components/css-generator.js.map +1 -0
  38. package/out/cli/components/damage-roll-generator.js +173 -0
  39. package/out/cli/components/damage-roll-generator.js.map +1 -0
  40. package/out/cli/components/datamodel-generator.js +672 -0
  41. package/out/cli/components/datamodel-generator.js.map +1 -0
  42. package/out/cli/components/derived-data-generator.js +1340 -0
  43. package/out/cli/components/derived-data-generator.js.map +1 -0
  44. package/out/cli/components/hotbar-drop-hook-generator.js +95 -0
  45. package/out/cli/components/hotbar-drop-hook-generator.js.map +1 -0
  46. package/out/cli/components/init-hook-generator.js +597 -0
  47. package/out/cli/components/init-hook-generator.js.map +1 -0
  48. package/out/cli/components/keywords-generator.js +220 -0
  49. package/out/cli/components/keywords-generator.js.map +1 -0
  50. package/out/cli/components/language-generator.js +110 -0
  51. package/out/cli/components/language-generator.js.map +1 -0
  52. package/out/cli/components/measured-template-preview.js +234 -0
  53. package/out/cli/components/measured-template-preview.js.map +1 -0
  54. package/out/cli/components/method-generator.js +1812 -0
  55. package/out/cli/components/method-generator.js.map +1 -0
  56. package/out/cli/components/ready-hook-generator.js +448 -0
  57. package/out/cli/components/ready-hook-generator.js.map +1 -0
  58. package/out/cli/components/token-generator.js +138 -0
  59. package/out/cli/components/token-generator.js.map +1 -0
  60. package/out/cli/components/utils.js +176 -0
  61. package/out/cli/components/utils.js.map +1 -0
  62. package/out/cli/components/vue/base-components/vue-attribute.js +148 -0
  63. package/out/cli/components/vue/base-components/vue-attribute.js.map +1 -0
  64. package/out/cli/components/vue/base-components/vue-boolean.js +77 -0
  65. package/out/cli/components/vue/base-components/vue-boolean.js.map +1 -0
  66. package/out/cli/components/vue/base-components/vue-calculator.js +106 -0
  67. package/out/cli/components/vue/base-components/vue-calculator.js.map +1 -0
  68. package/out/cli/components/vue/base-components/vue-damage-application.js +369 -0
  69. package/out/cli/components/vue/base-components/vue-damage-application.js.map +1 -0
  70. package/out/cli/components/vue/base-components/vue-damage-bonuses.js +225 -0
  71. package/out/cli/components/vue/base-components/vue-damage-bonuses.js.map +1 -0
  72. package/out/cli/components/vue/base-components/vue-damage-resistances.js +256 -0
  73. package/out/cli/components/vue/base-components/vue-damage-resistances.js.map +1 -0
  74. package/out/cli/components/vue/base-components/vue-damage-track.js +134 -0
  75. package/out/cli/components/vue/base-components/vue-damage-track.js.map +1 -0
  76. package/out/cli/components/vue/base-components/vue-date-time.js +55 -0
  77. package/out/cli/components/vue/base-components/vue-date-time.js.map +1 -0
  78. package/out/cli/components/vue/base-components/vue-dice.js +111 -0
  79. package/out/cli/components/vue/base-components/vue-dice.js.map +1 -0
  80. package/out/cli/components/vue/base-components/vue-die.js +86 -0
  81. package/out/cli/components/vue/base-components/vue-die.js.map +1 -0
  82. package/out/cli/components/vue/base-components/vue-document-choice.js +172 -0
  83. package/out/cli/components/vue/base-components/vue-document-choice.js.map +1 -0
  84. package/out/cli/components/vue/base-components/vue-document-choices.js +203 -0
  85. package/out/cli/components/vue/base-components/vue-document-choices.js.map +1 -0
  86. package/out/cli/components/vue/base-components/vue-document-link.js +73 -0
  87. package/out/cli/components/vue/base-components/vue-document-link.js.map +1 -0
  88. package/out/cli/components/vue/base-components/vue-extended-choice.js +101 -0
  89. package/out/cli/components/vue/base-components/vue-extended-choice.js.map +1 -0
  90. package/out/cli/components/vue/base-components/vue-inventory.js +532 -0
  91. package/out/cli/components/vue/base-components/vue-inventory.js.map +1 -0
  92. package/out/cli/components/vue/base-components/vue-macro-choice.js +150 -0
  93. package/out/cli/components/vue/base-components/vue-macro-choice.js.map +1 -0
  94. package/out/cli/components/vue/base-components/vue-measured-template.js +543 -0
  95. package/out/cli/components/vue/base-components/vue-measured-template.js.map +1 -0
  96. package/out/cli/components/vue/base-components/vue-money.js +496 -0
  97. package/out/cli/components/vue/base-components/vue-money.js.map +1 -0
  98. package/out/cli/components/vue/base-components/vue-number.js +184 -0
  99. package/out/cli/components/vue/base-components/vue-number.js.map +1 -0
  100. package/out/cli/components/vue/base-components/vue-paperdoll.js +56 -0
  101. package/out/cli/components/vue/base-components/vue-paperdoll.js.map +1 -0
  102. package/out/cli/components/vue/base-components/vue-parent-property-reference.js +89 -0
  103. package/out/cli/components/vue/base-components/vue-parent-property-reference.js.map +1 -0
  104. package/out/cli/components/vue/base-components/vue-prosemirror.js +31 -0
  105. package/out/cli/components/vue/base-components/vue-prosemirror.js.map +1 -0
  106. package/out/cli/components/vue/base-components/vue-resource.js +149 -0
  107. package/out/cli/components/vue/base-components/vue-resource.js.map +1 -0
  108. package/out/cli/components/vue/base-components/vue-roll-visualizer.js +121 -0
  109. package/out/cli/components/vue/base-components/vue-roll-visualizer.js.map +1 -0
  110. package/out/cli/components/vue/base-components/vue-self-property-reference.js +75 -0
  111. package/out/cli/components/vue/base-components/vue-self-property-reference.js.map +1 -0
  112. package/out/cli/components/vue/base-components/vue-string-choice.js +111 -0
  113. package/out/cli/components/vue/base-components/vue-string-choice.js.map +1 -0
  114. package/out/cli/components/vue/base-components/vue-string-choices.js +216 -0
  115. package/out/cli/components/vue/base-components/vue-string-choices.js.map +1 -0
  116. package/out/cli/components/vue/base-components/vue-string.js +73 -0
  117. package/out/cli/components/vue/base-components/vue-string.js.map +1 -0
  118. package/out/cli/components/vue/base-components/vue-text-field.js +66 -0
  119. package/out/cli/components/vue/base-components/vue-text-field.js.map +1 -0
  120. package/out/cli/components/vue/base-components/vue-tracker.js +444 -0
  121. package/out/cli/components/vue/base-components/vue-tracker.js.map +1 -0
  122. package/out/cli/components/vue/vue-action-component-generator.js +88 -0
  123. package/out/cli/components/vue/vue-action-component-generator.js.map +1 -0
  124. package/out/cli/components/vue/vue-active-effect-sheet-generator.js +1016 -0
  125. package/out/cli/components/vue/vue-active-effect-sheet-generator.js.map +1 -0
  126. package/out/cli/components/vue/vue-base-components-generator.js +59 -0
  127. package/out/cli/components/vue/vue-base-components-generator.js.map +1 -0
  128. package/out/cli/components/vue/vue-datatable-component-generator.js +307 -0
  129. package/out/cli/components/vue/vue-datatable-component-generator.js.map +1 -0
  130. package/out/cli/components/vue/vue-datatable-sheet-class-generator.js +342 -0
  131. package/out/cli/components/vue/vue-datatable-sheet-class-generator.js.map +1 -0
  132. package/out/cli/components/vue/vue-datatable2-component-generator.js +939 -0
  133. package/out/cli/components/vue/vue-datatable2-component-generator.js.map +1 -0
  134. package/out/cli/components/vue/vue-document-creation-app.js +140 -0
  135. package/out/cli/components/vue/vue-document-creation-app.js.map +1 -0
  136. package/out/cli/components/vue/vue-document-creation-sheet.js +105 -0
  137. package/out/cli/components/vue/vue-document-creation-sheet.js.map +1 -0
  138. package/out/cli/components/vue/vue-generator.js +240 -0
  139. package/out/cli/components/vue/vue-generator.js.map +1 -0
  140. package/out/cli/components/vue/vue-mixin.js +338 -0
  141. package/out/cli/components/vue/vue-mixin.js.map +1 -0
  142. package/out/cli/components/vue/vue-pinned-datatable-component-generator.js +306 -0
  143. package/out/cli/components/vue/vue-pinned-datatable-component-generator.js.map +1 -0
  144. package/out/cli/components/vue/vue-prompt-generator.js +201 -0
  145. package/out/cli/components/vue/vue-prompt-generator.js.map +1 -0
  146. package/out/cli/components/vue/vue-prompt-sheet-class-generator.js +252 -0
  147. package/out/cli/components/vue/vue-prompt-sheet-class-generator.js.map +1 -0
  148. package/out/cli/components/vue/vue-sheet-application-generator.js +2008 -0
  149. package/out/cli/components/vue/vue-sheet-application-generator.js.map +1 -0
  150. package/out/cli/components/vue/vue-sheet-class-generator.js +484 -0
  151. package/out/cli/components/vue/vue-sheet-class-generator.js.map +1 -0
  152. package/out/cli/generator.js +659 -0
  153. package/out/cli/generator.js.map +1 -0
  154. package/out/cli/main.js +43 -0
  155. package/out/cli/main.js.map +1 -0
  156. package/out/datatables.min.css +54 -0
  157. package/out/datatables.min.js +178 -0
  158. package/out/extension/github/githubAuthProvider.js +345 -0
  159. package/out/extension/github/githubAuthProvider.js.map +1 -0
  160. package/out/extension/github/githubConfig.js +132 -0
  161. package/out/extension/github/githubConfig.js.map +1 -0
  162. package/out/extension/github/githubGistActions.js +251 -0
  163. package/out/extension/github/githubGistActions.js.map +1 -0
  164. package/out/extension/github/githubGistManager.js +255 -0
  165. package/out/extension/github/githubGistManager.js.map +1 -0
  166. package/out/extension/github/githubManager.js +1735 -0
  167. package/out/extension/github/githubManager.js.map +1 -0
  168. package/out/extension/github/githubQuickActions.js +659 -0
  169. package/out/extension/github/githubQuickActions.js.map +1 -0
  170. package/out/extension/github/githubTreeProvider.js +181 -0
  171. package/out/extension/github/githubTreeProvider.js.map +1 -0
  172. package/out/extension/github/system-workflow.yml +48 -0
  173. package/out/extension/main.cjs +70315 -0
  174. package/out/extension/main.cjs.map +7 -0
  175. package/out/extension/main.js +237 -0
  176. package/out/extension/main.js.map +1 -0
  177. package/out/extension/package.json +426 -0
  178. package/out/isdl.png +0 -0
  179. package/out/language/generated/ast.js +2992 -0
  180. package/out/language/generated/ast.js.map +1 -0
  181. package/out/language/generated/grammar.js +13970 -0
  182. package/out/language/generated/grammar.js.map +1 -0
  183. package/out/language/generated/module.js +20 -0
  184. package/out/language/generated/module.js.map +1 -0
  185. package/out/language/intelligent-system-design-language-formatter.js +85 -0
  186. package/out/language/intelligent-system-design-language-formatter.js.map +1 -0
  187. package/out/language/intelligent-system-design-language-module.js +69 -0
  188. package/out/language/intelligent-system-design-language-module.js.map +1 -0
  189. package/out/language/intelligent-system-design-language-quickfixes.js +37 -0
  190. package/out/language/intelligent-system-design-language-quickfixes.js.map +1 -0
  191. package/out/language/intelligent-system-design-language-validator.js +515 -0
  192. package/out/language/intelligent-system-design-language-validator.js.map +1 -0
  193. package/out/language/isdl-hover-provider.js +77 -0
  194. package/out/language/isdl-hover-provider.js.map +1 -0
  195. package/out/language/isdl-scope-provider.js +149 -0
  196. package/out/language/isdl-scope-provider.js.map +1 -0
  197. package/out/language/main.cjs +47655 -0
  198. package/out/language/main.cjs.map +7 -0
  199. package/out/language/main.js +11 -0
  200. package/out/language/main.js.map +1 -0
  201. package/out/missing-character.png +0 -0
  202. package/out/package.json +426 -0
  203. package/out/paperdoll_default.png +0 -0
  204. package/out/progressbar.min.js +7 -0
  205. package/out/styles.scss +722 -0
  206. package/out/test/formatting/formatter.test.js +46 -0
  207. package/out/test/formatting/formatter.test.js.map +1 -0
  208. package/out/vuetify.esm.js +30279 -0
  209. package/package.json +426 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-card-generator.js","sourceRoot":"","sources":["../../../src/cli/components/chat-card-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC9F,OAAO,EAAmB,aAAa,EAAe,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAClH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,UAAU,qBAAqB,CAAC,KAAY,EAAE,WAAmB;IAEnE,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;IACvE,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,eAAe,CAAC,CAAC;IAEvE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE;QAClC,EAAE,CAAC,SAAS,CAAC,gBAAgB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;KACvD;IAED,MAAM,EAAE,GAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,IAAI,CAAU,CAAC,KAAK,CAAC;IAEhG,SAAS,iBAAiB,CAAC,QAAkB;QACzC,MAAM,cAAc,GAAG,YAAY,CAAc,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CA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EAAE;QAClC,EAAE,CAAC,SAAS,CAAC,gBAAgB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;KACvD;IAED,MAAM,QAAQ,GAAG,YAAY,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2G5B,CAAC,uBAAuB,EAAE,CAAC;IAE5B,EAAE,CAAC,aAAa,CAAC,iBAAiB,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC5D,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { expandToNode, toString } from 'langium/generate';
2
+ import * as fs from 'node:fs';
3
+ import * as path from 'node:path';
4
+ import * as sass from 'sass';
5
+ import { fileURLToPath } from 'url';
6
+ export function compileSCSS(dynamicId) {
7
+ const __filename = fileURLToPath(import.meta.url);
8
+ const __dirname = path.dirname(__filename);
9
+ console.log(__filename, __dirname);
10
+ // Path to the SCSS file
11
+ const scssFilePath = path.join(__dirname, '../../styles.scss');
12
+ // Read the SCSS file content
13
+ let scssContent = fs.readFileSync(scssFilePath, 'utf8');
14
+ // Replace the placeholder with the dynamic ID
15
+ scssContent = scssContent.replace(/\#\{\$dynamic-id\}/g, `${dynamicId}`);
16
+ // Create a temporary file to hold the modified SCSS
17
+ const tempScssFilePath = path.join(__dirname, 'temp-styles.scss');
18
+ fs.writeFileSync(tempScssFilePath, scssContent);
19
+ // Copy the _backgrounds.scss file to the same directory as the temp SCSS file
20
+ copyScssFile('../../_backgrounds.scss', '_backgrounds.scss');
21
+ copyScssFile('../../_handlebars.scss', '_handlebars.scss');
22
+ copyScssFile('../../_vuetifyOverrides.scss', '_vuetifyOverrides.scss');
23
+ function copyScssFile(source, destination) {
24
+ const filePath = path.join(__dirname, source);
25
+ const tempFilePath = path.join(__dirname, destination);
26
+ fs.copyFileSync(filePath, tempFilePath);
27
+ }
28
+ // Compile SCSS to CSS
29
+ const result = sass.compile(tempScssFilePath);
30
+ return result.css.toString();
31
+ }
32
+ export function generateSystemCss(entry, id, destination) {
33
+ const generatedFileDir = path.join(destination, "css");
34
+ const generatedFilePath = path.join(generatedFileDir, `${id}.css`);
35
+ if (!fs.existsSync(generatedFileDir)) {
36
+ fs.mkdirSync(generatedFileDir, { recursive: true });
37
+ }
38
+ const fileNode = expandToNode `
39
+ ${compileSCSS(id)}
40
+ `.appendNewLineIfNotEmpty();
41
+ fs.writeFileSync(generatedFilePath, toString(fileNode));
42
+ }
43
+ export function generateCustomCss(entry, id, destination) {
44
+ const generatedFileDir = path.join(destination, "css");
45
+ const generatedFilePath = path.join(generatedFileDir, `${id}-custom.css`);
46
+ if (!fs.existsSync(generatedFileDir)) {
47
+ fs.mkdirSync(generatedFileDir, { recursive: true });
48
+ }
49
+ // If the file already exists, don't overwrite it
50
+ if (fs.existsSync(generatedFilePath)) {
51
+ return;
52
+ }
53
+ const fileNode = expandToNode `
54
+ /* Custom CSS for ${id}. This file is empty by default and won't be overwritten by the generator. */
55
+ `.appendNewLineIfNotEmpty();
56
+ fs.writeFileSync(generatedFilePath, toString(fileNode));
57
+ }
58
+ //# sourceMappingURL=css-generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css-generator.js","sourceRoot":"","sources":["../../../src/cli/components/css-generator.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,MAAM,UAAU,WAAW,CAAC,SAAiB;IAEzC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClD,MAAM,SAA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} from 'langium/generate';
2
+ import * as fs from 'node:fs';
3
+ import * as path from 'node:path';
4
+ export function generateDamageRoll(entry, id, destination) {
5
+ const generatedFileDir = path.join(destination, "system", "rolls");
6
+ const generatedFilePath = path.join(generatedFileDir, `damage-roll.mjs`);
7
+ if (!fs.existsSync(generatedFileDir)) {
8
+ fs.mkdirSync(generatedFileDir, { recursive: true });
9
+ }
10
+ const fileNode = expandToNode `
11
+ import ${entry.config.name}Roll from "./roll.mjs";
12
+
13
+ /**
14
+ * Extended Roll class for damage with type metadata
15
+ */
16
+ export default class ${entry.config.name}DamageRoll extends ${entry.config.name}Roll {
17
+
18
+ constructor(formula, data = {}, options = {}) {
19
+ // Add AE Damage Type Bonus if damage type is specified and actor exists
20
+ if (options.type?.value && data.actor) {
21
+ const damageTypeKey = options.type.value.toLowerCase().replace(/\\s+/g, '');
22
+ const bonusField = \`\${damageTypeKey}bonusdamage\`;
23
+ const aeBonus = data.actor.system[bonusField];
24
+
25
+ if (aeBonus && aeBonus !== 0) {
26
+ // Add the AE bonus as a separate term to the formula
27
+ formula = \`\${formula} + \${aeBonus}[AE \${options.type.value} Damage Bonus]\`;
28
+ }
29
+ }
30
+
31
+ super(formula, data, options);
32
+
33
+ // Store damage type metadata
34
+ this._damageType = options.type?.value || null;
35
+ this._damageTypeData = options.type || {};
36
+ this.#createCustomPropertyAccessors();
37
+ }
38
+
39
+ /* -------------------------------------------- */
40
+
41
+ /**
42
+ * The damage type of this roll
43
+ * @type {string}
44
+ */
45
+ get type() {
46
+ return this._damageType;
47
+ }
48
+
49
+ /**
50
+ * The icon associated with this damage type
51
+ * @type {string}
52
+ */
53
+ get icon() {
54
+ return this._damageTypeData.icon || '';
55
+ }
56
+
57
+ /**
58
+ * The color associated with this damage type
59
+ * @type {string}
60
+ */
61
+ get color() {
62
+ return this._damageTypeData.color || '#ffffff';
63
+ }
64
+
65
+ /**
66
+ * Get a custom metadata property for this damage type
67
+ * @param {string} key - The property key
68
+ * @returns {*} The property value
69
+ */
70
+ getMetadata(key) {
71
+ return this._damageTypeData[key];
72
+ }
73
+
74
+ /**
75
+ * Get all custom metadata for this damage type
76
+ * @returns {object} All metadata properties
77
+ */
78
+ get metadata() {
79
+ return this._damageTypeData;
80
+ }
81
+
82
+ /**
83
+ * Access custom properties directly on the roll
84
+ * Enables usage like: damageRoll.physical, damageRoll.magical, etc.
85
+ */
86
+ #createCustomPropertyAccessors() {
87
+ if (this._damageTypeData) {
88
+ for (const [key, value] of Object.entries(this._damageTypeData)) {
89
+ if (!this.hasOwnProperty(key) && !this.constructor.prototype.hasOwnProperty(key)) {
90
+ Object.defineProperty(this, key, {
91
+ get: () => value,
92
+ enumerable: true,
93
+ configurable: true
94
+ });
95
+ }
96
+ }
97
+ }
98
+ }
99
+
100
+ /* -------------------------------------------- */
101
+
102
+ /** @override */
103
+ async getTooltip() {
104
+ let tooltip = await super.getTooltip();
105
+
106
+ // Add damage type information to tooltip
107
+ if (this.type) {
108
+ // Add data attribute for styling
109
+ tooltip = tooltip.replace('<div class="dice-tooltip"',
110
+ \`<div class="dice-tooltip damage-tooltip" data-damage-type="\${this.type}"\`);
111
+ }
112
+
113
+ // Build damage metadata section if we have metadata
114
+ if (this._damageTypeData && Object.keys(this._damageTypeData).length > 0) {
115
+ let metadataHtml = '<div class="damage-metadata" style="display: flex; gap: 0.5em; align-items: center;">';
116
+
117
+ // Add damage type with icon and color if available
118
+ if (this.type) {
119
+ metadataHtml += \`<span class="damage-property" data-property="type">Type: <span style="color: \${this.color};">\${this.type}</span></span>\`;
120
+ }
121
+
122
+ // Add custom metadata properties (excluding standard ones)
123
+ const excludedKeys = ['value', 'icon', 'color', 'label'];
124
+ const customProperties = Object.entries(this._damageTypeData)
125
+ .filter(([key]) => !excludedKeys.includes(key));
126
+
127
+ for (const [key, value] of customProperties) {
128
+ if (value !== null && value !== undefined && value !== '') {
129
+ metadataHtml += \`<span class="damage-property" data-property="\${key}">\${key}: \${value}</span>\`;
130
+ }
131
+ }
132
+
133
+ metadataHtml += '</div>';
134
+
135
+ const wrapper = document.createElement('div');
136
+ wrapper.innerHTML = tooltip;
137
+
138
+ // Choose the last .dice-tooltip (or use querySelector to pick a specific one)
139
+ const tips = wrapper.querySelectorAll('.dice-tooltip');
140
+ if (tips.length > 0) {
141
+ const tip = tips[tips.length - 1];
142
+ tip.insertAdjacentHTML('beforeend', metadataHtml);
143
+ tooltip = wrapper.innerHTML;
144
+ } else {
145
+ // fallback: append at end if no container found
146
+ tooltip += metadataHtml;
147
+ }
148
+ }
149
+
150
+ return tooltip;
151
+ }
152
+
153
+ /* -------------------------------------------- */
154
+
155
+ /**
156
+ * Create a DamageRoll from a damage() function call
157
+ * @param {string} formula - The dice formula
158
+ * @param {string} damageType - The damage type value
159
+ * @param {object} damageTypeData - The metadata associated with the damage type
160
+ * @param {object} data - Roll data context
161
+ * @param {object} options - Additional roll options
162
+ * @returns {${entry.config.name}DamageRoll}
163
+ */
164
+ static create(baseRoll, options = {}) {
165
+ const roll = new this(baseRoll._formula, baseRoll.data, options);
166
+ roll.#createCustomPropertyAccessors();
167
+ return roll;
168
+ }
169
+ }
170
+ `.appendNewLineIfNotEmpty();
171
+ fs.writeFileSync(generatedFilePath, toString(fileNode));
172
+ }
173
+ //# sourceMappingURL=damage-roll-generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"damage-roll-generator.js","sourceRoot":"","sources":["../../../src/cli/components/damage-roll-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,MAAM,UAAU,kBAAkB,CAAC,KAAY,EAAE,EAAU,EAAE,WAAmB;IAC5E,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnE,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAEzE,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE;QAClC,EAAE,CAAC,SAAS,CAAC,gBAAgB,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;KACvD;IAED,MAAM,QAAQ,GAAG,YAAY,CAAA;iBAChB,KAAK,CAAC,MAAM,CAAC,IAAI;;;;;+BAKH,KAAK,CAAC,MAAM,CAAC,IAAI,sBAAsB,KAAK,CAAC,MAAM,CAAC,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAkJ5D,KAAK,CAAC,MAAM,CAAC,IAAI;;;;;;;;KAQvC,CAAC,uBAAuB,EAAE,CAAC;IAE5B,EAAE,CAAC,aAAa,CAAC,iBAAiB,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC5D,CAAC"}