@intechstudio/grid-uikit 1.20260922.1223 → 1.20260923.1530

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.
@@ -0,0 +1,14 @@
1
+ <script lang="ts">
2
+ import { Pane } from "svelte-splitpanes";
3
+
4
+ export let size: number | null = null;
5
+ export let minSize = 0;
6
+ export let maxSize = 100;
7
+ export let snapSize = 0;
8
+ let clazz = "";
9
+ export { clazz as class };
10
+ </script>
11
+
12
+ <Pane bind:size {minSize} {maxSize} {snapSize} class={clazz}>
13
+ <slot />
14
+ </Pane>
@@ -0,0 +1,33 @@
1
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
2
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
3
+ $$bindings?: Bindings;
4
+ } & Exports;
5
+ (internal: unknown, props: Props & {
6
+ $$events?: Events;
7
+ $$slots?: Slots;
8
+ }): Exports & {
9
+ $set?: any;
10
+ $on?: any;
11
+ };
12
+ z_$$bindings?: Bindings;
13
+ }
14
+ type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
15
+ default: any;
16
+ } ? Props extends Record<string, never> ? any : {
17
+ children?: any;
18
+ } : {});
19
+ declare const GridPane: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
20
+ size?: number | null;
21
+ minSize?: number;
22
+ maxSize?: number;
23
+ snapSize?: number;
24
+ class?: string;
25
+ }, {
26
+ default: {};
27
+ }>, {
28
+ [evt: string]: CustomEvent<any>;
29
+ }, {
30
+ default: {};
31
+ }, {}, string>;
32
+ type GridPane = InstanceType<typeof GridPane>;
33
+ export default GridPane;
@@ -0,0 +1,36 @@
1
+ <script lang="ts">
2
+ import { Splitpanes } from "svelte-splitpanes";
3
+ import "./grid-splitpanes-theme.css";
4
+
5
+ export let horizontal = false;
6
+ export let pushOtherPanes = true;
7
+ export let dblClickSplitter = true;
8
+ export let firstSplitter = false;
9
+ export let rtl: boolean | "auto" = "auto";
10
+ export let id: string | undefined = undefined;
11
+ export let style: string | null = null;
12
+ let clazz = "";
13
+ export { clazz as class };
14
+ </script>
15
+
16
+ <Splitpanes
17
+ {id}
18
+ {horizontal}
19
+ {pushOtherPanes}
20
+ {dblClickSplitter}
21
+ {firstSplitter}
22
+ {rtl}
23
+ {style}
24
+ theme="grid-uikit-theme"
25
+ class={clazz}
26
+ on:pane-click
27
+ on:splitter-click
28
+ on:pane-maximize
29
+ on:ready
30
+ on:resize
31
+ on:resized
32
+ on:pane-add
33
+ on:pane-remove
34
+ >
35
+ <slot />
36
+ </Splitpanes>
@@ -0,0 +1,52 @@
1
+ import "./grid-splitpanes-theme.css";
2
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
3
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
+ $$bindings?: Bindings;
5
+ } & Exports;
6
+ (internal: unknown, props: Props & {
7
+ $$events?: Events;
8
+ $$slots?: Slots;
9
+ }): Exports & {
10
+ $set?: any;
11
+ $on?: any;
12
+ };
13
+ z_$$bindings?: Bindings;
14
+ }
15
+ type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
16
+ default: any;
17
+ } ? Props extends Record<string, never> ? any : {
18
+ children?: any;
19
+ } : {});
20
+ declare const GridSplitpanes: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
21
+ horizontal?: boolean;
22
+ pushOtherPanes?: boolean;
23
+ dblClickSplitter?: boolean;
24
+ firstSplitter?: boolean;
25
+ rtl?: boolean | "auto";
26
+ id?: string | undefined;
27
+ style?: string | null;
28
+ class?: string;
29
+ }, {
30
+ default: {};
31
+ }>, {
32
+ 'pane-click': CustomEvent<import("svelte-splitpanes").IPane>;
33
+ 'splitter-click': CustomEvent<import("svelte-splitpanes").IPane>;
34
+ 'pane-maximize': CustomEvent<import("svelte-splitpanes").IPane>;
35
+ ready: CustomEvent<void>;
36
+ resize: CustomEvent<import("svelte-splitpanes").IPaneSizingEvent[]>;
37
+ resized: CustomEvent<import("svelte-splitpanes").IPaneSizingEvent[]>;
38
+ 'pane-add': CustomEvent<{
39
+ index: number;
40
+ panes: import("svelte-splitpanes").IPaneSizingEvent[];
41
+ }>;
42
+ 'pane-remove': CustomEvent<{
43
+ removed: import("svelte-splitpanes").IPane;
44
+ panes: import("svelte-splitpanes").IPaneSizingEvent[];
45
+ }>;
46
+ } & {
47
+ [evt: string]: CustomEvent<any>;
48
+ }, {
49
+ default: {};
50
+ }, {}, string>;
51
+ type GridSplitpanes = InstanceType<typeof GridSplitpanes>;
52
+ export default GridSplitpanes;
@@ -53,7 +53,9 @@
53
53
  display: flex;
