@stubber/form-fields 1.4.1 → 1.4.3
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.
|
@@ -6,8 +6,6 @@ import { Label } from "@stubber/ui/label";
|
|
|
6
6
|
import { basicSetup } from "codemirror";
|
|
7
7
|
export let field;
|
|
8
8
|
let value = $field.data.base || "";
|
|
9
|
-
let params = $field.spec?.params || {};
|
|
10
|
-
let globals = params?.globals || {};
|
|
11
9
|
let editor_view;
|
|
12
10
|
$: state_key = $field.state?.state_key;
|
|
13
11
|
$: label = $field.spec?.title;
|
|
@@ -29,7 +27,7 @@ function globalCompletions(ctx) {
|
|
|
29
27
|
const text = m?.text ?? "";
|
|
30
28
|
const trailingDot = text.endsWith(".");
|
|
31
29
|
const parts = (trailingDot ? text.slice(0, -1) : text).split(".").filter(Boolean);
|
|
32
|
-
let container = globals;
|
|
30
|
+
let container = $field.spec?.params?.globals || {};
|
|
33
31
|
for (let i = 0; i < Math.max(0, parts.length - (trailingDot ? 0 : 1)); i++) {
|
|
34
32
|
container = container?.[parts[i]];
|
|
35
33
|
if (!container) break;
|