@fuzdev/fuz_ui 0.203.0 → 0.203.1
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.
- package/dist/ContextmenuEntry.svelte +4 -6
- package/dist/ContextmenuEntry.svelte.d.ts +2 -1
- package/dist/ContextmenuEntry.svelte.d.ts.map +1 -1
- package/dist/ContextmenuIcon.svelte +30 -0
- package/dist/ContextmenuIcon.svelte.d.ts +9 -0
- package/dist/ContextmenuIcon.svelte.d.ts.map +1 -0
- package/dist/ContextmenuLinkEntry.svelte +2 -9
- package/dist/ContextmenuLinkEntry.svelte.d.ts.map +1 -1
- package/dist/ContextmenuSubmenu.svelte +4 -2
- package/dist/ContextmenuSubmenu.svelte.d.ts +2 -1
- package/dist/ContextmenuSubmenu.svelte.d.ts.map +1 -1
- package/dist/ContextmenuTextEntry.svelte +5 -7
- package/dist/ContextmenuTextEntry.svelte.d.ts +2 -1
- package/dist/ContextmenuTextEntry.svelte.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import PendingAnimation from './PendingAnimation.svelte';
|
|
6
6
|
import {contextmenu_context, type ContextmenuRun} from './contextmenu_state.svelte.js';
|
|
7
|
+
import type {SvgData} from './svg.js';
|
|
8
|
+
import ContextmenuIcon from './ContextmenuIcon.svelte';
|
|
7
9
|
|
|
8
10
|
const {
|
|
9
11
|
run,
|
|
@@ -12,7 +14,7 @@
|
|
|
12
14
|
disabled: disabled_prop = false,
|
|
13
15
|
}: {
|
|
14
16
|
run: ContextmenuRun;
|
|
15
|
-
icon?: string | Snippet;
|
|
17
|
+
icon?: SvgData | string | Snippet;
|
|
16
18
|
children: Snippet;
|
|
17
19
|
disabled?: boolean;
|
|
18
20
|
} = $props();
|
|
@@ -65,11 +67,7 @@
|
|
|
65
67
|
>
|
|
66
68
|
<div class="content">
|
|
67
69
|
<div class="icon">
|
|
68
|
-
{
|
|
69
|
-
{icon}
|
|
70
|
-
{:else if icon}
|
|
71
|
-
{@render icon()}
|
|
72
|
-
{/if}
|
|
70
|
+
<ContextmenuIcon {icon} />
|
|
73
71
|
</div>
|
|
74
72
|
<div class="title">{@render children()}</div>
|
|
75
73
|
{#if pending}<PendingAnimation />{:else if error_message}⚠️{/if}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type Snippet } from 'svelte';
|
|
2
2
|
import { type ContextmenuRun } from './contextmenu_state.svelte.js';
|
|
3
|
+
import type { SvgData } from './svg.js';
|
|
3
4
|
type $$ComponentProps = {
|
|
4
5
|
run: ContextmenuRun;
|
|
5
|
-
icon?: string | Snippet;
|
|
6
|
+
icon?: SvgData | string | Snippet;
|
|
6
7
|
children: Snippet;
|
|
7
8
|
disabled?: boolean;
|
|
8
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextmenuEntry.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuEntry.svelte"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,OAAO,EAAC,MAAM,QAAQ,CAAC;AAI/C,OAAO,EAAsB,KAAK,cAAc,EAAC,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"ContextmenuEntry.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuEntry.svelte"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,OAAO,EAAC,MAAM,QAAQ,CAAC;AAI/C,OAAO,EAAsB,KAAK,cAAc,EAAC,MAAM,+BAA+B,CAAC;AACvF,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAGrC,KAAK,gBAAgB,GAAI;IACxB,GAAG,EAAE,cAAc,CAAC;IACpB,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IAClC,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAgEH,QAAA,MAAM,gBAAgB,sDAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type {Snippet} from 'svelte';
|
|
3
|
+
|
|
4
|
+
import type {SvgData} from './svg.js';
|
|
5
|
+
import Svg from './Svg.svelte';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Renders a contextmenu entry's `icon` value, shared by `ContextmenuEntry`,
|
|
9
|
+
* `ContextmenuSubmenu`, and `ContextmenuLinkEntry`. Renders nothing when
|
|
10
|
+
* `icon` is `undefined`.
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const {
|
|
16
|
+
icon,
|
|
17
|
+
}: {
|
|
18
|
+
icon?: SvgData | string | Snippet;
|
|
19
|
+
} = $props();
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
{#if typeof icon === 'string'}
|
|
23
|
+
{icon}
|
|
24
|
+
{:else if typeof icon === 'object'}
|
|
25
|
+
<!-- `SvgData` is a plain object; detect it positively by shape rather than
|
|
26
|
+
introspecting the snippet (whose runtime form is opaque/unsupported). -->
|
|
27
|
+
<Svg data={icon} />
|
|
28
|
+
{:else if icon}
|
|
29
|
+
{@render icon()}
|
|
30
|
+
{/if}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { SvgData } from './svg.js';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
icon?: SvgData | string | Snippet;
|
|
5
|
+
};
|
|
6
|
+
declare const ContextmenuIcon: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
|
+
type ContextmenuIcon = ReturnType<typeof ContextmenuIcon>;
|
|
8
|
+
export default ContextmenuIcon;
|
|
9
|
+
//# sourceMappingURL=ContextmenuIcon.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextmenuIcon.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuIcon.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAEpC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAGrC,KAAK,gBAAgB,GAAI;IACxB,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;CAClC,CAAC;AA+BH,QAAA,MAAM,eAAe,sDAAwC,CAAC;AAC9D,KAAK,eAAe,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC;AAC1D,eAAe,eAAe,CAAC"}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
import {icon_external_link, icon_link} from './icons.js';
|
|
9
9
|
import type {SvgData} from './svg.js';
|
|
10
10
|
import Svg from './Svg.svelte';
|
|
11
|
+
import ContextmenuIcon from './ContextmenuIcon.svelte';
|
|
11
12
|
|
|
12
13
|
const {
|
|
13
14
|
href,
|
|
@@ -92,15 +93,7 @@
|
|
|
92
93
|
<div class="content">
|
|
93
94
|
<div class="icon">
|
|
94
95
|
{#if icon}
|
|
95
|
-
{
|
|
96
|
-
{icon}
|
|
97
|
-
{:else if typeof icon === 'object'}
|
|
98
|
-
<!-- `SvgData` is a plain object; detect it positively by shape rather than
|
|
99
|
-
introspecting the snippet (whose runtime form is opaque/unsupported). -->
|
|
100
|
-
<Svg data={icon} />
|
|
101
|
-
{:else}
|
|
102
|
-
{@render icon()}
|
|
103
|
-
{/if}
|
|
96
|
+
<ContextmenuIcon {icon} />
|
|
104
97
|
{:else}
|
|
105
98
|
<Svg data={external ? icon_external_link : icon_link} />
|
|
106
99
|
{/if}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextmenuLinkEntry.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuLinkEntry.svelte"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAKpC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"ContextmenuLinkEntry.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuLinkEntry.svelte"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAKpC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAIrC,KAAK,gBAAgB,GAAI;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAyFH,QAAA,MAAM,oBAAoB,sDAAwC,CAAC;AACnE,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACpE,eAAe,oBAAoB,CAAC"}
|
|
@@ -5,13 +5,15 @@
|
|
|
5
5
|
import {contextmenu_context, contextmenu_dimensions_context} from './contextmenu_state.svelte.js';
|
|
6
6
|
import {contextmenu_calculate_submenu_translate} from './contextmenu_helpers.js';
|
|
7
7
|
import type {Dimensions} from './dimensions.svelte.js';
|
|
8
|
+
import type {SvgData} from './svg.js';
|
|
9
|
+
import ContextmenuIcon from './ContextmenuIcon.svelte';
|
|
8
10
|
|
|
9
11
|
const {
|
|
10
12
|
icon,
|
|
11
13
|
menu,
|
|
12
14
|
children,
|
|
13
15
|
}: {
|
|
14
|
-
icon?: Snippet;
|
|
16
|
+
icon?: SvgData | string | Snippet;
|
|
15
17
|
menu: Snippet;
|
|
16
18
|
children: Snippet;
|
|
17
19
|
} = $props();
|
|
@@ -87,7 +89,7 @@
|
|
|
87
89
|
>
|
|
88
90
|
<div class="content">
|
|
89
91
|
<div class="icon">
|
|
90
|
-
{
|
|
92
|
+
<ContextmenuIcon {icon} />
|
|
91
93
|
</div>
|
|
92
94
|
<div class="title">{@render children()}</div>
|
|
93
95
|
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextmenuSubmenu.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuSubmenu.svelte"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,OAAO,EAAC,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"ContextmenuSubmenu.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuSubmenu.svelte"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,OAAO,EAAC,MAAM,QAAQ,CAAC;AAM/C,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAGrC,KAAK,gBAAgB,GAAI;IACxB,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CAClB,CAAC;AA+FH,QAAA,MAAM,kBAAkB,sDAAwC,CAAC;AACjE,KAAK,kBAAkB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAChE,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import type {Snippet} from 'svelte';
|
|
3
|
+
|
|
2
4
|
import type {SvgData} from './svg.js';
|
|
3
|
-
import Svg from './Svg.svelte';
|
|
4
5
|
import ContextmenuEntry from './ContextmenuEntry.svelte';
|
|
5
6
|
import type {ContextmenuRun} from './contextmenu_state.svelte.js';
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
run,
|
|
9
10
|
content,
|
|
10
|
-
icon
|
|
11
|
+
icon,
|
|
11
12
|
}: {
|
|
12
13
|
run: ContextmenuRun;
|
|
13
14
|
content: string; // TODO @many rethink this API
|
|
14
|
-
icon
|
|
15
|
+
icon?: SvgData | string | Snippet;
|
|
15
16
|
} = $props();
|
|
16
17
|
|
|
17
18
|
// TODO consider making this the implicit default entry, so consumers can simply declare `{run, content}`
|
|
18
19
|
</script>
|
|
19
20
|
|
|
20
|
-
<ContextmenuEntry {run}>
|
|
21
|
-
{#snippet icon()}{#if typeof icon_value === 'string'}{icon_value}{:else}<Svg
|
|
22
|
-
data={icon_value}
|
|
23
|
-
/>{/if}{/snippet}
|
|
21
|
+
<ContextmenuEntry {run} {icon}>
|
|
24
22
|
{content}
|
|
25
23
|
</ContextmenuEntry>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
1
2
|
import type { SvgData } from './svg.js';
|
|
2
3
|
import type { ContextmenuRun } from './contextmenu_state.svelte.js';
|
|
3
4
|
type $$ComponentProps = {
|
|
4
5
|
run: ContextmenuRun;
|
|
5
6
|
content: string;
|
|
6
|
-
icon
|
|
7
|
+
icon?: SvgData | string | Snippet;
|
|
7
8
|
};
|
|
8
9
|
declare const ContextmenuTextEntry: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
9
10
|
type ContextmenuTextEntry = ReturnType<typeof ContextmenuTextEntry>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextmenuTextEntry.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuTextEntry.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"ContextmenuTextEntry.svelte.d.ts","sourceRoot":"../src/lib/","sources":["../src/lib/ContextmenuTextEntry.svelte"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,QAAQ,CAAC;AAEpC,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAEtC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAEjE,KAAK,gBAAgB,GAAI;IACxB,GAAG,EAAE,cAAc,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;CAClC,CAAC;AAuBH,QAAA,MAAM,oBAAoB,sDAAwC,CAAC;AACnE,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACpE,eAAe,oBAAoB,CAAC"}
|