54
54
  align-items: center;
55
55
  width: 30rem;
56
- border: solid 1px var(--border);
56
+ padding: 0;
57
+ margin: 0;
58
+ border: none;
57
59
  background: none;
58
60
  cursor: pointer;
59
61
  }
@@ -66,7 +68,7 @@
66
68
  justify-content: center;
67
69
  width: 2.5rem;
68
70
  height: 2rem;
69
- border-radius: 9999px;
71
+ border-radius: var(--radius-full);
70
72
  background: var(--background-muted);
71
73
  border: 1px solid var(--background-soft);
72
74
  font-size: 0.875rem;
@@ -79,21 +81,18 @@
79
81
  width: 100%;
80
82
  padding: 0.5rem;
81
83
  margin: 0.25rem 0;
82
- border-radius: 0.375rem;
83
- background: var(--background);
84
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
85
- transition:
86
- opacity 0.1s ease,
87
- background-color 0.1s ease;
84
+ border: solid 1px var(--border);
85
+ border-radius: var(--radius-medium);
86
+ background: var(--popover-background);
88
87
  }
89
88
 
90
89
  .notification-card:hover {
91
- opacity: 0.75;
90
+ background: var(--popover-selection);
92
91
  }
93
92
 
94
93
  .notification-icon {
95
94
  padding: 0.5rem;
96
- border-radius: 0.375rem;
95
+ border-radius: var(--radius-medium);
97
96
  background: var(--background-muted);
98
97
  }
99
98
 
