@dialecte/scl 0.2.10 → 0.2.11

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.
@@ -24771,60 +24771,155 @@ var Y = {
24771
24771
  query: xt,
24772
24772
  transaction: /* @__PURE__ */ o({ addEntry: () => St })
24773
24773
  }, Ct = {
24774
- LNode: [
24775
- "prefix",
24776
- "lnClass",
24777
- "lnInst"
24778
- ],
24779
- LN: [
24774
+ LNode: {
24775
+ compact: [
24776
+ "prefix",
24777
+ "lnClass",
24778
+ "lnInst"
24779
+ ],
24780
+ full: "{iedName}/{ldInst}/{prefix}{lnClass}{lnInst}"
24781
+ },
24782
+ LN: { compact: [
24780
24783
  "prefix",
24781
24784
  "lnClass",
24782
24785
  "inst"
24783
- ],
24784
- LN0: [
24786
+ ] },
24787
+ LN0: { compact: [
24785
24788
  "prefix",
24786
24789
  "lnClass",
24787
24790
  "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: "/"
24791
+ ] },
24792
+ LDevice: { compact: ["inst"] },
24793
+ ConnectedAP: {
24794
+ compact: ["iedName", "apName"],
24795
+ separator: "/"
24796
+ },
24797
+ GSE: {
24798
+ compact: ["ldInst", "cbName"],
24799
+ separator: "/"
24800
+ },
24801
+ SMV: {
24802
+ compact: ["ldInst", "cbName"],
24803
+ separator: "/"
24804
+ },
24805
+ Private: { compact: ["type"] },
24806
+ EnumVal: { compact: ["ord"] },
24807
+ Association: { compact: ["associationID"] },
24808
+ ConnectivityNode: { compact: ["pathName"] },
24809
+ FunctionRoleContent: { compact: ["roleInst"] },
24810
+ Resource: { compact: ["resInst"] },
24811
+ Hitem: {
24812
+ compact: ["version", "revision"],
24813
+ separator: "."
24814
+ },
24815
+ History: {
24816
+ compact: ["version", "revision"],
24817
+ separator: "."
24818
+ },
24819
+ ControlRef: { compact: "{output}[{outputInst}]/{pLN}.{pDO}/{controlled}" },
24820
+ SourceRef: {
24821
+ compact: "{pLN}.{pDO}.{pDA}",
24822
+ full: "{service}/Input[{inputInst}]/{pLN}.{pDO}.{pDA}/{source}"
24823
+ },
24824
+ FunctionCatRef: { compact: ["function"] },
24825
+ FunctionRef: { compact: ["function"] },
24826
+ AllocationRoleRef: { compact: ["allocationRole"] },
24827
+ PowerSystemRelationRef: { compact: ["powerSystemRelation"] },
24828
+ BehaviorDescriptionRef: { compact: ["behaviorDescription"] },
24829
+ ProcessResourceRef: { compact: ["processResource"] },
24830
+ LNodeDataRef: { compact: ["data"] },
24831
+ FunctionCategoryRef: { compact: ["functionCategory"] },
24832
+ LNodeInputRef: { compact: ["sourceRef"] },
24833
+ LNodeOutputRef: { compact: ["controlRef"] },
24834
+ ApplicationScRef: {
24835
+ compact: "{fileType} v{version}.{revision}",
24836
+ full: "{fileUuid}/{fileType} v{version}.{revision}"
24837
+ },
24838
+ LNodeSpecNaming: { compact: "{sIedName}/{sLdInst}/{sPrefix}{sLnClass}{sLnInst}" },
24839
+ SubscriberLNode: {
24840
+ compact: "{pLN}({service})",
24841
+ full: "{resourceName}/{inputName}/{pLN}({service})"
24842
+ },
24843
+ ControllingLNode: {
24844
+ compact: ["pLN"],
24845
+ full: "{resourceName}/{pLN}"
24846
+ },
24847
+ InputVar: { compact: "{varName}:{inputName}" },
24848
+ OutputVar: { compact: "{varName}:{outputName}" },
24849
+ ExtRef: {
24850
+ compact: "{iedName}/{ldInst}/{prefix}{lnClass}{lnInst}.{doName}.{daName}/{srcCBName}",
24851
+ full: "{pServT}/{intAddr}/{pLN}.{pDO}.{pDA}/{iedName}/{ldInst}/{prefix}{lnClass}{lnInst}.{doName}.{daName}/{srcCBName}"
24852
+ },
24853
+ FCDA: {
24854
+ compact: "{ldInst}/{prefix}{lnClass}{lnInst}.{doName}.{daName}[{fc}]",
24855
+ full: "{ldInst}/{prefix}{lnClass}{lnInst}.{doName}.{daName}[{fc}][{ix}]"
24856
+ }
24811
24857
  };
24812
24858
  //#endregion
24813
24859
  //#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];
24860
+ async function wt(e, t, n = {}) {
24861
+ let r = await e.getRecord(t);
24862
+ if (!r) return n.withLabels ? {
24863
+ title: "",
24864
+ labels: {}
24865
+ } : "";
24866
+ let i = r.tagName, a = Tt({
24867
+ tag: i,
24868
+ mode: n.mode ?? "compact",
24869
+ attributes: await e.any.getAttributes(r),
24870
+ value: r.value
24871
+ });
24872
+ return n.withLabels ? {
24873
+ title: a,
24874
+ labels: await Et(e, r)
24875
+ } : a;
24876
+ }
24877
+ function Tt(e) {
24878
+ let { tag: t, mode: n, attributes: r, value: i } = e, a = Ct[t];
24818
24879
  if (a) {
24819
- let e = wt[r] ?? "", t = a.map((e) => i[e]).filter(Boolean);
24820
- return t.length > 0 ? t.join(e) : r;
24880
+ let e = kt(a, r, n);
24881
+ if (e) return e;
24821
24882
  }
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;
24883
+ let o = (i ?? "").trim();
24884
+ if (o) return o;
24885
+ let s = m[t]?.attributes?.identityFields, c = s?.find((e) => e === "name" || e === "id") ?? s?.[0];
24886
+ return c && r[c] ? r[c] : r.name || t;
24887
+ }
24888
+ async function Et(e, t) {
24889
+ return Ot(await Dt(e, t));
24890
+ }
24891
+ async function Dt(e, t) {
24892
+ let n = [], r = await e.any.getChildren(t, "Labels");
24893
+ for (let t of r) {
24894
+ let r = await e.any.getChildren(t, "Label");
24895
+ for (let t of r) {
24896
+ let r = await e.any.getAttributes(t), i = (r.lang ?? "").toLowerCase(), a = (t.value ?? "").trim();
24897
+ i && a && n.push({
24898
+ lang: i,
24899
+ id: r.id ?? "",
24900
+ text: a
24901
+ });
24902
+ }
24903
+ }
24904
+ return n;
24905
+ }
24906
+ function Ot(e) {
24907
+ let t = {};
24908
+ for (let { lang: n, id: r, text: i } of e) (t[n] ??= {})[r] = i;
24909
+ return t;
24910
+ }
24911
+ function kt(e, t, n) {
24912
+ let r = n === "full" && e.full !== void 0, i = r ? e.full : e.compact, a = r ? e.fullSeparator ?? e.separator ?? "" : e.separator ?? "";
24913
+ if (typeof i == "string") return At(i, t);
24914
+ let o = i.map((e) => t[e]).filter(Boolean);
24915
+ return o.length > 0 ? o.join(a) : "";
24916
+ }
24917
+ function At(e, t) {
24918
+ 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
24919
  }
24825
24920
  //#endregion
24826
24921
  //#region src/v2019C1/extensions/presentation/index.ts
24827
- var Et = { query: /* @__PURE__ */ o({ extractElementTitle: () => Tt }) };
24922
+ var jt = { query: /* @__PURE__ */ o({ extractElementTitle: () => wt }) };
24828
24923
  //#endregion
24829
24924
  //#region src/v2019C1/extensions/template/transaction/ensure-substation-structure.ts
24830
24925
  async function X(e) {
@@ -24846,12 +24941,12 @@ async function X(e) {
24846
24941
  }
24847
24942
  //#endregion
24848
24943
  //#region src/v2019C1/extensions/template/transaction/shared/clone-utils.ts
24849
- var Dt = {
24944
+ var Mt = {
24850
24945
  scope: "tree",
24851
24946
  attributes: ["templateUuid", "originUuid"]
24852
24947
  };
24853
24948
  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 });
24949
+ let { sourceQuery: r, ref: i, targetParent: a, omit: o, promoteRoot: s, strip: c = Mt } = t, l = await r.getTree(i, { omit: o });
24855
24950
  if (!l) return;
24856
24951
  let u = s && l.tagName === s.from ? {
24857
24952
  ...l,
@@ -24864,7 +24959,7 @@ async function Z(e, t) {
24864
24959
  }
24865
24960
  //#endregion
24866
24961
  //#region src/v2019C1/extensions/template/transaction/shared/extract-data-model.ts
24867
- async function Ot(e, t) {
24962
+ async function Nt(e, t) {
24868
24963
  let { sourceQuery: n, scopeRef: r } = t, { LNode: i = [] } = await n.findDescendants(r, { collect: "LNode" });
24869
24964
  i.length > 0 && await q.transaction.extract(e, {
24870
24965
  sourceQuery: n,
@@ -24887,7 +24982,7 @@ async function Q(e, t, n) {
24887
24982
  }
24888
24983
  //#endregion
24889
24984
  //#region src/v2019C1/extensions/template/transaction/shared/clone-function.ts
24890
- async function kt(e, t) {
24985
+ async function Pt(e, t) {
24891
24986
  let { sourceQuery: n, functionRef: r, targetParentRef: i, omit: a, stripRootAttributes: o } = t;
24892
24987
  await Z(e, {
24893
24988
  sourceQuery: n,
@@ -24902,15 +24997,15 @@ async function kt(e, t) {
24902
24997
  scope: "root",
24903
24998
  attributes: [...o]
24904
24999
  } : !1
24905
- }), await Ot(e, {
25000
+ }), await Nt(e, {
24906
25001
  sourceQuery: n,
24907
25002
  scopeRef: r
24908
25003
  });
24909
25004
  }
24910
- async function At(e, t) {
24911
- let { sourceQuery: n, functionRef: r, structure: i, stripCategoriesUuid: a = !0 } = t, o = await jt(n, r);
25005
+ async function Ft(e, t) {
25006
+ let { sourceQuery: n, functionRef: r, structure: i, stripCategoriesUuid: a = !0 } = t, o = await It(n, r);
24912
25007
  for (let t of o) {
24913
- if (await Nt(e, n, t)) continue;
25008
+ if (await Rt(e, n, t)) continue;
24914
25009
  let r = {
24915
25010
  tagName: "FunctionCategory",
24916
25011
  id: t
@@ -24923,12 +25018,12 @@ async function At(e, t) {
24923
25018
  });
24924
25019
  }
24925
25020
  }
24926
- async function jt(e, t) {
24927
- let n = await Mt(e, t), r = /* @__PURE__ */ new Set();
25021
+ async function It(e, t) {
25022
+ let n = await Lt(e, t), r = /* @__PURE__ */ new Set();
24928
25023
  for (let { container: e } of n) e && r.add(e.id);
24929
25024
  return r;
24930
25025
  }
24931
- async function Mt(e, t) {
25026
+ async function Lt(e, t) {
24932
25027
  let n = await F.query.findRefsPointingTo(e, {
24933
25028
  target: t,
24934
25029
  containerTagName: "FunctionCategory"
@@ -24945,7 +25040,7 @@ async function Mt(e, t) {
24945
25040
  }
24946
25041
  return n;
24947
25042
  }
24948
- async function Nt(e, t, n) {
25043
+ async function Rt(e, t, n) {
24949
25044
  let r = await t.getRecord({
24950
25045
  tagName: "FunctionCategory",
24951
25046
  id: n
@@ -24961,7 +25056,7 @@ async function Nt(e, t, n) {
24961
25056
  }
24962
25057
  //#endregion
24963
25058
  //#region src/v2019C1/extensions/template/transaction/shared/clone-referenced.ts
24964
- async function Pt(e, t) {
25059
+ async function zt(e, t) {
24965
25060
  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
25061
  for (let e of s) {
24967
25062
  let t = e.attributes.find((e) => e.name === o)?.value;
@@ -24985,8 +25080,8 @@ async function Pt(e, t) {
24985
25080
  }
24986
25081
  return l;
24987
25082
  }
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, {
25083
+ async function Bt(e, t) {
25084
+ let { sourceQuery: n, scopeRef: r, refTagName: i, targetTagName: a, targetParent: o, omit: s } = t, c = await zt(e, {
24990
25085
  sourceQuery: n,
24991
25086
  scopeRef: r,
24992
25087
  refTagName: i,
@@ -24999,8 +25094,8 @@ async function Ft(e, t) {
24999
25094
  omit: s
25000
25095
  });
25001
25096
  }
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;
25097
+ async function Vt(e, t) {
25098
+ 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
25099
  for (let t of c) for (let r of N[t]) for (let o of r.target) await l(e, {
25005
25100
  sourceQuery: n,
25006
25101
  scopeRef: i,
@@ -25017,7 +25112,7 @@ var $ = [
25017
25112
  "ApplicationSclRef",
25018
25113
  "GeneralEquipment",
25019
25114
  "ConductingEquipment"
25020
- ], Lt = [
25115
+ ], Ht = [
25021
25116
  ...$,
25022
25117
  "DOS",
25023
25118
  "Labels",
@@ -25030,29 +25125,29 @@ var $ = [
25030
25125
  ];
25031
25126
  //#endregion
25032
25127
  //#region src/v2019C1/extensions/template/transaction/shared/clone-application.ts
25033
- async function Rt(e, t) {
25128
+ async function Ut(e, t) {
25034
25129
  let { sourceQuery: n, applicationRef: r, structure: i } = t, a = {
25035
25130
  tagName: "Substation",
25036
25131
  id: i.Substation.id
25037
- }, o = await Pt(e, {
25132
+ }, o = await zt(e, {
25038
25133
  sourceQuery: n,
25039
25134
  scopeRef: r,
25040
25135
  refTagName: "FunctionRef",
25041
25136
  targetTagName: "Function"
25042
25137
  });
25043
- for (let t of o) await kt(e, {
25138
+ for (let t of o) await Pt(e, {
25044
25139
  sourceQuery: n,
25045
25140
  functionRef: t,
25046
25141
  targetParentRef: await Q(n, t, i),
25047
25142
  omit: $
25048
25143
  });
25049
- for (let t of o) await At(e, {
25144
+ for (let t of o) await Ft(e, {
25050
25145
  sourceQuery: n,
25051
25146
  functionRef: t,
25052
25147
  structure: i,
25053
25148
  stripCategoriesUuid: !1
25054
25149
  });
25055
- await It(e, {
25150
+ await Vt(e, {
25056
25151
  sourceQuery: n,
25057
25152
  scopeTagName: "Application",
25058
25153
  scopeRef: r,
@@ -25068,12 +25163,12 @@ async function Rt(e, t) {
25068
25163
  }
25069
25164
  //#endregion
25070
25165
  //#region src/v2019C1/extensions/template/transaction/shared/post-extraction-cleanup.ts
25071
- async function zt(e) {
25166
+ async function Wt(e) {
25072
25167
  await U.transaction.orphanUuidRefs(e), await U.transaction.resetLNode(e), await U.transaction.pruneEmptyContainers(e);
25073
25168
  }
25074
25169
  //#endregion
25075
25170
  //#region src/v2019C1/extensions/template/transaction/asd/extract-to-asd.ts
25076
- async function Bt(e, t) {
25171
+ async function Gt(e, t) {
25077
25172
  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
25173
  await Y.transaction.addEntry(e, {
25079
25174
  filename: `ASD_${c.replace(/\s+/g, "_")}`,
@@ -25088,15 +25183,15 @@ async function Bt(e, t) {
25088
25183
  what: "ASD initialization",
25089
25184
  why: "Application was extracted from a previous file"
25090
25185
  }
25091
- }), await Rt(e, {
25186
+ }), await Ut(e, {
25092
25187
  sourceQuery: n,
25093
25188
  applicationRef: r,
25094
25189
  structure: s
25095
- }), await zt(e);
25190
+ }), await Wt(e);
25096
25191
  }
25097
25192
  //#endregion
25098
25193
  //#region src/v2019C1/extensions/template/transaction/fsd/extract-to-fsd.ts
25099
- async function Vt(e, t) {
25194
+ async function Kt(e, t) {
25100
25195
  let { sourceQuery: n, functionRef: r, tool: i, who: a, nameStructure: o } = t, s = await X(e), c = {
25101
25196
  tagName: s.Substation.tagName,
25102
25197
  id: s.Substation.id
@@ -25114,31 +25209,31 @@ async function Vt(e, t) {
25114
25209
  what: "FSD initialization",
25115
25210
  why: "Function was extracted from a previous file"
25116
25211
  }
25117
- }), await kt(e, {
25212
+ }), await Pt(e, {
25118
25213
  sourceQuery: n,
25119
25214
  functionRef: r,
25120
25215
  targetParentRef: c,
25121
- omit: Lt,
25216
+ omit: Ht,
25122
25217
  stripRootAttributes: ["templateUuid"]
25123
- }), await At(e, {
25218
+ }), await Ft(e, {
25124
25219
  sourceQuery: n,
25125
25220
  functionRef: r,
25126
25221
  structure: s
25127
- }), await zt(e);
25222
+ }), await Wt(e);
25128
25223
  }
25129
25224
  //#endregion
25130
25225
  //#region src/v2019C1/extensions/index.ts
25131
- var Ht = {
25226
+ var qt = {
25132
25227
  cleanUp: U,
25133
25228
  dataModel: q,
25134
25229
  history: Y,
25135
25230
  reference: F,
25136
25231
  template: { transaction: /* @__PURE__ */ o({
25137
25232
  ensureSubstationTemplateStructure: () => X,
25138
- extractToAsd: () => Bt,
25139
- extractToFsd: () => Vt
25233
+ extractToAsd: () => Gt,
25234
+ extractToFsd: () => Kt
25140
25235
  }) },
25141
- presentation: Et
25236
+ presentation: jt
25142
25237
  };
25143
25238
  //#endregion
25144
- export { V as a, z as i, B as n, dt as o, H as r, Ht as t };
25239
+ 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-CjWWzV7c.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-CjWWzV7c.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.11",
4
4
  "description": "Dialecte - SCL (Substation Configuration Language) sdk",
5
5
  "license": "MIT",
6
6
  "repository": {