@forgeax/app-shell 0.37.0 → 0.39.0

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,37 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
8
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
9
+ }) : x)(function(x) {
10
+ if (typeof require !== "undefined") return require.apply(this, arguments);
11
+ throw Error('Dynamic require of "' + x + '" is not supported');
12
+ });
13
+ var __commonJS = (cb, mod) => function __require2() {
14
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
15
+ };
16
+ var __copyProps = (to, from, except, desc) => {
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from))
19
+ if (!__hasOwnProp.call(to, key) && key !== except)
20
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
+ mod
31
+ ));
32
+
33
+ export {
34
+ __require,
35
+ __commonJS,
36
+ __toESM
37
+ };
package/dist/dock.js CHANGED
@@ -29,6 +29,7 @@ import {
29
29
  resolveRegion,
30
30
  trackDockPanelVisibility
31
31
  } from "./chunk-MYY2LEZI.js";
32
+ import "./chunk-QGM4M3NI.js";
32
33
  export {
33
34
  DOCK_REGIONS,
34
35
  REGIONS,
package/dist/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ import "./chunk-QGM4M3NI.js";
2
+
1
3
  // src/index.ts
2
4
  var AppShellRegistry = class {
3
5
  #contributions = /* @__PURE__ */ new Map();
package/dist/react.d.ts CHANGED
@@ -105,6 +105,56 @@ interface DockLayoutControlBinding<Anchor> {
105
105
  /** Bind the product-neutral layout-control state, toggle source, and live panel projection to React. */
106
106
  declare function useDockLayoutControlBinding<Anchor>({ state, onToggle, isPanelOpen, closePanel, reopenPanel, }: DockLayoutControlBindingOptions<Anchor>): DockLayoutControlBinding<Anchor>;
107
107
 
108
+ interface FloatingMenuAnchor {
109
+ readonly top: number;
110
+ readonly bottom: number;
111
+ readonly left: number;
112
+ readonly right: number;
113
+ }
114
+ interface FloatingMenuPoint {
115
+ readonly x: number;
116
+ readonly y: number;
117
+ }
118
+ interface FloatingMenuProps {
119
+ open: boolean;
120
+ onClose(): void;
121
+ point?: FloatingMenuPoint;
122
+ anchor?: FloatingMenuAnchor | null;
123
+ align?: 'start' | 'end';
124
+ /** Gap in pixels between the anchor and menu. */
125
+ offset?: number;
126
+ className?: string;
127
+ children: ReactNode;
128
+ }
129
+ /** Product-neutral floating menu portal with outside-dismiss and viewport clamping. */
130
+ declare function FloatingMenu({ open, onClose, point, anchor, align, offset, className, children, }: FloatingMenuProps): react.ReactPortal | null;
131
+
132
+ interface DockLayoutMenuPanel {
133
+ readonly id: string;
134
+ readonly title: string;
135
+ readonly icon?: ReactNode;
136
+ }
137
+ interface DockLayoutMenuProps<Anchor extends FloatingMenuAnchor> {
138
+ readonly state: DockLayoutControlState<Anchor>;
139
+ readonly onToggle: DockLayoutControlToggleSource<Anchor>['onToggle'];
140
+ readonly isPanelOpen: (panelId: string) => boolean;
141
+ readonly closePanel: (panelId: string) => void;
142
+ readonly reopenPanel: (panelId: string) => void;
143
+ readonly onReset: () => void;
144
+ readonly resetLabel: ReactNode;
145
+ readonly sectionLabel: ReactNode;
146
+ readonly emptyLabel: ReactNode;
147
+ readonly resetIcon?: ReactNode;
148
+ readonly panels: readonly DockLayoutMenuPanel[];
149
+ }
150
+ /**
151
+ * Product-neutral Dock layout-menu composition.
152
+ *
153
+ * Consumers inject copy, icons, reset policy and concrete panel adapters while
154
+ * App Shell owns the stable binding, carrier, row semantics and structure.
155
+ */
156
+ declare function DockLayoutMenu<Anchor extends FloatingMenuAnchor>({ state, onToggle, isPanelOpen, closePanel, reopenPanel, onReset, resetLabel, sectionLabel, emptyLabel, resetIcon, panels, }: DockLayoutMenuProps<Anchor>): react.JSX.Element;
157
+
108
158
  type ShellSlotElement = 'aside' | 'div' | 'main' | 'section';
109
159
  interface ShellSlotProps extends HTMLAttributes<HTMLElement> {
110
160
  as?: ShellSlotElement;
@@ -113,4 +163,4 @@ interface ShellSlotProps extends HTMLAttributes<HTMLElement> {
113
163
  /** Structural shell marker that preserves the caller's semantic element. */
114
164
  declare function ShellSlot({ as, name, ...props }: ShellSlotProps): ReactElement;
115
165
 
116
- export { DetachedPanelBoundary, type DetachedPanelBoundaryProps, DetachedSurfaceFrame, type DetachedSurfaceFrameProps, DetachedSurfaceStatus, type DetachedSurfaceStatusProps, type DetachedSurfaceStatusTone, type DockLayoutControlBinding, type DockLayoutControlBindingOptions, type PanelContentPadding, type PanelContentPolicy, type PanelContentScroll, type PanelContentTone, PanelEmptyState, type PanelEmptyStateProps, PanelSurface, type PanelSurfaceProps, ResizeHandle, type ResizeHandleProps, ShellSlot, type ShellSlotElement, type ShellSlotProps, SlotDebugOverlay, SurfacePlaceholder, type SurfacePlaceholderProps, SurfaceRegion, type SurfaceRegionProps, hashSlotHue, isSlotDebugEnabled, useDockLayoutControlBinding, useLocalSize };
166
+ export { DetachedPanelBoundary, type DetachedPanelBoundaryProps, DetachedSurfaceFrame, type DetachedSurfaceFrameProps, DetachedSurfaceStatus, type DetachedSurfaceStatusProps, type DetachedSurfaceStatusTone, type DockLayoutControlBinding, type DockLayoutControlBindingOptions, DockLayoutMenu, type DockLayoutMenuPanel, type DockLayoutMenuProps, FloatingMenu, type FloatingMenuAnchor, type FloatingMenuPoint, type FloatingMenuProps, type PanelContentPadding, type PanelContentPolicy, type PanelContentScroll, type PanelContentTone, PanelEmptyState, type PanelEmptyStateProps, PanelSurface, type PanelSurfaceProps, ResizeHandle, type ResizeHandleProps, ShellSlot, type ShellSlotElement, type ShellSlotProps, SlotDebugOverlay, SurfacePlaceholder, type SurfacePlaceholderProps, SurfaceRegion, type SurfaceRegionProps, hashSlotHue, isSlotDebugEnabled, useDockLayoutControlBinding, useLocalSize };
package/dist/react.js CHANGED
@@ -5,6 +5,430 @@ import {
5
5
  import {
6
6
  shouldShowDetachedPlaceholder
7
7
  } from "./chunk-QMT4V6XC.js";
8
+ import {
9
+ __commonJS,
10
+ __require,
11
+ __toESM
12
+ } from "./chunk-QGM4M3NI.js";
13
+
14
+ // node_modules/react-dom/cjs/react-dom.production.js
15
+ var require_react_dom_production = __commonJS({
16
+ "node_modules/react-dom/cjs/react-dom.production.js"(exports) {
17
+ "use strict";
18
+ var React = __require("react");
19
+ function formatProdErrorMessage(code) {
20
+ var url = "https://react.dev/errors/" + code;
21
+ if (1 < arguments.length) {
22
+ url += "?args[]=" + encodeURIComponent(arguments[1]);
23
+ for (var i = 2; i < arguments.length; i++)
24
+ url += "&args[]=" + encodeURIComponent(arguments[i]);
25
+ }
26
+ return "Minified React error #" + code + "; visit " + url + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
27
+ }
28
+ function noop() {
29
+ }
30
+ var Internals = {
31
+ d: {
32
+ f: noop,
33
+ r: function() {
34
+ throw Error(formatProdErrorMessage(522));
35
+ },
36
+ D: noop,
37
+ C: noop,
38
+ L: noop,
39
+ m: noop,
40
+ X: noop,
41
+ S: noop,
42
+ M: noop
43
+ },
44
+ p: 0,
45
+ findDOMNode: null
46
+ };
47
+ var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
48
+ function createPortal$1(children, containerInfo, implementation) {
49
+ var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
50
+ return {
51
+ $$typeof: REACT_PORTAL_TYPE,
52
+ key: null == key ? null : "" + key,
53
+ children,
54
+ containerInfo,
55
+ implementation
56
+ };
57
+ }
58
+ var ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
59
+ function getCrossOriginStringAs(as, input) {
60
+ if ("font" === as) return "";
61
+ if ("string" === typeof input)
62
+ return "use-credentials" === input ? input : "";
63
+ }
64
+ exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
65
+ exports.createPortal = function(children, container) {
66
+ var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
67
+ if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType)
68
+ throw Error(formatProdErrorMessage(299));
69
+ return createPortal$1(children, container, null, key);
70
+ };
71
+ exports.flushSync = function(fn) {
72
+ var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
73
+ try {
74
+ if (ReactSharedInternals.T = null, Internals.p = 2, fn) return fn();
75
+ } finally {
76
+ ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f();
77
+ }
78
+ };
79
+ exports.preconnect = function(href, options) {
80
+ "string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options));
81
+ };
82
+ exports.prefetchDNS = function(href) {
83
+ "string" === typeof href && Internals.d.D(href);
84
+ };
85
+ exports.preinit = function(href, options) {
86
+ if ("string" === typeof href && options && "string" === typeof options.as) {
87
+ var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0;
88
+ "style" === as ? Internals.d.S(
89
+ href,
90
+ "string" === typeof options.precedence ? options.precedence : void 0,
91
+ {
92
+ crossOrigin,
93
+ integrity,
94
+ fetchPriority
95
+ }
96
+ ) : "script" === as && Internals.d.X(href, {
97
+ crossOrigin,
98
+ integrity,
99
+ fetchPriority,
100
+ nonce: "string" === typeof options.nonce ? options.nonce : void 0
101
+ });
102
+ }
103
+ };
104
+ exports.preinitModule = function(href, options) {
105
+ if ("string" === typeof href)
106
+ if ("object" === typeof options && null !== options) {
107
+ if (null == options.as || "script" === options.as) {
108
+ var crossOrigin = getCrossOriginStringAs(
109
+ options.as,
110
+ options.crossOrigin
111
+ );
112
+ Internals.d.M(href, {
113
+ crossOrigin,
114
+ integrity: "string" === typeof options.integrity ? options.integrity : void 0,
115
+ nonce: "string" === typeof options.nonce ? options.nonce : void 0
116
+ });
117
+ }
118
+ } else null == options && Internals.d.M(href);
119
+ };
120
+ exports.preload = function(href, options) {
121
+ if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) {
122
+ var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);
123
+ Internals.d.L(href, as, {
124
+ crossOrigin,
125
+ integrity: "string" === typeof options.integrity ? options.integrity : void 0,
126
+ nonce: "string" === typeof options.nonce ? options.nonce : void 0,
127
+ type: "string" === typeof options.type ? options.type : void 0,
128
+ fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0,
129
+ referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0,
130
+ imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
131
+ imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0,
132
+ media: "string" === typeof options.media ? options.media : void 0
133
+ });
134
+ }
135
+ };
136
+ exports.preloadModule = function(href, options) {
137
+ if ("string" === typeof href)
138
+ if (options) {
139
+ var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);
140
+ Internals.d.m(href, {
141
+ as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0,
142
+ crossOrigin,
143
+ integrity: "string" === typeof options.integrity ? options.integrity : void 0
144
+ });
145
+ } else Internals.d.m(href);
146
+ };
147
+ exports.requestFormReset = function(form) {
148
+ Internals.d.r(form);
149
+ };
150
+ exports.unstable_batchedUpdates = function(fn, a) {
151
+ return fn(a);
152
+ };
153
+ exports.useFormState = function(action, initialState, permalink) {
154
+ return ReactSharedInternals.H.useFormState(action, initialState, permalink);
155
+ };
156
+ exports.useFormStatus = function() {
157
+ return ReactSharedInternals.H.useHostTransitionStatus();
158
+ };
159
+ exports.version = "19.2.8";
160
+ }
161
+ });
162
+
163
+ // node_modules/react-dom/cjs/react-dom.development.js
164
+ var require_react_dom_development = __commonJS({
165
+ "node_modules/react-dom/cjs/react-dom.development.js"(exports) {
166
+ "use strict";
167
+ "production" !== process.env.NODE_ENV && (function() {
168
+ function noop() {
169
+ }
170
+ function testStringCoercion(value) {
171
+ return "" + value;
172
+ }
173
+ function createPortal$1(children, containerInfo, implementation) {
174
+ var key = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
175
+ try {
176
+ testStringCoercion(key);
177
+ var JSCompiler_inline_result = false;
178
+ } catch (e) {
179
+ JSCompiler_inline_result = true;
180
+ }
181
+ JSCompiler_inline_result && (console.error(
182
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
183
+ "function" === typeof Symbol && Symbol.toStringTag && key[Symbol.toStringTag] || key.constructor.name || "Object"
184
+ ), testStringCoercion(key));
185
+ return {
186
+ $$typeof: REACT_PORTAL_TYPE,
187
+ key: null == key ? null : "" + key,
188
+ children,
189
+ containerInfo,
190
+ implementation
191
+ };
192
+ }
193
+ function getCrossOriginStringAs(as, input) {
194
+ if ("font" === as) return "";
195
+ if ("string" === typeof input)
196
+ return "use-credentials" === input ? input : "";
197
+ }
198
+ function getValueDescriptorExpectingObjectForWarning(thing) {
199
+ return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : 'something with type "' + typeof thing + '"';
200
+ }
201
+ function getValueDescriptorExpectingEnumForWarning(thing) {
202
+ return null === thing ? "`null`" : void 0 === thing ? "`undefined`" : "" === thing ? "an empty string" : "string" === typeof thing ? JSON.stringify(thing) : "number" === typeof thing ? "`" + thing + "`" : 'something with type "' + typeof thing + '"';
203
+ }
204
+ function resolveDispatcher() {
205
+ var dispatcher = ReactSharedInternals.H;
206
+ null === dispatcher && console.error(
207
+ "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem."
208
+ );
209
+ return dispatcher;
210
+ }
211
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
212
+ var React = __require("react"), Internals = {
213
+ d: {
214
+ f: noop,
215
+ r: function() {
216
+ throw Error(
217
+ "Invalid form element. requestFormReset must be passed a form that was rendered by React."
218
+ );
219
+ },
220
+ D: noop,
221
+ C: noop,
222
+ L: noop,
223
+ m: noop,
224
+ X: noop,
225
+ S: noop,
226
+ M: noop
227
+ },
228
+ p: 0,
229
+ findDOMNode: null
230
+ }, REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), ReactSharedInternals = React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
231
+ "function" === typeof Map && null != Map.prototype && "function" === typeof Map.prototype.forEach && "function" === typeof Set && null != Set.prototype && "function" === typeof Set.prototype.clear && "function" === typeof Set.prototype.forEach || console.error(
232
+ "React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"
233
+ );
234
+ exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = Internals;
235
+ exports.createPortal = function(children, container) {
236
+ var key = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;
237
+ if (!container || 1 !== container.nodeType && 9 !== container.nodeType && 11 !== container.nodeType)
238
+ throw Error("Target container is not a DOM element.");
239
+ return createPortal$1(children, container, null, key);
240
+ };
241
+ exports.flushSync = function(fn) {
242
+ var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
243
+ try {
244
+ if (ReactSharedInternals.T = null, Internals.p = 2, fn)
245
+ return fn();
246
+ } finally {
247
+ ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f() && console.error(
248
+ "flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task."
249
+ );
250
+ }
251
+ };
252
+ exports.preconnect = function(href, options) {
253
+ "string" === typeof href && href ? null != options && "object" !== typeof options ? console.error(
254
+ "ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",
255
+ getValueDescriptorExpectingEnumForWarning(options)
256
+ ) : null != options && "string" !== typeof options.crossOrigin && console.error(
257
+ "ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",
258
+ getValueDescriptorExpectingObjectForWarning(options.crossOrigin)
259
+ ) : console.error(
260
+ "ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
261
+ getValueDescriptorExpectingObjectForWarning(href)
262
+ );
263
+ "string" === typeof href && (options ? (options = options.crossOrigin, options = "string" === typeof options ? "use-credentials" === options ? options : "" : void 0) : options = null, Internals.d.C(href, options));
264
+ };
265
+ exports.prefetchDNS = function(href) {
266
+ if ("string" !== typeof href || !href)
267
+ console.error(
268
+ "ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
269
+ getValueDescriptorExpectingObjectForWarning(href)
270
+ );
271
+ else if (1 < arguments.length) {
272
+ var options = arguments[1];
273
+ "object" === typeof options && options.hasOwnProperty("crossOrigin") ? console.error(
274
+ "ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
275
+ getValueDescriptorExpectingEnumForWarning(options)
276
+ ) : console.error(
277
+ "ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",
278
+ getValueDescriptorExpectingEnumForWarning(options)
279
+ );
280
+ }
281
+ "string" === typeof href && Internals.d.D(href);
282
+ };
283
+ exports.preinit = function(href, options) {
284
+ "string" === typeof href && href ? null == options || "object" !== typeof options ? console.error(
285
+ "ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",
286
+ getValueDescriptorExpectingEnumForWarning(options)
287
+ ) : "style" !== options.as && "script" !== options.as && console.error(
288
+ 'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',
289
+ getValueDescriptorExpectingEnumForWarning(options.as)
290
+ ) : console.error(
291
+ "ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",
292
+ getValueDescriptorExpectingObjectForWarning(href)
293
+ );
294
+ if ("string" === typeof href && options && "string" === typeof options.as) {
295
+ var as = options.as, crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), integrity = "string" === typeof options.integrity ? options.integrity : void 0, fetchPriority = "string" === typeof options.fetchPriority ? options.fetchPriority : void 0;
296
+ "style" === as ? Internals.d.S(
297
+ href,
298
+ "string" === typeof options.precedence ? options.precedence : void 0,
299
+ {
300
+ crossOrigin,
301
+ integrity,
302
+ fetchPriority
303
+ }
304
+ ) : "script" === as && Internals.d.X(href, {
305
+ crossOrigin,
306
+ integrity,
307
+ fetchPriority,
308
+ nonce: "string" === typeof options.nonce ? options.nonce : void 0
309
+ });
310
+ }
311
+ };
312
+ exports.preinitModule = function(href, options) {
313
+ var encountered = "";
314
+ "string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
315
+ void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "script" !== options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingEnumForWarning(options.as) + ".");
316
+ if (encountered)
317
+ console.error(
318
+ "ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",
319
+ encountered
320
+ );
321
+ else
322
+ switch (encountered = options && "string" === typeof options.as ? options.as : "script", encountered) {
323
+ case "script":
324
+ break;
325
+ default:
326
+ encountered = getValueDescriptorExpectingEnumForWarning(encountered), console.error(
327
+ 'ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',
328
+ encountered,
329
+ href
330
+ );
331
+ }
332
+ if ("string" === typeof href)
333
+ if ("object" === typeof options && null !== options) {
334
+ if (null == options.as || "script" === options.as)
335
+ encountered = getCrossOriginStringAs(
336
+ options.as,
337
+ options.crossOrigin
338
+ ), Internals.d.M(href, {
339
+ crossOrigin: encountered,
340
+ integrity: "string" === typeof options.integrity ? options.integrity : void 0,
341
+ nonce: "string" === typeof options.nonce ? options.nonce : void 0
342
+ });
343
+ } else null == options && Internals.d.M(href);
344
+ };
345
+ exports.preload = function(href, options) {
346
+ var encountered = "";
347
+ "string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
348
+ null == options || "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : "string" === typeof options.as && options.as || (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
349
+ encountered && console.error(
350
+ 'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',
351
+ encountered
352
+ );
353
+ if ("string" === typeof href && "object" === typeof options && null !== options && "string" === typeof options.as) {
354
+ encountered = options.as;
355
+ var crossOrigin = getCrossOriginStringAs(
356
+ encountered,
357
+ options.crossOrigin
358
+ );
359
+ Internals.d.L(href, encountered, {
360
+ crossOrigin,
361
+ integrity: "string" === typeof options.integrity ? options.integrity : void 0,
362
+ nonce: "string" === typeof options.nonce ? options.nonce : void 0,
363
+ type: "string" === typeof options.type ? options.type : void 0,
364
+ fetchPriority: "string" === typeof options.fetchPriority ? options.fetchPriority : void 0,
365
+ referrerPolicy: "string" === typeof options.referrerPolicy ? options.referrerPolicy : void 0,
366
+ imageSrcSet: "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,
367
+ imageSizes: "string" === typeof options.imageSizes ? options.imageSizes : void 0,
368
+ media: "string" === typeof options.media ? options.media : void 0
369
+ });
370
+ }
371
+ };
372
+ exports.preloadModule = function(href, options) {
373
+ var encountered = "";
374
+ "string" === typeof href && href || (encountered += " The `href` argument encountered was " + getValueDescriptorExpectingObjectForWarning(href) + ".");
375
+ void 0 !== options && "object" !== typeof options ? encountered += " The `options` argument encountered was " + getValueDescriptorExpectingObjectForWarning(options) + "." : options && "as" in options && "string" !== typeof options.as && (encountered += " The `as` option encountered was " + getValueDescriptorExpectingObjectForWarning(options.as) + ".");
376
+ encountered && console.error(
377
+ 'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',
378
+ encountered
379
+ );
380
+ "string" === typeof href && (options ? (encountered = getCrossOriginStringAs(
381
+ options.as,
382
+ options.crossOrigin
383
+ ), Internals.d.m(href, {
384
+ as: "string" === typeof options.as && "script" !== options.as ? options.as : void 0,
385
+ crossOrigin: encountered,
386
+ integrity: "string" === typeof options.integrity ? options.integrity : void 0
387
+ })) : Internals.d.m(href));
388
+ };
389
+ exports.requestFormReset = function(form) {
390
+ Internals.d.r(form);
391
+ };
392
+ exports.unstable_batchedUpdates = function(fn, a) {
393
+ return fn(a);
394
+ };
395
+ exports.useFormState = function(action, initialState, permalink) {
396
+ return resolveDispatcher().useFormState(action, initialState, permalink);
397
+ };
398
+ exports.useFormStatus = function() {
399
+ return resolveDispatcher().useHostTransitionStatus();
400
+ };
401
+ exports.version = "19.2.8";
402
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
403
+ })();
404
+ }
405
+ });
406
+
407
+ // node_modules/react-dom/index.js
408
+ var require_react_dom = __commonJS({
409
+ "node_modules/react-dom/index.js"(exports, module) {
410
+ "use strict";
411
+ function checkDCE() {
412
+ if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") {
413
+ return;
414
+ }
415
+ if (process.env.NODE_ENV !== "production") {
416
+ throw new Error("^_^");
417
+ }
418
+ try {
419
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
420
+ } catch (err) {
421
+ console.error(err);
422
+ }
423
+ }
424
+ if (process.env.NODE_ENV === "production") {
425
+ checkDCE();
426
+ module.exports = require_react_dom_production();
427
+ } else {
428
+ module.exports = require_react_dom_development();
429
+ }
430
+ }
431
+ });
8
432
 
