@floegence/floe-webapp-core 0.48.5 → 0.48.6

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.
@@ -1,9 +1,9 @@
1
1
  import { isTypingElement as s } from "../../utils/dom.js";
2
- const g = "data-floe-local-interaction-surface", i = `[${g}="true"]`, A = "data-floe-canvas-wheel-interactive", R = `[${A}="true"]`, m = "data-floe-workbench-widget-shell", f = `[${m}="true"]`, L = "data-floe-workbench-widget-activation-surface", S = `[${L}="true"]`, C = "data-floe-workbench-text-selection-surface", _ = `[${C}="true"]`;
2
+ const g = "data-floe-local-interaction-surface", i = `[${g}="true"]`, A = "data-floe-canvas-wheel-interactive", m = `[${A}="true"]`, R = "data-floe-workbench-widget-shell", f = `[${R}="true"]`, L = "data-floe-workbench-widget-activation-surface", S = `[${L}="true"]`, h = "data-floe-workbench-text-selection-surface", _ = `[${h}="true"]`;
3
3
  function u(e) {
4
4
  return typeof Element < "u" && e instanceof Element ? e : typeof Node < "u" && e instanceof Node ? e.parentElement : null;
5
5
  }
6
- function h(e) {
6
+ function C(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;
@@ -13,7 +13,7 @@ function h(e) {
13
13
  function w(e, n) {
14
14
  let l = e;
15
15
  for (; l && l !== n; ) {
16
- if (s(l) || h(l))
16
+ if (s(l) || C(l))
17
17
  return !0;
18
18
  l = l.parentElement;
19
19
  }
@@ -33,7 +33,7 @@ function I(e) {
33
33
  const {
34
34
  target: n,
35
35
  localInteractionSurfaceSelector: l = i,
36
- wheelInteractiveSelector: o = R
36
+ wheelInteractiveSelector: o = m
37
37
  } = e, r = u(n);
38
38
  return r ? s(r) ? "typing_element" : r.closest(l) !== null ? "local_interaction_surface" : r.closest(o) !== null ? "wheel_interactive" : null : null;
39
39
  }
@@ -84,7 +84,7 @@ function H(e) {
84
84
  return null;
85
85
  let c = t;
86
86
  for (; c && c !== a; ) {
87
- if (c instanceof HTMLElement && s(c))
87
+ if (c instanceof HTMLElement && (s(c) || c.matches("iframe")))
88
88
  return c;
89
89
  c = c.parentElement;
90
90
  }
@@ -92,15 +92,15 @@ function H(e) {
92
92
  }
93
93
  export {
94
94
  A as CANVAS_WHEEL_INTERACTIVE_ATTR,
95
- R as DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR,
95
+ m as DEFAULT_CANVAS_WHEEL_INTERACTIVE_SELECTOR,
96
96
  i as DEFAULT_LOCAL_INTERACTION_SURFACE_SELECTOR,
97
97
  _ as DEFAULT_WORKBENCH_TEXT_SELECTION_SURFACE_SELECTOR,
98
98
  S as DEFAULT_WORKBENCH_WIDGET_ACTIVATION_SURFACE_SELECTOR,
99
99
  f as DEFAULT_WORKBENCH_WIDGET_SHELL_SELECTOR,
100
100
  g as LOCAL_INTERACTION_SURFACE_ATTR,
101
- C as WORKBENCH_TEXT_SELECTION_SURFACE_ATTR,
101
+ h as WORKBENCH_TEXT_SELECTION_SURFACE_ATTR,
102
102
  L as WORKBENCH_WIDGET_ACTIVATION_SURFACE_ATTR,
103
- m as WORKBENCH_WIDGET_SHELL_ATTR,
103
+ R as WORKBENCH_WIDGET_SHELL_ATTR,
104
104
  N as isLocalInteractionSurfaceTarget,
105
105
  d as resolveSurfaceInteractionTargetRole,
106
106
  O as resolveSurfaceWheelRouting,
@@ -130,8 +130,8 @@ function Qe(i) {
130
130
  widgetRoot: w ?? null,
131
131
  interactiveSelector: h().interactiveSelector,
132
132
  panSurfaceSelector: h().panSurfaceSelector
133
- }), ae = () => {
134
- F(), w?.focus({
133
+ }), ae = (t) => {
134
+ F(), t?.focus !== !1 && w?.focus({
135
135
  preventScroll: !0
136
136
  });
137
137
  }, _t = (t) => {
@@ -103,7 +103,10 @@ export interface WorkbenchWidgetBodyProps<TWidgetType extends string = Workbench
103
103
  motion?: WorkbenchWidgetMotionIntent | null;
104
104
  selected?: boolean;
105
105
  filtered?: boolean;
106
- requestActivate?: () => void;
106
+ /** Select and raise the widget. Set focus to false for local or embedded input observations. */
107
+ requestActivate?: (options?: {
108
+ focus?: boolean;
109
+ }) => void;
107
110
  }
108
111
  export interface WorkbenchWidgetDefinition<TWidgetType extends string = WorkbenchWidgetType> {
109
112
  type: TWidgetType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floegence/floe-webapp-core",
3
- "version": "0.48.5",
3
+ "version": "0.48.6",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",