diff --git a/packages/builder/src/builderStore/insertCodeMetadata.js b/packages/builder/src/builderStore/insertCodeMetadata.js
new file mode 100644
index 0000000000..00c18901b5
--- /dev/null
+++ b/packages/builder/src/builderStore/insertCodeMetadata.js
@@ -0,0 +1,17 @@
+export const insertCodeMetadata = props => {
+ if (props._code && props._code.length > 0) {
+ props._codeMeta = codeMetaData(props._code)
+ }
+
+ if (!props._children || props._children.length === 0) return
+
+ for (let child of props._children) {
+ insertCodeMetadata(child)
+ }
+}
+
+const codeMetaData = code => {
+ return {
+ dependsOnStore: RegExp(/(store.)/g).test(code),
+ }
+}
diff --git a/packages/builder/src/builderStore/store.js b/packages/builder/src/builderStore/store.js
index b0bcaf31f9..c3dad0a867 100644
--- a/packages/builder/src/builderStore/store.js
+++ b/packages/builder/src/builderStore/store.js
@@ -39,6 +39,7 @@ import {
} from "./loadComponentLibraries"
import { buildCodeForScreens } from "./buildCodeForScreens"
import { generate_screen_css } from "./generate_css"
+import { insertCodeMetadata } from "./insertCodeMetadata"
// import { uuid } from "./uuid"
let appname = ""
@@ -818,6 +819,8 @@ const setCurrentScreenFunctions = s => {
s.currentPreviewItem === "screen"
? buildCodeForScreens([s.currentPreviewItem])
: "({});"
+
+ insertCodeMetadata(s.currentPreviewItem.props)
}
const setScreenType = store => type => {
diff --git a/packages/builder/src/userInterface/EventsEditor/EventEditorModal.svelte b/packages/builder/src/userInterface/EventsEditor/EventEditorModal.svelte
index d0feb89bd0..56370d7a89 100644
--- a/packages/builder/src/userInterface/EventsEditor/EventEditorModal.svelte
+++ b/packages/builder/src/userInterface/EventsEditor/EventEditorModal.svelte
@@ -11,15 +11,17 @@
import { EVENT_TYPE_MEMBER_NAME } from "../../common/eventHandlers"
export let event
- export let eventOptions
+ export let eventOptions = []
export let open
export let onClose
export let onPropChanged
- let eventType = "onClick"
+ let eventType = ""
let draftEventHandler = { parameters: [] }
$: eventData = event || { handlers: [] }
+ $: if (!eventOptions.includes(eventType) && eventOptions.length > 0)
+ eventType = eventOptions[0].name
const closeModal = () => {
onClose()
@@ -74,7 +76,7 @@
Event Type
{@html getIcon('info', 20)}
-