intelligent-system-design-language 0.3.27 → 0.3.29
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/out/_isdlStyles.scss +29 -0
- package/out/cli/components/_isdlStyles.scss +29 -0
- package/out/cli/components/active-effect-sheet-generator.js +6 -2
- package/out/cli/components/active-effect-sheet-generator.js.map +1 -1
- package/out/cli/components/css-generator.js +77 -37
- package/out/cli/components/css-generator.js.map +1 -1
- package/out/cli/components/datamodel-generator.js +31 -13
- package/out/cli/components/datamodel-generator.js.map +1 -1
- package/out/cli/components/derived-data-generator.js +5 -2
- package/out/cli/components/derived-data-generator.js.map +1 -1
- package/out/cli/components/init-hook-generator.js +21 -12
- package/out/cli/components/init-hook-generator.js.map +1 -1
- package/out/cli/components/method-generator.js +35 -18
- package/out/cli/components/method-generator.js.map +1 -1
- package/out/cli/components/utils.js +2 -2
- package/out/cli/components/utils.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-attribute.js +5 -4
- package/out/cli/components/vue/base-components/vue-attribute.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-boolean.js +3 -2
- package/out/cli/components/vue/base-components/vue-boolean.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-damage-bonuses.js +3 -2
- package/out/cli/components/vue/base-components/vue-damage-bonuses.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-damage-resistances.js +3 -2
- package/out/cli/components/vue/base-components/vue-damage-resistances.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-damage-track.js +2 -1
- package/out/cli/components/vue/base-components/vue-damage-track.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-date-time.js +3 -2
- package/out/cli/components/vue/base-components/vue-date-time.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-dice.js +2 -1
- package/out/cli/components/vue/base-components/vue-dice.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-die.js +2 -1
- package/out/cli/components/vue/base-components/vue-die.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-document-choice.js +2 -1
- package/out/cli/components/vue/base-components/vue-document-choice.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-document-choices.js +2 -1
- package/out/cli/components/vue/base-components/vue-document-choices.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-document-link.js +2 -1
- package/out/cli/components/vue/base-components/vue-document-link.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-extended-choice.js +2 -1
- package/out/cli/components/vue/base-components/vue-extended-choice.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-image.js +89 -0
- package/out/cli/components/vue/base-components/vue-image.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-inventory.js +2 -1
- package/out/cli/components/vue/base-components/vue-inventory.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-macro-choice.js +2 -1
- package/out/cli/components/vue/base-components/vue-macro-choice.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-measured-template.js +3 -2
- package/out/cli/components/vue/base-components/vue-measured-template.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-money.js +4 -3
- package/out/cli/components/vue/base-components/vue-money.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-number.js +3 -2
- package/out/cli/components/vue/base-components/vue-number.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-paperdoll.js +2 -1
- package/out/cli/components/vue/base-components/vue-paperdoll.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-parent-property-reference.js +5 -1
- package/out/cli/components/vue/base-components/vue-parent-property-reference.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-prosemirror.js +3 -2
- package/out/cli/components/vue/base-components/vue-prosemirror.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-resource.js +2 -1
- package/out/cli/components/vue/base-components/vue-resource.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-roll-visualizer.js +2 -1
- package/out/cli/components/vue/base-components/vue-roll-visualizer.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-self-property-reference.js +2 -1
- package/out/cli/components/vue/base-components/vue-self-property-reference.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-string-choice.js +3 -1
- package/out/cli/components/vue/base-components/vue-string-choice.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-string-choices.js +3 -2
- package/out/cli/components/vue/base-components/vue-string-choices.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-string.js +4 -3
- package/out/cli/components/vue/base-components/vue-string.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-text-field.js +4 -3
- package/out/cli/components/vue/base-components/vue-text-field.js.map +1 -1
- package/out/cli/components/vue/base-components/vue-tracker.js +2 -1
- package/out/cli/components/vue/base-components/vue-tracker.js.map +1 -1
- package/out/cli/components/vue/vue-active-effect-sheet-generator.js +2 -2
- package/out/cli/components/vue/vue-base-components-generator.js +2 -0
- package/out/cli/components/vue/vue-base-components-generator.js.map +1 -1
- package/out/cli/components/vue/vue-datatable2-component-generator.js +158 -22
- package/out/cli/components/vue/vue-datatable2-component-generator.js.map +1 -1
- package/out/cli/components/vue/vue-generator.js +1 -0
- package/out/cli/components/vue/vue-generator.js.map +1 -1
- package/out/cli/components/vue/vue-mixin.js +1 -0
- package/out/cli/components/vue/vue-mixin.js.map +1 -1
- package/out/cli/components/vue/vue-sheet-application-generator.js +101 -53
- package/out/cli/components/vue/vue-sheet-application-generator.js.map +1 -1
- package/out/cli/components/vue/vue-sheet-class-generator.js +89 -2
- package/out/cli/components/vue/vue-sheet-class-generator.js.map +1 -1
- package/out/extension/main.cjs +1195 -662
- package/out/extension/main.cjs.map +3 -3
- package/out/extension/package.json +1 -1
- package/out/language/generated/ast.js +86 -12
- package/out/language/generated/ast.js.map +1 -1
- package/out/language/generated/grammar.js +1062 -654
- package/out/language/generated/grammar.js.map +1 -1
- package/out/language/intelligent-system-design-language-validator.js +60 -11
- package/out/language/intelligent-system-design-language-validator.js.map +1 -1
- package/out/language/isdl-scope-provider.js +6 -4
- package/out/language/isdl-scope-provider.js.map +1 -1
- package/out/language/main.cjs +1195 -662
- package/out/language/main.cjs.map +3 -3
- package/out/package.json +1 -1
- package/out/test/validating/theme.test.js +10 -10
- package/out/test/validating/theme.test.js.map +1 -1
- package/package.json +1 -1
|
@@ -35,6 +35,7 @@ export function generateVueMixin(description) {
|
|
|
35
35
|
"i-money": "MoneyField",
|
|
36
36
|
"i-inventory": "Inventory",
|
|
37
37
|
"i-damage-track": "DamageTrack",
|
|
38
|
+
"i-image": "ImageField",
|
|
38
39
|
};
|
|
39
40
|
const fileNode = expandToNode `
|
|
40
41
|
import { createApp } from "../../../lib/vue.esm-browser.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vue-mixin.js","sourceRoot":"","sources":["../../../../src/cli/components/vue/vue-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEtE,MAAM,UAAU,gBAAgB,CAAC,WAAmB;IAChD,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;IAC3E,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,uBAAuB,CAAC,CAAC;IAE/E,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,gBAAgB,GAAG;QACrB,aAAa,EAAE,WAAW;QAC1B,YAAY,EAAE,UAAU;QACxB,iBAAiB,EAAE,cAAc;QACjC,eAAe,EAAE,aAAa;QAC9B,mBAAmB,EAAE,gBAAgB;QACrC,aAAa,EAAE,WAAW;QAC1B,cAAc,EAAE,YAAY;QAC5B,cAAc,E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AA,0BAA0B,CAAC,MAAM,gBAAgB,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,uBAAuB,EAAE,IAAI,EAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqG/M,CAAC,aAAa,EAAE,CAAC;IAElB,EAAE,CAAC,aAAa,CAAC,iBAAiB,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as path from 'node:path';
|
|
2
2
|
import * as fs from 'node:fs';
|
|
3
3
|
import { expandToNode, joinToNode, toString } from 'langium/generate';
|
|
4
|
-
import { isAccess, isAction, isActor, isConfigFlag, isTheme, isThemeFieldParam, isThemePrimaryParam, isThemeSecondaryParam, isThemeTertiaryParam, isAttributeExp, isAttributeParamMod, isAttributeRollParam, isAttributeFunctionParam, isAttributeStyleParam, isBackgroundParam, isBooleanExp, isBooleanParamValue, isChoiceCustomProperty, isChoiceStringValue, isColorParam, isColumn, isDateExp, isDateTimeExp, isDiceField, isDiceFields, isDieChoicesParam, isDieNoneParam, isDieField, isDocumentChoiceExp, isDocumentChoicesExp, isEntry, isHtmlExp, isIconParam, isImageParam, isLabelParam, isMacroField, isMeasuredTemplateField, isDamageBonusesField, isDamageResistancesField, isPinnedField, isMoneyField, isDamageTrackExp, isDamageTrackTypesParam, isRollVisualizerField, isMethodBlock, isNumberExp, isNumberParamMax, isNumberParamMin, isNumberParamValue, isNumberParamCalculator, isPage, isPaperDollExp, isParentPropertyRefChoiceParam, isParentPropertyRefExp, isSelfPropertyRefExp, isProperty, isResourceExp, isRow, isSection, isSegmentsParameter, isSingleDocumentExp, isSizeParam, isStatusProperty, isStringChoiceField, isDamageTypeChoiceField, isStringChoicesField, isStringExp, isStringExtendedChoice, isStringParamChoices, isStringParamValue, isTableField, isTimeExp, isTrackerExp, isTrackerStyleParameter, isVisibilityParam, isInventoryField, isInventorySlotsParam, isInventoryRowsParam, isInventoryColumnsParam, isInventorySlotSizeParam, isInventoryQuantityParam, isInventoryMoneyParam, isInventorySumParam, isInventorySumMaxParam, isInventorySortParam, isInventoryEmptySlotsParam, isInventorySummaryParam, isWhereParam, isGlobalParam } from "../../../language/generated/ast.js";
|
|
4
|
+
import { isAccess, isAction, isActor, isConfigFlag, isTheme, isThemeFieldParam, isThemePrimaryParam, isThemeSecondaryParam, isThemeTertiaryParam, isAttributeExp, isAttributeParamMod, isAttributeRollParam, isAttributeFunctionParam, isAttributeStyleParam, isBackgroundParam, isBooleanExp, isBooleanParamValue, isChoiceCustomProperty, isChoiceStringValue, isColorParam, isColumn, isDateExp, isDateTimeExp, isDiceField, isDiceFields, isDieChoicesParam, isDieNoneParam, isDieField, isDocumentChoiceExp, isDocumentChoicesExp, isEntry, isHtmlExp, isIconParam, isImageParam, isLabelParam, isMacroField, isMeasuredTemplateField, isDamageBonusesField, isDamageResistancesField, isPinnedField, isMoneyField, isDamageTrackExp, isDamageTrackTypesParam, isRollVisualizerField, isImageField, isImagePrimaryParam, isHideLabelParam, isMethodBlock, isNumberExp, isNumberParamMax, isNumberParamMin, isNumberParamValue, isNumberParamCalculator, isPage, isPaperDollExp, isParentPropertyRefChoiceParam, isParentPropertyRefExp, isSelfPropertyRefExp, isProperty, isResourceExp, isRow, isSection, isSegmentsParameter, isSingleDocumentExp, isSizeParam, isStatusProperty, isStringChoiceField, isDamageTypeChoiceField, isStringChoicesField, isStringExp, isStringExtendedChoice, isStringParamChoices, isStringParamValue, isTableField, isTimeExp, isTrackerExp, isTrackerStyleParameter, isVisibilityParam, isInventoryField, isInventorySlotsParam, isInventoryRowsParam, isInventoryColumnsParam, isInventorySlotSizeParam, isInventoryQuantityParam, isInventoryMoneyParam, isInventorySumParam, isInventorySumMaxParam, isInventorySortParam, isInventoryEmptySlotsParam, isInventorySummaryParam, isWhereParam, isGlobalParam } from "../../../language/generated/ast.js";
|
|
5
5
|
import { getAllOfType, getDocument, getSystemPath, globalGetAllOfType, toMachineIdentifier } from '../utils.js';
|
|
6
6
|
import { AstUtils } from 'langium';
|
|
7
7
|
import { generateActionComponent, generateDocumentPromptApps } from './vue-action-component-generator.js';
|
|
@@ -9,7 +9,7 @@ import { generatePinnedVuetifyDatatableComponent } from './vue-pinned-datatable-
|
|
|
9
9
|
// import {generateDocumentChoiceComponent} from './vue-document-choice-component-generator.js';
|
|
10
10
|
import { generateDocumentChoicesComponent } from './base-components/vue-document-choices.js';
|
|
11
11
|
import { translateBodyExpressionToJavascript, translateExpression, compileVisualizerFormula } from '../method-generator.js';
|
|
12
|
-
import {
|
|
12
|
+
import { themeWidthToInlineStyle, themeHeightToInlineStyle, themePaintToInlineStyle, themeSizingToInlineStyle } from '../css-generator.js';
|
|
13
13
|
import { humanize } from "inflection";
|
|
14
14
|
import { generateVuetifyDatatableComponent } from "./vue-datatable2-component-generator.js";
|
|
15
15
|
import { generateDocumentChoiceComponent } from "./base-components/vue-document-choice.js";
|
|
@@ -497,19 +497,17 @@ function generateVueComponentScript(entry, id, document, destination) {
|
|
|
497
497
|
function generateAttributeRollMethod(attribute) {
|
|
498
498
|
const rollParam = attribute.params.find(isAttributeRollParam);
|
|
499
499
|
if (rollParam) {
|
|
500
|
-
// A block-style `roll: { ... }` is a method body
|
|
501
|
-
//
|
|
502
|
-
//
|
|
503
|
-
// `
|
|
504
|
-
//
|
|
500
|
+
// A block-style `roll: { ... }` is a method body that can call user functions
|
|
501
|
+
// (self.Foo(...)) and mutate the document (self.X += 1). Those need `this`, the action-style
|
|
502
|
+
// flush objects, and a flush/render tail — none of which exist in this <script setup> scope
|
|
503
|
+
// (`this` is undefined, `update` is never declared). So, like `function:`, the block runs as a
|
|
504
|
+
// real sheet method (_on<Attr>AttributeRoll, generated in vue-sheet-class-generator); here we
|
|
505
|
+
// only emit a delegating arrow. An expression-style `roll: roll(...)` (the else branch below)
|
|
506
|
+
// produces a single Roll value we wrap in a chat card and is unaffected.
|
|
505
507
|
if (isMethodBlock(rollParam.roll)) {
|
|
506
508
|
return expandToNode `
|
|
507
|
-
const on${
|
|
508
|
-
|
|
509
|
-
object: document
|
|
510
|
-
};
|
|
511
|
-
let system = context.object.system;
|
|
512
|
-
${translateExpression(entry, id, rollParam.roll, false, attribute)}
|
|
509
|
+
const on${attribute.name}AttributeRoll = async (event) => {
|
|
510
|
+
await document.sheet._on${attribute.name}AttributeRoll(event);
|
|
513
511
|
};
|
|
514
512
|
`;
|
|
515
513
|
}
|
|
@@ -832,6 +830,10 @@ function generateVueComponentTemplate(entry, id, document) {
|
|
|
832
830
|
const firstPagePinned = document.body.filter(isPinnedField); // We explicitly only want top-level pinned fields
|
|
833
831
|
const firstPageInventories = document.body.filter(isInventoryField); // We explicitly only want top-level inventories
|
|
834
832
|
const userColorsEnabled = getUserColorsEnabled(entry);
|
|
833
|
+
// If the author placed a primary image field (one bound to the native `img`), the portrait is
|
|
834
|
+
// rendered inline in their layout -- suppress the default drawer portrait to avoid two of them.
|
|
835
|
+
const hasPrimaryImage = getAllOfType(document.body, isImageField)
|
|
836
|
+
.some(f => f.params.some(p => isImagePrimaryParam(p) && p.value));
|
|
835
837
|
return expandToNode `
|
|
836
838
|
<template>
|
|
837
839
|
<v-app :style="userColorVars">
|
|
@@ -854,11 +856,11 @@ function generateVueComponentTemplate(entry, id, document) {
|
|
|
854
856
|
|
|
855
857
|
<!-- Navigation Drawer -->
|
|
856
858
|
<v-navigation-drawer v-model="drawer" temporary style="background-color: #dddddd">
|
|
857
|
-
|
|
859
|
+
${hasPrimaryImage ? '' : expandToNode `<v-img :src="context.document.img" style="background-color: lightgray" data-edit='img' data-action='onEditImage'>
|
|
858
860
|
<template #error>
|
|
859
861
|
<v-img src="/systems/${id}/img/missing-character.png" data-edit='img' data-action='onEditImage'></v-img>
|
|
860
862
|
</template>
|
|
861
|
-
</v-img
|
|
863
|
+
</v-img>`}
|
|
862
864
|
<v-tabs v-model="page" direction="vertical">
|
|
863
865
|
<v-tab value="${document.name.toLowerCase()}" prepend-icon="fa-solid fa-circle-user">${document.name}</v-tab>
|
|
864
866
|
${joinToNode(pages, generateNavListItem, { appendNewLineIfNotEmpty: true })}
|
|
@@ -1020,7 +1022,7 @@ function generateVueComponentTemplate(entry, id, document) {
|
|
|
1020
1022
|
`.appendNewLine();
|
|
1021
1023
|
}
|
|
1022
1024
|
function generateInventoryTabWindow(pageName, element) {
|
|
1023
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
1025
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
1024
1026
|
const systemPath = getSystemPath(element, [], undefined, false);
|
|
1025
1027
|
const iconParam = element.params.find(p => isIconParam(p));
|
|
1026
1028
|
const labelParam = element.params.find(p => isLabelParam(p));
|
|
@@ -1037,25 +1039,26 @@ function generateVueComponentTemplate(entry, id, document) {
|
|
|
1037
1039
|
const emptySlotsParam = element.params.find(isInventoryEmptySlotsParam);
|
|
1038
1040
|
const summaryParam = element.params.find(isInventorySummaryParam);
|
|
1039
1041
|
const label = labelParam ? labelParam.value : `${document.name}.${element.name}`;
|
|
1042
|
+
const hideLabel = element.params.some((p) => isHideLabelParam(p) && p.value);
|
|
1040
1043
|
const icon = iconParam === null || iconParam === void 0 ? void 0 : iconParam.value;
|
|
1041
1044
|
const slots = (_a = slotsParam === null || slotsParam === void 0 ? void 0 : slotsParam.value) !== null && _a !== void 0 ? _a : 20;
|
|
1042
1045
|
const rows = rowsParam === null || rowsParam === void 0 ? void 0 : rowsParam.value;
|
|
1043
1046
|
const slotSize = slotSizeParam ? parseInt(slotSizeParam.value.replace('px', '')) : 60;
|
|
1044
|
-
const documentType = (_b = element.
|
|
1045
|
-
const quantityField = (
|
|
1046
|
-
const moneyField = (
|
|
1047
|
-
const moneyFieldLabel = moneyField ? `${document.name}.${(
|
|
1048
|
-
const moneyFieldIcon = moneyField ? (
|
|
1049
|
-
const sortProperty = (
|
|
1050
|
-
const sortOrder = (
|
|
1051
|
-
const globalAllowed = (
|
|
1052
|
-
const emptySlots = (
|
|
1053
|
-
const summary = (
|
|
1047
|
+
const documentType = (_c = (_b = element.documents[0]) === null || _b === void 0 ? void 0 : _b.ref) === null || _c === void 0 ? void 0 : _c.name.toLowerCase();
|
|
1048
|
+
const quantityField = (_d = quantityParam === null || quantityParam === void 0 ? void 0 : quantityParam.field.ref) === null || _d === void 0 ? void 0 : _d.name.toLowerCase();
|
|
1049
|
+
const moneyField = (_e = moneyParam === null || moneyParam === void 0 ? void 0 : moneyParam.field.ref) === null || _e === void 0 ? void 0 : _e.name.toLowerCase();
|
|
1050
|
+
const moneyFieldLabel = moneyField ? `${document.name}.${(_g = (_f = moneyParam === null || moneyParam === void 0 ? void 0 : moneyParam.field) === null || _f === void 0 ? void 0 : _f.ref) === null || _g === void 0 ? void 0 : _g.name}` : undefined;
|
|
1051
|
+
const moneyFieldIcon = moneyField ? (_k = (_j = (_h = moneyParam === null || moneyParam === void 0 ? void 0 : moneyParam.field) === null || _h === void 0 ? void 0 : _h.ref) === null || _j === void 0 ? void 0 : _j.params.find(isIconParam)) === null || _k === void 0 ? void 0 : _k.value : undefined;
|
|
1052
|
+
const sortProperty = (_l = sortParam === null || sortParam === void 0 ? void 0 : sortParam.property.ref) === null || _l === void 0 ? void 0 : _l.name;
|
|
1053
|
+
const sortOrder = (_m = sortParam === null || sortParam === void 0 ? void 0 : sortParam.order) !== null && _m !== void 0 ? _m : 'asc';
|
|
1054
|
+
const globalAllowed = (_o = globalParam === null || globalParam === void 0 ? void 0 : globalParam.value) !== null && _o !== void 0 ? _o : false;
|
|
1055
|
+
const emptySlots = (_p = emptySlotsParam === null || emptySlotsParam === void 0 ? void 0 : emptySlotsParam.value) !== null && _p !== void 0 ? _p : 'show';
|
|
1056
|
+
const summary = (_q = summaryParam === null || summaryParam === void 0 ? void 0 : summaryParam.value) !== null && _q !== void 0 ? _q : 'full';
|
|
1054
1057
|
// Handle sum properties (can be single or array)
|
|
1055
1058
|
let sumProperties = [];
|
|
1056
1059
|
if (sumParam) {
|
|
1057
1060
|
if (sumParam.properties.property) {
|
|
1058
|
-
sumProperties = [((
|
|
1061
|
+
sumProperties = [((_r = sumParam.properties.property.ref) === null || _r === void 0 ? void 0 : _r.name) || ''];
|
|
1059
1062
|
}
|
|
1060
1063
|
else if (sumParam.properties.properties) {
|
|
1061
1064
|
sumProperties = sumParam.properties.properties
|
|
@@ -1078,7 +1081,7 @@ function generateVueComponentTemplate(entry, id, document) {
|
|
|
1078
1081
|
sumMax = `context.${toString(sumMaxNode)}`;
|
|
1079
1082
|
}
|
|
1080
1083
|
}
|
|
1081
|
-
else if ((
|
|
1084
|
+
else if ((_s = sumMaxParam.values) === null || _s === void 0 ? void 0 : _s.values) {
|
|
1082
1085
|
// It's an array of ints/expressions
|
|
1083
1086
|
const maxValues = sumMaxParam.values.values.map((val) => {
|
|
1084
1087
|
if (typeof val === 'number') {
|
|
@@ -1109,6 +1112,7 @@ function generateVueComponentTemplate(entry, id, document) {
|
|
|
1109
1112
|
systemPath="${systemPath}"
|
|
1110
1113
|
:context="context"
|
|
1111
1114
|
:editMode="editModeRef"
|
|
1115
|
+
${hideLabel ? `:hideLabel="true"` : ''}
|
|
1112
1116
|
${icon ? `icon="${icon}"` : ''}
|
|
1113
1117
|
${slots ? `:maxSlots="${slots}"` : ''}
|
|
1114
1118
|
${rows ? `:rows="${rows}"` : ''}
|
|
@@ -1159,17 +1163,28 @@ function generateVueComponentTemplate(entry, id, document) {
|
|
|
1159
1163
|
`.appendNewLine();
|
|
1160
1164
|
}
|
|
1161
1165
|
function generateElement(element, isTopLevel = false) {
|
|
1162
|
-
var _a;
|
|
1166
|
+
var _a, _b;
|
|
1163
1167
|
// A layout container's `theme: { ... }` compiles to an inline `style="..."` of ACTUAL
|
|
1164
1168
|
// CSS (not `--isdl-*` vars, which would inherit and leak sizing into nested children).
|
|
1165
|
-
//
|
|
1166
|
-
|
|
1167
|
-
|
|
1169
|
+
// The themed style is split by who owns the geometry: WIDTH governs the flex item that
|
|
1170
|
+
// lays out in the row (the OUTER v-col/v-row), so it must ride that element -- putting it
|
|
1171
|
+
// on the inner card lets the column keep its full width and the card just floats inside.
|
|
1172
|
+
// HEIGHT + PAINT (border/bg/text) belong on the visible v-card surface (or the bare
|
|
1173
|
+
// row/column when there is no card). See css-generator's theme*ToInlineStyle helpers.
|
|
1174
|
+
const themeParam = (_a = element.params) === null || _a === void 0 ? void 0 : _a.find(isThemeFieldParam);
|
|
1168
1175
|
if (isSection(element)) {
|
|
1176
|
+
const colStyle = themeWidthToInlineStyle(themeParam);
|
|
1177
|
+
const colAttr = colStyle.length > 0 ? ` style="${colStyle}"` : '';
|
|
1178
|
+
const cardStyle = [themeHeightToInlineStyle(themeParam), themePaintToInlineStyle(themeParam)]
|
|
1179
|
+
.filter(s => s.length > 0).join('; ');
|
|
1180
|
+
const cardAttr = cardStyle.length > 0 ? ` style="${cardStyle}"` : '';
|
|
1181
|
+
// `hideLabel: true` on a section drops its title bar entirely (compact, unlabeled panel).
|
|
1182
|
+
const hideTitle = ((_b = element.params) !== null && _b !== void 0 ? _b : []).some((p) => isHideLabelParam(p) && p.value);
|
|
1183
|
+
const titleNode = hideTitle ? '' : `<v-card-title>{{ game.i18n.localize('${document.name}.${element.name}') }}</v-card-title>`;
|
|
1169
1184
|
return expandToNode `
|
|
1170
|
-
<v-col class="section isdl-section isdl-section-${element.name.toLowerCase()}">
|
|
1171
|
-
<v-card variant="outlined" elevation="4"${
|
|
1172
|
-
|
|
1185
|
+
<v-col class="section isdl-section isdl-section-${element.name.toLowerCase()}"${colAttr}>
|
|
1186
|
+
<v-card variant="outlined" elevation="4"${cardAttr}>
|
|
1187
|
+
${titleNode}
|
|
1173
1188
|
|
|
1174
1189
|
<v-card-text>
|
|
1175
1190
|
<v-row dense>
|
|
@@ -1180,6 +1195,13 @@ function generateVueComponentTemplate(entry, id, document) {
|
|
|
1180
1195
|
</v-col>
|
|
1181
1196
|
`;
|
|
1182
1197
|
}
|
|
1198
|
+
// Bare row/column have no inner card, so sizing AND border ride the element itself.
|
|
1199
|
+
// (background/text are section-only and rejected by the validator, so paint here only ever
|
|
1200
|
+
// yields a border.) themePaintToInlineStyle was previously omitted here -- dropping borders
|
|
1201
|
+
// authored on a row/column.
|
|
1202
|
+
const containerStyle = [themeSizingToInlineStyle(themeParam), themePaintToInlineStyle(themeParam)]
|
|
1203
|
+
.filter(s => s.length > 0).join('; ');
|
|
1204
|
+
const styleAttr = containerStyle.length > 0 ? ` style="${containerStyle}"` : '';
|
|
1183
1205
|
if (isRow(element)) {
|
|
1184
1206
|
return expandToNode `
|
|
1185
1207
|
<v-row dense class="isdl-row"${styleAttr}>
|
|
@@ -1220,7 +1242,11 @@ function generateVueComponentTemplate(entry, id, document) {
|
|
|
1220
1242
|
const iconParam = standardParams.find(p => isIconParam(p));
|
|
1221
1243
|
const colorParam = standardParams.find(p => isColorParam(p));
|
|
1222
1244
|
const label = `${document.name}.${element.name}`;
|
|
1223
|
-
|
|
1245
|
+
// `hideLabel: true` suppresses the field's label text. Passed to every field component
|
|
1246
|
+
// via the shared fragment; each component guards its label render on !hideLabel.
|
|
1247
|
+
const hideLabel = standardParams.some(p => isHideLabelParam(p) && p.value);
|
|
1248
|
+
const baseFragment = `:disabled="isDisabled('${element.name.toLowerCase()}')" v-if="!isHidden('${element.name.toLowerCase()}')"`;
|
|
1249
|
+
const standardParamsFragment = `${baseFragment}${colorParam ? ` color="${colorParam.value}"` : ''}${hideLabel ? ' :hideLabel="true"' : ''}`;
|
|
1224
1250
|
const systemPath = getSystemPath(element, [], undefined, false);
|
|
1225
1251
|
const entry = AstUtils.getContainerOfType(element, isEntry);
|
|
1226
1252
|
// Single choke point for the theme marker: render the field by type, then stamp the
|
|
@@ -1228,7 +1254,7 @@ function generateVueComponentTemplate(entry, id, document) {
|
|
|
1228
1254
|
// Every field branch returns an <i-...> root, so this reaches ALL field types -- no
|
|
1229
1255
|
// per-branch allowlist to drift out of sync as new field types are added.
|
|
1230
1256
|
const fieldComponent = (() => {
|
|
1231
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
|
|
1257
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
|
|
1232
1258
|
if (isRollVisualizerField(element)) {
|
|
1233
1259
|
const { formula, data } = compileVisualizerFormula(entry, id, element);
|
|
1234
1260
|
return expandToNode `
|
|
@@ -1237,6 +1263,7 @@ function generateVueComponentTemplate(entry, id, document) {
|
|
|
1237
1263
|
label="${label}"
|
|
1238
1264
|
${iconParam ? `icon="${iconParam.value}"` : ``}
|
|
1239
1265
|
${colorParam ? `color="${colorParam.value}"` : ``}
|
|
1266
|
+
${hideLabel ? `:hideLabel="true"` : ``}
|
|
1240
1267
|
systemPath="${systemPath}"
|
|
1241
1268
|
:formula='${formula}'
|
|
1242
1269
|
:rollData='${data}'
|
|
@@ -1662,6 +1689,24 @@ function generateVueComponentTemplate(entry, id, document) {
|
|
|
1662
1689
|
</i-measured-template>
|
|
1663
1690
|
`;
|
|
1664
1691
|
}
|
|
1692
|
+
if (isImageField(element)) {
|
|
1693
|
+
// A `primary: true` image binds to the document's native `img` (the movable
|
|
1694
|
+
// portrait); otherwise it stores at its own system path. The edit path is
|
|
1695
|
+
// document-relative ("img" vs "system.<name>") so the sheet's onEditImage handler
|
|
1696
|
+
// reads/writes the right property.
|
|
1697
|
+
const isPrimary = element.params.some(p => isImagePrimaryParam(p) && p.value);
|
|
1698
|
+
const imagePath = isPrimary ? 'img' : systemPath;
|
|
1699
|
+
return expandToNode `
|
|
1700
|
+
<i-image
|
|
1701
|
+
:context="context"
|
|
1702
|
+
label="${label}"
|
|
1703
|
+
icon="${iconParam === null || iconParam === void 0 ? void 0 : iconParam.value}"
|
|
1704
|
+
systemPath="${imagePath}"
|
|
1705
|
+
:primary="${isPrimary}"
|
|
1706
|
+
${standardParamsFragment}>
|
|
1707
|
+
</i-image>
|
|
1708
|
+
`;
|
|
1709
|
+
}
|
|
1665
1710
|
if (isDamageBonusesField(element)) {
|
|
1666
1711
|
return expandToNode `
|
|
1667
1712
|
<i-bonuses
|
|
@@ -1847,6 +1892,7 @@ function generateVueComponentTemplate(entry, id, document) {
|
|
|
1847
1892
|
return expandToNode `
|
|
1848
1893
|
<i-damage-track
|
|
1849
1894
|
label="${label}"
|
|
1895
|
+
${hideLabel ? `:hideLabel="true"` : ''}
|
|
1850
1896
|
systemPath="system.${element.name.toLowerCase()}"
|
|
1851
1897
|
:context="context"
|
|
1852
1898
|
:editMode="editModeRef"
|
|
@@ -1881,9 +1927,10 @@ function generateVueComponentTemplate(entry, id, document) {
|
|
|
1881
1927
|
isWounds = element.tag == "wounds";
|
|
1882
1928
|
}
|
|
1883
1929
|
return expandToNode `
|
|
1884
|
-
<i-tracker
|
|
1930
|
+
<i-tracker
|
|
1885
1931
|
label="${label}"
|
|
1886
|
-
|
|
1932
|
+
${hideLabel ? `:hideLabel="true"` : ''}
|
|
1933
|
+
systemPath="system.${element.name.toLowerCase()}" :context="context"
|
|
1887
1934
|
:visibility="visibilityStates['${element.name.toLowerCase()}'].value"
|
|
1888
1935
|
:editMode="editModeRef"
|
|
1889
1936
|
:primaryColor="${primaryColor}" :secondaryColor="secondaryColor" :tertiaryColor="tertiaryColor"
|
|
@@ -2017,9 +2064,9 @@ function generateVueComponentTemplate(entry, id, document) {
|
|
|
2017
2064
|
// wrapper they have no drop target. The wrapper only exists in the layout
|
|
2018
2065
|
// case (never nested inside a .tabs-container), so no double drop binding.
|
|
2019
2066
|
return expandToNode `
|
|
2020
|
-
<
|
|
2067
|
+
<v-col class="pa-1 datatable-drop-zone" cols="12" v-if="!isHidden('${element.name.toLowerCase()}')">
|
|
2021
2068
|
<${componentName} systemPath="${systemPath}" :context="context" :primaryColor="primaryColor" :secondaryColor="secondaryColor" :tertiaryColor="tertiaryColor"></${componentName}>
|
|
2022
|
-
</
|
|
2069
|
+
</v-col>
|
|
2023
2070
|
`.appendNewLine();
|
|
2024
2071
|
}
|
|
2025
2072
|
if (isInventoryField(element)) {
|
|
@@ -2047,21 +2094,21 @@ function generateVueComponentTemplate(entry, id, document) {
|
|
|
2047
2094
|
const rows = rowsParam === null || rowsParam === void 0 ? void 0 : rowsParam.value;
|
|
2048
2095
|
const columns = columnsParam === null || columnsParam === void 0 ? void 0 : columnsParam.value;
|
|
2049
2096
|
const slotSize = slotSizeParam ? parseInt(slotSizeParam.value.replace('px', '')) : 60;
|
|
2050
|
-
const documentType = (_u = element.
|
|
2051
|
-
const quantityField = (
|
|
2052
|
-
const moneyField = (
|
|
2053
|
-
const moneyFieldLabel = moneyField ? `${document.name}.${(
|
|
2054
|
-
const moneyFieldIcon = moneyField ? (
|
|
2055
|
-
const sortProperty = (
|
|
2056
|
-
const sortOrder = (
|
|
2057
|
-
const globalAllowed = (
|
|
2058
|
-
const emptySlots = (
|
|
2059
|
-
const summary = (
|
|
2097
|
+
const documentType = (_v = (_u = element.documents[0]) === null || _u === void 0 ? void 0 : _u.ref) === null || _v === void 0 ? void 0 : _v.name.toLowerCase();
|
|
2098
|
+
const quantityField = (_w = quantityParam === null || quantityParam === void 0 ? void 0 : quantityParam.field.ref) === null || _w === void 0 ? void 0 : _w.name.toLowerCase();
|
|
2099
|
+
const moneyField = (_x = moneyParam === null || moneyParam === void 0 ? void 0 : moneyParam.field.ref) === null || _x === void 0 ? void 0 : _x.name.toLowerCase();
|
|
2100
|
+
const moneyFieldLabel = moneyField ? `${document.name}.${(_z = (_y = moneyParam === null || moneyParam === void 0 ? void 0 : moneyParam.field) === null || _y === void 0 ? void 0 : _y.ref) === null || _z === void 0 ? void 0 : _z.name}` : undefined;
|
|
2101
|
+
const moneyFieldIcon = moneyField ? (_2 = (_1 = (_0 = moneyParam === null || moneyParam === void 0 ? void 0 : moneyParam.field) === null || _0 === void 0 ? void 0 : _0.ref) === null || _1 === void 0 ? void 0 : _1.params.find(isIconParam)) === null || _2 === void 0 ? void 0 : _2.value : undefined;
|
|
2102
|
+
const sortProperty = (_3 = sortParam === null || sortParam === void 0 ? void 0 : sortParam.property.ref) === null || _3 === void 0 ? void 0 : _3.name;
|
|
2103
|
+
const sortOrder = (_4 = sortParam === null || sortParam === void 0 ? void 0 : sortParam.order) !== null && _4 !== void 0 ? _4 : 'asc';
|
|
2104
|
+
const globalAllowed = (_5 = globalParam === null || globalParam === void 0 ? void 0 : globalParam.value) !== null && _5 !== void 0 ? _5 : false;
|
|
2105
|
+
const emptySlots = (_6 = emptySlotsParam === null || emptySlotsParam === void 0 ? void 0 : emptySlotsParam.value) !== null && _6 !== void 0 ? _6 : 'show';
|
|
2106
|
+
const summary = (_7 = summaryParam === null || summaryParam === void 0 ? void 0 : summaryParam.value) !== null && _7 !== void 0 ? _7 : 'full';
|
|
2060
2107
|
// Handle sum properties (can be single or array)
|
|
2061
2108
|
let sumProperties = [];
|
|
2062
2109
|
if (sumParam) {
|
|
2063
2110
|
if (sumParam.properties.property) {
|
|
2064
|
-
sumProperties = [((
|
|
2111
|
+
sumProperties = [((_8 = sumParam.properties.property.ref) === null || _8 === void 0 ? void 0 : _8.name) || ''];
|
|
2065
2112
|
}
|
|
2066
2113
|
else if (sumParam.properties.properties) {
|
|
2067
2114
|
sumProperties = sumParam.properties.properties
|
|
@@ -2084,7 +2131,7 @@ function generateVueComponentTemplate(entry, id, document) {
|
|
|
2084
2131
|
sumMax = `context.${toString(sumMaxNode)}`;
|
|
2085
2132
|
}
|
|
2086
2133
|
}
|
|
2087
|
-
else if ((
|
|
2134
|
+
else if ((_9 = sumMaxParam.values) === null || _9 === void 0 ? void 0 : _9.values) {
|
|
2088
2135
|
// It's an array of ints/expressions
|
|
2089
2136
|
const maxValues = sumMaxParam.values.values.map((val) => {
|
|
2090
2137
|
if (typeof val === 'number') {
|
|
@@ -2115,6 +2162,7 @@ function generateVueComponentTemplate(entry, id, document) {
|
|
|
2115
2162
|
systemPath="${systemPath}"
|
|
2116
2163
|
:context="context"
|
|
2117
2164
|
:editMode="editModeRef"
|
|
2165
|
+
${hideLabel ? `:hideLabel="true"` : ''}
|
|
2118
2166
|
${icon ? `icon="${icon}"` : ''}
|
|
2119
2167
|
${slots ? `:maxSlots="${slots}"` : ''}
|
|
2120
2168
|
${rows ? `:rows="${rows}"` : ''}
|