9
433
  // src/react.tsx
10
434
  import { createElement } from "react";
@@ -427,6 +851,183 @@ function useDockLayoutControlBinding({
427
851
  return useMemo(() => ({ snapshot, panelControl }), [panelControl, snapshot]);
428
852
  }
429
853
 
854
+ // src/floating-menu.tsx
855
+ var import_react_dom = __toESM(require_react_dom(), 1);
856
+ import { useEffect as useEffect4, useLayoutEffect, useRef as useRef2, useState as useState3 } from "react";
857
+ import { Fragment, jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
858
+ var VIEWPORT_PADDING = 8;
859
+ function FloatingMenu({
860
+ open,
861
+ onClose,
862
+ point,
863
+ anchor,
864
+ align = "start",
865
+ offset = 6,
866
+ className,
867
+ children
868
+ }) {
869
+ const menuRef = useRef2(null);
870
+ const [position, setPosition] = useState3({ top: 0 });
871
+ useLayoutEffect(() => {
872
+ if (!open) return;
873
+ const viewportWidth = window.innerWidth;
874
+ const viewportHeight = window.innerHeight;
875
+ const menuWidth = menuRef.current?.offsetWidth ?? 0;
876
+ const menuHeight = menuRef.current?.offsetHeight ?? 0;
877
+ if (point) {
878
+ const left = Math.min(point.x, viewportWidth - menuWidth - VIEWPORT_PADDING);
879
+ const top = Math.min(point.y, viewportHeight - menuHeight - VIEWPORT_PADDING);
880
+ setPosition({
881
+ left: Math.max(VIEWPORT_PADDING, left),
882
+ top: Math.max(VIEWPORT_PADDING, top)
883
+ });
884
+ return;
885
+ }
886
+ if (anchor) {
887
+ const top = Math.min(anchor.bottom + offset, viewportHeight - menuHeight - VIEWPORT_PADDING);
888
+ if (align === "end") {
889
+ const right = Math.min(
890
+ viewportWidth - anchor.right,
891
+ viewportWidth - menuWidth - VIEWPORT_PADDING
892
+ );
893
+ setPosition({
894
+ right: Math.max(VIEWPORT_PADDING, right),
895
+ top: Math.max(VIEWPORT_PADDING, top)
896
+ });
897
+ } else {
898
+ const left = Math.min(anchor.left, viewportWidth - menuWidth - VIEWPORT_PADDING);
899
+ setPosition({
900
+ left: Math.max(VIEWPORT_PADDING, left),
901
+ top: Math.max(VIEWPORT_PADDING, top)
902
+ });
903
+ }
904
+ }
905
+ }, [align, anchor?.bottom, anchor?.left, anchor?.right, anchor?.top, offset, open, point?.x, point?.y]);
906
+ useEffect4(() => {
907
+ if (!open) return;
908
+ const closeOnEscape = (event) => {
909
+ if (event.key === "Escape") onClose();
910
+ };
911
+ document.addEventListener("keydown", closeOnEscape);
912
+ return () => document.removeEventListener("keydown", closeOnEscape);
913
+ }, [onClose, open]);
914
+ if (!open) return null;
915
+ return (0, import_react_dom.createPortal)(
916
+ /* @__PURE__ */ jsxs3(Fragment, { children: [
917
+ /* @__PURE__ */ jsx7(
918
+ "div",
919
+ {
920
+ "data-app-shell-floating-menu-backdrop": "",
921
+ style: { position: "fixed", inset: 0, zIndex: "var(--z-menu-backdrop)" },
922
+ onClick: onClose,
923
+ onContextMenu: (event) => {
924
+ event.preventDefault();
925
+ onClose();
926
+ }
927
+ }
928
+ ),
929
+ /* @__PURE__ */ jsx7(
930
+ "div",
931
+ {
932
+ ref: menuRef,
933
+ "data-app-shell-floating-menu": "",
934
+ className,
935
+ style: {
936
+ position: "fixed",
937
+ left: position.left,
938
+ right: position.right,
939
+ top: position.top,
940
+ zIndex: "var(--z-menu)"
941
+ },
942
+ onContextMenu: (event) => event.preventDefault(),
943
+ role: "menu",
944
+ children
945
+ }
946
+ )
947
+ ] }),
948
+ document.body
949
+ );
950
+ }
951
+
952
+ // src/dock-layout-menu.tsx
953
+ import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
954
+ function DockLayoutMenu({
955
+ state,
956
+ onToggle,
957
+ isPanelOpen,
958
+ closePanel,
959
+ reopenPanel,
960
+ onReset,
961
+ resetLabel,
962
+ sectionLabel,
963
+ emptyLabel,
964
+ resetIcon,
965
+ panels
966
+ }) {
967
+ const { snapshot, panelControl } = useDockLayoutControlBinding({
968
+ state,
969
+ onToggle,
970
+ isPanelOpen,
971
+ closePanel,
972
+ reopenPanel
973
+ });
974
+ return /* @__PURE__ */ jsxs4(
975
+ FloatingMenu,
976
+ {
977
+ open: snapshot.open,
978
+ onClose: state.close,
979
+ anchor: snapshot.anchor,
980
+ align: "end",
981
+ className: "fx-dl-menu",
982
+ children: [
983
+ /* @__PURE__ */ jsxs4(
984
+ "button",
985
+ {
986
+ type: "button",
987
+ role: "menuitem",
988
+ "data-app-shell-dock-layout-reset": "",
989
+ className: "fx-dl-item fx-dl-reset",
990
+ onClick: () => {
991
+ try {
992
+ onReset();
993
+ } finally {
994
+ state.close();
995
+ }
996
+ },
997
+ children: [
998
+ resetIcon ? /* @__PURE__ */ jsx8("span", { className: "fx-dl-icon", "aria-hidden": "true", children: resetIcon }) : null,
999
+ resetLabel
1000
+ ]
1001
+ }
1002
+ ),
1003
+ /* @__PURE__ */ jsx8("div", { className: "fx-dl-sep", role: "separator" }),
1004
+ /* @__PURE__ */ jsx8("div", { className: "fx-dl-head", children: sectionLabel }),
1005
+ panels.length === 0 ? /* @__PURE__ */ jsx8("div", { className: "fx-dl-head", "data-app-shell-dock-layout-empty": "", children: emptyLabel }) : panels.map((panel) => {
1006
+ const isOpen = panelControl.isOpen(panel.id);
1007
+ return /* @__PURE__ */ jsxs4(
1008
+ "button",
1009
+ {
1010
+ type: "button",
1011
+ role: "menuitemcheckbox",
1012
+ "aria-checked": isOpen,
1013
+ className: `fx-dl-item${isOpen ? " on" : ""}`,
1014
+ onClick: () => {
1015
+ panelControl.toggle(panel.id);
1016
+ },
1017
+ children: [
1018
+ /* @__PURE__ */ jsx8("span", { className: "fx-dl-check", "aria-hidden": "true", children: isOpen ? "\u2713" : "\uFF0B" }),
1019
+ panel.icon ? /* @__PURE__ */ jsx8("span", { className: "fx-dl-icon", "aria-hidden": "true", children: panel.icon }) : null,
1020
+ panel.title
1021
+ ]
1022
+ },
1023
+ panel.id
1024
+ );
1025
+ })
1026
+ ]
1027
+ }
1028
+ );
1029
+ }
1030
+
430
1031
  // src/react.tsx
431
1032
  function ShellSlot({
432
1033
  as = "div",
@@ -439,6 +1040,8 @@ export {
439
1040
  DetachedPanelBoundary,
440
1041
  DetachedSurfaceFrame,
441
1042
  DetachedSurfaceStatus,
1043
+ DockLayoutMenu,
1044
+ FloatingMenu,
442
1045
  PanelEmptyState,
443
1046
  PanelSurface,
444
1047
  ResizeHandle,
@@ -451,3 +1054,27 @@ export {
451
1054
  useDockLayoutControlBinding,
452
1055
  useLocalSize
453
1056
  };
1057
+ /*! Bundled license information:
1058
+
1059
+ react-dom/cjs/react-dom.production.js:
1060
+ (**
1061
+ * @license React
1062
+ * react-dom.production.js
1063
+ *
1064
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
1065
+ *
1066
+ * This source code is licensed under the MIT license found in the
1067
+ * LICENSE file in the root directory of this source tree.
1068
+ *)
1069
+
1070
+ react-dom/cjs/react-dom.development.js:
1071
+ (**
1072
+ * @license React
1073
+ * react-dom.development.js
1074
+ *
1075
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
1076
+ *
1077
+ * This source code is licensed under the MIT license found in the
1078
+ * LICENSE file in the root directory of this source tree.
1079
+ *)
1080
+ */
package/dist/window.js CHANGED
@@ -11,6 +11,7 @@ import {
11
11
  surfaceKey,
12
12
  surfaceWindowLabel
13
13
  } from "./chunk-QMT4V6XC.js";
14
+ import "./chunk-QGM4M3NI.js";
14
15
  export {
15
16
  canOpenPanelWindow,
16
17
  createBrowserWindowManager,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgeax/app-shell",
3
- "version": "0.37.0",
3
+ "version": "0.39.0",
4
4
  "description": "Generic Dock, Panel, Window, and Slot composition primitives",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",