windmill-components 1.472.2 → 1.472.4

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.
@@ -1,7 +1,6 @@
1
1
  <script>import { DraftService, ScriptService, ScheduleService, PostgresTriggerService } from '../gen';
2
2
  import { inferArgs } from '../infer';
3
3
  import { initialCode } from '../script_helpers';
4
- import { page } from '$app/stores';
5
4
  import { defaultScripts, enterpriseLicense, userStore, workspaceStore } from '../stores';
6
5
  import { cleanValueProperties, emptySchema, emptyString, encodeState, formatCron, orderedJsonStringify, replaceFalseWithUndefined } from '../utils';
7
6
  import Path from './Path.svelte';
@@ -175,16 +174,17 @@ if (script.content == '') {
175
174
  initContent(script.language, script.kind, template);
176
175
  }
177
176
  async function isTemplateScript() {
178
- let getInitBlockTemplate = $page.url.searchParams.get('id');
179
- if (getInitBlockTemplate === null) {
177
+ const params = new URLSearchParams(window.location.search);
178
+ const templateId = params.get('id');
179
+ if (templateId === null) {
180
180
  return undefined;
181
181
  }
182
182
  try {
183
- getInitBlockTemplate = await PostgresTriggerService.getTemplateScript({
183
+ const templateScript = await PostgresTriggerService.getTemplateScript({
184
184
  workspace: $workspaceStore,
185
- id: getInitBlockTemplate
185
+ id: templateId
186
186
  });
187
- return getInitBlockTemplate;
187
+ return templateScript;
188
188
  }
189
189
  catch (error) {
190
190
  sendUserToast('An error occured when trying to load your template script, please try again later', true);
@@ -62,6 +62,9 @@ $: containerHeight = Math.min(
62
62
  maxHeight($app.subgrids?.[`${id}-0`] ?? [], 0, $breakpoint) * (ROW_HEIGHT + ROW_GAP_Y) + 16,
63
63
  // 32px (2rem) of top and bottom margin
64
64
  wrapperHeight - headerHeight - 64);
65
+ async function getMenuElements() {
66
+ return Array.from(document.querySelectorAll('[data-menu]'));
67
+ }
65
68
  </script>
66
69
 
67
70
  <InitializeComponent {id} />
@@ -148,7 +151,11 @@ wrapperHeight - headerHeight - 64);
148
151
  <div
149
152
  style={css?.popup?.style}
150
153
  class={twMerge('mx-24 mt-8 bg-surface rounded-lg relative', css?.popup?.class)}
151
- use:clickOutside={false}
154
+ use:clickOutside={{
155
+ capture: false,
156
+ stopPropagation: false,
157
+ exclude: getMenuElements
158
+ }}
152
159
  on:click_outside={(e) => {
153
160
  if ($mode !== 'dnd' && !unclickableOutside) {
154
161
  handleClickAway(e)
@@ -54,7 +54,7 @@ async function getMenuElements() {
54
54
 
55
55
  <!--svelte-ignore a11y-no-static-element-interactions-->
56
56
  {#if open}
57
- <div {...$menuElement} use:$menuElement.action data-menu class="z-[6000]" on:click|stopPropagation>
57
+ <div {...$menuElement} use:$menuElement.action data-menu class="z-[6000]" on:click>
58
58
  <div
59
59
  class={twMerge(
60
60
  'border w-56 origin-top-right rounded-md shadow-md focus:outline-none overflow-y-auto py-1',
@@ -1,15 +1,8 @@
1
1
  <script>import { melt } from '@melt-ui/svelte';
2
- import { goto } from '$app/navigation';
3
2
  export let href = undefined;
4
3
  export let disabled = false;
5
4
  export let target = undefined;
6
5
  export let item;
7
- function handleClick(e) {
8
- if (href && !target) {
9
- e.preventDefault();
10
- goto(href);
11
- }
12
- }
13
6
  </script>
14
7
 
15
8
  {#if href}
@@ -21,7 +14,6 @@ function handleClick(e) {
21
14
  aria-disabled={disabled}
22
15
  tabindex={disabled ? -1 : undefined}
23
16
  {target}
24
- on:click={handleClick}
25
17
  on:m-focusin
26
18
  on:m-focusout
27
19
  >
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-components",
3
- "version": "1.472.2",
3
+ "version": "1.472.4",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build",