@septkit/ui 0.0.50 → 0.0.51
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/dialecte/composables/use-active-document.js +26 -23
- package/dist/dialecte/composables/use-live-data.js +13 -13
- package/dist/external/.pnpm/{@dialecte_scl@0.3.9/node_modules/@dialecte/scl/dist/hooks-DO4gUiix.js → @dialecte_scl@0.3.12/node_modules/@dialecte/scl/dist/hooks-Cm_UYBBt.js} +1 -1
- package/dist/external/.pnpm/@dialecte_scl@0.3.12/node_modules/@dialecte/scl/dist/v2019C1/index.js +22 -0
- package/dist/index.d.ts +41 -9
- package/dist/merge/build-view-model.js +71 -60
- package/dist/merge/decision-toggle.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/merge/element-detail.vue_vue_type_script_setup_true_lang.js +139 -67
- package/dist/merge/merge-correlate.js +46 -0
- package/dist/merge/merge-decision.js +6 -0
- package/dist/merge/merge-highlight.js +44 -0
- package/dist/merge/merge-preflight.js +5 -0
- package/dist/merge/merge-preflight.vue_vue_type_script_setup_true_lang.js +41 -0
- package/dist/merge/merge-progress.vue_vue_type_script_setup_true_lang.js +12 -20
- package/dist/merge/merge-review.vue_vue_type_script_setup_true_lang.js +233 -189
- package/dist/merge/merge-tree.vue_vue_type_script_setup_true_lang.js +74 -65
- package/dist/merge/merge.service.js +36 -23
- package/dist/merge/use-document-progress.js +8 -9
- package/dist/merge/use-merge-session.js +122 -111
- package/dist/ui.css +1 -1
- package/package.json +2 -2
- package/dist/external/.pnpm/@dialecte_scl@0.3.9/node_modules/@dialecte/scl/dist/v2019C1/index.js +0 -3
- package/dist/external/.pnpm/@lucide_vue@1.23.0_vue@3.5.39_typescript@5.8.3_/node_modules/@lucide/vue/dist/esm/icons/rotate-ccw.js +0 -11
|
@@ -1,31 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { computed as e, getCurrentScope as t, onScopeDispose as n, ref as r } from "vue";
|
|
2
2
|
//#region lib/dialecte/composables/use-active-document.ts
|
|
3
|
-
function
|
|
4
|
-
let { project:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
if (
|
|
14
|
-
|
|
3
|
+
function i(i) {
|
|
4
|
+
let { project: a, activeDocumentId: o, hydrate: s, clear: c } = i, l = r(), u = e(() => l.value !== void 0), d = r(o.value), f = 0, p = !1;
|
|
5
|
+
function m() {
|
|
6
|
+
l.value = void 0, c?.();
|
|
7
|
+
}
|
|
8
|
+
async function h(e) {
|
|
9
|
+
let t = ++f;
|
|
10
|
+
if (d.value = e, m(), e) try {
|
|
11
|
+
let { ready: n } = await a.getDocumentStatus(e);
|
|
12
|
+
if (p || t !== f) return;
|
|
13
|
+
if (n) {
|
|
14
|
+
let t = a.openDocument(e);
|
|
15
|
+
l.value = t, s?.(t);
|
|
16
|
+
}
|
|
15
17
|
} catch (e) {
|
|
16
|
-
if (
|
|
17
|
-
console.debug("[useActiveDocument] getDocumentStatus failed", e)
|
|
18
|
+
if (p || t !== f) return;
|
|
19
|
+
console.debug("[useActiveDocument] getDocumentStatus failed", e);
|
|
18
20
|
}
|
|
19
21
|
}
|
|
20
|
-
|
|
21
|
-
let
|
|
22
|
-
|
|
22
|
+
h(o.value);
|
|
23
|
+
let g = o.subscribe((e) => void h(e)), _ = () => {
|
|
24
|
+
p || (p = !0, f += 1, g(), m());
|
|
23
25
|
};
|
|
24
|
-
return
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
return t() && n(_), {
|
|
27
|
+
document: l,
|
|
28
|
+
isReady: u,
|
|
29
|
+
activeDocumentId: d,
|
|
30
|
+
stop: _
|
|
28
31
|
};
|
|
29
32
|
}
|
|
30
33
|
//#endregion
|
|
31
|
-
export {
|
|
34
|
+
export { i as useActiveDocument };
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { useDebounceFn as e } from "../../external/.pnpm/@vueuse_shared@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/shared/dist/index.js";
|
|
2
2
|
import { useAsyncState as t } from "../../external/.pnpm/@vueuse_core@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/core/dist/index.js";
|
|
3
3
|
import { useDialecteChannel as n } from "./use-dialecte-channel.js";
|
|
4
|
-
import { computed as r, toValue as i,
|
|
4
|
+
import { computed as r, toValue as i, watch as a } from "vue";
|
|
5
5
|
//#region lib/dialecte/composables/use-live-data.ts
|
|
6
|
-
function
|
|
7
|
-
let { document: s, fetcher: c, initial: l } =
|
|
8
|
-
return
|
|
9
|
-
e?.type === "commit" && e.documentId === h.value
|
|
10
|
-
}),
|
|
11
|
-
u.value = l, m();
|
|
12
|
-
}), {
|
|
6
|
+
function o(o) {
|
|
7
|
+
let { document: s, fetcher: c, initial: l } = o, { state: u, isLoading: d, error: f, execute: p } = t(c, l, { immediate: !1 }), m = e(p, 50), h = r(() => i(s)), { data: g } = n(r(() => h.value?.channelName));
|
|
8
|
+
return a(g, (e) => {
|
|
9
|
+
e?.type === "commit" && e.documentId === h.value?.documentId && m();
|
|
10
|
+
}), a(() => h.value?.documentId, (e) => {
|
|
11
|
+
u.value = l, e && m();
|
|
12
|
+
}, { immediate: !0 }), {
|
|
13
13
|
state: u,
|
|
14
14
|
isLoading: d,
|
|
15
15
|
error: f,
|
|
16
16
|
refresh: p
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
let { project: s, fetcher: c, initial: l } =
|
|
21
|
-
return
|
|
19
|
+
function s(o) {
|
|
20
|
+
let { project: s, fetcher: c, initial: l } = o, { state: u, isLoading: d, error: f, execute: p } = t(c, l, { immediate: !1 }), m = e(p, 50), h = r(() => i(s)?.channelName), { data: g } = n(h);
|
|
21
|
+
return a(g, (e) => {
|
|
22
22
|
switch (e?.type) {
|
|
23
23
|
case "commit":
|
|
24
24
|
case "init-empty-document":
|
|
25
25
|
case "document-removed":
|
|
26
26
|
case "document-imported": m();
|
|
27
27
|
}
|
|
28
|
-
}),
|
|
28
|
+
}), a(h, (e) => {
|
|
29
29
|
u.value = l, e && m();
|
|
30
30
|
}, { immediate: !0 }), {
|
|
31
31
|
state: u,
|
|
@@ -35,4 +35,4 @@ function c(a) {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
//#endregion
|
|
38
|
-
export {
|
|
38
|
+
export { o as useLiveData, s as useProjectLiveData };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { XSI_NAMESPACE as e } from "../../../../../@dialecte_core@0.4.9/node_modules/@dialecte/core/dist/helpers.js";
|
|
2
|
-
//#region node_modules/.pnpm/@dialecte+scl@0.3.
|
|
2
|
+
//#region node_modules/.pnpm/@dialecte+scl@0.3.12/node_modules/@dialecte/scl/dist/hooks-Cm_UYBBt.js
|
|
3
3
|
var t = /* @__PURE__ */ "AccessControl.AccessPoint.Address.AllocationRole.AllocationRoleRef.AnalogueWiringParameters.AnalogueWiringParametersRef.Application.ApplicationSclRef.Association.Authentication.BDA.Bay.BayType.BehaviorDescription.BehaviorDescriptionRef.BehaviorReference.BinaryWiringParameters.BinaryWiringParametersRef.BitRate.CheckoutID.ClientLN.ClientServices.CommProt.Communication.CommunicationServiceSpecifications.ConductingEquipment.ConfDataSet.ConfLNs.ConfLdName.ConfLogControl.ConfReportControl.ConfSG.ConfSigRef.ConnectedAP.ConnectivityNode.ControlRef.ControllingLNode.DA.DAI.DAS.DAType.DO.DOI.DOS.DOType.DataObjectDirectory.DataSet.DataSetDirectory.DataTypeTemplates.DynAssociation.DynDataSet.EnumType.EnumVal.EqFunction.EqSubFunction.ExtCtrl.ExtRef.FCDA.FileHandling.Function.FunctionCatRef.FunctionCategory.FunctionCategoryRef.FunctionRef.FunctionRole.FunctionRoleContent.FunctionSclRef.FunctionTemplate.FunctionalSubVariant.FunctionalVariant.FunctionalVariantGroup.FunctionalVariantRef.GOOSE.GOOSEMcSecurity.GOOSESecurity.GSE.GSEControl.GSEDir.GSESettings.GSSE.GeneralEquipment.GetCBValues.GetDataObjectDefinition.GetDataSetValue.GetDirectory.GooseParameters.GooseParametersRef.Header.History.Hitem.IED.IEDName.IEDSourceFiles.InputVar.InputVarRef.Inputs.IssuerName.KDC.L2CommParameters.L3IPv4CommParameters.L3IPv6CommParameters.LDevice.LN.LN0.LNode.LNodeDataRef.LNodeInputRef.LNodeInputs.LNodeOutputRef.LNodeOutputs.LNodeSpecNaming.LNodeType.Label.Labels.Line.Log.LogControl.LogParameters.LogParametersRef.LogSettings.MaxTime.McSecurity.MinRequestedSCDFile.MinRequestedSCDFiles.MinTime.MultiAPPerSubNet.NeutralPoint.OptFields.OutputVar.OutputVarRef.Outputs.P.PhysConn.PowerSystemRelation.PowerSystemRelationRef.PowerSystemRelations.PowerTransformer.Private.Process.ProcessEcho.ProcessResource.ProcessResourceRef.ProcessResources.Project.ProjectProcessReference.ProtNs.Protocol.ReadWrite.RedProt.ReportControl.ReportParameters.ReportParametersRef.ReportSettings.Resource.RptEnabled.SCL.SCSM.SDI.SDO.SDS.SGEdit.SMV.SMVParameters.SMVParametersRef.SMVSecurity.SMVSettings.SMVsc.SVMcSecurity.SampledValueControl.SamplesPerSec.SclFileReference.SecPerSamples.Security.Server.ServerAt.ServiceSpecifications.Services.SetDataSetValue.SettingControl.SettingGroups.SignalRole.SmpRate.SmvOpts.SourceFiles.SourceRef.SubCategory.SubCheckoutID.SubEquipment.SubFunction.SubFunctionTemplate.SubNetwork.Subject.SubscriberLNode.Substation.SupSubscription.TapChanger.Terminal.Text.TimeSyncProt.TimerActivatedControl.TransformerWinding.TrgOps.Val.ValueHandling.Variable.VariableApplyTo.VariableRef.Voltage.VoltageLevel".split("."), n = {
|
|
4
4
|
AccessControl: {
|
|
5
5
|
tag: "AccessControl",
|
package/dist/external/.pnpm/@dialecte_scl@0.3.12/node_modules/@dialecte/scl/dist/v2019C1/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "../../../../../../@dialecte_core@0.4.9/node_modules/@dialecte/core/dist/index.js";
|
|
2
|
+
import { i as e } from "../hooks-Cm_UYBBt.js";
|
|
3
|
+
//#region node_modules/.pnpm/@dialecte+scl@0.3.12/node_modules/@dialecte/scl/dist/v2019C1/index.js
|
|
4
|
+
var t = {
|
|
5
|
+
"cross-type-template-uuid": {
|
|
6
|
+
title: "Placeholder templateUuid reused across element types",
|
|
7
|
+
description: "One templateUuid is carried by elements of several different types, so it cannot identify a single template element — it is an authoring placeholder, not real lineage.",
|
|
8
|
+
fallback: "Template lineage is ignored for these elements; each instance is recognised by its name within its parent instead, so the merge still proceeds."
|
|
9
|
+
},
|
|
10
|
+
"duplicate-instance-uuid": {
|
|
11
|
+
title: "Duplicate instance uuid",
|
|
12
|
+
description: "The same uuid is used by more than one element. Every instance uuid in an SCL must be unique, so uuid-based identity is ambiguous for the affected elements.",
|
|
13
|
+
fallback: "The affected elements are matched by name and position rather than uuid, so the merge still proceeds — resolve the duplication to restore reliable identity."
|
|
14
|
+
},
|
|
15
|
+
"template-uuid-type-mismatch": {
|
|
16
|
+
title: "templateUuid resolves to a different element type",
|
|
17
|
+
description: "A templateUuid points in-file to an element of a different type than the one carrying it. An instance cannot derive from a template of another type, so the lineage is inconsistent.",
|
|
18
|
+
fallback: "The mismatched lineage is ignored and the element is recognised by name, so the merge still proceeds."
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { t as TEMPLATE_UUID_WARNING_INFO, e as presentationScope };
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ import { Reactive } from 'vue';
|
|
|
21
21
|
import { Ref } from 'vue';
|
|
22
22
|
import { Scl } from '@dialecte/scl/v2019C1';
|
|
23
23
|
import { ShallowRef } from 'vue';
|
|
24
|
+
import { TemplateUuidWarning } from '@dialecte/scl/v2019C1';
|
|
24
25
|
|
|
25
26
|
declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLButtonElement>;
|
|
26
27
|
|
|
@@ -100,6 +101,8 @@ declare type __VLS_Props_11 = {
|
|
|
100
101
|
detail: ElementDetailVM | undefined;
|
|
101
102
|
/** Consumer-supplied fixed prefix/suffix per attribute; the user edits only the core. */
|
|
102
103
|
affixMask?: AffixMaskResolver;
|
|
104
|
+
/** The selected group is skipped: lock editing and show the skip (current) value. */
|
|
105
|
+
disabled?: boolean;
|
|
103
106
|
};
|
|
104
107
|
|
|
105
108
|
declare type __VLS_Props_12 = MergeSessionParams & {
|
|
@@ -462,10 +465,15 @@ export declare const DecisionToggle: DefineComponent<__VLS_PublicProps_2, {}, {}
|
|
|
462
465
|
export declare type DetailAttribute = {
|
|
463
466
|
name: string;
|
|
464
467
|
status: ChangeStatus;
|
|
465
|
-
/** The current/instance value — the `-` line, present when modified/removed. */
|
|
468
|
+
/** The current/instance value — the `-` line, present when modified/removed. (Skip target.) */
|
|
466
469
|
before?: string;
|
|
467
|
-
/** The
|
|
470
|
+
/** The incoming/proposed value — the `+` line, present when added/modified. (Accept target.) */
|
|
468
471
|
after?: string;
|
|
472
|
+
/**
|
|
473
|
+
* The live value that will actually be written — the user's edit, or accept/skip choice.
|
|
474
|
+
* Defaults to `after` (accept) when unset; a skip sets it to `before`. The input binds to this.
|
|
475
|
+
*/
|
|
476
|
+
written?: string;
|
|
469
477
|
/** When set, the attribute is user-editable and its value renders as an input. */
|
|
470
478
|
editable?: EditableMode;
|
|
471
479
|
/** The engine auto-resolved a placement collision on this field (value = the resolved one). */
|
|
@@ -664,6 +672,15 @@ export declare type MergeNodeMeta = {
|
|
|
664
672
|
regionHead?: boolean;
|
|
665
673
|
/** For a satellite companion that lives elsewhere: its real document path (shown as subtitle). */
|
|
666
674
|
path?: string;
|
|
675
|
+
/**
|
|
676
|
+
* Present on an instance ROOT (Application/Function): its linkage to the loaded template
|
|
677
|
+
* and its member cluster. Drives the "linked / up to date" badge and the select-to-highlight
|
|
678
|
+
* of the whole instance (subtree + folded satellites).
|
|
679
|
+
*/
|
|
680
|
+
instance?: {
|
|
681
|
+
linked: boolean;
|
|
682
|
+
upToDate: boolean;
|
|
683
|
+
};
|
|
667
684
|
};
|
|
668
685
|
|
|
669
686
|
export declare const MergeReview: DefineComponent<__VLS_Props_12, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
@@ -743,14 +760,21 @@ export declare type UnifiedDiff = {
|
|
|
743
760
|
};
|
|
744
761
|
|
|
745
762
|
/**
|
|
746
|
-
* Reactively
|
|
763
|
+
* Reactively resolve the shell's active document — race-safe across realms.
|
|
747
764
|
*
|
|
748
765
|
* The active-document id (shell `localStorage` `storage` event) and the
|
|
749
766
|
* project's document registry (BroadcastChannel) are not ordered across realms,
|
|
750
767
|
* so in an iframe extension the id can arrive before the document is registered
|
|
751
768
|
* / its records are readable. `project.getDocumentStatus(id)` reconciles this
|
|
752
|
-
* realm's store against persisted state first, so
|
|
753
|
-
* of the document. Results from a superseded switch are ignored.
|
|
769
|
+
* realm's store against persisted state first, so the exposed document never
|
|
770
|
+
* races ahead of the document. Results from a superseded switch are ignored.
|
|
771
|
+
*
|
|
772
|
+
* The resolved document is returned as a nullable `document` ref (single source
|
|
773
|
+
* of truth); `isReady` is derived from it. When the active id changes, the
|
|
774
|
+
* previous document is dropped *before* the new one's readiness is probed, so a
|
|
775
|
+
* stale document is never exposed for the new id. Consumers should gate on
|
|
776
|
+
* `isReady`/`document` and can pass optional `hydrate`/`clear` callbacks to also
|
|
777
|
+
* mirror the value into a module-level document store.
|
|
754
778
|
*
|
|
755
779
|
* Cleanup runs automatically when used inside a component/effect scope; the
|
|
756
780
|
* returned `stop` lets scope-less callers (e.g. an extension bootstrap) tear it
|
|
@@ -759,10 +783,11 @@ export declare type UnifiedDiff = {
|
|
|
759
783
|
export declare function useActiveDocument<GenericDocument>(params: {
|
|
760
784
|
project: ActiveDocumentProject<GenericDocument>;
|
|
761
785
|
activeDocumentId: ActiveDocumentObservable<string>;
|
|
762
|
-
hydrate
|
|
763
|
-
clear
|
|
786
|
+
hydrate?: (doc: GenericDocument) => void;
|
|
787
|
+
clear?: () => void;
|
|
764
788
|
}): {
|
|
765
|
-
|
|
789
|
+
document: Ref<GenericDocument | undefined>;
|
|
790
|
+
isReady: ComputedRef<boolean>;
|
|
766
791
|
activeDocumentId: Ref<string | undefined>;
|
|
767
792
|
stop: () => void;
|
|
768
793
|
};
|
|
@@ -796,9 +821,15 @@ export declare function useDialog(): DialogController;
|
|
|
796
821
|
* a `commit` message for this documentId — posted by any Document instance,
|
|
797
822
|
* in this tab or another — re-runs the fetcher. Document state itself is plain,
|
|
798
823
|
* non-reactive data in core; do not watch it.
|
|
824
|
+
*
|
|
825
|
+
* The document may be absent (`undefined`): the composable then holds `initial`,
|
|
826
|
+
* subscribes to nothing, and starts fetching once a document appears — mirroring
|
|
827
|
+
* {@link useProjectLiveData}. This lets a caller pass a document that is null
|
|
828
|
+
* before hydration or during a teardown/switch without pre-guarding a value
|
|
829
|
+
* that would otherwise throw.
|
|
799
830
|
*/
|
|
800
831
|
export declare function useLiveData<T>(params: {
|
|
801
|
-
document: LiveDataDocument |
|
|
832
|
+
document: MaybeRefOrGetter<LiveDataDocument | undefined>;
|
|
802
833
|
fetcher: () => Promise<T>;
|
|
803
834
|
initial: T;
|
|
804
835
|
}): {
|
|
@@ -821,6 +852,7 @@ export declare function useMergeSession(params: MergeSessionParams): {
|
|
|
821
852
|
previewXml: ShallowRef<string | undefined, string | undefined>;
|
|
822
853
|
previewBeforeXml: ShallowRef<string | undefined, string | undefined>;
|
|
823
854
|
previewLoading: ShallowRef<boolean, boolean>;
|
|
855
|
+
warnings: ShallowRef<TemplateUuidWarning[], TemplateUuidWarning[]>;
|
|
824
856
|
load: () => Promise<void>;
|
|
825
857
|
setDecision: (groupId: string, action: "accept" | "skip") => void;
|
|
826
858
|
setValue: (groupId: string, attr: string, value: string) => void;
|
|
@@ -1,46 +1,47 @@
|
|
|
1
1
|
import { extractTitle as e, getAttributes as t } from "./merge.service.js";
|
|
2
2
|
//#region lib/merge/build-view-model.ts
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
function n(e) {
|
|
4
|
+
return e.instances.flatMap((e) => e.groups);
|
|
5
|
+
}
|
|
6
|
+
function r(e) {
|
|
7
|
+
let { report: t, correlation: r } = e, i = /* @__PURE__ */ new Map();
|
|
8
|
+
for (let e of n(t)) i.set(e.primary, {
|
|
9
|
+
role: "primary",
|
|
10
|
+
groupId: e.id
|
|
11
|
+
});
|
|
12
|
+
let a = /* @__PURE__ */ new Map();
|
|
13
|
+
function o(e) {
|
|
14
|
+
let t = r.get(e);
|
|
15
|
+
if (!t) return;
|
|
16
|
+
let n = i.get(e);
|
|
17
|
+
a.set(t, {
|
|
18
|
+
change: e.change,
|
|
19
|
+
role: n?.role ?? "plain",
|
|
20
|
+
groupId: n?.groupId,
|
|
21
|
+
node: e
|
|
13
22
|
});
|
|
14
23
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (e.sourceRef) {
|
|
19
|
-
let n = await t(i, e.sourceRef);
|
|
20
|
-
return n.uuid ? r.get(n.uuid)?.id : void 0;
|
|
21
|
-
}
|
|
24
|
+
function s(e) {
|
|
25
|
+
o(e);
|
|
26
|
+
for (let t of e.children) s(t);
|
|
22
27
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
o.set(t, {
|
|
28
|
+
function c(e, t) {
|
|
29
|
+
if (e.change !== "unchanged") {
|
|
30
|
+
let n = r.get(e);
|
|
31
|
+
n && a.set(n, {
|
|
28
32
|
change: e.change,
|
|
29
|
-
role:
|
|
30
|
-
groupId:
|
|
33
|
+
role: "companion",
|
|
34
|
+
groupId: t,
|
|
31
35
|
node: e
|
|
32
36
|
});
|
|
33
37
|
}
|
|
38
|
+
for (let n of e.children) c(n, t);
|
|
34
39
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
for (let e of n.roots) await l(e);
|
|
40
|
-
for (let e of n.groups) for (let t of e.companions) await c(t);
|
|
41
|
-
return o;
|
|
40
|
+
for (let e of t.instances) s(e.tree);
|
|
41
|
+
for (let e of n(t)) for (let t of e.companions) c(t, e.id);
|
|
42
|
+
return a;
|
|
42
43
|
}
|
|
43
|
-
async function
|
|
44
|
+
async function i(t) {
|
|
44
45
|
let { tree: n, changeByStagedId: r, query: i } = t, a = {
|
|
45
46
|
items: [],
|
|
46
47
|
meta: {},
|
|
@@ -51,7 +52,7 @@ async function r(t) {
|
|
|
51
52
|
let c = r.get(t.id), l = c?.change ?? (n.added ? "added" : "unchanged"), u = c?.groupId ?? (l === "unchanged" ? void 0 : n.groupId), d = c?.role ?? "plain", f = {
|
|
52
53
|
tagName: t.tagName,
|
|
53
54
|
id: t.id
|
|
54
|
-
}, p = l !== "unchanged" && (!s || s.change === "unchanged" || s.groupId !== u), m = {
|
|
55
|
+
}, p = l !== "unchanged" && (!s || s.change === "unchanged" || s.groupId !== u || s.change !== l), m = {
|
|
55
56
|
added: c ? c.change === "added" : n.added,
|
|
56
57
|
groupId: u ?? n.groupId
|
|
57
58
|
}, h = [];
|
|
@@ -82,12 +83,22 @@ async function r(t) {
|
|
|
82
83
|
changed: g
|
|
83
84
|
};
|
|
84
85
|
}
|
|
85
|
-
|
|
86
|
+
a.items.push((await o(n, {
|
|
86
87
|
added: !1,
|
|
87
88
|
groupId: void 0
|
|
88
|
-
}, void 0)).node)
|
|
89
|
+
}, void 0)).node);
|
|
90
|
+
let s = /* @__PURE__ */ new Map();
|
|
91
|
+
for (let [e, t] of r) s.set(t.node, e);
|
|
92
|
+
for (let e of t.instances) {
|
|
93
|
+
let t = s.get(e.tree);
|
|
94
|
+
!t || !a.meta[t] || (a.meta[t].instance = {
|
|
95
|
+
linked: e.linked,
|
|
96
|
+
upToDate: e.upToDate
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return a;
|
|
89
100
|
}
|
|
90
|
-
async function
|
|
101
|
+
async function a(e, n, r) {
|
|
91
102
|
let i = new Map((n?.editableAttributes ?? []).map((e) => [e.attr, e])), a = [];
|
|
92
103
|
if (e.change === "added" && e.sourceRef) {
|
|
93
104
|
let n = await t(r.sourceQuery, e.sourceRef);
|
|
@@ -142,13 +153,13 @@ async function i(e, n, r) {
|
|
|
142
153
|
}
|
|
143
154
|
return {
|
|
144
155
|
tag: e.tagName,
|
|
145
|
-
title: await
|
|
156
|
+
title: await s(e, r),
|
|
146
157
|
change: e.change,
|
|
147
158
|
attributes: a
|
|
148
159
|
};
|
|
149
160
|
}
|
|
150
|
-
async function
|
|
151
|
-
let
|
|
161
|
+
async function o(e, t, r, i) {
|
|
162
|
+
let a = {
|
|
152
163
|
added: [],
|
|
153
164
|
updated: [],
|
|
154
165
|
skipped: [],
|
|
@@ -156,49 +167,49 @@ async function a(e, t, n, r) {
|
|
|
156
167
|
removed: [],
|
|
157
168
|
renamed: []
|
|
158
169
|
};
|
|
159
|
-
for (let
|
|
160
|
-
let e = await o
|
|
161
|
-
if (
|
|
162
|
-
t(
|
|
170
|
+
for (let o of n(e)) {
|
|
171
|
+
let e = await s(o.primary, i), n = o.primary.tagName, c = o.companions.length;
|
|
172
|
+
if (o.primary.change === "target-only") {
|
|
173
|
+
t(o.id) === "skip" ? a.preserved.push({
|
|
163
174
|
title: e,
|
|
164
|
-
tag:
|
|
165
|
-
}) :
|
|
175
|
+
tag: n
|
|
176
|
+
}) : a.removed.push({
|
|
166
177
|
title: e,
|
|
167
|
-
tag:
|
|
178
|
+
tag: n
|
|
168
179
|
});
|
|
169
180
|
continue;
|
|
170
181
|
}
|
|
171
|
-
if (t(
|
|
172
|
-
|
|
182
|
+
if (t(o.id) === "skip") {
|
|
183
|
+
a.skipped.push({
|
|
173
184
|
title: e,
|
|
174
|
-
tag:
|
|
185
|
+
tag: n
|
|
175
186
|
});
|
|
176
187
|
continue;
|
|
177
188
|
}
|
|
178
|
-
for (let t of
|
|
189
|
+
for (let t of o.editableAttributes ?? []) t.conflict && t.suggestedValue && r(o.id, t.attr) == null && a.renamed.push({
|
|
179
190
|
title: e,
|
|
180
191
|
field: t.attr,
|
|
181
192
|
to: t.suggestedValue
|
|
182
193
|
});
|
|
183
|
-
let l =
|
|
184
|
-
if (
|
|
194
|
+
let l = o.editableAttributes?.find((e) => e.attr === "name" && e.conflict), u = r(o.id, "name") ?? l?.suggestedValue ?? e;
|
|
195
|
+
if (o.primary.change === "added") a.added.push({
|
|
185
196
|
title: u,
|
|
186
|
-
tag:
|
|
197
|
+
tag: n,
|
|
187
198
|
detail: c ? `+${c} companion${c > 1 ? "s" : ""}` : void 0
|
|
188
199
|
});
|
|
189
|
-
else if (
|
|
190
|
-
let e =
|
|
191
|
-
|
|
200
|
+
else if (o.primary.change === "modified") {
|
|
201
|
+
let e = o.primary.attributeChanges?.length ?? 0;
|
|
202
|
+
a.updated.push({
|
|
192
203
|
title: u,
|
|
193
|
-
tag:
|
|
204
|
+
tag: n,
|
|
194
205
|
detail: e ? `${e} attribute change${e > 1 ? "s" : ""}` : void 0
|
|
195
206
|
});
|
|
196
207
|
}
|
|
197
208
|
}
|
|
198
|
-
return
|
|
209
|
+
return a;
|
|
199
210
|
}
|
|
200
|
-
async function
|
|
211
|
+
async function s(t, n) {
|
|
201
212
|
return t.instanceRef ? e(n.targetQuery, t.instanceRef) : t.sourceRef ? e(n.sourceQuery, t.sourceRef) : t.tagName;
|
|
202
213
|
}
|
|
203
214
|
//#endregion
|
|
204
|
-
export { n as buildChangeIndex,
|
|
215
|
+
export { n as allGroups, r as buildChangeIndex, a as buildDetail, i as buildStructuralTree, o as buildSummary };
|
|
@@ -23,13 +23,13 @@ var c = {
|
|
|
23
23
|
})[d.size ?? "undefined"]);
|
|
24
24
|
return (e, s) => (o(), t("div", c, [n("button", {
|
|
25
25
|
type: "button",
|
|
26
|
-
class: a(["btn join-item", [f.value, i.value === "accept" ? "btn-success" : "btn-ghost"]]),
|
|
26
|
+
class: a(["btn join-item font-semibold", [f.value, i.value === "accept" ? "btn-success text-success-content" : "btn-ghost"]]),
|
|
27
27
|
disabled: r.disabled,
|
|
28
28
|
"aria-pressed": i.value === "accept",
|
|
29
29
|
onClick: s[0] ||= (e) => i.value = "accept"
|
|
30
30
|
}, " Accept ", 10, l), n("button", {
|
|
31
31
|
type: "button",
|
|
32
|
-
class: a(["btn join-item", [f.value, i.value === "skip" ? "btn-warning" : "btn-ghost"]]),
|
|
32
|
+
class: a(["btn join-item font-semibold", [f.value, i.value === "skip" ? "btn-warning text-black" : "btn-ghost"]]),
|
|
33
33
|
disabled: r.disabled,
|
|
34
34
|
"aria-pressed": i.value === "skip",
|
|
35
35
|
onClick: s[1] ||= (e) => i.value = "skip"
|