Removing more dead code
This commit is contained in:
parent
ee5d19456e
commit
75809576fe
|
@ -1,5 +1,5 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { createEventDispatcher, onMount } from "svelte"
|
import { createEventDispatcher } from "svelte"
|
||||||
import {
|
import {
|
||||||
decodeJSBinding,
|
decodeJSBinding,
|
||||||
encodeJSBinding,
|
encodeJSBinding,
|
||||||
|
@ -16,7 +16,6 @@
|
||||||
} from "../CodeEditor"
|
} from "../CodeEditor"
|
||||||
import { JsonFormatter } from "@budibase/frontend-core"
|
import { JsonFormatter } from "@budibase/frontend-core"
|
||||||
import { licensing } from "@/stores/portal"
|
import { licensing } from "@/stores/portal"
|
||||||
import { BindingMode } from "@budibase/types"
|
|
||||||
import type {
|
import type {
|
||||||
EnrichedBinding,
|
EnrichedBinding,
|
||||||
BindingCompletion,
|
BindingCompletion,
|
||||||
|
@ -32,8 +31,6 @@
|
||||||
|
|
||||||
export let bindings: EnrichedBinding[] = []
|
export let bindings: EnrichedBinding[] = []
|
||||||
export let value: string = ""
|
export let value: string = ""
|
||||||
export let allowHBS = true
|
|
||||||
export let allowJS = false
|
|
||||||
export let allowHelpers = true
|
export let allowHelpers = true
|
||||||
export let allowSnippets = true
|
export let allowSnippets = true
|
||||||
export let context = null
|
export let context = null
|
||||||
|
@ -43,13 +40,10 @@
|
||||||
let getCaretPosition: CaretPositionFn | undefined
|
let getCaretPosition: CaretPositionFn | undefined
|
||||||
let insertAtPos: InsertAtPositionFn | undefined
|
let insertAtPos: InsertAtPositionFn | undefined
|
||||||
|
|
||||||
// TO Switch the runtime
|
|
||||||
$: readable = runtimeToReadableBinding(bindings, value || "")
|
$: readable = runtimeToReadableBinding(bindings, value || "")
|
||||||
|
|
||||||
$: jsValue = decodeJSBinding(readable)
|
$: jsValue = decodeJSBinding(readable)
|
||||||
|
|
||||||
$: useSnippets = allowSnippets && !$licensing.isFreePlan
|
$: useSnippets = allowSnippets && !$licensing.isFreePlan
|
||||||
$: editorModeOptions = getModeOptions(allowHBS, allowJS)
|
|
||||||
$: enrichedBindings = enrichBindings(bindings, context, $snippets)
|
$: enrichedBindings = enrichBindings(bindings, context, $snippets)
|
||||||
$: editorMode = EditorModes.JS
|
$: editorMode = EditorModes.JS
|
||||||
$: bindingCompletions = bindingsToCompletions(enrichedBindings, editorMode)
|
$: bindingCompletions = bindingsToCompletions(enrichedBindings, editorMode)
|
||||||
|
@ -77,17 +71,6 @@
|
||||||
return completions
|
return completions
|
||||||
}
|
}
|
||||||
|
|
||||||
const getModeOptions = (allowHBS: boolean, allowJS: boolean) => {
|
|
||||||
let options = []
|
|
||||||
if (allowHBS) {
|
|
||||||
options.push(BindingMode.Text)
|
|
||||||
}
|
|
||||||
if (allowJS) {
|
|
||||||
options.push(BindingMode.JavaScript)
|
|
||||||
}
|
|
||||||
return options
|
|
||||||
}
|
|
||||||
|
|
||||||
const highlightJSON = (json: JSONValue) => {
|
const highlightJSON = (json: JSONValue) => {
|
||||||
return JsonFormatter.format(json, {
|
return JsonFormatter.format(json, {
|
||||||
keyColor: "#e06c75",
|
keyColor: "#e06c75",
|
||||||
|
|
Loading…
Reference in New Issue