@aglyn/plugins-logic 1.0.0-beta.250 → 1.0.0-beta.253
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/package.json +8 -8
- package/src/lib/model/parameter-choice-rows.d.ts +38 -0
- package/src/lib/model/parameter-choice-rows.js +48 -0
- package/src/lib/model/parameter-choice-rows.js.map +1 -0
- package/src/lib/model/parameter-options.d.ts +1 -16
- package/src/lib/model/parameter-options.js +1 -31
- package/src/lib/model/parameter-options.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aglyn/plugins-logic",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.253",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://aglyn.com",
|
|
6
6
|
"repository": {
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aglyn/aglyn": "1.0.0-beta.
|
|
29
|
-
"@aglyn/shared-data-mdi": "1.0.0-beta.
|
|
30
|
-
"@aglyn/shared-ui-jsx": "1.0.0-beta.
|
|
31
|
-
"@aglyn/shared-ui-snackstack": "1.0.0-beta.
|
|
32
|
-
"@aglyn/shared-util-timestamp": "1.0.0-beta.
|
|
33
|
-
"@aglyn/tenant-data-admin": "1.0.0-beta.
|
|
34
|
-
"@aglyn/tenant-feature-instance": "1.0.0-beta.
|
|
28
|
+
"@aglyn/aglyn": "1.0.0-beta.253",
|
|
29
|
+
"@aglyn/shared-data-mdi": "1.0.0-beta.253",
|
|
30
|
+
"@aglyn/shared-ui-jsx": "1.0.0-beta.253",
|
|
31
|
+
"@aglyn/shared-ui-snackstack": "1.0.0-beta.253",
|
|
32
|
+
"@aglyn/shared-util-timestamp": "1.0.0-beta.253",
|
|
33
|
+
"@aglyn/tenant-data-admin": "1.0.0-beta.253",
|
|
34
|
+
"@aglyn/tenant-feature-instance": "1.0.0-beta.253",
|
|
35
35
|
"@swc/helpers": "0.5.23"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
import type { HostFunctionParameterOption } from '@aglyn/aglyn';
|
|
18
|
+
/**
|
|
19
|
+
* A parameter's choices as rows (AGL-3768), with no runtime imports so the
|
|
20
|
+
* native apps' function editors build and read the same rows the console's
|
|
21
|
+
* choices editor does.
|
|
22
|
+
*/
|
|
23
|
+
/** One row of the choices editor, blanks and all, as the author sees it. */
|
|
24
|
+
export interface ParameterChoiceRow {
|
|
25
|
+
/** What the function receives. */
|
|
26
|
+
value: string;
|
|
27
|
+
/** What the visitor reads; the value when blank. */
|
|
28
|
+
label: string;
|
|
29
|
+
}
|
|
30
|
+
/** The rows a stored choice list opens as. */
|
|
31
|
+
export declare function choiceRowsFromOptions(options: HostFunctionParameterOption[] | undefined): ParameterChoiceRow[];
|
|
32
|
+
/**
|
|
33
|
+
* The choice list rows store as (AGL-3768) — the same shape the one-line
|
|
34
|
+
* grammar produced. A row with no value is not a choice yet; the second row
|
|
35
|
+
* of a value is dropped, since a list cannot tell the function which of two
|
|
36
|
+
* identical values was picked; a label equal to its value is not stored.
|
|
37
|
+
*/
|
|
38
|
+
export declare function optionsFromChoiceRows(rows: readonly ParameterChoiceRow[]): HostFunctionParameterOption[];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Aglyn LLC
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/ /** The rows a stored choice list opens as. */ export function choiceRowsFromOptions(options) {
|
|
17
|
+
return (options != null ? options : []).map((option)=>{
|
|
18
|
+
var _option_label;
|
|
19
|
+
return {
|
|
20
|
+
value: option.value,
|
|
21
|
+
label: (_option_label = option.label) != null ? _option_label : ''
|
|
22
|
+
};
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The choice list rows store as (AGL-3768) — the same shape the one-line
|
|
27
|
+
* grammar produced. A row with no value is not a choice yet; the second row
|
|
28
|
+
* of a value is dropped, since a list cannot tell the function which of two
|
|
29
|
+
* identical values was picked; a label equal to its value is not stored.
|
|
30
|
+
*/ export function optionsFromChoiceRows(rows) {
|
|
31
|
+
const options = [];
|
|
32
|
+
const seen = new Set();
|
|
33
|
+
for (const row of rows){
|
|
34
|
+
const value = row.value.trim();
|
|
35
|
+
if (!value || seen.has(value)) continue;
|
|
36
|
+
seen.add(value);
|
|
37
|
+
const label = row.label.trim();
|
|
38
|
+
options.push(label && label !== value ? {
|
|
39
|
+
value,
|
|
40
|
+
label
|
|
41
|
+
} : {
|
|
42
|
+
value
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return options;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=parameter-choice-rows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/logic/src/lib/model/parameter-choice-rows.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { HostFunctionParameterOption } from '@aglyn/aglyn'\n\n/**\n * A parameter's choices as rows (AGL-3768), with no runtime imports so the\n * native apps' function editors build and read the same rows the console's\n * choices editor does.\n */\n\n/** One row of the choices editor, blanks and all, as the author sees it. */\nexport interface ParameterChoiceRow {\n /** What the function receives. */\n value: string\n /** What the visitor reads; the value when blank. */\n label: string\n}\n\n/** The rows a stored choice list opens as. */\nexport function choiceRowsFromOptions(\n options: HostFunctionParameterOption[] | undefined,\n): ParameterChoiceRow[] {\n return (options ?? []).map((option) => ({\n value: option.value,\n label: option.label ?? '',\n }))\n}\n\n/**\n * The choice list rows store as (AGL-3768) — the same shape the one-line\n * grammar produced. A row with no value is not a choice yet; the second row\n * of a value is dropped, since a list cannot tell the function which of two\n * identical values was picked; a label equal to its value is not stored.\n */\nexport function optionsFromChoiceRows(\n rows: readonly ParameterChoiceRow[],\n): HostFunctionParameterOption[] {\n const options: HostFunctionParameterOption[] = []\n const seen = new Set<string>()\n for (const row of rows) {\n const value = row.value.trim()\n if (!value || seen.has(value)) continue\n seen.add(value)\n const label = row.label.trim()\n options.push(label && label !== value ? { value, label } : { value })\n }\n return options\n}\n"],"names":["choiceRowsFromOptions","options","map","option","value","label","optionsFromChoiceRows","rows","seen","Set","row","trim","has","add","push"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAkBD,4CAA4C,GAC5C,OAAO,SAASA,sBACdC,OAAkD;IAElD,OAAO,CAACA,kBAAAA,UAAW,EAAE,EAAEC,GAAG,CAAC,CAACC;YAEnBA;eAF+B;YACtCC,OAAOD,OAAOC,KAAK;YACnBC,KAAK,GAAEF,gBAAAA,OAAOE,KAAK,YAAZF,gBAAgB;QACzB;;AACF;AAEA;;;;;CAKC,GACD,OAAO,SAASG,sBACdC,IAAmC;IAEnC,MAAMN,UAAyC,EAAE;IACjD,MAAMO,OAAO,IAAIC;IACjB,KAAK,MAAMC,OAAOH,KAAM;QACtB,MAAMH,QAAQM,IAAIN,KAAK,CAACO,IAAI;QAC5B,IAAI,CAACP,SAASI,KAAKI,GAAG,CAACR,QAAQ;QAC/BI,KAAKK,GAAG,CAACT;QACT,MAAMC,QAAQK,IAAIL,KAAK,CAACM,IAAI;QAC5BV,QAAQa,IAAI,CAACT,SAASA,UAAUD,QAAQ;YAAEA;YAAOC;QAAM,IAAI;YAAED;QAAM;IACrE;IACA,OAAOH;AACT"}
|
|
@@ -24,19 +24,4 @@ import { type HostFunctionParameterOption } from '@aglyn/aglyn';
|
|
|
24
24
|
export declare function parseParameterOptions(text: string): HostFunctionParameterOption[];
|
|
25
25
|
/** The inverse, for showing a stored list in that one line. */
|
|
26
26
|
export declare function formatParameterOptions(options: HostFunctionParameterOption[] | undefined): string;
|
|
27
|
-
|
|
28
|
-
export interface ParameterChoiceRow {
|
|
29
|
-
/** What the function receives. */
|
|
30
|
-
value: string;
|
|
31
|
-
/** What the visitor reads; the value when blank. */
|
|
32
|
-
label: string;
|
|
33
|
-
}
|
|
34
|
-
/** The rows a stored choice list opens as. */
|
|
35
|
-
export declare function choiceRowsFromOptions(options: HostFunctionParameterOption[] | undefined): ParameterChoiceRow[];
|
|
36
|
-
/**
|
|
37
|
-
* The choice list rows store as (AGL-3768) — the same shape the one-line
|
|
38
|
-
* grammar produced. A row with no value is not a choice yet; the second row
|
|
39
|
-
* of a value is dropped, since a list cannot tell the function which of two
|
|
40
|
-
* identical values was picked; a label equal to its value is not stored.
|
|
41
|
-
*/
|
|
42
|
-
export declare function optionsFromChoiceRows(rows: readonly ParameterChoiceRow[]): HostFunctionParameterOption[];
|
|
27
|
+
export { choiceRowsFromOptions, optionsFromChoiceRows, type ParameterChoiceRow, } from './parameter-choice-rows';
|
|
@@ -25,36 +25,6 @@
|
|
|
25
25
|
/** The inverse, for showing a stored list in that one line. */ export function formatParameterOptions(options) {
|
|
26
26
|
return formatFunctionParameterOptions(options);
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
return (options != null ? options : []).map((option)=>{
|
|
30
|
-
var _option_label;
|
|
31
|
-
return {
|
|
32
|
-
value: option.value,
|
|
33
|
-
label: (_option_label = option.label) != null ? _option_label : ''
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* The choice list rows store as (AGL-3768) — the same shape the one-line
|
|
39
|
-
* grammar produced. A row with no value is not a choice yet; the second row
|
|
40
|
-
* of a value is dropped, since a list cannot tell the function which of two
|
|
41
|
-
* identical values was picked; a label equal to its value is not stored.
|
|
42
|
-
*/ export function optionsFromChoiceRows(rows) {
|
|
43
|
-
const options = [];
|
|
44
|
-
const seen = new Set();
|
|
45
|
-
for (const row of rows){
|
|
46
|
-
const value = row.value.trim();
|
|
47
|
-
if (!value || seen.has(value)) continue;
|
|
48
|
-
seen.add(value);
|
|
49
|
-
const label = row.label.trim();
|
|
50
|
-
options.push(label && label !== value ? {
|
|
51
|
-
value,
|
|
52
|
-
label
|
|
53
|
-
} : {
|
|
54
|
-
value
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
return options;
|
|
58
|
-
}
|
|
28
|
+
export { choiceRowsFromOptions, optionsFromChoiceRows } from "./parameter-choice-rows.js";
|
|
59
29
|
|
|
60
30
|
//# sourceMappingURL=parameter-options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../libs/plugins/logic/src/lib/model/parameter-options.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n formatFunctionParameterOptions,\n type HostFunctionParameterOption,\n parseFunctionParameterOptions,\n} from '@aglyn/aglyn'\n\n/**\n * A parameter's choice list as one line of text (AGL-3202). The grammar lives\n * in core — `parseFunctionParameterOptions` — because the canvas's Function\n * Input element reads the same line and a plugin may not import another. These\n * are the names the function builder has always called it by.\n */\nexport function parseParameterOptions(\n text: string,\n): HostFunctionParameterOption[] {\n return parseFunctionParameterOptions(text)\n}\n\n/** The inverse, for showing a stored list in that one line. */\nexport function formatParameterOptions(\n options: HostFunctionParameterOption[] | undefined,\n): string {\n return formatFunctionParameterOptions(options)\n}\n\
|
|
1
|
+
{"version":3,"sources":["../../../../../../../libs/plugins/logic/src/lib/model/parameter-options.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n formatFunctionParameterOptions,\n type HostFunctionParameterOption,\n parseFunctionParameterOptions,\n} from '@aglyn/aglyn'\n\n/**\n * A parameter's choice list as one line of text (AGL-3202). The grammar lives\n * in core — `parseFunctionParameterOptions` — because the canvas's Function\n * Input element reads the same line and a plugin may not import another. These\n * are the names the function builder has always called it by.\n */\nexport function parseParameterOptions(\n text: string,\n): HostFunctionParameterOption[] {\n return parseFunctionParameterOptions(text)\n}\n\n/** The inverse, for showing a stored list in that one line. */\nexport function formatParameterOptions(\n options: HostFunctionParameterOption[] | undefined,\n): string {\n return formatFunctionParameterOptions(options)\n}\n\nexport {\n choiceRowsFromOptions,\n optionsFromChoiceRows,\n type ParameterChoiceRow,\n} from './parameter-choice-rows'\n"],"names":["formatFunctionParameterOptions","parseFunctionParameterOptions","parseParameterOptions","text","formatParameterOptions","options","choiceRowsFromOptions","optionsFromChoiceRows"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GAED,SACEA,8BAA8B,EAE9BC,6BAA6B,QACxB,eAAc;AAErB;;;;;CAKC,GACD,OAAO,SAASC,sBACdC,IAAY;IAEZ,OAAOF,8BAA8BE;AACvC;AAEA,6DAA6D,GAC7D,OAAO,SAASC,uBACdC,OAAkD;IAElD,OAAOL,+BAA+BK;AACxC;AAEA,SACEC,qBAAqB,EACrBC,qBAAqB,QAEhB,6BAAyB"}
|