@dialecte/scl 0.2.10 → 0.2.12

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.
@@ -24445,6 +24445,7 @@ var dt = {
24445
24445
  ".ssd",
24446
24446
  ".scd",
24447
24447
  ".isd",
24448
+ ".icd",
24448
24449
  ".xml"
24449
24450
  ],
24450
24451
  hooks: ot()
@@ -24771,60 +24772,155 @@ var Y = {
24771
24772
  query: xt,
24772
24773
  transaction: /* @__PURE__ */ o({ addEntry: () => St })
24773
24774
  }, Ct = {
24774
- LNode: [
24775
- "prefix",
24776
- "lnClass",
24777
- "lnInst"
24778
- ],
24779
- LN: [
24775
+ LNode: {
24776
+ compact: [
24777
+ "prefix",
24778
+ "lnClass",
24779
+ "lnInst"
24780
+ ],
24781
+ full: "{iedName}/{ldInst}/{prefix}{lnClass}{lnInst}"
24782
+ },
24783
+ LN: { compact: [
24780
24784
  "prefix",
24781
24785
  "lnClass",
24782
24786
  "inst"
24783
- ],
24784
- LN0: [
24787
+ ] },
24788
+ LN0: { compact: [
24785
24789
  "prefix",
24786
24790
  "lnClass",
24787
24791
  "inst"
24788
- ],
24789
- LDevice: ["inst"],
24790
- ConnectedAP: ["iedName", "apName"],
24791
- GSE: ["ldInst", "cbName"],
24792
- SMV: ["ldInst", "cbName"],
24793
- Private: ["type"],
24794
- EnumVal: ["ord"],
24795
- Association: ["associationID"],
24796
- ConnectivityNode: ["pathName"],
24797
- ControlRef: ["output", "outputInst"],
24798
- SourceRef: ["input", "inputInst"],
24799
- FunctionRoleContent: ["roleInst"],
24800
- Resource: ["resInst"],
24801
- Hitem: ["version", "revision"],
24802
- History: ["version", "revision"]
24803
- }, wt = {
24804
- ConnectedAP: " / ",
24805
- GSE: "/",
24806
- SMV: "/",
24807
- Hitem: ".",
24808
- History: ".",
24809
- ControlRef: "/",
24810
- SourceRef: "/"
24792
+ ] },
24793
+ LDevice: { compact: ["inst"] },
24794
+ ConnectedAP: {
24795
+ compact: ["iedName", "apName"],
24796
+ separator: "/"
24797
+ },
24798
+ GSE: {
24799
+ compact: ["ldInst", "cbName"],
24800
+ separator: "/"
24801
+ },
24802
+ SMV: {
24803
+ compact: ["ldInst", "cbName"],
24804
+ separator: "/"
24805
+ },
24806
+ Private: { compact: ["type"] },
24807
+ EnumVal: { compact: ["ord"] },
24808
+ Association: { compact: ["associationID"] },
24809
+ ConnectivityNode: { compact: ["pathName"] },
24810
+ FunctionRoleContent: { compact: ["roleInst"] },
24811
+ Resource: { compact: ["resInst"] },
24812
+ Hitem: {
24813
+ compact: ["version", "revision"],
24814
+ separator: "."
24815
+ },
24816
+ History: {
24817
+ compact: ["version", "revision"],
24818
+ separator: "."
24819
+ },
24820
+ ControlRef: { compact: "{output}[{outputInst}]/{pLN}.{pDO}/{controlled}" },
24821
+ SourceRef: {
24822
+ compact: "{pLN}.{pDO}.{pDA}",
24823
+ full: "{service}/Input[{inputInst}]/{pLN}.{pDO}.{pDA}/{source}"
24824
+ },
24825
+ FunctionCatRef: { compact: ["function"] },
24826
+ FunctionRef: { compact: ["function"] },
24827
+ AllocationRoleRef: { compact: ["allocationRole"] },
24828
+ PowerSystemRelationRef: { compact: ["powerSystemRelation"] },
24829
+ BehaviorDescriptionRef: { compact: ["behaviorDescription"] },
24830
+ ProcessResourceRef: { compact: ["processResource"] },
24831
+ LNodeDataRef: { compact: ["data"] },
24832
+ FunctionCategoryRef: { compact: ["functionCategory"] },
24833
+ LNodeInputRef: { compact: ["sourceRef"] },
24834
+ LNodeOutputRef: { compact: ["controlRef"] },
24835
+ ApplicationScRef: {
24836
+ compact: "{fileType} v{version}.{revision}",
24837
+ full: "{fileUuid}/{fileType} v{version}.{revision}"
24838
+ },
24839
+ LNodeSpecNaming: { compact: "{sIedName}/{sLdInst}/{sPrefix}{sLnClass}{sLnInst}" },
24840
+ SubscriberLNode: {
24841
+ compact: "{pLN}({service})",
24842
+ full: "{resourceName}/{inputName}/{pLN}({service})"
24843
+ },
24844
+ ControllingLNode: {
24845
+ compact: ["pLN"],
24846
+ full: "{resourceName}/{pLN}"
24847
+ },
24848
+ InputVar: { compact: "{varName}:{inputName}" },
24849
+ OutputVar: { compact: "{varName}:{outputName}" },
24850
+ ExtRef: {
24851
+ compact: "{iedName}/{ldInst}/{prefix}{lnClass}{lnInst}.{doName}.{daName}/{srcCBName}",
24852
+ full: "{pServT}/{intAddr}/{pLN}.{pDO}.{pDA}/{iedName}/{ldInst}/{prefix}{lnClass}{lnInst}.{doName}.{daName}/{srcCBName}"
24853
+ },
24854
+ FCDA: {
24855
+ compact: "{ldInst}/{prefix}{lnClass}{lnInst}.{doName}.{daName}[{fc}]",
24856
+ full: "{ldInst}/{prefix}{lnClass}{lnInst}.{doName}.{daName}[{fc}][{ix}]"
24857
+ }
24811
24858
  };
