archgraph-argo 0.13.9 → 0.14.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.
|
@@ -275,6 +275,17 @@ function ensureStyleToken(styleEx, keyValue) {
|
|
|
275
275
|
const token = String(keyValue).indexOf('=') >= 0 ? String(keyValue) + ';' : String(keyValue) + '=;';
|
|
276
276
|
return text ? token + text : token;
|
|
277
277
|
}
|
|
278
|
+
// Force a StyleEx token to a value (replaces an existing one, else prepends).
|
|
279
|
+
// Used for DLKO=1 (the "Freeze Visible" connector-display flag EA persists in the
|
|
280
|
+
// diagram's StyleEx): every projected diagram must default to Freeze Visible ON, even
|
|
281
|
+
// if EA previously stored DLKO=0 / dropped it after a human unchecked the box.
|
|
282
|
+
function setStyleToken(styleEx, key, value) {
|
|
283
|
+
const text = String(styleEx === null || styleEx === undefined ? '' : styleEx);
|
|
284
|
+
const re = new RegExp('(^|;|\\s)' + key + '=[^;]*', 'i');
|
|
285
|
+
if (re.test(text)) { return text.replace(re, (m, pre) => pre + key + '=' + value); }
|
|
286
|
+
const token = key + '=' + value + ';';
|
|
287
|
+
return text ? token + text : token;
|
|
288
|
+
}
|
|
278
289
|
|
|
279
290
|
// ---------------------------------------------------------------------------
|
|
280
291
|
// Core sync
|
|
@@ -530,7 +541,7 @@ function syncGraphToQea(graph, qeaPath, opts) {
|
|
|
530
541
|
for (const view of graph.views || []) {
|
|
531
542
|
if (!view || view.view_id === undefined || view.view_id === null) { continue; }
|
|
532
543
|
const viewId = String(view.view_id);
|
|
533
|
-
const styleEx = 'schema_view_id=' + viewId + ';';
|
|
544
|
+
const styleEx = 'schema_view_id=' + viewId + ';DLKO=1;';
|
|
534
545
|
const parentObjectId = (function () {
|
|
535
546
|
if (view.parent_element_id !== undefined && view.parent_element_id !== null && view.parent_element_id !== '') {
|
|
536
547
|
const pid = elemIdByAliasAll.get(String(view.parent_element_id));
|
|
@@ -550,8 +561,12 @@ function syncGraphToQea(graph, qeaPath, opts) {
|
|
|
550
561
|
if (existing) {
|
|
551
562
|
diagViewRows.set(viewId, existing);
|
|
552
563
|
// EA may have rewritten StyleEx and dropped the anchor — re-inject it while
|
|
553
|
-
// preserving EA's own formatting tokens so identity stays discoverable.
|
|
554
|
-
|
|
564
|
+
// preserving EA's own formatting tokens so identity stays discoverable. Also
|
|
565
|
+
// force DLKO=1 so every diagram defaults to "Freeze Visible" checked.
|
|
566
|
+
const anchoredStyleEx = ensureStyleToken(
|
|
567
|
+
setStyleToken(existing.StyleEx, 'DLKO', '1'),
|
|
568
|
+
'schema_view_id=' + viewId
|
|
569
|
+
);
|
|
555
570
|
const changed = intended.Name !== (existing.Name || '') || (existing.StyleEx || '') !== anchoredStyleEx;
|
|
556
571
|
if (DEBUG && changed) { console.error('DEBUG diagram chg', viewId, JSON.stringify({n:[intended.Name,(existing.Name||'')], style: !!parseStyleToken(existing.StyleEx,'schema_view_id')})); }
|
|
557
572
|
if (changed && !o.dryRun) {
|
package/package.json
CHANGED