@intechstudio/grid-uikit 1.20260116.1329 → 1.20260206.1447

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.
@@ -25,7 +25,9 @@
25
25
  if (element) {
26
26
  await tick();
27
27
  requestAnimationFrame(() => {
28
- width = element.offsetWidth;
28
+ if (element) {
29
+ width = element.offsetWidth;
30
+ }
29
31
  });
30
32
  }
31
33
  }
@@ -17,7 +17,9 @@
17
17
  if (element) {
18
18
  await tick();
19
19
  requestAnimationFrame(() => {
20
- width = element.offsetWidth;
20
+ if (element) {
21
+ width = element.offsetWidth;
22
+ }
21
23
  });
22
24
  }
23
25
  }
@@ -1,12 +1,12 @@
1
1
  import type { Action } from "svelte/action";
2
- import ContextMenu, { type ContextMenuItem } from "./ContextMenu.svelte";
2
+ import { type ContextMenuItem } from "./ContextMenu.svelte";
3
3
  import { type Writable } from "svelte/store";
4
4
  export interface ContextMenuOptions {
5
5
  items: ContextMenuItem[];
6
6
  }
7
- interface ContextMenuWritable extends Writable<ContextMenu | undefined> {
7
+ interface ContextMenuStore extends Writable<Record<string, any> | undefined> {
8
8
  close: () => void;
9
9
  }
10
- export declare let contextMenu: ContextMenuWritable;
10
+ export declare const contextMenu: ContextMenuStore;
11
11
  export declare const contextTarget: Action<HTMLElement, ContextMenuOptions>;
12
12
  export {};
@@ -1,12 +1,12 @@
1
1
  import ContextMenu, {} from "./ContextMenu.svelte";
2
+ import { mount, unmount } from "svelte";
2
3
  import { get, writable } from "svelte/store";
3
- export let contextMenu = createContextMenuStore();
4
4
  function createContextMenuStore() {
5
5
  const store = writable(undefined);
6
6
  const close = () => {
7
7
  const cm = get(store);
8
8
  if (cm) {
9
- cm.$destroy(); // Ensure that the context menu has a $destroy method
9
+ unmount(cm);
10
10
  store.set(undefined);
11
11
  }
12
12
  };
@@ -15,6 +15,7 @@ function createContextMenuStore() {
15
15
  close,
16
16
  };
17
17
  }
18
+ export const contextMenu = createContextMenuStore();
18
19
  export const contextTarget = (node, options) => {
19
20
  const handleContextMenu = (e) => {
20
21
  e.preventDefault();
@@ -25,7 +26,7 @@ export const contextTarget = (node, options) => {
25
26
  const createContextMenu = async (x, y) => {
26
27
  // If a context menu is already open, destroy it
27
28
  contextMenu.close();
28
- contextMenu.set(new ContextMenu({
29
+ contextMenu.set(mount(ContextMenu, {
29
30
  target: document.body,
30
31
  props: {
31
32
  target: node,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intechstudio/grid-uikit",
3
- "version": "1.20260116.1329",
3
+ "version": "1.20260206.1447",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/intechstudio/grid-uikit.git"