@floegence/floe-webapp-core 0.35.40 → 0.35.41

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,27 @@
1
+ import { type Component } from 'solid-js';
2
+ export declare const NOTES_CONTEXT_MENU_WIDTH_PX = 188;
3
+ type NotesContextMenuActionItem = Readonly<{
4
+ id: string;
5
+ kind: 'action';
6
+ label: string;
7
+ icon: Component<{
8
+ class?: string;
9
+ }>;
10
+ onSelect: () => void;
11
+ disabled?: boolean;
12
+ destructive?: boolean;
13
+ }>;
14
+ type NotesContextMenuSeparatorItem = Readonly<{
15
+ id: string;
16
+ kind: 'separator';
17
+ }>;
18
+ export type NotesContextMenuItem = NotesContextMenuActionItem | NotesContextMenuSeparatorItem;
19
+ export interface NotesContextMenuProps {
20
+ x: number;
21
+ y: number;
22
+ items: readonly NotesContextMenuItem[];
23
+ menuRef?: (el: HTMLDivElement) => void;
24
+ }
25
+ export declare function estimateNotesContextMenuHeight(actionCount: number, separatorCount?: number): number;
26
+ export declare function NotesContextMenu(props: NotesContextMenuProps): import("solid-js").JSX.Element;
27
+ export {};
@@ -0,0 +1,52 @@
1
+ import { use as E, insert as c, createComponent as m, addEventListener as T, effect as v, className as f, setStyleProperty as d, template as i, delegateEvents as N } from "solid-js/web";
2
+ import { For as x } from "solid-js";
3
+ import { cn as C } from "../../utils/cn.js";
4
+ var O = /* @__PURE__ */ i("<div role=menu class=notes-context-menu>"), h = /* @__PURE__ */ i("<div role=separator aria-orientation=horizontal class=notes-context-menu__separator>"), I = /* @__PURE__ */ i("<button type=button role=menuitem><span class=notes-context-menu__label>");
5
+ const H = 188, M = 16, X = 32, P = 9;
6
+ function S(t) {
7
+ return t.kind === "action";
8
+ }
9
+ function y(t, n = 0) {
10
+ return M + Math.max(1, t) * X + Math.max(0, n) * P;
11
+ }
12
+ function R(t) {
13
+ return (() => {
14
+ var n = O();
15
+ n.$$contextmenu = (e) => e.preventDefault();
16
+ var s = t.menuRef;
17
+ return typeof s == "function" ? E(s, n) : t.menuRef = n, c(n, m(x, {
18
+ get each() {
19
+ return t.items;
20
+ },
21
+ children: (e) => {
22
+ if (!S(e))
23
+ return h();
24
+ const a = e.icon;
25
+ return (() => {
26
+ var o = I(), u = o.firstChild;
27
+ return T(o, "click", e.onSelect, !0), c(o, m(a, {
28
+ class: "h-3.5 w-3.5"
29
+ }), u), c(u, () => e.label), v((r) => {
30
+ var l = C("notes-context-menu__item", e.destructive && "is-destructive"), _ = e.disabled;
31
+ return l !== r.e && f(o, r.e = l), _ !== r.t && (o.disabled = r.t = _), r;
32
+ }, {
33
+ e: void 0,
34
+ t: void 0
35
+ }), o;
36
+ })();
37
+ }
38
+ })), v((e) => {
39
+ var a = `${t.x}px`, o = `${t.y}px`;
40
+ return a !== e.e && d(n, "left", e.e = a), o !== e.t && d(n, "top", e.t = o), e;
41
+ }, {
42
+ e: void 0,
43
+ t: void 0
44
+ }), n;
45
+ })();
46
+ }
47
+ N(["contextmenu", "click"]);
48
+ export {
49
+ H as NOTES_CONTEXT_MENU_WIDTH_PX,
50
+ R as NotesContextMenu,
51
+ y as estimateNotesContextMenuHeight
52
+ };
@@ -0,0 +1,7 @@
1
+ import { type NotesController } from './types';
2
+ export interface NotesOverlayProps {
3
+ open: boolean;
4
+ onClose: () => void;
5
+ controller: NotesController;
6
+ }
7
+ export declare function NotesOverlay(props: NotesOverlayProps): import("solid-js").JSX.Element;