@@ -0,0 +1,71 @@
1
+ <script lang="ts">
2
+ import { createEventDispatcher } from "svelte";
3
+ import { fly } from "svelte/transition";
4
+ import LogMessage from "./LogMessage.svelte";
5
+ import { logStreamStore as defaultLogStreamStore } from "./logStream";
6
+ import type { LogStream } from "./logStream";
7
+
8
+ const dispatch = createEventDispatcher();
9
+
10
+ export let store: LogStream = defaultLogStreamStore;
11
+ export let bottom: string = "5rem";
12
+
13
+ function handleClick(index: number) {
14
+ store.dismissLog({ index });
15
+ }
16
+
17
+ function handleMouseEnter() {
18
+ store.enableTimeout(false);
19
+ }
20
+
21
+ function handleMouseLeave() {
22
+ store.enableTimeout(true);
23
+ }
24
+
25
+ function handleCreation() {
26
+ dispatch("content-change", { count: $store.length });
27
+ }
28
+
29
+ function handleDestroy() {
30
+ store.enableTimeout(true);
31
+ dispatch("content-change", { count: $store.length });
32
+ }
33
+ </script>
34
+
35
+ <!-- svelte-ignore a11y-no-static-element-interactions -->
36
+ <div class="log-stream" style="bottom: {bottom};">
37
+ {#each $store as log, i (log)}
38
+ <div
39
+ class="log-stream-item"
40
+ on:mouseenter={handleMouseEnter}
41
+ on:mouseleave={handleMouseLeave}
42
+ in:fly|global={{ x: -10, delay: 100 + 400 * i, duration: 500 }}
43
+ out:fly|global={{ x: 10, delay: 400 * i, duration: 500 }}
44
+ >
45
+ <LogMessage
46
+ count={log.count}
47
+ type={log.data.type}
48
+ text={log.data.message}
49
+ on:destroy={handleDestroy}
50
+ on:creation={handleCreation}
51
+ on:click={() => handleClick(i)}
52
+ />
53
+ </div>
54
+ {/each}
55
+ </div>
56
+
57
+ <style>
58
+ .log-stream {
59
+ position: absolute;
60
+ left: 50%;
61
+ transform: translateX(-50%);
62
+ z-index: 2;
63
+ display: flex;
64
+ flex-direction: column;
65
+ pointer-events: none;
66
+ }
67
+
68
+ .log-stream-item {
69
+ pointer-events: auto;
70
+ }
71
+ </style>
@@ -0,0 +1,4 @@
1
+ import type { LogStream } from "./logStream";
2
+ declare const LogStream: any;
3
+ type LogStream = InstanceType<typeof LogStream>;
4
+ export default LogStream;
@@ -191,7 +191,7 @@
191
191
  $effect(() => {
192
192
  if (tooltipElement) {
193
193
  previousFocusedElement = document.activeElement as HTMLElement | null;
194
- tooltipElement.focus();
194
+ tooltipElement.focus({ preventScroll: true });
195
195
  const handleFocusOut = (e: FocusEvent) => {
196
196
  const relatedTarget = e.relatedTarget as Node | null;
197
197
  if (relatedTarget && tooltipElement?.contains(relatedTarget)) {
@@ -267,7 +267,7 @@
267
267
  showbuttons = false;
268
268
  if (restoreFocus && previousFocusedElement) {
269
269
  isRestoringFocus = true;
270
- previousFocusedElement.focus();
270
+ previousFocusedElement.focus({ preventScroll: true });
271
271
  previousFocusedElement = null;
272
272
  requestAnimationFrame(() => {
273
273
  isRestoringFocus = false;
@@ -0,0 +1,46 @@
1
+ .splitpanes.grid-uikit-theme .splitpanes__pane {
2
+ position: relative;
3
+ overflow: visible;
4
+ background-color: transparent;
5
+ }
6
+
7
+ .splitpanes.grid-uikit-theme .splitpanes__splitter {
8
+ position: relative;
9
+ background-color: transparent;
10
+ min-width: 0;
11
+ min-height: 0;
12
+ }
13
+
14
+ .splitpanes.grid-uikit-theme .splitpanes__splitter:before {
15
+ content: "";
16
+ position: absolute;
17
+ background-color: transparent;
18
+ z-index: 1;
19
+ }
20
+
21
+ .splitpanes.grid-uikit-theme
22
+ .splitpanes__splitter.splitpanes__splitter__active {
23
+ z-index: 2;
24
+ }
25
+
26
+ .grid-uikit-theme.splitpanes--vertical > .splitpanes__splitter {
27
+ width: 0;
28
+ }
29
+ .grid-uikit-theme.splitpanes--vertical > .splitpanes__splitter:before {
30
+ top: 0;
31
+ left: -3px;
32
+ right: -3px;
33
+ height: 100%;
34
+ cursor: col-resize;
35
+ }
36
+
37
+ .grid-uikit-theme.splitpanes--horizontal > .splitpanes__splitter {
38
+ height: 0;
39
+ }
40
+ .grid-uikit-theme.splitpanes--horizontal > .splitpanes__splitter:before {
41
+ left: 0;
42
+ top: -3px;
43
+ bottom: -3px;
44
+ width: 100%;
45
+ cursor: row-resize;
46
+ }
package/dist/index.d.ts CHANGED
@@ -26,3 +26,7 @@ export { Color } from "./color";
26
26
  export { default as ColorLayerSelector, type LayerClickDetail, } from "./ColorLayerSelector.svelte";
27
27
  export { default as LogMessage } from "./LogMessage.svelte";
28
28
  export { LogMessageType } from "./LogMessageType";
29
+ export { default as LogStream } from "./LogStream.svelte";
30
+ export { createLogStream, logStreamStore, type LogStreamMessage, type LogStreamOptions, } from "./logStream";
31
+ export { default as GridSplitpanes } from "./GridSplitpanes.svelte";
32
+ export { default as GridPane } from "./GridPane.svelte";
package/dist/index.js CHANGED
@@ -26,3 +26,7 @@ export { Color } from "./color";
26
26
  export { default as ColorLayerSelector, } from "./ColorLayerSelector.svelte";
27
27
  export { default as LogMessage } from "./LogMessage.svelte";
28
28
  export { LogMessageType } from "./LogMessageType";
29
+ export { default as LogStream } from "./LogStream.svelte";
30
+ export { createLogStream, logStreamStore, } from "./logStream";
31
+ export { default as GridSplitpanes } from "./GridSplitpanes.svelte";
32
+ export { default as GridPane } from "./GridPane.svelte";
@@ -0,0 +1,35 @@
1
+ import type { LogMessageType } from "./LogMessageType";
2
+ export type LogStreamMessage = {
3
+ type: LogMessageType;
4
+ message: string;
5
+ };
6
+ type LogStreamEntry = {
7
+ data: LogStreamMessage;
8
+ count: number;
9
+ };
10
+ export type LogStreamOptions = {
11
+ /** Max number of entries kept on screen at once; oldest is dropped first. */
12
+ maxVisible?: number;
13
+ /** How long an entry stays before auto-clearing, in ms. */
14
+ autoDismissMs?: number;
15
+ };
16
+ export declare function createLogStream(options?: LogStreamOptions): {
17
+ subscribe: (this: void, run: import("svelte/store").Subscriber<LogStreamEntry[]>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
18
+ push: (entry: LogStreamMessage) => void;
19
+ dismissLog: ({ index }: {
20
+ index: number;
21
+ }) => void;
22
+ enableTimeout: (value: boolean) => void;
23
+ reset: () => void;
24
+ };
25
+ export type LogStream = ReturnType<typeof createLogStream>;
26
+ export declare const logStreamStore: {
27
+ subscribe: (this: void, run: import("svelte/store").Subscriber<LogStreamEntry[]>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
28
+ push: (entry: LogStreamMessage) => void;
29
+ dismissLog: ({ index }: {
30
+ index: number;
31
+ }) => void;
32
+ enableTimeout: (value: boolean) => void;
33
+ reset: () => void;
34
+ };
35
+ export {};
@@ -0,0 +1,52 @@
1
+ import { writable } from "svelte/store";
2
+ export function createLogStream(options = {}) {
3
+ const { maxVisible = 3, autoDismissMs = 5000 } = options;
4
+ const store = writable([]);
5
+ let isTimeoutEnabled = true;
6
+ let clearHandle;
7
+ function clearLogs(force = false) {
8
+ if (isTimeoutEnabled || force) {
9
+ store.set([]);
10
+ }
11
+ else {
12
+ clearHandle = setTimeout(() => clearLogs(), 500);
13
+ }
14
+ }
15
+ function push(entry) {
16
+ clearTimeout(clearHandle);
17
+ store.update((entries) => {
18
+ const last = entries.at(-1);
19
+ if (last && last.data.message === entry.message) {
20
+ last.count++;
21
+ return entries;
22
+ }
23
+ const next = [...entries, { data: entry, count: 1 }];
24
+ if (next.length > maxVisible) {
25
+ next.shift();
26
+ }
27
+ return next;
28
+ });
29
+ clearHandle = setTimeout(() => clearLogs(), autoDismissMs);
30
+ }
31
+ function dismissLog({ index }) {
32
+ store.update((entries) => {
33
+ entries.splice(index, 1);
34
+ return entries;
35
+ });
36
+ }
37
+ function enableTimeout(value) {
38
+ isTimeoutEnabled = value;
39
+ }
40
+ function reset() {
41
+ clearTimeout(clearHandle);
42
+ clearLogs(true);
43
+ }
44
+ return {
45
+ subscribe: store.subscribe,
46
+ push,
47
+ dismissLog,
48
+ enableTimeout,
49
+ reset,
50
+ };
51
+ }
52
+ export const logStreamStore = createLogStream();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intechstudio/grid-uikit",
3
- "version": "1.20260922.1223",
3
+ "version": "1.20260923.1530",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/intechstudio/grid-uikit.git"
@@ -32,6 +32,7 @@
32
32
  "dependencies": {
33
33
  "@melt-ui/svelte": "^0.86.6",
34
34
  "svelte-easy-popover": "^1.0.0",
35
+ "svelte-splitpanes": "^8.0.12",
35
36
  "color-convert": "^2.0.1"
36
37
  },
37
38
  "devDependencies": {