@mulmoclaude/accounting-plugin 3.0.1 → 4.0.0

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/dist/vue.js CHANGED
@@ -5441,6 +5441,12 @@ function summariseEntry(json, translate) {
5441
5441
  if (!entryId || !date) return null;
5442
5442
  return translate("pluginAccounting.preview.entry", { date });
5443
5443
  }
5444
+ /** UNREACHABLE on the live path, deliberately. Only `getReport` produces a
5445
+ * `profitLoss` payload, and it is not in `PREVIEW_ACTIONS`, so the bridge never
5446
+ * posts its result and no card is rendered to summarise. Kept because the
5447
+ * decision is one line to reverse (#2716) and because the tests below pin the
5448
+ * formatting for whoever reverses it — but a passing test here is NOT evidence
5449
+ * that anything renders. */
5444
5450
  function summarisePl(json, translate) {
5445
5451
  const { profitLoss } = json;
5446
5452
  if (!isRecord(profitLoss)) return null;
@@ -5452,6 +5458,7 @@ function summarisePl(json, translate) {
5452
5458
  net: formatAmountNumeric(netIncome)
5453
5459
  });
5454
5460
  }
5461
+ /** UNREACHABLE on the live path, for the same reason as `summarisePl` above. */
5455
5462
  function summariseBs(json, translate) {
5456
5463
  const { balanceSheet } = json;
5457
5464
  if (!isRecord(balanceSheet)) return null;
@@ -5480,15 +5487,16 @@ function summariseFallback(json, translate) {
5480
5487
  if (bookId !== void 0) return translate("pluginAccounting.previewSummary", { bookId });
5481
5488
  return translate("pluginAccounting.previewGeneric");
5482
5489
  }
5483
- /** Merge the two props a host might carry the payload on. `isRecord` rejects
5484
- * arrays, which the old `typeof value === "object"` check spread into the
5485
- * payload. */
5490
+ /** The payload as a record, or an empty one. `isRecord` rejects arrays, which
5491
+ * the old `typeof value === "object"` check spread into the payload. */
5486
5492
  var asPayload = (value) => isRecord(value) ? value : {};
5487
- function summarisePreview(data, jsonData, translate) {
5488
- const json = {
5489
- ...asPayload(data),
5490
- ...asPayload(jsonData)
5491
- };
5493
+ /** `data` is `ToolResult.data` — the only place the payload arrives. There used
5494
+ * to be a second `jsonData` parameter merged over it, for "hosts that carry it
5495
+ * there"; no host ever did and the router only ever writes `data`
5496
+ * (`router.ts`), so it was dead weight on a function whose whole job is to
5497
+ * pick a branch. */
5498
+ function summarisePreview(data, translate) {
5499
+ const json = asPayload(data);
5492
5500
  return summariseError(json, translate) ?? summariseEntry(json, translate) ?? summarisePl(json, translate) ?? summariseBs(json, translate) ?? summariseBook(json, translate) ?? summariseFallback(json, translate);
5493
5501
  }
5494
5502
  //#endregion
@@ -5501,14 +5509,11 @@ var _hoisted_1 = {
5501
5509
  //#region src/vue/Preview.vue
5502
5510
  var Preview_default = /* @__PURE__ */ defineComponent({
5503
5511
  __name: "Preview",
5504
- props: {
5505
- data: {},
5506
- jsonData: {}
5507
- },
5512
+ props: { result: {} },
5508
5513
  setup(__props) {
5509
5514
  const { t } = useAccountingI18n();
5510
5515
  const props = __props;
5511
- const summary = computed(() => summarisePreview(props.data, props.jsonData, t));
5516
+ const summary = computed(() => summarisePreview(props.result.data, t));
5512
5517
  return (_ctx, _cache) => {
5513
5518
  return openBlock(), createElementBlock("div", _hoisted_1, [_cache[0] || (_cache[0] = createElementVNode("span", { class: "material-icons text-base align-middle mr-1" }, "account_balance", -1)), createElementVNode("span", null, toDisplayString(summary.value), 1)]);
5514
5519
  };