@floegence/floe-webapp-core 0.36.21 → 0.36.23

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.
@@ -38,3 +38,4 @@ export declare function resolveSurfaceWheelRouting(options: SurfaceWheelRoutingO
38
38
  export declare function isLocalInteractionSurfaceTarget(options: SurfaceInteractionRoutingOptions): boolean;
39
39
  export declare function resolveWorkbenchWidgetEventOwnership(options: WorkbenchWidgetEventOwnershipOptions): WorkbenchWidgetEventOwnership;
40
40
  export declare function shouldActivateWorkbenchWidgetLocalTarget(options: WorkbenchWidgetLocalActivationTargetOptions): boolean;
41
+ export declare function resolveWorkbenchWidgetLocalTypingTarget(options: WorkbenchWidgetLocalActivationTargetOptions): HTMLElement | null;
@@ -1,73 +1,90 @@
1
- import { isTypingElement as o } from "../../utils/dom.js";
2
- const f = "data-floe-local-interaction-surface", u = `[${f}="true"]`, E = "data-floe-canvas-wheel-interactive", d = `[${E}="true"]`, _ = "data-floe-workbench-widget-shell", i = `[${_}="true"]`;
3
- function a(e) {
1
+ import { isTypingElement as u } from "../../utils/dom.js";
2
+ const E = "data-floe-local-interaction-surface", i = `[${E}="true"]`, d = "data-floe-canvas-wheel-interactive", _ = `[${d}="true"]`, g = "data-floe-workbench-widget-shell", s = `[${g}="true"]`;
3
+ function o(e) {
4
4
  return typeof Element < "u" && e instanceof Element ? e : typeof Node < "u" && e instanceof Node ? e.parentElement : null;
5
5
  }
6
6
  function T(e) {
7
7
  if (!e || typeof HTMLElement > "u" || !(e instanceof HTMLElement))
8
8
  return !1;
9
9
  if (e.matches("button, input, select, textarea, summary") || e.matches("a[href], area[href]") || e.matches('iframe, [contenteditable="true"]')) return !0;
10
- const t = e.getAttribute("tabindex");
11
- return t !== null && t !== "-1";
10
+ const r = e.getAttribute("tabindex");
11
+ return r !== null && r !== "-1";
12
12
  }
13
- function S(e, t) {
14
- let r = e;
15
- for (; r && r !== t; ) {
16
- if (o(r) || T(r))
13
+ function S(e, r) {
14
+ let l = e;
15
+ for (; l && l !== r; ) {
16
+ if (u(l) || T(l))
17
17
  return !0;
18
- r = r.parentElement;
18
+ l = l.parentElement;
19
19
  }
20
20
  return !1;
21
21
  }
22
- function s(e) {
22
+ function f(e) {
23
23
  const {
24
- target: t,
25
- interactiveSelector: r,
24
+ target: r,
25
+ interactiveSelector: l,
26
26
  panSurfaceSelector: c,
27
- localInteractionSurfaceSelector: n = u
28
- } = e, l = t instanceof Element ? t : null;
29
- return l ? l.closest(c) !== null ? "pan_surface" : o(l) || l.closest(r) !== null || l.closest(n) !== null ? "local_surface" : "canvas" : "canvas";
27
+ localInteractionSurfaceSelector: t = i
28
+ } = e, n = r instanceof Element ? r : null;
29
+ return n ? n.closest(c) !== null ? "pan_surface" : u(n) || n.closest(l) !== null || n.closest(t) !== null ? "local_surface" : "canvas" : "canvas";
30
30
  }
31
- function g(e) {
31
+ function m(e) {
32
32
  const {
33
- target: t,
34
- localInteractionSurfaceSelector: r = u,
35
- wheelInteractiveSelector: c = d
36
- } = e, n = a(t);
37
- return n ? o(n) ? "typing_element" : n.closest(r) !== null ? "local_interaction_surface" : n.closest(c) !== null ? "wheel_interactive" : null : null;
33
+ target: r,
34
+ localInteractionSurfaceSelector: l = i,
35
+ wheelInteractiveSelector: c = _
36
+ } = e, t = o(r);
37
+ return t ? u(t) ? "typing_element" : t.closest(l) !== null ? "local_interaction_surface" : t.closest(c) !== null ? "wheel_interactive" : null : null;
38
38
  }
39
- function L(e) {
40
- const t = g(e);
41
- return t ? { kind: "local_surface", reason: t } : e.disablePanZoom ? { kind: "ignore", reason: "pan_zoom_disabled" } : { kind: "canvas_zoom" };
39
+ function R(e) {
40
+ const r = m(e);
41
+ return r ? { kind: "local_surface", reason: r } : e.disablePanZoom ? { kind: "ignore", reason: "pan_zoom_disabled" } : { kind: "canvas_zoom" };
42
42
  }
43
43
  function A(e) {
44
- return s(e) !== "canvas";
44
+ return f(e) !== "canvas";
45
45
  }
46
- function m(e) {
46
+ function h(e) {
47
47
  const {
48
- widgetRoot: t,
49
- shellSelector: r = i
50
- } = e, c = a(t), n = a(e.target);
51
- return !c || !n || !c.contains(n) ? "outside_widget" : s(e) !== "canvas" ? "widget_local" : n === c || n.closest(r) !== null ? "widget_shell" : "widget_local";
48
+ widgetRoot: r,
49
+ shellSelector: l = s
50
+ } = e, c = o(r), t = o(e.target);
51
+ return !c || !t || !c.contains(t) ? "outside_widget" : f(e) !== "canvas" ? "widget_local" : t === c || t.closest(l) !== null ? "widget_shell" : "widget_local";
52
52
  }
53
- function R(e) {
53
+ function w(e) {
54
54
  const {
55
- widgetRoot: t,
56
- shellSelector: r = i,
57
- localInteractionSurfaceSelector: c = u
58
- } = e, n = a(t), l = a(e.target);
59
- return !n || !l || !n.contains(l) || l === n || l.closest(r) !== null || l.closest(e.panSurfaceSelector) !== null || l.closest(c) !== null || S(l, n) ? !1 : m(e) === "widget_local";
55
+ widgetRoot: r,
56
+ shellSelector: l = s,
57
+ localInteractionSurfaceSelector: c = i
58
+ } = e, t = o(r), n = o(e.target);
59
+ return !t || !n || !t.contains(n) || n === t || n.closest(l) !== null || n.closest(e.panSurfaceSelector) !== null || n.closest(c) !== null || S(n, t) ? !1 : h(e) === "widget_local";
60
+ }
61
+ function I(e) {
62
+ const {
63
+ widgetRoot: r,
64
+ shellSelector: l = s,
65
+ localInteractionSurfaceSelector: c = i
66
+ } = e, t = o(r), n = o(e.target);
67
+ if (!t || !n || !t.contains(n) || n === t || n.closest(l) !== null || n.closest(e.panSurfaceSelector) !== null || n.closest(c) !== null)
68
+ return null;
69
+ let a = n;
70
+ for (; a && a !== t; ) {
71
+ if (a instanceof HTMLElement && u(a))
72
+ return a;
73
+ a = a.parentElement;
74
+ }
75
+ return null;
60
76
  }
61
77
  export {
62
- E as CANVAS_WHEEL_INTERACTIVE_ATTR,
63
- d as DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR,
64
- u as DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR,
65
- i as DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR,
66
- f as LOCAL_INTERACTION_SURFACE_ATTR,
67
- _ as WORKBENCH_WIDGET_SHELL_ATTR,
78
+ d as CANVAS_WHEEL_INTERACTIVE_ATTR,
79
+ _ as DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR,
80
+ i as DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR,
81
+ s as DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR,
82
+ E as LOCAL_INTERACTION_SURFACE_ATTR,
83
+ g as WORKBENCH_WIDGET_SHELL_ATTR,
68
84
  A as isLocalInteractionSurfaceTarget,
69
- s as resolveSurfaceInteractionTargetRole,
70
- L as resolveSurfaceWheelRouting,
71
- m as resolveWorkbenchWidgetEventOwnership,
72
- R as shouldActivateWorkbenchWidgetLocalTarget
85
+ f as resolveSurfaceInteractionTargetRole,
86
+ R as resolveSurfaceWheelRouting,
87
+ h as resolveWorkbenchWidgetEventOwnership,
88
+ I as resolveWorkbenchWidgetLocalTypingTarget,
89
+ w as shouldActivateWorkbenchWidgetLocalTarget
73
90
  };