24812
24859
  //#endregion
24813
24860
  //#region src/v2019C1/extensions/presentation/query/extract-element-title.ts
24814
- async function Tt(e, t) {
24815
- let n = await e.getRecord(t);
24816
- if (!n) return "";
24817
- let r = n.tagName, i = await e.any.getAttributes(n), a = Ct[r];
24861
+ async function wt(e, t, n = {}) {
24862
+ let r = await e.getRecord(t);
24863
+ if (!r) return n.withLabels ? {
24864
+ title: "",
24865
+ labels: {}
24866
+ } : "";
24867
+ let i = r.tagName, a = Tt({
24868
+ tag: i,
24869
+ mode: n.mode ?? "compact",
24870
+ attributes: await e.any.getAttributes(r),
24871
+ value: r.value
24872
+ });
24873
+ return n.withLabels ? {
24874
+ title: a,
24875
+ labels: await Et(e, r)
24876
+ } : a;
24877
+ }
24878
+ function Tt(e) {
24879
+ let { tag: t, mode: n, attributes: r, value: i } = e, a = Ct[t];
24818
24880
  if (a) {
24819
- let e = wt[r] ?? "", t = a.map((e) => i[e]).filter(Boolean);
24820
- return t.length > 0 ? t.join(e) : r;
24881
+ let e = kt(a, r, n);
24882
+ if (e) return e;
24821
24883
  }
24822
- let o = m[r]?.attributes?.identityFields, s = o?.find((e) => e === "name" || e === "id") ?? o?.[0];
24823
- return s ? i[s] || r : i.name || r;
24884
+ let o = (i ?? "").trim();
24885
+ if (o) return o;
24886
+ let s = m[t]?.attributes?.identityFields, c = s?.find((e) => e === "name" || e === "id") ?? s?.[0];
24887
+ return c && r[c] ? r[c] : r.name || t;
24888
+ }
24889
+ async function Et(e, t) {
24890
+ return Ot(await Dt(e, t));
24891
+ }
24892
+ async function Dt(e, t) {
24893
+ let n = [], r = await e.any.getChildren(t, "Labels");
24894
+ for (let t of r) {
24895
+ let r = await e.any.getChildren(t, "Label");
24896
+ for (let t of r) {
24897
+ let r = await e.any.getAttributes(t), i = (r.lang ?? "").toLowerCase(), a = (t.value ?? "").trim();
24898
+ i && a && n.push({
24899
+ lang: i,
24900
+ id: r.id ?? "",
24901
+ text: a
24902
+ });
24903
+ }
24904
+ }
24905
+ return n;
24906
+ }
24907
+ function Ot(e) {
24908
+ let t = {};
24909
+ for (let { lang: n, id: r, text: i } of e) (t[n] ??= {})[r] = i;
24910
+ return t;
24911
+ }
24912
+ function kt(e, t, n) {
24913
+ let r = n === "full" && e.full !== void 0, i = r ? e.full : e.compact, a = r ? e.fullSeparator ?? e.separator ?? "" : e.separator ?? "";
24914
+ if (typeof i == "string") return At(i, t);
24915
+ let o = i.map((e) => t[e]).filter(Boolean);
24916
+ return o.length > 0 ? o.join(a) : "";
24917
+ }
24918
+ function At(e, t) {
24919
+ return e.replace(/\{([a-zA-Z_][a-zA-Z0-9_]*)\}/g, (e, n) => t[n] ?? "").replace(/\[\]/g, "").replace(/\(\)/g, "").split("/").map((e) => e.split(".").filter((e) => e !== "").join(".")).filter((e) => e !== "").join("/");
24824
24920
  }
24825
24921
  //#endregion
24826
24922
  //#region src/v2019C1/extensions/presentation/index.ts
24827
- var Et = { query: /* @__PURE__ */ o({ extractElementTitle: () => Tt }) };
24923
+ var jt = { query: /* @__PURE__ */ o({ extractElementTitle: () => wt }) };
24828
24924
  //#endregion
24829
24925
  //#region src/v2019C1/extensions/template/transaction/ensure-substation-structure.ts
24830
24926
  async function X(e) {
@@ -24846,12 +24942,12 @@ async function X(e) {
24846
24942
  }
24847
24943
  //#endregion
24848
24944
  //#region src/v2019C1/extensions/template/transaction/shared/clone-utils.ts
24849
- var Dt = {
24945
+ var Mt = {
24850
24946
  scope: "tree",
24851
24947
  attributes: ["templateUuid", "originUuid"]
24852
24948
  };
24853
24949
  async function Z(e, t) {
24854
- let { sourceQuery: r, ref: i, targetParent: a, omit: o, promoteRoot: s, strip: c = Dt } = t, l = await r.getTree(i, { omit: o });
24950
+ let { sourceQuery: r, ref: i, targetParent: a, omit: o, promoteRoot: s, strip: c = Mt } = t, l = await r.getTree(i, { omit: o });
24855
24951
  if (!l) return;
24856
24952
  let u = s && l.tagName === s.from ? {
24857
24953
  ...l,
@@ -24864,7 +24960,7 @@ async function Z(e, t) {
24864
24960
  }
24865
24961
  //#endregion
24866
24962
  //#region src/v2019C1/extensions/template/transaction/shared/extract-data-model.ts
24867
- async function Ot(e, t) {
24963
+ async function Nt(e, t) {
24868
24964
  let { sourceQuery: n, scopeRef: r } = t, { LNode: i = [] } = await n.findDescendants(r, { collect: "LNode" });
24869
24965
  i.length > 0 && await q.transaction.extract(e, {
24870
24966
  sourceQuery: n,
@@ -24887,7 +24983,7 @@ async function Q(e, t, n) {
24887
24983
  }
24888
24984
  //#endregion
24889
24985
  //#region src/v2019C1/extensions/template/transaction/shared/clone-function.ts
24890
- async function kt(e, t) {
24986
+ async function Pt(e, t) {
24891
24987
  let { sourceQuery: n, functionRef: r, targetParentRef: i, omit: a, stripRootAttributes: o } = t;
24892
24988
  await Z(e, {
24893
24989
  sourceQuery: n,
@@ -24902,15 +24998,15 @@ async function kt(e, t) {
24902
24998
  scope: "root",
24903
24999
  attributes: [...o]
24904
25000
  } : !1
24905
- }), await Ot(e, {
25001
+ }), await Nt(e, {
24906
25002
  sourceQuery: n,
24907
25003
  scopeRef: r
24908
25004
  });
24909
25005
  }
24910
- async function At(e, t) {
24911
- let { sourceQuery: n, functionRef: r, structure: i, stripCategoriesUuid: a = !0 } = t, o = await jt(n, r);
25006
+ async function Ft(e, t) {
25007
+ let { sourceQuery: n, functionRef: r, structure: i, stripCategoriesUuid: a = !0 } = t, o = await It(n, r);
24912
25008
  for (let t of o) {
24913
- if (await Nt(e, n, t)) continue;
25009
+ if (await Rt(e, n, t)) continue;
24914
25010
  let r = {
24915
25011
  tagName: "FunctionCategory",
24916
25012
  id: t
@@ -24923,12 +25019,12 @@ async function At(e, t) {
24923
25019
  });
24924
25020
  }
24925
25021
  }
24926
- async function jt(e, t) {
24927
- let n = await Mt(e, t), r = /* @__PURE__ */ new Set();
25022
+ async function It(e, t) {
25023
+ let n = await Lt(e, t), r = /* @__PURE__ */ new Set();
24928
25024
  for (let { container: e } of n) e && r.add(e.id);
24929
25025
  return r;
24930
25026
  }
24931
- async function Mt(e, t) {
25027
+ async function Lt(e, t) {
24932
25028
  let n = await F.query.findRefsPointingTo(e, {
24933
25029
  target: t,
24934
25030
  containerTagName: "FunctionCategory"
@@ -24945,7 +25041,7 @@ async function Mt(e, t) {
24945
25041
  }
24946
25042
  return n;
24947
25043
  }
24948
- async function Nt(e, t, n) {
25044
+ async function Rt(e, t, n) {
24949
25045
  let r = await t.getRecord({
24950
25046
  tagName: "FunctionCategory",
24951
25047
  id: n
@@ -24961,7 +25057,7 @@ async function Nt(e, t, n) {
24961
25057
  }
24962
25058
  //#endregion
24963
25059
  //#region src/v2019C1/extensions/template/transaction/shared/clone-referenced.ts
24964
- async function Pt(e, t) {
25060
+ async function zt(e, t) {
24965
25061
  let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a } = t, o = N[i][0].attribute.uuid, { [i]: s = [] } = await n.findDescendants(r, { collect: i }), c = /* @__PURE__ */ new Set();
24966
25062
  for (let e of s) {
24967
25063
  let t = e.attributes.find((e) => e.name === o)?.value;
@@ -24985,8 +25081,8 @@ async function Pt(e, t) {
24985
25081
  }
24986
25082
  return l;
24987
25083
  }
24988
- async function Ft(e, t) {
24989
- let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a, targetParent: o, omit: s } = t, c = await Pt(e, {
25084
+ async function Bt(e, t) {
25085
+ let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a, targetParent: o, omit: s } = t, c = await zt(e, {
24990
25086
  sourceQuery: n,
24991
25087
  scopeRef: r,
24992
25088
  refTagName: i,
@@ -24999,8 +25095,8 @@ async function Ft(e, t) {
24999
25095
  omit: s
25000
25096
  });
25001
25097
  }
25002
- async function It(e, t) {
25003
- let { sourceQuery: n, scopeTagName: r, scopeRef: i, targetParent: a, skip: o = /* @__PURE__ */ new Set(), omit: s } = t, c = u[r].filter((e) => e in N && !o.has(e)), l = Ft;
25098
+ async function Vt(e, t) {
25099
+ let { sourceQuery: n, scopeTagName: r, scopeRef: i, targetParent: a, skip: o = /* @__PURE__ */ new Set(), omit: s } = t, c = u[r].filter((e) => e in N && !o.has(e)), l = Bt;
25004
25100
  for (let t of c) for (let r of N[t]) for (let o of r.target) await l(e, {
25005
25101
  sourceQuery: n,
25006
25102
  scopeRef: i,
@@ -25017,7 +25113,7 @@ var $ = [
25017
25113
  "ApplicationSclRef",
25018
25114
  "GeneralEquipment",
25019
25115
  "ConductingEquipment"
25020
- ], Lt = [
25116
+ ], Ht = [
25021
25117
  ...$,
25022
25118
  "DOS",
25023
25119
  "Labels",
@@ -25030,29 +25126,29 @@ var $ = [
25030
25126
  ];
25031
25127
  //#endregion
25032
25128
  //#region src/v2019C1/extensions/template/transaction/shared/clone-application.ts
25033
- async function Rt(e, t) {
25129
+ async function Ut(e, t) {
25034
25130
  let { sourceQuery: n, applicationRef: r, structure: i } = t, a = {
25035
25131
  tagName: "Substation",
25036
25132
  id: i.Substation.id
25037
- }, o = await Pt(e, {
25133
+ }, o = await zt(e, {
25038
25134
  sourceQuery: n,
25039
25135
  scopeRef: r,
25040
25136
  refTagName: "FunctionRef",
25041
25137
  targetTagName: "Function"
25042
25138
  });
25043
- for (let t of o) await kt(e, {
25139
+ for (let t of o) await Pt(e, {
25044
25140
  sourceQuery: n,
25045
25141
  functionRef: t,
25046
25142
  targetParentRef: await Q(n, t, i),
25047
25143
  omit: $
25048
25144
  });
25049
- for (let t of o) await At(e, {
25145
+ for (let t of o) await Ft(e, {
25050
25146
  sourceQuery: n,
25051
25147
  functionRef: t,
25052
25148
  structure: i,
25053
25149
  stripCategoriesUuid: !1
25054
25150
  });
25055
- await It(e, {
25151
+ await Vt(e, {
25056
25152
  sourceQuery: n,
25057
25153
  scopeTagName: "Application",
25058
25154
  scopeRef: r,
@@ -25068,12 +25164,12 @@ async function Rt(e, t) {
25068
25164
  }
25069
25165
  //#endregion
25070
25166
  //#region src/v2019C1/extensions/template/transaction/shared/post-extraction-cleanup.ts
25071
- async function zt(e) {
25167
+ async function Wt(e) {
25072
25168
  await U.transaction.orphanUuidRefs(e), await U.transaction.resetLNode(e), await U.transaction.pruneEmptyContainers(e);
25073
25169
  }
25074
25170
  //#endregion
25075
25171
  //#region src/v2019C1/extensions/template/transaction/asd/extract-to-asd.ts
25076
- async function Bt(e, t) {
25172
+ async function Gt(e, t) {
25077
25173
  let { sourceQuery: n, applicationRef: r, tool: i, who: a, nameStructure: o } = t, s = await X(e), c = await e.getAttribute(r, { name: "name" }) || "Unnamed Application";
25078
25174
  await Y.transaction.addEntry(e, {
25079
25175
  filename: `ASD_${c.replace(/\s+/g, "_")}`,
@@ -25088,15 +25184,15 @@ async function Bt(e, t) {
25088
25184
  what: "ASD initialization",
25089
25185
  why: "Application was extracted from a previous file"
25090
25186
  }
25091
- }), await Rt(e, {
25187
+ }), await Ut(e, {
25092
25188
  sourceQuery: n,
25093
25189
  applicationRef: r,
25094
25190
  structure: s
25095
- }), await zt(e);
25191
+ }), await Wt(e);
25096
25192
  }
25097
25193
  //#endregion
25098
25194
  //#region src/v2019C1/extensions/template/transaction/fsd/extract-to-fsd.ts
25099
- async function Vt(e, t) {
25195
+ async function Kt(e, t) {
25100
25196
  let { sourceQuery: n, functionRef: r, tool: i, who: a, nameStructure: o } = t, s = await X(e), c = {
25101
25197
  tagName: s.Substation.tagName,
25102
25198
  id: s.Substation.id
@@ -25114,31 +25210,31 @@ async function Vt(e, t) {
25114
25210
  what: "FSD initialization",
25115
25211
  why: "Function was extracted from a previous file"
25116
25212
  }
25117
- }), await kt(e, {
25213
+ }), await Pt(e, {
25118
25214
  sourceQuery: n,
25119
25215
  functionRef: r,
25120
25216
  targetParentRef: c,
25121
- omit: Lt,
25217
+ omit: Ht,
25122
25218
  stripRootAttributes: ["templateUuid"]
25123
- }), await At(e, {
25219
+ }), await Ft(e, {
25124
25220
  sourceQuery: n,
25125
25221
  functionRef: r,
25126
25222
  structure: s
25127
- }), await zt(e);
25223
+ }), await Wt(e);
25128
25224
  }
25129
25225
  //#endregion
25130
25226
  //#region src/v2019C1/extensions/index.ts
25131
- var Ht = {
25227
+ var qt = {
25132
25228
  cleanUp: U,
25133
25229
  dataModel: q,
25134
25230
  history: Y,
25135
25231
  reference: F,
25136
25232
  template: { transaction: /* @__PURE__ */ o({
25137
25233
  ensureSubstationTemplateStructure: () => X,
25138
- extractToAsd: () => Bt,
25139
- extractToFsd: () => Vt
25234
+ extractToAsd: () => Gt,
25235
+ extractToFsd: () => Kt
25140
25236
  }) },
25141
- presentation: Et
25237
+ presentation: jt
25142
25238
  };
25143
25239
  //#endregion
25144
- export { V as a, z as i, B as n, dt as o, H as r, Ht as t };
25240
+ export { V as a, z as i, B as n, dt as o, H as r, qt as t };
@@ -1,3 +1,8 @@
1
- export declare const TITLE_FIELDS_OVERRIDE: Partial<Record<string, string[]>>;
2
- export declare const TITLE_SEPARATORS: Partial<Record<string, string>>;
1
+ export type TitleSpec = {
2
+ compact: string | string[];
3
+ full?: string | string[];
4
+ separator?: string;
5
+ fullSeparator?: string;
6
+ };
7
+ export declare const TITLE_FIELDS_OVERRIDE: Partial<Record<string, TitleSpec>>;
3
8
  //# sourceMappingURL=title.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"title.d.ts","sourceRoot":"","sources":["../../../../../src/v2019C1/extensions/presentation/constants/title.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAkBnE,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAQ5D,CAAA"}
1
+ {"version":3,"file":"title.d.ts","sourceRoot":"","sources":["../../../../../src/v2019C1/extensions/presentation/constants/title.ts"],"names":[],"mappings":"AA4BA,MAAM,MAAM,SAAS,GAAG;IACvB,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC1B,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IACxB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,aAAa,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAsFpE,CAAA"}
@@ -1,13 +1,42 @@
1
1
  import { Config } from '../../../config';
2
2
  import { AnyRefOrRecord } from '@dialecte/core';
3
3
  import type * as Core from '@dialecte/core';
4
+ export type ExtractElementTitleOptions = {
5
+ mode?: 'compact' | 'full';
6
+ };
7
+ export type ExtractElementTitleOptionsWithLabels = ExtractElementTitleOptions & {
8
+ withLabels: true;
9
+ };
10
+ /**
11
+ * Rich title payload (returned when `withLabels: true`).
12
+ *
13
+ * - `title` is the engineering identifier computed from override -> text body
14
+ * -> identityFields -> tagName.
15
+ * - `labels` is a two-level map `[lang][id]` → text:
16
+ * - outer key: lowercased BCP 47 language tag (e.g. `en`, `en-us`, `fr`).
17
+ * - inner key: IEC `id` attribute of the `<Label>` element; `''` when absent.
18
+ * Empty object when no `<Labels>` element is present.
19
+ *
20
+ * Typical UI usage:
21
+ * const display = labels[currentLang]?.[''] ?? labels.en?.[''] ?? title
22
+ */
23
+ export type ElementTitle = {
24
+ title: string;
25
+ labels: Record<string, Record<string, string>>;
26
+ };
4
27
  /**
5
28
  * Query extension: extracts a human-readable title for an SCL element.
6
29
  *
7
- * Strategy:
8
- * 1. If the element has a title-field override, concatenate those attributes.
9
- * 2. Otherwise, use `name` > `id` > `inst` from identity fields.
10
- * 3. Fallback: tagName.
30
+ * Default returns the title string. Pass `{ withLabels: true }` to also
31
+ * collect `<Labels>/<Label lang="...">` children (IEC 61850-6 i18n); this
32
+ * incurs extra child-record traversal so it is opt-in.
33
+ *
34
+ * Resolution precedence for the title (first non-empty wins):
35
+ * 1. `TITLE_FIELDS_OVERRIDE` spec for the tag (compact or full).
36
+ * 2. `record.value` (XML text body) - handles BayType, IEDName, Val, etc.
37
+ * 3. `DEFINITION.identityFields` fallback (name > id > first).
38
+ * 4. tagName.
11
39
  */
12
- export declare function extractElementTitle(query: Core.Query<Config>, refOrRecord: AnyRefOrRecord): Promise<string>;
40
+ export declare function extractElementTitle(query: Core.Query<Config>, refOrRecord: AnyRefOrRecord, options: ExtractElementTitleOptionsWithLabels): Promise<ElementTitle>;
41
+ export declare function extractElementTitle(query: Core.Query<Config>, refOrRecord: AnyRefOrRecord, options?: ExtractElementTitleOptions): Promise<string>;
13
42
  //# sourceMappingURL=extract-element-title.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extract-element-title.d.ts","sourceRoot":"","sources":["../../../../../src/v2019C1/extensions/presentation/query/extract-element-title.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAO,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,KAAK,IAAI,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAIpD;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CACxC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EACzB,WAAW,EAAE,cAAc,GACzB,OAAO,CAAC,MAAM,CAAC,CAwBjB"}
1
+ {"version":3,"file":"extract-element-title.d.ts","sourceRoot":"","sources":["../../../../../src/v2019C1/extensions/presentation/query/extract-element-title.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAO,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,KAAK,IAAI,MAAM,gBAAgB,CAAA;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAIpD,MAAM,MAAM,0BAA0B,GAAG;IACxC,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,oCAAoC,GAAG,0BAA0B,GAAG;IAC/E,UAAU,EAAE,IAAI,CAAA;CAChB,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,YAAY,GAAG;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAC9C,CAAA;AAID;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAClC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EACzB,WAAW,EAAE,cAAc,EAC3B,OAAO,EAAE,oCAAoC,GAC3C,OAAO,CAAC,YAAY,CAAC,CAAA;AACxB,wBAAgB,mBAAmB,CAClC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EACzB,WAAW,EAAE,cAAc,EAC3B,OAAO,CAAC,EAAE,0BAA0B,GAClC,OAAO,CAAC,MAAM,CAAC,CAAA"}
@@ -1,4 +1,4 @@
1
- import { a as e, i as t, n, o as r, r as i, t as a } from "../extensions-CwOeOPzF.js";
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "../extensions-LXr0OQFz.js";
2
2
  import { Project as o } from "@dialecte/core";
3
3
  //#region src/v2019C1/dialecte.ts
4
4
  function s(e) {
@@ -1,4 +1,4 @@
1
- import { o as e, r as t, t as n } from "../extensions-CwOeOPzF.js";
1
+ import { o as e, r as t, t as n } from "../extensions-LXr0OQFz.js";
2
2
  import { CUSTOM_RECORD_ID_ATTRIBUTE as r, CUSTOM_RECORD_ID_ATTRIBUTE_NAME as i } from "@dialecte/core/helpers";
3
3
  import { XMLNS_DEV_NAMESPACE as a, createTestProject as o, createTestRecordFactory as s, createTestRunner as c, createXmlAssertions as l } from "@dialecte/core/test";
4
4
  //#region src/v2019C1/test/hydrated-test.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dialecte/scl",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "description": "Dialecte - SCL (Substation Configuration Language) sdk",
5
5
  "license": "MIT",
6
6
  "repository": {