diff --git a/packages/builder/src/common/ActionButton.svelte b/packages/builder/src/common/ActionButton.svelte new file mode 100644 index 0000000000..fca74c09ff --- /dev/null +++ b/packages/builder/src/common/ActionButton.svelte @@ -0,0 +1,53 @@ + + + + + diff --git a/packages/builder/src/common/Icons/Events.svelte b/packages/builder/src/common/Icons/Events.svelte new file mode 100644 index 0000000000..b7d92481e3 --- /dev/null +++ b/packages/builder/src/common/Icons/Events.svelte @@ -0,0 +1,9 @@ + + + + diff --git a/packages/builder/src/common/Icons/Pencil.svelte b/packages/builder/src/common/Icons/Pencil.svelte new file mode 100644 index 0000000000..266458a132 --- /dev/null +++ b/packages/builder/src/common/Icons/Pencil.svelte @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/packages/builder/src/common/Icons/index.js b/packages/builder/src/common/Icons/index.js index 2e2ffc2010..c00ebb3ce4 100644 --- a/packages/builder/src/common/Icons/index.js +++ b/packages/builder/src/common/Icons/index.js @@ -4,3 +4,5 @@ export { default as TerminalIcon } from './Terminal.svelte'; export { default as InputIcon } from './Input.svelte'; export { default as ImageIcon } from './Image.svelte'; export { default as ArrowDownIcon } from './ArrowDown.svelte'; +export { default as EventsIcon } from './Events.svelte'; +export { default as PencilIcon } from './Pencil.svelte'; diff --git a/packages/builder/src/common/Input.svelte b/packages/builder/src/common/Input.svelte new file mode 100644 index 0000000000..04938b670a --- /dev/null +++ b/packages/builder/src/common/Input.svelte @@ -0,0 +1,27 @@ + + + + + diff --git a/packages/builder/src/common/Modal.svelte b/packages/builder/src/common/Modal.svelte index 0f47d553a0..5d695d0fc1 100644 --- a/packages/builder/src/common/Modal.svelte +++ b/packages/builder/src/common/Modal.svelte @@ -1,41 +1,44 @@ -
-
- -
-
- - -.uk-modal-dialog { - border-radius: .3rem; -} - - \ No newline at end of file +
+
+ {#if onClosed} +
+
diff --git a/packages/builder/src/common/PlusButton.svelte b/packages/builder/src/common/PlusButton.svelte new file mode 100644 index 0000000000..7424ffa66e --- /dev/null +++ b/packages/builder/src/common/PlusButton.svelte @@ -0,0 +1,23 @@ + + + diff --git a/packages/builder/src/common/Select.svelte b/packages/builder/src/common/Select.svelte new file mode 100644 index 0000000000..bebad32c38 --- /dev/null +++ b/packages/builder/src/common/Select.svelte @@ -0,0 +1,55 @@ + + + + +
+ + + {@html getIcon('chevron-down', '24')} + +
diff --git a/packages/builder/src/userInterface/ComponentPanel.svelte b/packages/builder/src/userInterface/ComponentPanel.svelte index 5649820970..d4d982f2e2 100644 --- a/packages/builder/src/userInterface/ComponentPanel.svelte +++ b/packages/builder/src/userInterface/ComponentPanel.svelte @@ -2,9 +2,10 @@ import PropsView from "./PropsView.svelte"; import { store } from "../builderStore"; import IconButton from "../common/IconButton.svelte"; - import { LayoutIcon, PaintIcon, TerminalIcon } from '../common/Icons/'; + import { LayoutIcon, PaintIcon, TerminalIcon, EventsIcon } from '../common/Icons/'; import CodeEditor from './CodeEditor.svelte'; import LayoutEditor from './LayoutEditor.svelte'; + import EventsEditor from "./EventsEditor"; let current_view = 'props'; @@ -17,6 +18,7 @@ const onPropChanged = store.setComponentProp; const onStyleChanged = store.setComponentStyle; +
@@ -36,6 +38,11 @@ +
  • + +
  • {#if !componentInfo.component} @@ -45,6 +52,8 @@ {:else if current_view === 'layout'} + {:else if current_view === 'events'} + {:else} {/if} diff --git a/packages/builder/src/userInterface/EventListSelector.svelte b/packages/builder/src/userInterface/EventListSelector.svelte deleted file mode 100644 index cfbe20345d..0000000000 --- a/packages/builder/src/userInterface/EventListSelector.svelte +++ /dev/null @@ -1,88 +0,0 @@ - - -
    -
    - {#each events as ev, index} - -
    - - -
    - -
    - {/each} - -
    - -
    -
    -
    - - - diff --git a/packages/builder/src/userInterface/EventSelector.svelte b/packages/builder/src/userInterface/EventSelector.svelte deleted file mode 100644 index e109d8122d..0000000000 --- a/packages/builder/src/userInterface/EventSelector.svelte +++ /dev/null @@ -1,105 +0,0 @@ - - -
    - - - - -
    - -{#if parameters} - {#each parameters as p, index} - -
    - {p.name} -
    - - - {/each} -{/if} - - diff --git a/packages/builder/src/userInterface/EventsEditor/EventEditorModal.svelte b/packages/builder/src/userInterface/EventsEditor/EventEditorModal.svelte new file mode 100644 index 0000000000..290381c5dc --- /dev/null +++ b/packages/builder/src/userInterface/EventsEditor/EventEditorModal.svelte @@ -0,0 +1,164 @@ + + + + + +

    + {eventData.name ? `${eventData.name} Event` : 'Create a New Component Event'} +

    + + Click here to learn more about component events + + +
    +
    +
    +
    Event Type
    + {@html getIcon('info', 20)} +
    + +
    +
    + +
    +
    Event Action(s)
    + {@html getIcon('info', 20)} +
    + { + createNewEventHandler(draftEventHandler); + draftEventHandler = { parameters: [] }; + }} + handler={draftEventHandler} /> + {#if eventData} + {#each eventData.handlers as handler, index} + deleteEventHandler(index)} + {handler} /> + {/each} + {/if} + +
    + + + Save + +
    +
    diff --git a/packages/builder/src/userInterface/EventsEditor/EventsEditor.svelte b/packages/builder/src/userInterface/EventsEditor/EventsEditor.svelte new file mode 100644 index 0000000000..fa9907e077 --- /dev/null +++ b/packages/builder/src/userInterface/EventsEditor/EventsEditor.svelte @@ -0,0 +1,152 @@ + + + + +
    +

    Events

    + openModal()} /> +
    + +
    +
    + {#each events as event, index} + {#if event.handlers.length > 0} +
    openModal({ ...event, index })}> + {event.name} + EDIT +
    + {/if} + {/each} +
    +
    + diff --git a/packages/builder/src/userInterface/EventsEditor/HandlerSelector.svelte b/packages/builder/src/userInterface/EventsEditor/HandlerSelector.svelte new file mode 100644 index 0000000000..e22a992fe7 --- /dev/null +++ b/packages/builder/src/userInterface/EventsEditor/HandlerSelector.svelte @@ -0,0 +1,148 @@ + + + + +
    +
    +
    + Action + +
    + {#if parameters} + {#each parameters as param, idx} +
    + {param.name} + +
    + {/each} + {/if} +
    +
    + {#if parameters.length > 0} + {#if newHandler} + + {:else} + + {/if} + {/if} +
    +
    diff --git a/packages/builder/src/userInterface/EventsEditor/index.js b/packages/builder/src/userInterface/EventsEditor/index.js new file mode 100644 index 0000000000..7782e7fccd --- /dev/null +++ b/packages/builder/src/userInterface/EventsEditor/index.js @@ -0,0 +1 @@ +export { default } from "./EventsEditor.svelte"; \ No newline at end of file diff --git a/packages/builder/src/userInterface/StateBindingControl.svelte b/packages/builder/src/userInterface/StateBindingControl.svelte index 32065a111e..76f81f2bc8 100644 --- a/packages/builder/src/userInterface/StateBindingControl.svelte +++ b/packages/builder/src/userInterface/StateBindingControl.svelte @@ -1,5 +1,6 @@