@magmonium/cli 0.8.5 → 0.8.7
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/bin/commands/fix-i18n.js +21 -4
- package/codegen/index.js +229 -35
- package/package.json +1 -1
- package/src/compilers/web-component/lib/web-component-wrapper.d.ts +8 -0
- package/src/compilers/web-component/lib/web-component-wrapper.d.ts.map +1 -1
- package/src/compilers/web-component/lib/web-component-wrapper.js +62 -29
- package/src/compilers/web-component/lib/web-component-wrapper.js.map +1 -1
- package/src/index.d.ts +1 -0
- package/src/index.d.ts.map +1 -1
- package/src/index.js +1 -0
- package/src/index.js.map +1 -1
- package/src/utils/ai-provider-translator.d.ts +44 -0
- package/src/utils/ai-provider-translator.d.ts.map +1 -0
- package/src/utils/ai-provider-translator.js +190 -0
- package/src/utils/ai-provider-translator.js.map +1 -0
- package/src/utils/i18n-fixer.d.ts +7 -0
- package/src/utils/i18n-fixer.d.ts.map +1 -1
- package/src/utils/i18n-fixer.js +68 -44
- package/src/utils/i18n-fixer.js.map +1 -1
- package/src/utils/i18n-utils.d.ts +2 -1
- package/src/utils/i18n-utils.d.ts.map +1 -1
- package/src/utils/i18n-utils.js +9 -3
- package/src/utils/i18n-utils.js.map +1 -1
- package/src/utils/web-translation-providers.d.ts +6 -1
- package/src/utils/web-translation-providers.d.ts.map +1 -1
- package/src/utils/web-translation-providers.js.map +1 -1
package/bin/commands/fix-i18n.js
CHANGED
|
@@ -4,22 +4,39 @@ function fixI18nCommand(program) {
|
|
|
4
4
|
program
|
|
5
5
|
.command('fix-i18n')
|
|
6
6
|
.description(
|
|
7
|
-
'Scan templates and TypeScript for missing i18n keys and auto-translate them.
|
|
7
|
+
'Scan templates and TypeScript for missing i18n keys and auto-translate them. An AI provider (the OpenAI-compatible endpoint m-one-ui uses, or a llama-server if one answers) translates first; web APIs fill what it misses.'
|
|
8
8
|
)
|
|
9
9
|
.option('--dry-run', 'Preview what would be created/deleted without writing files', false)
|
|
10
10
|
.option('-v, --verbose', 'Log per-language translation results', false)
|
|
11
11
|
.option('--root <path>', 'Workspace root (defaults to cwd)', process.cwd())
|
|
12
12
|
.option('--limit <n>', 'Process at most N keys per run (for batching large workspaces)', parseInt)
|
|
13
|
-
.option('--
|
|
14
|
-
.option('--
|
|
13
|
+
.option('--key <keys...>', 'Only these keys (i18n file names, e.g. nav-delete-references-left); skips stale-copy cleanup')
|
|
14
|
+
.option('--ai-base-url <url>', 'AI provider base URL, ending in /v1 (env MAG_AI_BASE_URL); token from env MAG_AI_TOKEN', process.env.MAG_AI_BASE_URL)
|
|
15
|
+
.option('--ai-model <id>', 'AI provider model id (env MAG_AI_MODEL)', process.env.MAG_AI_MODEL)
|
|
16
|
+
.option('--llama-host <url>', 'llama-server tried when no AI provider is given', 'http://127.0.0.1:8080')
|
|
15
17
|
.action(async (options) => {
|
|
16
18
|
const root = path.resolve(options.root);
|
|
17
19
|
|
|
20
|
+
if (options.aiBaseUrl && !options.aiModel) {
|
|
21
|
+
console.error('fix-i18n failed: --ai-base-url needs --ai-model (or MAG_AI_MODEL)');
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
const aiProvider = options.aiBaseUrl
|
|
25
|
+
? { baseUrl: options.aiBaseUrl, model: options.aiModel, token: process.env.MAG_AI_TOKEN }
|
|
26
|
+
: undefined;
|
|
27
|
+
|
|
18
28
|
try {
|
|
19
29
|
const { I18nFixer } = require('../../src/index.js');
|
|
20
30
|
|
|
21
31
|
const fixer = new I18nFixer(root, options.verbose);
|
|
22
|
-
const results = await fixer.fix({
|
|
32
|
+
const results = await fixer.fix({
|
|
33
|
+
dryRun: options.dryRun,
|
|
34
|
+
verbose: options.verbose,
|
|
35
|
+
limit: options.limit,
|
|
36
|
+
llamaHost: options.llamaHost,
|
|
37
|
+
aiProvider,
|
|
38
|
+
keys: options.key,
|
|
39
|
+
});
|
|
23
40
|
|
|
24
41
|
if (results.length === 0) return;
|
|
25
42
|
|
package/codegen/index.js
CHANGED
|
@@ -418,6 +418,7 @@ __export(index_exports, {
|
|
|
418
418
|
canHostDefaultChild: () => canHostDefaultChild,
|
|
419
419
|
canHostNavChildren: () => canHostNavChildren,
|
|
420
420
|
canOfferAddChild: () => canOfferAddChild,
|
|
421
|
+
canOfferReplaceParent: () => canOfferReplaceParent,
|
|
421
422
|
canOutputCall: () => canOutputCall,
|
|
422
423
|
canPasteNavInto: () => canPasteNavInto,
|
|
423
424
|
canPlaceChild: () => canPlaceChild,
|
|
@@ -503,6 +504,7 @@ __export(index_exports, {
|
|
|
503
504
|
controlMapStateRootIds: () => controlMapStateRootIds,
|
|
504
505
|
controlMapUsesAuth: () => controlMapUsesAuth,
|
|
505
506
|
controlMapUsesBusy: () => controlMapUsesBusy,
|
|
507
|
+
controlNavReferences: () => controlNavReferences,
|
|
506
508
|
controlUsesOverlayRef: () => controlUsesOverlayRef,
|
|
507
509
|
controlVariantIds: () => controlVariantIds,
|
|
508
510
|
controlVariants: () => controlVariants,
|
|
@@ -1248,6 +1250,9 @@ __export(index_exports, {
|
|
|
1248
1250
|
redirectRouteLiteral: () => redirectRouteLiteral,
|
|
1249
1251
|
referencedShapeIds: () => referencedShapeIds,
|
|
1250
1252
|
relationshipParent: () => relationshipParent,
|
|
1253
|
+
remapControlMapNavs: () => remapControlMapNavs,
|
|
1254
|
+
remapControlNavs: () => remapControlNavs,
|
|
1255
|
+
remapNavSourceNavs: () => remapNavSourceNavs,
|
|
1251
1256
|
remapRuleNavs: () => remapRuleNavs,
|
|
1252
1257
|
remapScreenComputedNavs: () => remapScreenComputedNavs,
|
|
1253
1258
|
remapShapeHolders: () => remapShapeHolders,
|
|
@@ -1287,6 +1292,7 @@ __export(index_exports, {
|
|
|
1287
1292
|
repipeCall: () => repipeCall,
|
|
1288
1293
|
replaceChainStep: () => replaceChainStep,
|
|
1289
1294
|
replaceMenuItem: () => replaceMenuItem,
|
|
1295
|
+
replaceParentNav: () => replaceParentNav,
|
|
1290
1296
|
requiredCallArgLeaves: () => requiredCallArgLeaves,
|
|
1291
1297
|
requiredOptionValue: () => requiredOptionValue,
|
|
1292
1298
|
resolveBranchArm: () => resolveBranchArm,
|
|
@@ -9068,7 +9074,7 @@ function screenMemberExpression(binding, ctx) {
|
|
|
9068
9074
|
return void 0;
|
|
9069
9075
|
}
|
|
9070
9076
|
}
|
|
9071
|
-
function screenControlInputGuards(node, ctx, renderBinding = () => void 0, bindingPresent = () => true) {
|
|
9077
|
+
function screenControlInputGuards(node, ctx, renderBinding = () => void 0, bindingPresent = () => true, computedPresent = () => true) {
|
|
9072
9078
|
if (node.type !== "screen" /* SCREEN */) return [];
|
|
9073
9079
|
const ref = embeddedRefOf(node, ctx);
|
|
9074
9080
|
if (!ref) return [];
|
|
@@ -9087,6 +9093,12 @@ function screenControlInputGuards(node, ctx, renderBinding = () => void 0, bindi
|
|
|
9087
9093
|
if (binding?.kind === "input") {
|
|
9088
9094
|
const source = ctx.inputs?.[binding.inputId];
|
|
9089
9095
|
if (source && !source.required) guard(`${source.name}()`, source.name);
|
|
9096
|
+
} else if (binding?.kind === "variable") {
|
|
9097
|
+
const source = ctx.variables?.[binding.variableId];
|
|
9098
|
+
if (source) guard(`${source.name}()`, source.name);
|
|
9099
|
+
} else if (binding?.kind === "computed" && !computedPresent(binding.computedId)) {
|
|
9100
|
+
const source = ctx.screenComputeds?.[binding.computedId];
|
|
9101
|
+
if (source) guard(`${source.name}()`, source.name);
|
|
9090
9102
|
} else if (binding?.kind === "data" && !bindingPresent(binding.binding)) {
|
|
9091
9103
|
const expression = renderBinding(binding.binding);
|
|
9092
9104
|
if (expression !== void 0) guard(expression, target.name);
|
|
@@ -15733,37 +15745,97 @@ function outcomeReadsArgs(outcome) {
|
|
|
15733
15745
|
);
|
|
15734
15746
|
}
|
|
15735
15747
|
var within = (navId, root) => !!navId && (navId === root || navId.startsWith(`${root}${NAV_ID_SEP}`));
|
|
15736
|
-
function
|
|
15737
|
-
|
|
15738
|
-
|
|
15739
|
-
|
|
15740
|
-
|
|
15741
|
-
|
|
15742
|
-
|
|
15743
|
-
]
|
|
15744
|
-
|
|
15745
|
-
|
|
15746
|
-
|
|
15747
|
-
|
|
15748
|
-
|
|
15749
|
-
|
|
15750
|
-
|
|
15751
|
-
|
|
15752
|
-
|
|
15753
|
-
|
|
15754
|
-
)
|
|
15755
|
-
|
|
15756
|
-
|
|
15757
|
-
|
|
15758
|
-
|
|
15759
|
-
|
|
15760
|
-
|
|
15761
|
-
|
|
15762
|
-
|
|
15763
|
-
|
|
15748
|
+
function controlNavReferences(control) {
|
|
15749
|
+
const outcomes = [
|
|
15750
|
+
...Object.values(control.outputOutcomes ?? {}),
|
|
15751
|
+
...Object.values(control.screenOutputOutcomes ?? {})
|
|
15752
|
+
];
|
|
15753
|
+
const navs = [
|
|
15754
|
+
...outcomes.flatMap(
|
|
15755
|
+
(outcome) => OUTCOME_ARMS.map((arm) => outcome?.[arm]?.nav)
|
|
15756
|
+
),
|
|
15757
|
+
...Object.values(control.outputNavs ?? {})
|
|
15758
|
+
];
|
|
15759
|
+
const routeNavIds = (args) => args.flatMap(
|
|
15760
|
+
(arg) => arg?.source === "route" && arg.navId ? [arg.navId] : []
|
|
15761
|
+
);
|
|
15762
|
+
const navRows = navs.flatMap(
|
|
15763
|
+
(nav) => nav?.kind === "nav" ? [
|
|
15764
|
+
[
|
|
15765
|
+
...nav.navId ? [nav.navId] : [],
|
|
15766
|
+
...routeNavIds(Object.values(nav.params ?? {}))
|
|
15767
|
+
]
|
|
15768
|
+
] : []
|
|
15769
|
+
);
|
|
15770
|
+
const tabRows = Object.values(control.outputNewTabs ?? {}).map(
|
|
15771
|
+
(tab) => routeNavIds(
|
|
15772
|
+
tab?.mode === "value" ? [tab.value] : tab?.mode === "function" ? Object.values(tab.args ?? {}) : []
|
|
15773
|
+
)
|
|
15774
|
+
);
|
|
15775
|
+
return [...navRows, ...tabRows].filter((row) => row.length > 0);
|
|
15776
|
+
}
|
|
15777
|
+
function remapControlNavs(control, remap) {
|
|
15778
|
+
const navs = [
|
|
15779
|
+
...[
|
|
15780
|
+
...Object.values(control.outputOutcomes ?? {}),
|
|
15781
|
+
...Object.values(control.screenOutputOutcomes ?? {})
|
|
15782
|
+
].flatMap((outcome2) => OUTCOME_ARMS.map((arm) => outcome2?.[arm]?.nav)),
|
|
15783
|
+
...Object.values(control.outputNavs ?? {})
|
|
15784
|
+
];
|
|
15785
|
+
const named = [
|
|
15786
|
+
...controlNavReferences(control).flat(),
|
|
15787
|
+
...navs.flatMap((nav2) => Object.keys(nav2?.params ?? {}))
|
|
15788
|
+
];
|
|
15789
|
+
if (!named.some((navId) => remap(navId) !== navId)) return control;
|
|
15790
|
+
const arg = (value) => value.source === "route" ? { ...value, navId: remap(value.navId) } : value;
|
|
15791
|
+
const nav = (value) => value.kind !== "nav" ? value : {
|
|
15792
|
+
...value,
|
|
15793
|
+
...value.navId ? { navId: remap(value.navId) } : {},
|
|
15794
|
+
...value.params ? {
|
|
15795
|
+
params: Object.fromEntries(
|
|
15796
|
+
Object.entries(value.params).map(([navId, row]) => [
|
|
15797
|
+
remap(navId),
|
|
15798
|
+
arg(row)
|
|
15799
|
+
])
|
|
15800
|
+
)
|
|
15801
|
+
} : {}
|
|
15802
|
+
};
|
|
15803
|
+
const outcome = (value) => {
|
|
15804
|
+
const next = { ...value };
|
|
15805
|
+
for (const key2 of OUTCOME_ARMS) {
|
|
15806
|
+
const armNav = value[key2]?.nav;
|
|
15807
|
+
if (armNav) next[key2] = { ...value[key2], nav: nav(armNav) };
|
|
15764
15808
|
}
|
|
15809
|
+
return next;
|
|
15810
|
+
};
|
|
15811
|
+
const each = (map, fn) => map && Object.fromEntries(
|
|
15812
|
+
Object.entries(map).map(([key2, value]) => [key2, fn(value)])
|
|
15813
|
+
);
|
|
15814
|
+
return {
|
|
15815
|
+
...control,
|
|
15816
|
+
...control.outputOutcomes ? { outputOutcomes: each(control.outputOutcomes, outcome) } : {},
|
|
15817
|
+
...control.screenOutputOutcomes ? { screenOutputOutcomes: each(control.screenOutputOutcomes, outcome) } : {},
|
|
15818
|
+
...control.outputNavs ? { outputNavs: each(control.outputNavs, nav) } : {},
|
|
15819
|
+
...control.outputNewTabs ? {
|
|
15820
|
+
outputNewTabs: each(
|
|
15821
|
+
control.outputNewTabs,
|
|
15822
|
+
(tab) => tab.mode === "value" ? { ...tab, ...tab.value ? { value: arg(tab.value) } : {} } : tab.mode === "function" ? { ...tab, ...tab.args ? { args: each(tab.args, arg) } : {} } : tab
|
|
15823
|
+
)
|
|
15824
|
+
} : {}
|
|
15825
|
+
};
|
|
15826
|
+
}
|
|
15827
|
+
function remapControlMapNavs(controls, remap) {
|
|
15828
|
+
let next;
|
|
15829
|
+
for (const [id, control] of Object.entries(controls)) {
|
|
15830
|
+
const remapped = remapControlNavs(control, remap);
|
|
15831
|
+
if (remapped === control) continue;
|
|
15832
|
+
next ??= { ...controls };
|
|
15833
|
+
next[id] = remapped;
|
|
15765
15834
|
}
|
|
15766
|
-
return
|
|
15835
|
+
return next ?? controls;
|
|
15836
|
+
}
|
|
15837
|
+
function countOutcomeNavReferences(controlMaps, navId) {
|
|
15838
|
+
return controlMaps.flatMap((controls) => Object.values(controls)).flatMap(controlNavReferences).filter((row) => row.some((named) => within(named, navId))).length;
|
|
15767
15839
|
}
|
|
15768
15840
|
var quote2 = (value) => `'${value.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
|
|
15769
15841
|
function outcomeNavStatement(nav, navMap, read) {
|
|
@@ -15998,7 +16070,9 @@ function screenMemberOptions(scope, dataType, cardinality, required, byName) {
|
|
|
15998
16070
|
binding: {
|
|
15999
16071
|
kind: "variable",
|
|
16000
16072
|
variableId: variable.id
|
|
16001
|
-
}
|
|
16073
|
+
},
|
|
16074
|
+
// Always `signal<T | undefined>`, whatever it is seeded with.
|
|
16075
|
+
...required ? { optional: true } : {}
|
|
16002
16076
|
}));
|
|
16003
16077
|
const constants = cardinality === "one" ? byName(Object.values(scope.constants ?? {})).filter((constant) => constant.dataType === dataType).map((constant) => ({
|
|
16004
16078
|
value: encode("constant", constant.id),
|
|
@@ -16017,7 +16091,14 @@ function screenMemberOptions(scope, dataType, cardinality, required, byName) {
|
|
|
16017
16091
|
binding: {
|
|
16018
16092
|
kind: "computed",
|
|
16019
16093
|
computedId: computed.id
|
|
16020
|
-
}
|
|
16094
|
+
},
|
|
16095
|
+
...required && screenComputedIsOptional(
|
|
16096
|
+
computed,
|
|
16097
|
+
screenComputedFunction(computed, scope.functions ?? {}),
|
|
16098
|
+
scope.inputs ?? {},
|
|
16099
|
+
scope.computeds ?? {},
|
|
16100
|
+
scope.functions ?? {}
|
|
16101
|
+
) ? { optional: true } : {}
|
|
16021
16102
|
}));
|
|
16022
16103
|
return [...inputs, ...variables, ...constants, ...computeds];
|
|
16023
16104
|
}
|
|
@@ -20115,7 +20196,17 @@ function renderTag(node, indent2, names, methods, operationOf, storeProp, ctx, w
|
|
|
20115
20196
|
node,
|
|
20116
20197
|
ctx,
|
|
20117
20198
|
(binding) => bindingExpression(binding, guardScope),
|
|
20118
|
-
(binding) => bindingAlwaysPresent(binding, guardScope)
|
|
20199
|
+
(binding) => bindingAlwaysPresent(binding, guardScope),
|
|
20200
|
+
(computedId) => {
|
|
20201
|
+
const computed = ctx.screenComputeds?.[computedId];
|
|
20202
|
+
return !!computed && !screenComputedIsOptional(
|
|
20203
|
+
computed,
|
|
20204
|
+
screenComputedFunction(computed, ctx.functions ?? {}),
|
|
20205
|
+
ctx.inputs ?? {},
|
|
20206
|
+
ctx.screenComputeds ?? {},
|
|
20207
|
+
ctx.functions ?? {}
|
|
20208
|
+
);
|
|
20209
|
+
}
|
|
20119
20210
|
);
|
|
20120
20211
|
const inputAliases = new Map(
|
|
20121
20212
|
guards.map((guard) => [guard.expression, guard.alias])
|
|
@@ -23957,7 +24048,7 @@ __export(package_exports, {
|
|
|
23957
24048
|
version: () => version
|
|
23958
24049
|
});
|
|
23959
24050
|
var name = "@magmonium/one";
|
|
23960
|
-
var version = "0.4.
|
|
24051
|
+
var version = "0.4.32";
|
|
23961
24052
|
var description = "Magmonium One \u2014 Angular design-system primitives for mm Apps";
|
|
23962
24053
|
var author = "magmonium";
|
|
23963
24054
|
var license = "MIT";
|
|
@@ -24025,7 +24116,7 @@ __export(package_exports2, {
|
|
|
24025
24116
|
version: () => version2
|
|
24026
24117
|
});
|
|
24027
24118
|
var name2 = "@magmonium/cli";
|
|
24028
|
-
var version2 = "0.8.
|
|
24119
|
+
var version2 = "0.8.7";
|
|
24029
24120
|
var description2 = "A powerful and extensible asset compilation tool that can be shared across multiple projects";
|
|
24030
24121
|
var bin = {
|
|
24031
24122
|
"mag-cli": "bin/cli.js"
|
|
@@ -24991,6 +25082,103 @@ var pasteNav = (clipboard, targetId, navMap, outletScreens) => {
|
|
|
24991
25082
|
consumeClipboard: isCut
|
|
24992
25083
|
};
|
|
24993
25084
|
};
|
|
25085
|
+
var remapNavArgs = (args, remap) => {
|
|
25086
|
+
if (!args || !Object.values(args).some(
|
|
25087
|
+
(arg) => arg.source === "nav-param" && remap(arg.navId) !== arg.navId
|
|
25088
|
+
)) {
|
|
25089
|
+
return args;
|
|
25090
|
+
}
|
|
25091
|
+
return Object.fromEntries(
|
|
25092
|
+
Object.entries(args).map(([paramId, arg]) => [
|
|
25093
|
+
paramId,
|
|
25094
|
+
arg.source === "nav-param" ? { ...arg, navId: remap(arg.navId) } : arg
|
|
25095
|
+
])
|
|
25096
|
+
);
|
|
25097
|
+
};
|
|
25098
|
+
var remapNavSourceNavs = (navMap, remap) => {
|
|
25099
|
+
let next;
|
|
25100
|
+
for (const [id, nav] of Object.entries(navMap)) {
|
|
25101
|
+
const gateArgs = remapNavArgs(nav.visibilitySource?.args, remap);
|
|
25102
|
+
const resolverArgs = remapNavArgs(nav.instanceSource?.args, remap);
|
|
25103
|
+
if (gateArgs === nav.visibilitySource?.args && resolverArgs === nav.instanceSource?.args) {
|
|
25104
|
+
continue;
|
|
25105
|
+
}
|
|
25106
|
+
next ??= { ...navMap };
|
|
25107
|
+
next[id] = {
|
|
25108
|
+
...nav,
|
|
25109
|
+
...nav.visibilitySource ? { visibilitySource: { ...nav.visibilitySource, args: gateArgs } } : {},
|
|
25110
|
+
...nav.instanceSource ? { instanceSource: { ...nav.instanceSource, args: resolverArgs } } : {}
|
|
25111
|
+
};
|
|
25112
|
+
}
|
|
25113
|
+
return next ?? navMap;
|
|
25114
|
+
};
|
|
25115
|
+
var canOfferReplaceParent = (navMap, navId) => {
|
|
25116
|
+
const child = navMap[navId];
|
|
25117
|
+
const parentId = parentNavId(navId);
|
|
25118
|
+
const parent = parentId ? navMap[parentId] : void 0;
|
|
25119
|
+
if (!child || !parent || child.platform || parent.platform) return false;
|
|
25120
|
+
const appChildren = parent.children.filter(
|
|
25121
|
+
(id) => navMap[id] && !navMap[id].platform
|
|
25122
|
+
);
|
|
25123
|
+
return appChildren.length === 1 && appChildren[0] === navId && child.linkKind === parent.linkKind && child.presentation !== "dynamic" && parent.presentation !== "dynamic";
|
|
25124
|
+
};
|
|
25125
|
+
var replaceParentNav = (navMap, navId) => {
|
|
25126
|
+
if (!canOfferReplaceParent(navMap, navId)) return void 0;
|
|
25127
|
+
const parentId = parentNavId(navId);
|
|
25128
|
+
const child = navMap[navId];
|
|
25129
|
+
const parent = navMap[parentId];
|
|
25130
|
+
if (child.visibilitySource && parent.visibilitySource) {
|
|
25131
|
+
return { refused: "both-gated" };
|
|
25132
|
+
}
|
|
25133
|
+
const merged = { ...child, navId: parentId };
|
|
25134
|
+
delete merged.isDefault;
|
|
25135
|
+
if (parent.isDefault) merged.isDefault = true;
|
|
25136
|
+
if (merged.label === void 0 && parent.label !== void 0) {
|
|
25137
|
+
merged.label = parent.label;
|
|
25138
|
+
}
|
|
25139
|
+
if (merged.icon === void 0 && parent.icon !== void 0) {
|
|
25140
|
+
merged.icon = parent.icon;
|
|
25141
|
+
}
|
|
25142
|
+
if (!merged.visibilitySource && parent.visibilitySource) {
|
|
25143
|
+
merged.visibilitySource = parent.visibilitySource;
|
|
25144
|
+
}
|
|
25145
|
+
if (merged.isDefault && !canBeDefaultNav(merged)) {
|
|
25146
|
+
return { refused: "default-claim" };
|
|
25147
|
+
}
|
|
25148
|
+
const treeIds = navTreeIds(navMap, navId);
|
|
25149
|
+
const remapped = /* @__PURE__ */ new Map([[navId, parentId]]);
|
|
25150
|
+
treeIds.slice(1).forEach((id) => {
|
|
25151
|
+
const oldParentId = parentNavId(id);
|
|
25152
|
+
const newParentId = oldParentId ? remapped.get(oldParentId) : void 0;
|
|
25153
|
+
if (newParentId) remapped.set(id, childNavId(newParentId, navSegmentId(id)));
|
|
25154
|
+
});
|
|
25155
|
+
const next = { ...navMap };
|
|
25156
|
+
treeIds.forEach((id) => delete next[id]);
|
|
25157
|
+
treeIds.forEach((id) => {
|
|
25158
|
+
const nextId = remapped.get(id);
|
|
25159
|
+
if (!nextId) return;
|
|
25160
|
+
next[nextId] = {
|
|
25161
|
+
...id === navId ? merged : navMap[id],
|
|
25162
|
+
navId: nextId,
|
|
25163
|
+
children: navMap[id].children.map(
|
|
25164
|
+
(childId) => remapped.get(childId) ?? childId
|
|
25165
|
+
)
|
|
25166
|
+
};
|
|
25167
|
+
});
|
|
25168
|
+
const bound = [merged.pageId, merged.componentKey];
|
|
25169
|
+
const released = [parent.pageId, parent.componentKey].filter(
|
|
25170
|
+
(screenId) => !!screenId && !bound.includes(screenId)
|
|
25171
|
+
);
|
|
25172
|
+
return {
|
|
25173
|
+
navMap: remapNavSourceNavs(
|
|
25174
|
+
next,
|
|
25175
|
+
(named) => remapped.get(named) ?? named
|
|
25176
|
+
),
|
|
25177
|
+
navId: parentId,
|
|
25178
|
+
remapped,
|
|
25179
|
+
released: [...new Set(released)]
|
|
25180
|
+
};
|
|
25181
|
+
};
|
|
24994
25182
|
var sanitizeNavMap = (value) => {
|
|
24995
25183
|
const seeded = createPlatformNavMap();
|
|
24996
25184
|
if (!value || typeof value !== "object") return seeded;
|
|
@@ -31946,6 +32134,7 @@ var HISTORY_SELECTION_KEYS = [
|
|
|
31946
32134
|
canHostDefaultChild,
|
|
31947
32135
|
canHostNavChildren,
|
|
31948
32136
|
canOfferAddChild,
|
|
32137
|
+
canOfferReplaceParent,
|
|
31949
32138
|
canOutputCall,
|
|
31950
32139
|
canPasteNavInto,
|
|
31951
32140
|
canPlaceChild,
|
|
@@ -32031,6 +32220,7 @@ var HISTORY_SELECTION_KEYS = [
|
|
|
32031
32220
|
controlMapStateRootIds,
|
|
32032
32221
|
controlMapUsesAuth,
|
|
32033
32222
|
controlMapUsesBusy,
|
|
32223
|
+
controlNavReferences,
|
|
32034
32224
|
controlUsesOverlayRef,
|
|
32035
32225
|
controlVariantIds,
|
|
32036
32226
|
controlVariants,
|
|
@@ -32776,6 +32966,9 @@ var HISTORY_SELECTION_KEYS = [
|
|
|
32776
32966
|
redirectRouteLiteral,
|
|
32777
32967
|
referencedShapeIds,
|
|
32778
32968
|
relationshipParent,
|
|
32969
|
+
remapControlMapNavs,
|
|
32970
|
+
remapControlNavs,
|
|
32971
|
+
remapNavSourceNavs,
|
|
32779
32972
|
remapRuleNavs,
|
|
32780
32973
|
remapScreenComputedNavs,
|
|
32781
32974
|
remapShapeHolders,
|
|
@@ -32815,6 +33008,7 @@ var HISTORY_SELECTION_KEYS = [
|
|
|
32815
33008
|
repipeCall,
|
|
32816
33009
|
replaceChainStep,
|
|
32817
33010
|
replaceMenuItem,
|
|
33011
|
+
replaceParentNav,
|
|
32818
33012
|
requiredCallArgLeaves,
|
|
32819
33013
|
requiredOptionValue,
|
|
32820
33014
|
resolveBranchArm,
|
package/package.json
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
import { WebComponentConfig } from '../model/type';
|
|
2
|
+
export declare function compileGlobalStyles(componentPath: string): {
|
|
3
|
+
css: string;
|
|
4
|
+
fontUrls: string[];
|
|
5
|
+
preconnectUrls: Array<{
|
|
6
|
+
url: string;
|
|
7
|
+
crossorigin: boolean;
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
2
10
|
export declare function createWebComponentWrapper(config: WebComponentConfig): string;
|
|
3
11
|
//# sourceMappingURL=web-component-wrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-component-wrapper.d.ts","sourceRoot":"","sources":["../../../../../../../libs/cli/src/compilers/web-component/lib/web-component-wrapper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"web-component-wrapper.d.ts","sourceRoot":"","sources":["../../../../../../../libs/cli/src/compilers/web-component/lib/web-component-wrapper.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AA2EnD,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG;IAC1D,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,cAAc,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CAC9D,CA+HA;AA+ND,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAa5E"}
|
|
@@ -1,26 +1,68 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.compileGlobalStyles = compileGlobalStyles;
|
|
3
4
|
exports.createWebComponentWrapper = createWebComponentWrapper;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
5
6
|
const node_fs_1 = require("node:fs");
|
|
6
7
|
const path_1 = require("path");
|
|
7
8
|
const sass = tslib_1.__importStar(require("sass"));
|
|
8
|
-
|
|
9
|
+
/** Nearest ancestor of `startPath` (itself included) holding one of `markers`. */
|
|
10
|
+
function findUp(startPath, markers) {
|
|
9
11
|
let current = (0, path_1.resolve)(startPath);
|
|
10
12
|
for (let i = 0; i < 10; i++) {
|
|
11
|
-
if ((0, node_fs_1.existsSync)((0, path_1.join)(current,
|
|
12
|
-
(0, node_fs_1.existsSync)((0, path_1.join)(current, 'tsconfig.base.json'))) {
|
|
13
|
+
if (markers.some((m) => (0, node_fs_1.existsSync)((0, path_1.join)(current, m))))
|
|
13
14
|
return current;
|
|
14
|
-
}
|
|
15
15
|
const parent = (0, path_1.dirname)(current);
|
|
16
16
|
if (parent === current)
|
|
17
17
|
break;
|
|
18
18
|
current = parent;
|
|
19
19
|
}
|
|
20
|
-
return
|
|
20
|
+
return '';
|
|
21
|
+
}
|
|
22
|
+
function findWorkspaceRoot(startPath) {
|
|
23
|
+
return findUp(startPath, ['nx.json', 'tsconfig.base.json']) || startPath;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Where the global styles' paths resolve from: the Nx workspace, else a
|
|
27
|
+
* standalone Angular CLI workspace (`angular.json`), else the build's cwd.
|
|
28
|
+
*/
|
|
29
|
+
function findStylesRoot(startPath) {
|
|
30
|
+
return (findUp(startPath, ['nx.json', 'tsconfig.base.json']) ||
|
|
31
|
+
findUp(startPath, ['angular.json']) ||
|
|
32
|
+
process.cwd());
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The app's build options — its Nx `project.json`, else the `angular.json`
|
|
36
|
+
* project whose root holds the component (a standalone CLI-made app).
|
|
37
|
+
*/
|
|
38
|
+
function findBuildOptions(componentPath, workspaceRoot) {
|
|
39
|
+
const projectDir = findUp((0, path_1.dirname)(componentPath), ['project.json']);
|
|
40
|
+
if (projectDir) {
|
|
41
|
+
const projectJson = JSON.parse((0, node_fs_1.readFileSync)((0, path_1.join)(projectDir, 'project.json'), 'utf8'));
|
|
42
|
+
return {
|
|
43
|
+
options: projectJson.targets?.build?.options || {},
|
|
44
|
+
projectRoot: projectDir,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
const angularJsonPath = (0, path_1.join)(workspaceRoot, 'angular.json');
|
|
48
|
+
if (!(0, node_fs_1.existsSync)(angularJsonPath))
|
|
49
|
+
return undefined;
|
|
50
|
+
const angularJson = JSON.parse((0, node_fs_1.readFileSync)(angularJsonPath, 'utf8'));
|
|
51
|
+
const projects = Object.values(angularJson.projects || {});
|
|
52
|
+
const component = (0, path_1.resolve)(componentPath);
|
|
53
|
+
const project = projects
|
|
54
|
+
.filter((p) => component.startsWith((0, path_1.resolve)(workspaceRoot, p.root || '')))
|
|
55
|
+
.sort((a, b) => (b.root || '').length - (a.root || '').length)[0] ||
|
|
56
|
+
projects[0];
|
|
57
|
+
if (!project)
|
|
58
|
+
return undefined;
|
|
59
|
+
return {
|
|
60
|
+
options: project.architect?.build?.options || {},
|
|
61
|
+
projectRoot: (0, path_1.resolve)(workspaceRoot, project.root || ''),
|
|
62
|
+
};
|
|
21
63
|
}
|
|
22
64
|
function compileGlobalStyles(componentPath) {
|
|
23
|
-
const workspaceRoot =
|
|
65
|
+
const workspaceRoot = findStylesRoot(componentPath);
|
|
24
66
|
const monorepoSass = (0, path_1.join)(workspaceRoot, 'libs/one/src/lib/shared/sass');
|
|
25
67
|
const embeddedSass = (0, path_1.join)(workspaceRoot, 'sass');
|
|
26
68
|
const publishedSass = (0, path_1.join)(workspaceRoot, 'node_modules/@magmonium/one/sass');
|
|
@@ -29,20 +71,6 @@ function compileGlobalStyles(componentPath) {
|
|
|
29
71
|
: (0, node_fs_1.existsSync)(embeddedSass)
|
|
30
72
|
? embeddedSass
|
|
31
73
|
: publishedSass;
|
|
32
|
-
// Find project.json to get global styles
|
|
33
|
-
let currentDir = (0, path_1.dirname)(componentPath);
|
|
34
|
-
let projectJsonPath = '';
|
|
35
|
-
for (let i = 0; i < 10; i++) {
|
|
36
|
-
const checkPath = (0, path_1.join)(currentDir, 'project.json');
|
|
37
|
-
if ((0, node_fs_1.existsSync)(checkPath)) {
|
|
38
|
-
projectJsonPath = checkPath;
|
|
39
|
-
break;
|
|
40
|
-
}
|
|
41
|
-
const parentDir = (0, path_1.dirname)(currentDir);
|
|
42
|
-
if (parentDir === currentDir)
|
|
43
|
-
break;
|
|
44
|
-
currentDir = parentDir;
|
|
45
|
-
}
|
|
46
74
|
const stylesToCompile = [];
|
|
47
75
|
// ALWAYS include foundational reset first
|
|
48
76
|
const resetSassPath = (0, path_1.resolve)(sassLibPath, '_reset.sass');
|
|
@@ -52,14 +80,19 @@ function compileGlobalStyles(componentPath) {
|
|
|
52
80
|
let externalStyles = '';
|
|
53
81
|
let preconnectMatches = [];
|
|
54
82
|
const extraIncludePaths = [];
|
|
55
|
-
|
|
83
|
+
let build;
|
|
84
|
+
try {
|
|
85
|
+
build = findBuildOptions(componentPath, workspaceRoot);
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
console.warn('⚠️ Failed to parse project.json / angular.json for global styles');
|
|
89
|
+
}
|
|
90
|
+
if (build) {
|
|
56
91
|
try {
|
|
57
|
-
const
|
|
58
|
-
const projectStyles =
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const includePaths = projectJson.targets?.build?.options?.stylePreprocessorOptions
|
|
62
|
-
?.includePaths || [];
|
|
92
|
+
const { options, projectRoot } = build;
|
|
93
|
+
const projectStyles = options.styles || [];
|
|
94
|
+
// Respect stylePreprocessorOptions.includePaths from the build options
|
|
95
|
+
const includePaths = options.stylePreprocessorOptions?.includePaths || [];
|
|
63
96
|
for (const p of includePaths) {
|
|
64
97
|
extraIncludePaths.push((0, path_1.resolve)(workspaceRoot, p));
|
|
65
98
|
}
|
|
@@ -72,7 +105,7 @@ function compileGlobalStyles(componentPath) {
|
|
|
72
105
|
}
|
|
73
106
|
}
|
|
74
107
|
// Also check index.html for fonts/links
|
|
75
|
-
const indexOption =
|
|
108
|
+
const indexOption = options.index;
|
|
76
109
|
const indexHtmlPath = indexOption
|
|
77
110
|
? (0, path_1.resolve)(workspaceRoot, indexOption)
|
|
78
111
|
: (0, path_1.join)(projectRoot, 'src/index.html');
|
|
@@ -85,7 +118,7 @@ function compileGlobalStyles(componentPath) {
|
|
|
85
118
|
}
|
|
86
119
|
}
|
|
87
120
|
catch {
|
|
88
|
-
console.warn('⚠️ Failed to
|
|
121
|
+
console.warn('⚠️ Failed to read global styles from the build options');
|
|
89
122
|
}
|
|
90
123
|
}
|
|
91
124
|
let combinedCss = '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-component-wrapper.js","sourceRoot":"","sources":["../../../../../../../libs/cli/src/compilers/web-component/lib/web-component-wrapper.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"web-component-wrapper.js","sourceRoot":"","sources":["../../../../../../../libs/cli/src/compilers/web-component/lib/web-component-wrapper.ts"],"names":[],"mappings":";;AA8EA,kDAmIC;AA+ND,8DAaC;;AA7bD,qCAA6E;AAC7E,+BAAwD;AACxD,mDAA6B;AAG7B,kFAAkF;AAClF,SAAS,MAAM,CAAC,SAAiB,EAAE,OAAiB;IAClD,IAAI,OAAO,GAAG,IAAA,cAAO,EAAC,SAAS,CAAC,CAAC;IACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;QAC5B,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,oBAAU,EAAC,IAAA,WAAI,EAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;YAAE,OAAO,OAAO,CAAC;QACtE,MAAM,MAAM,GAAG,IAAA,cAAO,EAAC,OAAO,CAAC,CAAC;QAChC,IAAI,MAAM,KAAK,OAAO;YAAE,MAAM;QAC9B,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,iBAAiB,CAAC,SAAiB;IAC1C,OAAO,MAAM,CAAC,SAAS,EAAE,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC,IAAI,SAAS,CAAC;AAC3E,CAAC;AAED;;;GAGG;AACH,SAAS,cAAc,CAAC,SAAiB;IACvC,OAAO,CACL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BAiBV,MAAM,CAAC,QAAQ;;;;;;;;;;;uCAWH,MAAM,CAAC,QAAQ;;+DAES,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;;;2BAmBpD,MAAM,CAAC,QAAQ;;;;;;;;yBAQjB,MAAM,CAAC,QAAQ;;;;;;;;;;;;;WAa7B,MAAM,CAAC,SAAS;iBACV,MAAM,CAAC,SAAS;GAC9B,CAAC;AACJ,CAAC;AAED,SAAgB,yBAAyB,CAAC,MAA0B;IAClE,MAAM,cAAc,GAAG,mBAAmB,CAAC,MAAM,CAAC,CAAC;IACnD,2EAA2E;IAC3E,6EAA6E;IAC7E,0DAA0D;IAC1D,MAAM,aAAa,GAAG,iBAAiB,CACrC,MAAM,CAAC,aAAa,IAAI,OAAO,CAAC,GAAG,EAAE,CACtC,CAAC;IACF,MAAM,UAAU,GAAG,IAAA,cAAO,EAAC,aAAa,EAAE,mBAAmB,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAC5E,IAAA,mBAAS,EAAC,UAAU,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3C,MAAM,WAAW,GAAG,IAAA,WAAI,EAAC,UAAU,EAAE,GAAG,MAAM,CAAC,QAAQ,KAAK,CAAC,CAAC;IAC9D,IAAA,uBAAa,EAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IAC3C,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
package/src/index.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export * from './utils/translation-manager';
|
|
|
25
25
|
export * from './utils/interactive-translator';
|
|
26
26
|
export * from './utils/ollama-translator';
|
|
27
27
|
export * from './utils/web-translation-providers';
|
|
28
|
+
export * from './utils/ai-provider-translator';
|
|
28
29
|
export * from './utils/i18n-fixer';
|
|
29
30
|
export * from './utils/i18n-sanitizer';
|
|
30
31
|
export * from './utils/i18n-compile-validator';
|
package/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/cli/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../libs/cli/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cA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