@ggui-ai/dev-stack 0.8.0 → 0.10.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.
- package/dist/hub-preview/client.js +840 -831
- package/dist/local-registry/compile-ui.js +4 -4
- package/package.json +7 -7
|
@@ -63,26 +63,26 @@ var require_react_production = __commonJS({
|
|
|
63
63
|
};
|
|
64
64
|
var assign = Object.assign;
|
|
65
65
|
var emptyObject = {};
|
|
66
|
-
function
|
|
66
|
+
function Component(props, context, updater) {
|
|
67
67
|
this.props = props;
|
|
68
68
|
this.context = context;
|
|
69
69
|
this.refs = emptyObject;
|
|
70
70
|
this.updater = updater || ReactNoopUpdateQueue;
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
Component.prototype.isReactComponent = {};
|
|
73
|
+
Component.prototype.setState = function(partialState, callback) {
|
|
74
74
|
if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
|
|
75
75
|
throw Error(
|
|
76
76
|
"takes an object of state variables to update or a function which returns an object of state variables."
|
|
77
77
|
);
|
|
78
78
|
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
|
79
79
|
};
|
|
80
|
-
|
|
80
|
+
Component.prototype.forceUpdate = function(callback) {
|
|
81
81
|
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
|
82
82
|
};
|
|
83
83
|
function ComponentDummy() {
|
|
84
84
|
}
|
|
85
|
-
ComponentDummy.prototype =
|
|
85
|
+
ComponentDummy.prototype = Component.prototype;
|
|
86
86
|
function PureComponent(props, context, updater) {
|
|
87
87
|
this.props = props;
|
|
88
88
|
this.context = context;
|
|
@@ -91,7 +91,7 @@ var require_react_production = __commonJS({
|
|
|
91
91
|
}
|
|
92
92
|
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
93
93
|
pureComponentPrototype.constructor = PureComponent;
|
|
94
|
-
assign(pureComponentPrototype,
|
|
94
|
+
assign(pureComponentPrototype, Component.prototype);
|
|
95
95
|
pureComponentPrototype.isPureReactComponent = true;
|
|
96
96
|
var isArrayImpl = Array.isArray;
|
|
97
97
|
function noop() {
|
|
@@ -296,7 +296,7 @@ var require_react_production = __commonJS({
|
|
|
296
296
|
};
|
|
297
297
|
exports.Activity = REACT_ACTIVITY_TYPE;
|
|
298
298
|
exports.Children = Children;
|
|
299
|
-
exports.Component =
|
|
299
|
+
exports.Component = Component;
|
|
300
300
|
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
301
301
|
exports.Profiler = REACT_PROFILER_TYPE;
|
|
302
302
|
exports.PureComponent = PureComponent;
|
|
@@ -2785,9 +2785,9 @@ var require_react_dom_client_production = __commonJS({
|
|
|
2785
2785
|
function createFiberImplClass(tag, pendingProps, key, mode) {
|
|
2786
2786
|
return new FiberNode(tag, pendingProps, key, mode);
|
|
2787
2787
|
}
|
|
2788
|
-
function shouldConstruct(
|
|
2789
|
-
|
|
2790
|
-
return !(!
|
|
2788
|
+
function shouldConstruct(Component) {
|
|
2789
|
+
Component = Component.prototype;
|
|
2790
|
+
return !(!Component || !Component.isReactComponent);
|
|
2791
2791
|
}
|
|
2792
2792
|
function createWorkInProgress(current, pendingProps) {
|
|
2793
2793
|
var workInProgress2 = current.alternate;
|
|
@@ -4157,7 +4157,7 @@ var require_react_dom_client_production = __commonJS({
|
|
|
4157
4157
|
if (!objectIs(nextDeps[i], prevDeps[i])) return false;
|
|
4158
4158
|
return true;
|
|
4159
4159
|
}
|
|
4160
|
-
function renderWithHooks(current, workInProgress2,
|
|
4160
|
+
function renderWithHooks(current, workInProgress2, Component, props, secondArg, nextRenderLanes) {
|
|
4161
4161
|
renderLanes = nextRenderLanes;
|
|
4162
4162
|
currentlyRenderingFiber = workInProgress2;
|
|
4163
4163
|
workInProgress2.memoizedState = null;
|
|
@@ -4165,11 +4165,11 @@ var require_react_dom_client_production = __commonJS({
|
|
|
4165
4165
|
workInProgress2.lanes = 0;
|
|
4166
4166
|
ReactSharedInternals.H = null === current || null === current.memoizedState ? HooksDispatcherOnMount : HooksDispatcherOnUpdate;
|
|
4167
4167
|
shouldDoubleInvokeUserFnsInHooksDEV = false;
|
|
4168
|
-
nextRenderLanes =
|
|
4168
|
+
nextRenderLanes = Component(props, secondArg);
|
|
4169
4169
|
shouldDoubleInvokeUserFnsInHooksDEV = false;
|
|
4170
4170
|
didScheduleRenderPhaseUpdateDuringThisPass && (nextRenderLanes = renderWithHooksAgain(
|
|
4171
4171
|
workInProgress2,
|
|
4172
|
-
|
|
4172
|
+
Component,
|
|
4173
4173
|
props,
|
|
4174
4174
|
secondArg
|
|
4175
4175
|
));
|
|
@@ -4187,7 +4187,7 @@ var require_react_dom_client_production = __commonJS({
|
|
|
4187
4187
|
if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300));
|
|
4188
4188
|
null === current || didReceiveUpdate || (current = current.dependencies, null !== current && checkIfContextChanged(current) && (didReceiveUpdate = true));
|
|
4189
4189
|
}
|
|
4190
|
-
function renderWithHooksAgain(workInProgress2,
|
|
4190
|
+
function renderWithHooksAgain(workInProgress2, Component, props, secondArg) {
|
|
4191
4191
|
currentlyRenderingFiber = workInProgress2;
|
|
4192
4192
|
var numberOfReRenders = 0;
|
|
4193
4193
|
do {
|
|
@@ -4205,7 +4205,7 @@ var require_react_dom_client_production = __commonJS({
|
|
|
4205
4205
|
null != children.memoCache && (children.memoCache.index = 0);
|
|
4206
4206
|
}
|
|
4207
4207
|
ReactSharedInternals.H = HooksDispatcherOnRerender;
|
|
4208
|
-
children =
|
|
4208
|
+
children = Component(props, secondArg);
|
|
4209
4209
|
} while (didScheduleRenderPhaseUpdateDuringThisPass);
|
|
4210
4210
|
return children;
|
|
4211
4211
|
}
|
|
@@ -5406,17 +5406,17 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5406
5406
|
"function" === typeof instance.UNSAFE_componentWillReceiveProps && instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
|
|
5407
5407
|
instance.state !== workInProgress2 && classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
|
|
5408
5408
|
}
|
|
5409
|
-
function resolveClassComponentProps(
|
|
5409
|
+
function resolveClassComponentProps(Component, baseProps) {
|
|
5410
5410
|
var newProps = baseProps;
|
|
5411
5411
|
if ("ref" in baseProps) {
|
|
5412
5412
|
newProps = {};
|
|
5413
5413
|
for (var propName in baseProps)
|
|
5414
5414
|
"ref" !== propName && (newProps[propName] = baseProps[propName]);
|
|
5415
5415
|
}
|
|
5416
|
-
if (
|
|
5416
|
+
if (Component = Component.defaultProps) {
|
|
5417
5417
|
newProps === baseProps && (newProps = assign({}, newProps));
|
|
5418
|
-
for (var propName$73 in
|
|
5419
|
-
void 0 === newProps[propName$73] && (newProps[propName$73] =
|
|
5418
|
+
for (var propName$73 in Component)
|
|
5419
|
+
void 0 === newProps[propName$73] && (newProps[propName$73] = Component[propName$73]);
|
|
5420
5420
|
}
|
|
5421
5421
|
return newProps;
|
|
5422
5422
|
}
|
|
@@ -5560,8 +5560,8 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5560
5560
|
renderLanes2
|
|
5561
5561
|
);
|
|
5562
5562
|
}
|
|
5563
|
-
function updateForwardRef(current, workInProgress2,
|
|
5564
|
-
|
|
5563
|
+
function updateForwardRef(current, workInProgress2, Component, nextProps, renderLanes2) {
|
|
5564
|
+
Component = Component.render;
|
|
5565
5565
|
var ref = workInProgress2.ref;
|
|
5566
5566
|
if ("ref" in nextProps) {
|
|
5567
5567
|
var propsWithoutRef = {};
|
|
@@ -5572,7 +5572,7 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5572
5572
|
nextProps = renderWithHooks(
|
|
5573
5573
|
current,
|
|
5574
5574
|
workInProgress2,
|
|
5575
|
-
|
|
5575
|
+
Component,
|
|
5576
5576
|
propsWithoutRef,
|
|
5577
5577
|
ref,
|
|
5578
5578
|
renderLanes2
|
|
@@ -5585,10 +5585,10 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5585
5585
|
reconcileChildren(current, workInProgress2, nextProps, renderLanes2);
|
|
5586
5586
|
return workInProgress2.child;
|
|
5587
5587
|
}
|
|
5588
|
-
function updateMemoComponent(current, workInProgress2,
|
|
5588
|
+
function updateMemoComponent(current, workInProgress2, Component, nextProps, renderLanes2) {
|
|
5589
5589
|
if (null === current) {
|
|
5590
|
-
var type =
|
|
5591
|
-
if ("function" === typeof type && !shouldConstruct(type) && void 0 === type.defaultProps && null ===
|
|
5590
|
+
var type = Component.type;
|
|
5591
|
+
if ("function" === typeof type && !shouldConstruct(type) && void 0 === type.defaultProps && null === Component.compare)
|
|
5592
5592
|
return workInProgress2.tag = 15, workInProgress2.type = type, updateSimpleMemoComponent(
|
|
5593
5593
|
current,
|
|
5594
5594
|
workInProgress2,
|
|
@@ -5597,7 +5597,7 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5597
5597
|
renderLanes2
|
|
5598
5598
|
);
|
|
5599
5599
|
current = createFiberFromTypeAndProps(
|
|
5600
|
-
|
|
5600
|
+
Component.type,
|
|
5601
5601
|
null,
|
|
5602
5602
|
nextProps,
|
|
5603
5603
|
workInProgress2,
|
|
@@ -5611,9 +5611,9 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5611
5611
|
type = current.child;
|
|
5612
5612
|
if (!checkScheduledUpdateOrContext(current, renderLanes2)) {
|
|
5613
5613
|
var prevProps = type.memoizedProps;
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
if (
|
|
5614
|
+
Component = Component.compare;
|
|
5615
|
+
Component = null !== Component ? Component : shallowEqual;
|
|
5616
|
+
if (Component(prevProps, nextProps) && current.ref === workInProgress2.ref)
|
|
5617
5617
|
return bailoutOnAlreadyFinishedWork(current, workInProgress2, renderLanes2);
|
|
5618
5618
|
}
|
|
5619
5619
|
workInProgress2.flags |= 1;
|
|
@@ -5622,7 +5622,7 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5622
5622
|
current.return = workInProgress2;
|
|
5623
5623
|
return workInProgress2.child = current;
|
|
5624
5624
|
}
|
|
5625
|
-
function updateSimpleMemoComponent(current, workInProgress2,
|
|
5625
|
+
function updateSimpleMemoComponent(current, workInProgress2, Component, nextProps, renderLanes2) {
|
|
5626
5626
|
if (null !== current) {
|
|
5627
5627
|
var prevProps = current.memoizedProps;
|
|
5628
5628
|
if (shallowEqual(prevProps, nextProps) && current.ref === workInProgress2.ref)
|
|
@@ -5634,7 +5634,7 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5634
5634
|
return updateFunctionComponent(
|
|
5635
5635
|
current,
|
|
5636
5636
|
workInProgress2,
|
|
5637
|
-
|
|
5637
|
+
Component,
|
|
5638
5638
|
nextProps,
|
|
5639
5639
|
renderLanes2
|
|
5640
5640
|
);
|
|
@@ -5794,12 +5794,12 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5794
5794
|
workInProgress2.flags |= 4194816;
|
|
5795
5795
|
}
|
|
5796
5796
|
}
|
|
5797
|
-
function updateFunctionComponent(current, workInProgress2,
|
|
5797
|
+
function updateFunctionComponent(current, workInProgress2, Component, nextProps, renderLanes2) {
|
|
5798
5798
|
prepareToReadContext(workInProgress2);
|
|
5799
|
-
|
|
5799
|
+
Component = renderWithHooks(
|
|
5800
5800
|
current,
|
|
5801
5801
|
workInProgress2,
|
|
5802
|
-
|
|
5802
|
+
Component,
|
|
5803
5803
|
nextProps,
|
|
5804
5804
|
void 0,
|
|
5805
5805
|
renderLanes2
|
|
@@ -5809,33 +5809,33 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5809
5809
|
return bailoutHooks(current, workInProgress2, renderLanes2), bailoutOnAlreadyFinishedWork(current, workInProgress2, renderLanes2);
|
|
5810
5810
|
isHydrating && nextProps && pushMaterializedTreeId(workInProgress2);
|
|
5811
5811
|
workInProgress2.flags |= 1;
|
|
5812
|
-
reconcileChildren(current, workInProgress2,
|
|
5812
|
+
reconcileChildren(current, workInProgress2, Component, renderLanes2);
|
|
5813
5813
|
return workInProgress2.child;
|
|
5814
5814
|
}
|
|
5815
|
-
function replayFunctionComponent(current, workInProgress2, nextProps,
|
|
5815
|
+
function replayFunctionComponent(current, workInProgress2, nextProps, Component, secondArg, renderLanes2) {
|
|
5816
5816
|
prepareToReadContext(workInProgress2);
|
|
5817
5817
|
workInProgress2.updateQueue = null;
|
|
5818
5818
|
nextProps = renderWithHooksAgain(
|
|
5819
5819
|
workInProgress2,
|
|
5820
|
-
|
|
5820
|
+
Component,
|
|
5821
5821
|
nextProps,
|
|
5822
5822
|
secondArg
|
|
5823
5823
|
);
|
|
5824
5824
|
finishRenderingHooks(current);
|
|
5825
|
-
|
|
5825
|
+
Component = checkDidRenderIdHook();
|
|
5826
5826
|
if (null !== current && !didReceiveUpdate)
|
|
5827
5827
|
return bailoutHooks(current, workInProgress2, renderLanes2), bailoutOnAlreadyFinishedWork(current, workInProgress2, renderLanes2);
|
|
5828
|
-
isHydrating &&
|
|
5828
|
+
isHydrating && Component && pushMaterializedTreeId(workInProgress2);
|
|
5829
5829
|
workInProgress2.flags |= 1;
|
|
5830
5830
|
reconcileChildren(current, workInProgress2, nextProps, renderLanes2);
|
|
5831
5831
|
return workInProgress2.child;
|
|
5832
5832
|
}
|
|
5833
|
-
function updateClassComponent(current, workInProgress2,
|
|
5833
|
+
function updateClassComponent(current, workInProgress2, Component, nextProps, renderLanes2) {
|
|
5834
5834
|
prepareToReadContext(workInProgress2);
|
|
5835
5835
|
if (null === workInProgress2.stateNode) {
|
|
5836
|
-
var context = emptyContextObject, contextType =
|
|
5836
|
+
var context = emptyContextObject, contextType = Component.contextType;
|
|
5837
5837
|
"object" === typeof contextType && null !== contextType && (context = readContext(contextType));
|
|
5838
|
-
context = new
|
|
5838
|
+
context = new Component(nextProps, context);
|
|
5839
5839
|
workInProgress2.memoizedState = null !== context.state && void 0 !== context.state ? context.state : null;
|
|
5840
5840
|
context.updater = classComponentUpdater;
|
|
5841
5841
|
workInProgress2.stateNode = context;
|
|
@@ -5845,27 +5845,27 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5845
5845
|
context.state = workInProgress2.memoizedState;
|
|
5846
5846
|
context.refs = {};
|
|
5847
5847
|
initializeUpdateQueue(workInProgress2);
|
|
5848
|
-
contextType =
|
|
5848
|
+
contextType = Component.contextType;
|
|
5849
5849
|
context.context = "object" === typeof contextType && null !== contextType ? readContext(contextType) : emptyContextObject;
|
|
5850
5850
|
context.state = workInProgress2.memoizedState;
|
|
5851
|
-
contextType =
|
|
5851
|
+
contextType = Component.getDerivedStateFromProps;
|
|
5852
5852
|
"function" === typeof contextType && (applyDerivedStateFromProps(
|
|
5853
5853
|
workInProgress2,
|
|
5854
|
-
|
|
5854
|
+
Component,
|
|
5855
5855
|
contextType,
|
|
5856
5856
|
nextProps
|
|
5857
5857
|
), context.state = workInProgress2.memoizedState);
|
|
5858
|
-
"function" === typeof
|
|
5858
|
+
"function" === typeof Component.getDerivedStateFromProps || "function" === typeof context.getSnapshotBeforeUpdate || "function" !== typeof context.UNSAFE_componentWillMount && "function" !== typeof context.componentWillMount || (contextType = context.state, "function" === typeof context.componentWillMount && context.componentWillMount(), "function" === typeof context.UNSAFE_componentWillMount && context.UNSAFE_componentWillMount(), contextType !== context.state && classComponentUpdater.enqueueReplaceState(context, context.state, null), processUpdateQueue(workInProgress2, nextProps, context, renderLanes2), suspendIfUpdateReadFromEntangledAsyncAction(), context.state = workInProgress2.memoizedState);
|
|
5859
5859
|
"function" === typeof context.componentDidMount && (workInProgress2.flags |= 4194308);
|
|
5860
5860
|
nextProps = true;
|
|
5861
5861
|
} else if (null === current) {
|
|
5862
5862
|
context = workInProgress2.stateNode;
|
|
5863
|
-
var unresolvedOldProps = workInProgress2.memoizedProps, oldProps = resolveClassComponentProps(
|
|
5863
|
+
var unresolvedOldProps = workInProgress2.memoizedProps, oldProps = resolveClassComponentProps(Component, unresolvedOldProps);
|
|
5864
5864
|
context.props = oldProps;
|
|
5865
|
-
var oldContext = context.context, contextType$jscomp$0 =
|
|
5865
|
+
var oldContext = context.context, contextType$jscomp$0 = Component.contextType;
|
|
5866
5866
|
contextType = emptyContextObject;
|
|
5867
5867
|
"object" === typeof contextType$jscomp$0 && null !== contextType$jscomp$0 && (contextType = readContext(contextType$jscomp$0));
|
|
5868
|
-
var getDerivedStateFromProps =
|
|
5868
|
+
var getDerivedStateFromProps = Component.getDerivedStateFromProps;
|
|
5869
5869
|
contextType$jscomp$0 = "function" === typeof getDerivedStateFromProps || "function" === typeof context.getSnapshotBeforeUpdate;
|
|
5870
5870
|
unresolvedOldProps = workInProgress2.pendingProps !== unresolvedOldProps;
|
|
5871
5871
|
contextType$jscomp$0 || "function" !== typeof context.UNSAFE_componentWillReceiveProps && "function" !== typeof context.componentWillReceiveProps || (unresolvedOldProps || oldContext !== contextType) && callComponentWillReceiveProps(
|
|
@@ -5882,12 +5882,12 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5882
5882
|
oldContext = workInProgress2.memoizedState;
|
|
5883
5883
|
unresolvedOldProps || oldState !== oldContext || hasForceUpdate ? ("function" === typeof getDerivedStateFromProps && (applyDerivedStateFromProps(
|
|
5884
5884
|
workInProgress2,
|
|
5885
|
-
|
|
5885
|
+
Component,
|
|
5886
5886
|
getDerivedStateFromProps,
|
|
5887
5887
|
nextProps
|
|
5888
5888
|
), oldContext = workInProgress2.memoizedState), (oldProps = hasForceUpdate || checkShouldComponentUpdate(
|
|
5889
5889
|
workInProgress2,
|
|
5890
|
-
|
|
5890
|
+
Component,
|
|
5891
5891
|
oldProps,
|
|
5892
5892
|
nextProps,
|
|
5893
5893
|
oldState,
|
|
@@ -5898,14 +5898,14 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5898
5898
|
context = workInProgress2.stateNode;
|
|
5899
5899
|
cloneUpdateQueue(current, workInProgress2);
|
|
5900
5900
|
contextType = workInProgress2.memoizedProps;
|
|
5901
|
-
contextType$jscomp$0 = resolveClassComponentProps(
|
|
5901
|
+
contextType$jscomp$0 = resolveClassComponentProps(Component, contextType);
|
|
5902
5902
|
context.props = contextType$jscomp$0;
|
|
5903
5903
|
getDerivedStateFromProps = workInProgress2.pendingProps;
|
|
5904
5904
|
oldState = context.context;
|
|
5905
|
-
oldContext =
|
|
5905
|
+
oldContext = Component.contextType;
|
|
5906
5906
|
oldProps = emptyContextObject;
|
|
5907
5907
|
"object" === typeof oldContext && null !== oldContext && (oldProps = readContext(oldContext));
|
|
5908
|
-
unresolvedOldProps =
|
|
5908
|
+
unresolvedOldProps = Component.getDerivedStateFromProps;
|
|
5909
5909
|
(oldContext = "function" === typeof unresolvedOldProps || "function" === typeof context.getSnapshotBeforeUpdate) || "function" !== typeof context.UNSAFE_componentWillReceiveProps && "function" !== typeof context.componentWillReceiveProps || (contextType !== getDerivedStateFromProps || oldState !== oldProps) && callComponentWillReceiveProps(
|
|
5910
5910
|
workInProgress2,
|
|
5911
5911
|
context,
|
|
@@ -5920,12 +5920,12 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5920
5920
|
var newState = workInProgress2.memoizedState;
|
|
5921
5921
|
contextType !== getDerivedStateFromProps || oldState !== newState || hasForceUpdate || null !== current && null !== current.dependencies && checkIfContextChanged(current.dependencies) ? ("function" === typeof unresolvedOldProps && (applyDerivedStateFromProps(
|
|
5922
5922
|
workInProgress2,
|
|
5923
|
-
|
|
5923
|
+
Component,
|
|
5924
5924
|
unresolvedOldProps,
|
|
5925
5925
|
nextProps
|
|
5926
5926
|
), newState = workInProgress2.memoizedState), (contextType$jscomp$0 = hasForceUpdate || checkShouldComponentUpdate(
|
|
5927
5927
|
workInProgress2,
|
|
5928
|
-
|
|
5928
|
+
Component,
|
|
5929
5929
|
contextType$jscomp$0,
|
|
5930
5930
|
nextProps,
|
|
5931
5931
|
oldState,
|
|
@@ -5940,7 +5940,7 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5940
5940
|
context = nextProps;
|
|
5941
5941
|
markRef(current, workInProgress2);
|
|
5942
5942
|
nextProps = 0 !== (workInProgress2.flags & 128);
|
|
5943
|
-
context || nextProps ? (context = workInProgress2.stateNode,
|
|
5943
|
+
context || nextProps ? (context = workInProgress2.stateNode, Component = nextProps && "function" !== typeof Component.getDerivedStateFromError ? null : context.render(), workInProgress2.flags |= 1, null !== current && nextProps ? (workInProgress2.child = reconcileChildFibers(
|
|
5944
5944
|
workInProgress2,
|
|
5945
5945
|
current.child,
|
|
5946
5946
|
null,
|
|
@@ -5948,9 +5948,9 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5948
5948
|
), workInProgress2.child = reconcileChildFibers(
|
|
5949
5949
|
workInProgress2,
|
|
5950
5950
|
null,
|
|
5951
|
-
|
|
5951
|
+
Component,
|
|
5952
5952
|
renderLanes2
|
|
5953
|
-
)) : reconcileChildren(current, workInProgress2,
|
|
5953
|
+
)) : reconcileChildren(current, workInProgress2, Component, renderLanes2), workInProgress2.memoizedState = context.state, current = workInProgress2.child) : current = bailoutOnAlreadyFinishedWork(
|
|
5954
5954
|
current,
|
|
5955
5955
|
workInProgress2,
|
|
5956
5956
|
renderLanes2
|
|
@@ -19674,15 +19674,18 @@ var require_jsx_runtime = __commonJS({
|
|
|
19674
19674
|
});
|
|
19675
19675
|
|
|
19676
19676
|
// hub-preview-client/main.tsx
|
|
19677
|
-
var
|
|
19677
|
+
var import_react43 = __toESM(require_react(), 1);
|
|
19678
19678
|
var import_client = __toESM(require_client(), 1);
|
|
19679
19679
|
|
|
19680
|
-
// ../
|
|
19681
|
-
var
|
|
19682
|
-
var
|
|
19680
|
+
// ../mcp-apps-react/dist/chunk-7P6ASYW6.mjs
|
|
19681
|
+
var __defProp2 = Object.defineProperty;
|
|
19682
|
+
var __export2 = (target, all) => {
|
|
19683
|
+
for (var name in all)
|
|
19684
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
19685
|
+
};
|
|
19683
19686
|
|
|
19684
19687
|
// ../protocol/dist/version.js
|
|
19685
|
-
var PROTOCOL_VERSION = "draft-2026-
|
|
19688
|
+
var PROTOCOL_VERSION = "draft-2026-08-19";
|
|
19686
19689
|
var PROTOCOL_SCHEMA_VERSION = PROTOCOL_VERSION;
|
|
19687
19690
|
var CLIENT_SUPPORTED_VERSIONS = Object.freeze([
|
|
19688
19691
|
PROTOCOL_SCHEMA_VERSION
|
|
@@ -34209,7 +34212,7 @@ config(en_default());
|
|
|
34209
34212
|
|
|
34210
34213
|
// ../protocol/dist/gadgets/stdlib-gadgets.js
|
|
34211
34214
|
var STDLIB_GADGETS_PACKAGE = "@ggui-ai/gadgets";
|
|
34212
|
-
var STDLIB_GADGETS_VERSION = "0.
|
|
34215
|
+
var STDLIB_GADGETS_VERSION = "0.10.0";
|
|
34213
34216
|
var STDLIB_GADGETS = [
|
|
34214
34217
|
{
|
|
34215
34218
|
package: STDLIB_GADGETS_PACKAGE,
|
|
@@ -34360,15 +34363,24 @@ var jsonValueSchema = external_exports.lazy(() => external_exports.union([
|
|
|
34360
34363
|
// surface as `undefined` at runtime which JSON.stringify drops.
|
|
34361
34364
|
external_exports.record(external_exports.string(), jsonValueSchema)
|
|
34362
34365
|
]));
|
|
34366
|
+
var jsonSchemaTypeNameSchema = external_exports.enum([
|
|
34367
|
+
"string",
|
|
34368
|
+
"number",
|
|
34369
|
+
"integer",
|
|
34370
|
+
"boolean",
|
|
34371
|
+
"array",
|
|
34372
|
+
"object",
|
|
34373
|
+
"null"
|
|
34374
|
+
]);
|
|
34363
34375
|
var jsonSchemaSchema = external_exports.lazy(() => external_exports.object({
|
|
34364
|
-
type
|
|
34365
|
-
|
|
34366
|
-
|
|
34367
|
-
|
|
34368
|
-
|
|
34369
|
-
|
|
34370
|
-
|
|
34371
|
-
|
|
34376
|
+
// Single type OR a draft-07 type array (`['string','null']` —
|
|
34377
|
+
// the canonical nullability form the enforced-props-schema
|
|
34378
|
+
// emission produces). Mirrors `JsonSchemaTypeName | JsonSchemaTypeName[]`
|
|
34379
|
+
// on the TS type — the zod and TS sides are an SSoT pair; widen
|
|
34380
|
+
// both or neither.
|
|
34381
|
+
type: external_exports.union([
|
|
34382
|
+
jsonSchemaTypeNameSchema,
|
|
34383
|
+
external_exports.array(jsonSchemaTypeNameSchema)
|
|
34372
34384
|
]).optional(),
|
|
34373
34385
|
description: external_exports.string().optional(),
|
|
34374
34386
|
enum: external_exports.array(jsonValueSchema).optional(),
|
|
@@ -34536,12 +34548,12 @@ var clientCapabilitiesSpecSchema = external_exports.object({
|
|
|
34536
34548
|
}).strict();
|
|
34537
34549
|
var appPublicEnvSchema = external_exports.record(external_exports.string().regex(PUBLIC_ENV_APP_KEY_RE), external_exports.string()).readonly();
|
|
34538
34550
|
var dataContractSchema = external_exports.object({
|
|
34539
|
-
propsSpec: propsSpecSchema.optional(),
|
|
34540
|
-
actionSpec: actionSpecSchema.optional(),
|
|
34541
|
-
streamSpec: streamSpecSchema.optional(),
|
|
34542
|
-
contextSpec: contextSpecSchema.optional(),
|
|
34543
|
-
agentCapabilities: agentCapabilitiesSpecSchema.optional(),
|
|
34544
|
-
clientCapabilities: clientCapabilitiesSpecSchema.optional()
|
|
34551
|
+
propsSpec: propsSpecSchema.optional().describe("Initial render data: {description?, properties: {<name>: {schema: <JSON Schema>, required?: boolean, description?, default?, example?}}}. A prop is required at the wire gate ONLY when `required: true`; omitted \u21D2 optional (declare `required: true` for props the render must always pass)."),
|
|
34552
|
+
actionSpec: actionSpecSchema.optional().describe("User gestures the agent reacts to on its next turn: {<action>: {label: string (REQUIRED \u2014 button copy / accessible name), schema?: <payload JSON Schema>, description?, example?, icon?, confirm?, nextStep?: '<agentCapabilities.tools key>'}}. Every action is agent-routed; `nextStep` is a hint, not a dispatch."),
|
|
34553
|
+
streamSpec: streamSpecSchema.optional().describe("Live update channels the agent emits into: {<channel>: {schema: <JSON Schema>, description?, example?, mode?: append|replace, replay?: latest|all|none, complete?, source?: {tool, args?}}}. `source.tool` must be declared in agentCapabilities.tools."),
|
|
34554
|
+
contextSpec: contextSpecSchema.optional().describe("Observable client state the agent reads alongside each action: {<slot>: {schema: <JSON Schema>, description?, default?, debounceMs?, example?}}. State that needs no next-turn reasoning belongs here, not in actionSpec."),
|
|
34555
|
+
agentCapabilities: agentCapabilitiesSpecSchema.optional().describe("MCP tools the AGENT may call: {tools: {<bareToolName>: {toolInfo: {inputSchema (REQUIRED), description?, outputSchema?}, serverInfo?: {name, version?}, usage?, example?: {input, output}}}}. Key by the BARE tool name (after any `mcp__<server>__` prefix); the component never calls these."),
|
|
34556
|
+
clientCapabilities: clientCapabilitiesSpecSchema.optional().describe("Browser-capability gadgets the COMPONENT imports: {gadgets: {<npm package>: {<exportName>: {description?, usage?}}}} \u2014 `use`-prefixed export keys are hooks, PascalCase keys are components; version and transport resolve from the app's registered catalog, never on the wire.")
|
|
34545
34557
|
}).passthrough();
|
|
34546
34558
|
|
|
34547
34559
|
// ../protocol/dist/schemas/blueprint.js
|
|
@@ -34557,11 +34569,17 @@ var blueprintSourceSchema = external_exports.union([
|
|
|
34557
34569
|
userBlueprintSourceSchema,
|
|
34558
34570
|
curatedBlueprintSourceSchema
|
|
34559
34571
|
]);
|
|
34572
|
+
var BLUEPRINT_VARIANCE_KEYS = ["persona", "aesthetic", "context", "seedPrompt"];
|
|
34560
34573
|
var blueprintVarianceSchema = external_exports.object({
|
|
34561
34574
|
persona: external_exports.string().optional().describe('Design persona, e.g. "minimalist" / "data-dense". Part of cache identity.'),
|
|
34562
34575
|
aesthetic: external_exports.string().optional().describe('Visual aesthetic, e.g. "calm" / "ornate". Part of cache identity.'),
|
|
34563
34576
|
context: external_exports.record(external_exports.string(), jsonValueSchema).optional().describe('Deliberate design-shaping signals (e.g. {situation:"sad"}) \u2014 part of cache identity. NOT for per-user runtime data; put that in propsSpec/contextSpec.'),
|
|
34564
34577
|
seedPrompt: external_exports.string().optional().describe("Generation seed directive. Part of cache identity.")
|
|
34578
|
+
}, {
|
|
34579
|
+
// A rejection that teaches (ggui#523 item 2): the first live guest
|
|
34580
|
+
// turn sent `mood` and got a bare "Unrecognized key" — name the
|
|
34581
|
+
// legal set and where the misplaced intent belongs.
|
|
34582
|
+
error: (issue2) => issue2.code === "unrecognized_keys" ? `variance: unknown key(s) ${issue2.keys.map((k) => JSON.stringify(k)).join(", ")} \u2014 variance is EXACTLY {${BLUEPRINT_VARIANCE_KEYS.join(", ")}}; put tonal intent in \`aesthetic\`, and per-user runtime data in props / contextSpec, never in variance` : void 0
|
|
34565
34583
|
}).strict();
|
|
34566
34584
|
var blueprintSchema = external_exports.object({
|
|
34567
34585
|
blueprintId: external_exports.string().min(1),
|
|
@@ -34622,15 +34640,17 @@ var jsonPatchOpSchema = external_exports.union([
|
|
|
34622
34640
|
}).strict()
|
|
34623
34641
|
]);
|
|
34624
34642
|
var jsonPatchSchema = external_exports.array(jsonPatchOpSchema);
|
|
34643
|
+
var BLUEPRINT_DRAFT_KEYS = ["contract", "variance", "generator"];
|
|
34625
34644
|
var blueprintDraftObjectSchema = external_exports.object({
|
|
34626
34645
|
contract: dataContractSchema,
|
|
34627
|
-
variance:
|
|
34628
|
-
|
|
34629
|
-
|
|
34630
|
-
|
|
34631
|
-
|
|
34632
|
-
}).strict().optional(),
|
|
34646
|
+
// ONE declaration of the variance shape, protocol-wide: the same
|
|
34647
|
+
// schema (with its `.describe()` teaching and its legal-set
|
|
34648
|
+
// rejection message) that `blueprintMeta.variance` projects on the
|
|
34649
|
+
// way back out (ggui#523 item 1 — the mirror-of-a-mirror is gone).
|
|
34650
|
+
variance: blueprintVarianceSchema.optional(),
|
|
34633
34651
|
generator: external_exports.string().optional()
|
|
34652
|
+
}, {
|
|
34653
|
+
error: (issue2) => issue2.code === "unrecognized_keys" ? `blueprintDraft: unknown key(s) ${issue2.keys.map((k) => JSON.stringify(k)).join(", ")} \u2014 a draft is EXACTLY {${BLUEPRINT_DRAFT_KEYS.join(", ")}}; \`intent\` is a top-level ggui_handshake field, not a draft field, and the four specs live INSIDE \`contract\`` : void 0
|
|
34634
34654
|
}).strict();
|
|
34635
34655
|
var blueprintDraftSchema = blueprintDraftObjectSchema;
|
|
34636
34656
|
var blueprintMetaSchema = external_exports.object({
|
|
@@ -34692,6 +34712,10 @@ var getSessionInputShape = {
|
|
|
34692
34712
|
sessionId: external_exports.string().min(1).describe("GguiSession opaque id (UUID) \u2014 returned by ggui_render.")
|
|
34693
34713
|
};
|
|
34694
34714
|
var getSessionInputSchema = external_exports.object(getSessionInputShape);
|
|
34715
|
+
var getRenderSourceInputShape = {
|
|
34716
|
+
sessionId: external_exports.string().min(1).describe("GguiSession opaque id (UUID) \u2014 returned by ggui_render.")
|
|
34717
|
+
};
|
|
34718
|
+
var getRenderSourceInputSchema = external_exports.object(getRenderSourceInputShape);
|
|
34695
34719
|
var listFeaturedBlueprintsInputShape = {};
|
|
34696
34720
|
var listFeaturedBlueprintsInputSchema = external_exports.object(listFeaturedBlueprintsInputShape);
|
|
34697
34721
|
var searchBlueprintsInputShape = {
|
|
@@ -34726,7 +34750,7 @@ var handshakeInputSchema = external_exports.object({
|
|
|
34726
34750
|
* and the contract validators; variance feeds the variance axis
|
|
34727
34751
|
* and rides through to the suggestion's `blueprintMeta`.
|
|
34728
34752
|
*/
|
|
34729
|
-
blueprintDraft: blueprintDraftSchema.describe(
|
|
34753
|
+
blueprintDraft: blueprintDraftSchema.describe(`Agent's draft \u2014 a JSON OBJECT, never a JSON-encoded string (pass {contract: {...}}, not "{\\"contract\\":...}"; a string fails input validation with -32602). Fields: contract (required) + optional variance + optional generator slug hint. The server combines this with cached blueprints + validator outcomes to produce a three-mode suggestion (cache / agent / synth).`),
|
|
34730
34754
|
/**
|
|
34731
34755
|
* Skip blueprint-search on step-2 and route straight to validation
|
|
34732
34756
|
* + (if validation passes) agent-mode suggestion against the draft.
|
|
@@ -34826,10 +34850,11 @@ var renderErrorCodeSchema = external_exports.enum([
|
|
|
34826
34850
|
"PRODUCTION_FAILED",
|
|
34827
34851
|
"VALIDATION_ERROR",
|
|
34828
34852
|
"NO_PLATFORM_KEY",
|
|
34829
|
-
"NO_CREDENTIALS"
|
|
34853
|
+
"NO_CREDENTIALS",
|
|
34854
|
+
"GENERATION_QUEUE_OVERLOADED"
|
|
34830
34855
|
]);
|
|
34831
34856
|
var renderErrorSchema = external_exports.object({
|
|
34832
|
-
code: renderErrorCodeSchema.describe("Canonical failure class. PRODUCTION_FAILED: generation did not produce a component. VALIDATION_ERROR: a server-side precondition rejected the render before generation. NO_PLATFORM_KEY: the server's managed provider-key configuration has no key for the resolved route. NO_CREDENTIALS: no generation credentials are configured on the server."),
|
|
34857
|
+
code: renderErrorCodeSchema.describe("Canonical failure class. PRODUCTION_FAILED: generation did not produce a component. VALIDATION_ERROR: a server-side precondition rejected the render before generation. NO_PLATFORM_KEY: the server's managed provider-key configuration has no key for the resolved route. NO_CREDENTIALS: no generation credentials are configured on the server. GENERATION_QUEUE_OVERLOADED: the deployment's admission gate rejected the request before generation started (queue full or wait timed out) \u2014 not a failed attempt; safe to retry immediately."),
|
|
34833
34858
|
message: external_exports.string().describe("Human-readable failure detail \u2014 fold into the next attempt or surface to the operator.")
|
|
34834
34859
|
});
|
|
34835
34860
|
var resourceReadErrorCodeSchema = external_exports.enum([
|
|
@@ -34887,33 +34912,78 @@ var renderOutputSchema = external_exports.object({
|
|
|
34887
34912
|
description: external_exports.string(),
|
|
34888
34913
|
example: external_exports.string(),
|
|
34889
34914
|
args: external_exports.object({
|
|
34890
|
-
sessionId: external_exports.string()
|
|
34915
|
+
sessionId: external_exports.string(),
|
|
34916
|
+
// The per-call long-poll window in seconds. Carried on the hint
|
|
34917
|
+
// because consume's own default is 0 (single non-blocking
|
|
34918
|
+
// drain): an agent copying a timeout-less hint gets an instant
|
|
34919
|
+
// empty result and stops looping.
|
|
34920
|
+
timeout: external_exports.number()
|
|
34891
34921
|
})
|
|
34892
|
-
}).optional().describe("
|
|
34922
|
+
}).optional().describe("Required-next-call hint \u2014 when the rendered contract has actions, points the agent at ggui_consume({sessionId, timeout}) for the inbound action loop. Absent for pure-display renders.")
|
|
34893
34923
|
});
|
|
34894
34924
|
var updateInputSchema = external_exports.discriminatedUnion("kind", [
|
|
34895
34925
|
external_exports.object({
|
|
34896
34926
|
sessionId: external_exports.string().describe("GguiSession opaque id (UUID) \u2014 returned by ggui_render."),
|
|
34897
34927
|
kind: external_exports.literal("replace"),
|
|
34898
|
-
props: external_exports.record(external_exports.string(), external_exports.unknown()).describe("Full replacement props map. New map IS the new state.")
|
|
34928
|
+
props: external_exports.record(external_exports.string(), external_exports.unknown()).describe("Full replacement props map. New map IS the new state, rendered as a NEW card (a new history entry). For an in-place repaint of the mounted card use ggui_amend.")
|
|
34929
|
+
}).strict(),
|
|
34930
|
+
external_exports.object({
|
|
34931
|
+
sessionId: external_exports.string().describe("GguiSession opaque id (UUID) \u2014 returned by ggui_render."),
|
|
34932
|
+
kind: external_exports.literal("merge"),
|
|
34933
|
+
patch: external_exports.record(external_exports.string(), external_exports.unknown()).describe("RFC 7396 JSON Merge Patch \u2014 null deletes a key; arrays fully replace. The merged state renders as a NEW card (a new history entry). For an in-place repaint of the mounted card use ggui_amend.")
|
|
34934
|
+
}).strict()
|
|
34935
|
+
]);
|
|
34936
|
+
var amendInputSchema = external_exports.discriminatedUnion("kind", [
|
|
34937
|
+
external_exports.object({
|
|
34938
|
+
sessionId: external_exports.string().describe("GguiSession opaque id (UUID) \u2014 returned by ggui_render."),
|
|
34939
|
+
kind: external_exports.literal("replace"),
|
|
34940
|
+
props: external_exports.record(external_exports.string(), external_exports.unknown()).describe("Full replacement props map, applied to the currently mounted card in place.")
|
|
34899
34941
|
}).strict(),
|
|
34900
34942
|
external_exports.object({
|
|
34901
34943
|
sessionId: external_exports.string().describe("GguiSession opaque id (UUID) \u2014 returned by ggui_render."),
|
|
34902
34944
|
kind: external_exports.literal("merge"),
|
|
34903
|
-
patch: external_exports.record(external_exports.string(), external_exports.unknown()).describe("RFC 7396 JSON Merge Patch \u2014 null deletes a key; arrays fully replace.")
|
|
34945
|
+
patch: external_exports.record(external_exports.string(), external_exports.unknown()).describe("RFC 7396 JSON Merge Patch \u2014 null deletes a key; arrays fully replace. Applied to the currently mounted card in place.")
|
|
34904
34946
|
}).strict()
|
|
34905
34947
|
]);
|
|
34906
34948
|
var updateOutputSchema = external_exports.object({
|
|
34907
34949
|
sessionId: external_exports.string(),
|
|
34908
34950
|
updated: external_exports.boolean(),
|
|
34909
34951
|
/**
|
|
34910
|
-
*
|
|
34911
|
-
*
|
|
34912
|
-
*
|
|
34952
|
+
* The epoch-pinned URI of the NEW history record this update minted
|
|
34953
|
+
* (`ui://ggui/render/{id}[/{key}]#{epoch}` — see epoch-uri.ts). On a
|
|
34954
|
+
* no-op (`updated: false`) no record is minted and this is the bare
|
|
34955
|
+
* live-head URI. Mirrored on the LLM-visible structuredContent so
|
|
34956
|
+
* SDKs that strip `_meta` from tool_results can still reach the
|
|
34913
34957
|
* mount URI. Kept in sync with the update handler's wire shape —
|
|
34914
34958
|
* this export and the handler's inline schema must not drift.
|
|
34915
34959
|
*/
|
|
34916
|
-
resourceUri: external_exports.string()
|
|
34960
|
+
resourceUri: external_exports.string(),
|
|
34961
|
+
/**
|
|
34962
|
+
* The session's head epoch after this call: advanced by one on a
|
|
34963
|
+
* real update (`updated: true`), unchanged on a no-op. `ggui_render`
|
|
34964
|
+
* mints epoch 0. The session ROW is the authority
|
|
34965
|
+
* (`GguiSessionBase.epoch`, absent ⇒ 0); the ledger's `ui.reminted`
|
|
34966
|
+
* events are the wire signal only — the ledger is horizon-bounded
|
|
34967
|
+
* and must never be counted as the source of truth.
|
|
34968
|
+
*/
|
|
34969
|
+
epoch: external_exports.number().int().min(0),
|
|
34970
|
+
/**
|
|
34971
|
+
* Present ONLY on a no-op (`updated: false`): the patch conformed to
|
|
34972
|
+
* the contract but left the final props semantically identical to
|
|
34973
|
+
* the current state, so nothing was written, nothing changes on
|
|
34974
|
+
* screen, and NO new history record was minted. Model-visible by
|
|
34975
|
+
* design — the common producer of a no-op is an agent echoing
|
|
34976
|
+
* existing props back believing it changed the UI, and this field is
|
|
34977
|
+
* its feedback channel.
|
|
34978
|
+
*/
|
|
34979
|
+
warning: external_exports.string().optional()
|
|
34980
|
+
});
|
|
34981
|
+
var amendOutputSchema = external_exports.object({
|
|
34982
|
+
sessionId: external_exports.string(),
|
|
34983
|
+
updated: external_exports.boolean(),
|
|
34984
|
+
resourceUri: external_exports.string(),
|
|
34985
|
+
/** Same no-op feedback channel as ggui_update's `warning`. */
|
|
34986
|
+
warning: external_exports.string().optional()
|
|
34917
34987
|
});
|
|
34918
34988
|
var declareToolCatalogInputSchema = external_exports.object({
|
|
34919
34989
|
toolCatalog: external_exports.record(external_exports.string(), external_exports.object({ name: external_exports.string(), version: external_exports.string().optional() }).strict()).describe("Per-app canonical tool identities: bare tool name -> its server's initialize-declared serverInfo. Host/library-supplied; not an agent action.")
|
|
@@ -34922,6 +34992,45 @@ var declareToolCatalogOutputSchema = external_exports.object({
|
|
|
34922
34992
|
saved: external_exports.boolean(),
|
|
34923
34993
|
appId: external_exports.string()
|
|
34924
34994
|
}).strict();
|
|
34995
|
+
var RUNTIME_PULL_MAX_LIMIT = 100;
|
|
34996
|
+
var RUNTIME_PULL_MAX_WAIT_SECONDS = 20;
|
|
34997
|
+
var gguiSessionEventSchema = external_exports.object({
|
|
34998
|
+
seq: external_exports.number().int().min(1).describe('Monotonic, gap-free per render; starts at 1 (0 is the "no events yet" cursor sentinel, never an event).'),
|
|
34999
|
+
type: external_exports.string().min(1).describe("Wire-frame type \u2014 see the canonical GguiSessionEventType taxonomy; plain string so servers can mint new types without a protocol bump."),
|
|
35000
|
+
timestamp: external_exports.string().describe("ISO 8601 UTC timestamp the server stamped on emission."),
|
|
35001
|
+
data: external_exports.unknown().describe("Type-specific payload \u2014 structurally identical to the matching live-channel frame payload.")
|
|
35002
|
+
});
|
|
35003
|
+
var runtimePullInputShape = {
|
|
35004
|
+
sessionId: external_exports.string().min(1).describe('Active render id \u2014 sourced from `_meta["ai.ggui/render"].sessionId` on the iframe boot envelope. Unknown and cross-tenant ids surface uniformly as session_not_found.'),
|
|
35005
|
+
sinceSequence: external_exports.number().int().min(0).optional().describe("Replay cursor \u2014 only events with seq > sinceSequence return. Omit (= 0) on first pull; advance to the last event's seq (or lastSequence on an empty page) on every subsequent pull."),
|
|
35006
|
+
limit: external_exports.number().int().min(1).optional().describe(`Max events per page. Values above ${RUNTIME_PULL_MAX_LIMIT} are clamped to ${RUNTIME_PULL_MAX_LIMIT}; omit for the default ${RUNTIME_PULL_MAX_LIMIT}. When hasMore is true, immediately re-pull with the advanced cursor.`),
|
|
35007
|
+
wait: external_exports.number().min(0).optional().describe(`Subscription-mode hold, in seconds. When set and the cursor page is empty, the server holds this call until an event lands or the hold elapses (values above ${RUNTIME_PULL_MAX_WAIT_SECONDS} are clamped to ${RUNTIME_PULL_MAX_WAIT_SECONDS}). An empty page after a full hold is a NORMAL result \u2014 immediately re-pull to stay subscribed, or back off to sparse un-held pulls after a few consecutive empties. Omit (= 0) for an immediate return.`)
|
|
35008
|
+
};
|
|
35009
|
+
var runtimePullInputSchema = external_exports.object(runtimePullInputShape);
|
|
35010
|
+
var runtimePullEventsPageSchema = external_exports.object({
|
|
35011
|
+
events: external_exports.array(gguiSessionEventSchema),
|
|
35012
|
+
lastSequence: external_exports.number().int().min(0),
|
|
35013
|
+
hasMore: external_exports.boolean()
|
|
35014
|
+
});
|
|
35015
|
+
var runtimePullHorizonSchema = external_exports.object({
|
|
35016
|
+
reason: external_exports.literal("REPLAY_HORIZON_PASSED"),
|
|
35017
|
+
currentSequence: external_exports.number().int().min(0)
|
|
35018
|
+
});
|
|
35019
|
+
var runtimePullOutputSchema = external_exports.union([
|
|
35020
|
+
runtimePullEventsPageSchema,
|
|
35021
|
+
runtimePullHorizonSchema
|
|
35022
|
+
]);
|
|
35023
|
+
var RUNTIME_TELEMETRY_MAX_EVENTS = 40;
|
|
35024
|
+
var runtimeTelemetryInputShape = {
|
|
35025
|
+
sessionId: external_exports.string().min(1).describe("Render id the report concerns \u2014 sourced from the boot envelope. Client-claimed: used as a log tag only."),
|
|
35026
|
+
events: external_exports.array(external_exports.object({
|
|
35027
|
+
at: external_exports.number().min(0).describe("Milliseconds since iframe boot (monotonic, client clock)."),
|
|
35028
|
+
kind: external_exports.string().min(1).max(64).describe("Event name \u2014 e.g. 'boot.path', 'status.connected', 'channel_failover_swap', 'doorbell.ring'."),
|
|
35029
|
+
detail: external_exports.string().max(512).optional().describe("Optional compact context (JSON fragment or message).")
|
|
35030
|
+
})).min(1).max(RUNTIME_TELEMETRY_MAX_EVENTS).describe("Batched ladder/doorbell events, oldest first.")
|
|
35031
|
+
};
|
|
35032
|
+
var runtimeTelemetryInputSchema = external_exports.object(runtimeTelemetryInputShape);
|
|
35033
|
+
var runtimeTelemetryOutputSchema = external_exports.object({ ok: external_exports.literal(true) });
|
|
34925
35034
|
|
|
34926
35035
|
// ../protocol/dist/schemas/invoke.js
|
|
34927
35036
|
var textBlockSchema = external_exports.object({
|
|
@@ -35047,87 +35156,13 @@ var appThemeSchema = external_exports.object({
|
|
|
35047
35156
|
// ../protocol/dist/registry/canonicalize-contract.js
|
|
35048
35157
|
var import_canonicalize = __toESM(require_canonicalize(), 1);
|
|
35049
35158
|
|
|
35159
|
+
// ../protocol/dist/validation/enforced-props-schema.js
|
|
35160
|
+
var import_canonicalize2 = __toESM(require_canonicalize(), 1);
|
|
35161
|
+
|
|
35050
35162
|
// ../protocol/dist/types/data-contract.js
|
|
35051
35163
|
var CONTEXT_SLOT_VALUE_MAX_BYTES = 16 * 1024;
|
|
35052
35164
|
var CONTEXT_SNAPSHOT_MAX_BYTES = 64 * 1024;
|
|
35053
35165
|
|
|
35054
|
-
// ../protocol/dist/schemas/ops-blueprint.js
|
|
35055
|
-
var opsGenerateBlueprintInputSchema = external_exports.object({
|
|
35056
|
-
contract: dataContractSchema,
|
|
35057
|
-
generator: external_exports.string().min(1).optional().describe("Generator slug (e.g. `ui-gen-default-haiku-4-5`). When omitted, dispatches through `GeneratorRegistry.defaultGenerator()`."),
|
|
35058
|
-
persona: external_exports.string().optional().describe("Free-form persona tag (e.g. 'minimalist', 'data-dense'). Normalized via lowercase+trim before persistence; logged as a warning when within Levenshtein distance < 2 of an existing tag for the same appId."),
|
|
35059
|
-
aesthetic: external_exports.string().optional().describe("Free-form aesthetic tag (e.g. 'glassmorphic', 'brutalist', 'editorial'). Persisted on `Blueprint.variance.aesthetic`. Distinct from persona \u2014 persona names the user mental model; aesthetic names the visual treatment."),
|
|
35060
|
-
context: external_exports.record(external_exports.string(), jsonValueSchema).optional().describe("Small structured signal carried alongside the persona. Persisted on `Blueprint.variance.context`."),
|
|
35061
|
-
seedPrompt: external_exports.string().optional().describe("The raw operator prompt that produced this variant. Round-trip input for the variant-selector + audit trail."),
|
|
35062
|
-
setAsOperatorDefault: external_exports.boolean().optional().describe("When true, pins the new blueprint as the operator default for its `(appId, contractHash)` group, clearing any prior default in the same group.")
|
|
35063
|
-
}).strict();
|
|
35064
|
-
var opsGenerateBlueprintOutputSchema = external_exports.object({
|
|
35065
|
-
blueprintId: external_exports.string().min(1),
|
|
35066
|
-
codeHash: external_exports.string().optional().describe("Content hash of the generated code body. Absent when the generator returned a non-`ok` result and persistence skipped \u2014 the failure mode is surfaced through generator-level error reporting elsewhere."),
|
|
35067
|
-
validatorScore: external_exports.number().min(0).max(1).optional().describe("Advanced generator's iterative-loop validator score (0-1). Absent for default-generator output."),
|
|
35068
|
-
source: llmBlueprintSourceSchema.describe("Provenance stamped on the persisted `Blueprint.source` \u2014 always the `llm` arm on this path: `generator` is the engine slug the dispatch resolved to (stamped from the engine's own metadata claim); `model` is the LLM model id the engine called.")
|
|
35069
|
-
}).strict();
|
|
35070
|
-
var opsRegisterBlueprintInputSchema = external_exports.object({
|
|
35071
|
-
contract: dataContractSchema,
|
|
35072
|
-
componentCode: external_exports.string().min(1).describe("Verbatim component-code body to persist. Stored as-is \u2014 no LLM call, no validator pass. Operator owns correctness; the handler computes the canonical sha256 codeHash and routes the bytes through the same persistence seams as `*_generate_*`."),
|
|
35073
|
-
persona: external_exports.string().optional().describe("Free-form persona tag (e.g. 'minimalist', 'data-dense'). Normalized via lowercase+trim before persistence; logged as a warning when within Levenshtein distance < 2 of an existing tag for the same appId."),
|
|
35074
|
-
aesthetic: external_exports.string().optional().describe("Free-form aesthetic tag. Persisted on `Blueprint.variance.aesthetic`."),
|
|
35075
|
-
context: external_exports.record(external_exports.string(), jsonValueSchema).optional().describe("Small structured signal carried alongside the persona. Persisted on `Blueprint.variance.context`."),
|
|
35076
|
-
seedPrompt: external_exports.string().optional().describe("Optional originating prompt for audit + round-tripping (e.g. the prose the operator originally fed into `*_generate_*` before exporting)."),
|
|
35077
|
-
setAsOperatorDefault: external_exports.boolean().optional().describe("When true, pins the new blueprint as the operator default for its `(appId, contractHash)` group, clearing any prior default in the same group.")
|
|
35078
|
-
}).strict();
|
|
35079
|
-
var opsRegisterBlueprintOutputSchema = external_exports.object({
|
|
35080
|
-
blueprintId: external_exports.string().min(1),
|
|
35081
|
-
codeHash: external_exports.string().min(1).describe("Content hash of the persisted code body (full sha256 hex)."),
|
|
35082
|
-
source: userBlueprintSourceSchema.describe('Provenance stamped on the persisted `Blueprint.source` \u2014 always `{kind: "user"}` on this path: operator-supplied bytes, no LLM dispatch, no engine claim to record.')
|
|
35083
|
-
}).strict();
|
|
35084
|
-
var opsListBlueprintsInputSchema = external_exports.object({
|
|
35085
|
-
contractHash: external_exports.string().min(1).optional().describe("Filter to a single `(appId, contractHash)` group. Combine with `generator` / `persona` to narrow within the group."),
|
|
35086
|
-
generator: external_exports.string().min(1).optional().describe('Filter to engine-generated blueprints (`source.kind === "llm"`) whose `source.generator` equals this slug. `user`-sourced rows never match (they carry no engine provenance).'),
|
|
35087
|
-
persona: external_exports.string().optional().describe("Filter on `variance.persona`. Normalized to match persisted form (lowercase+trim)."),
|
|
35088
|
-
intentKeywords: external_exports.array(external_exports.string().min(1)).optional().describe("Semantic-search tokens. When set, dispatches through `BlueprintSearch.search()` rather than indexed `list()`.")
|
|
35089
|
-
}).strict();
|
|
35090
|
-
var opsListBlueprintsOutputSchema = external_exports.object({
|
|
35091
|
-
blueprints: external_exports.array(blueprintSchema)
|
|
35092
|
-
}).strict();
|
|
35093
|
-
var opsUpdateBlueprintInputSchema = external_exports.object({
|
|
35094
|
-
blueprintId: external_exports.string().min(1),
|
|
35095
|
-
isOperatorDefault: external_exports.literal(true).optional().describe("When `true`, pins this blueprint as the operator default for its `(appId, contractHash)` group. Clears any prior default. Cannot set to `false` \u2014 to unpin, set another blueprint in the same group as default, or delete this one."),
|
|
35096
|
-
variance: blueprintVarianceSchema.optional().describe('Partial-merge into the existing variance. Supplied keys overwrite; omitted keys preserve. Pass `{persona: ""}` to clear a persona (handler treats empty string as removal).')
|
|
35097
|
-
}).strict();
|
|
35098
|
-
var opsUpdateBlueprintOutputSchema = external_exports.object({
|
|
35099
|
-
blueprintId: external_exports.string().min(1),
|
|
35100
|
-
updatedAt: external_exports.string().min(1)
|
|
35101
|
-
}).strict();
|
|
35102
|
-
var opsDeleteBlueprintInputSchema = external_exports.object({
|
|
35103
|
-
blueprintId: external_exports.string().min(1)
|
|
35104
|
-
}).strict();
|
|
35105
|
-
var opsDeleteBlueprintOutputSchema = external_exports.object({
|
|
35106
|
-
deleted: external_exports.literal(true)
|
|
35107
|
-
}).strict();
|
|
35108
|
-
|
|
35109
|
-
// ../protocol/dist/envelopes/builders.js
|
|
35110
|
-
function resolveSchemaVersion(parts) {
|
|
35111
|
-
if ("schemaVersion" in parts) {
|
|
35112
|
-
return parts.schemaVersion;
|
|
35113
|
-
}
|
|
35114
|
-
return PROTOCOL_SCHEMA_VERSION;
|
|
35115
|
-
}
|
|
35116
|
-
function makeActionEnvelope(parts) {
|
|
35117
|
-
const envelope = {
|
|
35118
|
-
sessionId: parts.sessionId,
|
|
35119
|
-
type: parts.type
|
|
35120
|
-
};
|
|
35121
|
-
if (parts.payload !== void 0)
|
|
35122
|
-
envelope.payload = parts.payload;
|
|
35123
|
-
if (parts.clientSeq !== void 0)
|
|
35124
|
-
envelope.clientSeq = parts.clientSeq;
|
|
35125
|
-
const stamp = resolveSchemaVersion(parts);
|
|
35126
|
-
if (stamp !== void 0)
|
|
35127
|
-
envelope.schemaVersion = stamp;
|
|
35128
|
-
return envelope;
|
|
35129
|
-
}
|
|
35130
|
-
|
|
35131
35166
|
// ../protocol/dist/validation/ajv-runtime.js
|
|
35132
35167
|
var import_ajv = __toESM(require_ajv(), 1);
|
|
35133
35168
|
var import_ajv_formats = __toESM(require_dist(), 1);
|
|
@@ -35170,8 +35205,20 @@ if (!standaloneAjv.getKeyword("example")) {
|
|
|
35170
35205
|
if (!standaloneAjv.getKeyword("nullable")) {
|
|
35171
35206
|
standaloneAjv.addKeyword({ keyword: "nullable" });
|
|
35172
35207
|
}
|
|
35208
|
+
var standaloneCjsAjv = new import_ajv.default({
|
|
35209
|
+
...AJV_OPTIONS,
|
|
35210
|
+
code: { source: true }
|
|
35211
|
+
});
|
|
35212
|
+
(0, import_ajv_formats.default)(standaloneCjsAjv);
|
|
35213
|
+
if (!standaloneCjsAjv.getKeyword("example")) {
|
|
35214
|
+
standaloneCjsAjv.addKeyword({ keyword: "example" });
|
|
35215
|
+
}
|
|
35216
|
+
if (!standaloneCjsAjv.getKeyword("nullable")) {
|
|
35217
|
+
standaloneCjsAjv.addKeyword({ keyword: "nullable" });
|
|
35218
|
+
}
|
|
35173
35219
|
function injectClosedShape(schema) {
|
|
35174
|
-
const
|
|
35220
|
+
const typeSet = new Set(Array.isArray(schema.type) ? schema.type : schema.type ? [schema.type] : []);
|
|
35221
|
+
const isObjectNode = typeSet.has("object") || schema.properties !== void 0;
|
|
35175
35222
|
if (isObjectNode) {
|
|
35176
35223
|
const out = { ...schema };
|
|
35177
35224
|
if (out.properties) {
|
|
@@ -35192,7 +35239,7 @@ function injectClosedShape(schema) {
|
|
|
35192
35239
|
out.anyOf = out.anyOf.map(injectClosedShape);
|
|
35193
35240
|
return out;
|
|
35194
35241
|
}
|
|
35195
|
-
if (
|
|
35242
|
+
if (typeSet.has("array") && schema.items) {
|
|
35196
35243
|
return { ...schema, items: injectClosedShape(schema.items) };
|
|
35197
35244
|
}
|
|
35198
35245
|
if (schema.oneOf || schema.anyOf) {
|
|
@@ -35212,7 +35259,10 @@ function compileForValidation(schema) {
|
|
|
35212
35259
|
function mapAjvErrorsToViolations(errors, data) {
|
|
35213
35260
|
if (!errors)
|
|
35214
35261
|
return [];
|
|
35215
|
-
return errors.map((err) =>
|
|
35262
|
+
return errors.map((err) => ({
|
|
35263
|
+
...mapOne(err, data),
|
|
35264
|
+
...err.keyword ? { keyword: err.keyword } : {}
|
|
35265
|
+
}));
|
|
35216
35266
|
}
|
|
35217
35267
|
function prefixViolations(violations, prefix) {
|
|
35218
35268
|
if (!prefix)
|
|
@@ -35559,24 +35609,92 @@ function validateActionEnvelope(envelope, spec, precompiledActions) {
|
|
|
35559
35609
|
return validateActionData(envelope.payload, spec, precompiledActions);
|
|
35560
35610
|
}
|
|
35561
35611
|
|
|
35562
|
-
// ../
|
|
35563
|
-
var
|
|
35564
|
-
|
|
35565
|
-
|
|
35566
|
-
|
|
35567
|
-
|
|
35612
|
+
// ../protocol/dist/schemas/ops-blueprint.js
|
|
35613
|
+
var opsGenerateBlueprintInputSchema = external_exports.object({
|
|
35614
|
+
appId: external_exports.string().min(1).optional().describe("Target app for this curation call. Defaults to the caller's bound app identity; callers not bound to an app must provide it. The deployment's authorization policy decides whether the caller may curate the named app."),
|
|
35615
|
+
contract: dataContractSchema,
|
|
35616
|
+
generator: external_exports.string().min(1).optional().describe("Generator slug (e.g. `ui-gen-default-haiku-4-5`). When omitted, dispatches through `GeneratorRegistry.defaultGenerator()`."),
|
|
35617
|
+
persona: external_exports.string().optional().describe("Free-form persona tag (e.g. 'minimalist', 'data-dense'). Normalized via lowercase+trim before persistence; logged as a warning when within Levenshtein distance < 2 of an existing tag for the same appId."),
|
|
35618
|
+
aesthetic: external_exports.string().optional().describe("Free-form aesthetic tag (e.g. 'glassmorphic', 'brutalist', 'editorial'). Persisted on `Blueprint.variance.aesthetic`. Distinct from persona \u2014 persona names the user mental model; aesthetic names the visual treatment."),
|
|
35619
|
+
context: external_exports.record(external_exports.string(), jsonValueSchema).optional().describe("Small structured signal carried alongside the persona. Persisted on `Blueprint.variance.context`."),
|
|
35620
|
+
seedPrompt: external_exports.string().optional().describe("The raw operator prompt that produced this variant. Round-trip input for the variant-selector + audit trail."),
|
|
35621
|
+
setAsOperatorDefault: external_exports.boolean().optional().describe("When true, pins the new blueprint as the operator default for its `(appId, contractHash)` group, clearing any prior default in the same group.")
|
|
35622
|
+
}).strict();
|
|
35623
|
+
var opsGenerateBlueprintOutputSchema = external_exports.object({
|
|
35624
|
+
blueprintId: external_exports.string().min(1),
|
|
35625
|
+
codeHash: external_exports.string().optional().describe("Content hash of the generated code body. Absent when the generator returned a non-`ok` result and persistence skipped \u2014 the failure mode is surfaced through generator-level error reporting elsewhere."),
|
|
35626
|
+
validatorScore: external_exports.number().min(0).max(1).optional().describe("Advanced generator's iterative-loop validator score (0-1). Absent for default-generator output."),
|
|
35627
|
+
source: llmBlueprintSourceSchema.describe("Provenance stamped on the persisted `Blueprint.source` \u2014 always the `llm` arm on this path: `generator` is the engine slug the dispatch resolved to (stamped from the engine's own metadata claim); `model` is the LLM model id the engine called.")
|
|
35628
|
+
}).strict();
|
|
35629
|
+
var opsRegisterBlueprintInputSchema = external_exports.object({
|
|
35630
|
+
appId: external_exports.string().min(1).optional().describe("Target app for this curation call. Defaults to the caller's bound app identity; callers not bound to an app must provide it. The deployment's authorization policy decides whether the caller may curate the named app."),
|
|
35631
|
+
contract: dataContractSchema,
|
|
35632
|
+
componentCode: external_exports.string().min(1).describe("Verbatim component-code body to persist. Stored as-is \u2014 no LLM call, no validator pass. Operator owns correctness; the handler computes the canonical sha256 codeHash and routes the bytes through the same persistence seams as `*_generate_*`."),
|
|
35633
|
+
persona: external_exports.string().optional().describe("Free-form persona tag (e.g. 'minimalist', 'data-dense'). Normalized via lowercase+trim before persistence; logged as a warning when within Levenshtein distance < 2 of an existing tag for the same appId."),
|
|
35634
|
+
aesthetic: external_exports.string().optional().describe("Free-form aesthetic tag. Persisted on `Blueprint.variance.aesthetic`."),
|
|
35635
|
+
context: external_exports.record(external_exports.string(), jsonValueSchema).optional().describe("Small structured signal carried alongside the persona. Persisted on `Blueprint.variance.context`."),
|
|
35636
|
+
seedPrompt: external_exports.string().optional().describe("Optional originating prompt for audit + round-tripping (e.g. the prose the operator originally fed into `*_generate_*` before exporting)."),
|
|
35637
|
+
setAsOperatorDefault: external_exports.boolean().optional().describe("When true, pins the new blueprint as the operator default for its `(appId, contractHash)` group, clearing any prior default in the same group.")
|
|
35638
|
+
}).strict();
|
|
35639
|
+
var opsRegisterBlueprintOutputSchema = external_exports.object({
|
|
35640
|
+
blueprintId: external_exports.string().min(1),
|
|
35641
|
+
codeHash: external_exports.string().min(1).describe("Content hash of the persisted code body (full sha256 hex)."),
|
|
35642
|
+
source: userBlueprintSourceSchema.describe('Provenance stamped on the persisted `Blueprint.source` \u2014 always `{kind: "user"}` on this path: operator-supplied bytes, no LLM dispatch, no engine claim to record.')
|
|
35643
|
+
}).strict();
|
|
35644
|
+
var opsListBlueprintsInputSchema = external_exports.object({
|
|
35645
|
+
appId: external_exports.string().min(1).optional().describe("Target app for this curation call. Defaults to the caller's bound app identity; callers not bound to an app must provide it. The deployment's authorization policy decides whether the caller may curate the named app."),
|
|
35646
|
+
contractHash: external_exports.string().min(1).optional().describe("Filter to a single `(appId, contractHash)` group. Combine with `generator` / `persona` to narrow within the group."),
|
|
35647
|
+
generator: external_exports.string().min(1).optional().describe('Filter to engine-generated blueprints (`source.kind === "llm"`) whose `source.generator` equals this slug. `user`-sourced rows never match (they carry no engine provenance).'),
|
|
35648
|
+
persona: external_exports.string().optional().describe("Filter on `variance.persona`. Normalized to match persisted form (lowercase+trim)."),
|
|
35649
|
+
intentKeywords: external_exports.array(external_exports.string().min(1)).optional().describe("Semantic-search tokens. When set, dispatches through `BlueprintSearch.search()` rather than indexed `list()`.")
|
|
35650
|
+
}).strict();
|
|
35651
|
+
var opsListBlueprintsOutputSchema = external_exports.object({
|
|
35652
|
+
blueprints: external_exports.array(blueprintSchema)
|
|
35653
|
+
}).strict();
|
|
35654
|
+
var opsUpdateBlueprintInputSchema = external_exports.object({
|
|
35655
|
+
appId: external_exports.string().min(1).optional().describe("Target app for this curation call. Defaults to the caller's bound app identity; callers not bound to an app must provide it. The deployment's authorization policy decides whether the caller may curate the named app. Must match the app the addressed blueprint belongs to."),
|
|
35656
|
+
blueprintId: external_exports.string().min(1),
|
|
35657
|
+
isOperatorDefault: external_exports.literal(true).optional().describe("When `true`, pins this blueprint as the operator default for its `(appId, contractHash)` group. Clears any prior default. Cannot set to `false` \u2014 to unpin, set another blueprint in the same group as default, or delete this one."),
|
|
35658
|
+
variance: blueprintVarianceSchema.optional().describe('Partial-merge into the existing variance. Supplied keys overwrite; omitted keys preserve. Pass `{persona: ""}` to clear a persona (handler treats empty string as removal).')
|
|
35659
|
+
}).strict();
|
|
35660
|
+
var opsUpdateBlueprintOutputSchema = external_exports.object({
|
|
35661
|
+
blueprintId: external_exports.string().min(1),
|
|
35662
|
+
updatedAt: external_exports.string().min(1)
|
|
35663
|
+
}).strict();
|
|
35664
|
+
var opsDeleteBlueprintInputSchema = external_exports.object({
|
|
35665
|
+
appId: external_exports.string().min(1).optional().describe("Target app for this curation call. Defaults to the caller's bound app identity; callers not bound to an app must provide it. The deployment's authorization policy decides whether the caller may curate the named app. Must match the app the addressed blueprint belongs to."),
|
|
35666
|
+
blueprintId: external_exports.string().min(1)
|
|
35667
|
+
}).strict();
|
|
35668
|
+
var opsDeleteBlueprintOutputSchema = external_exports.object({
|
|
35669
|
+
deleted: external_exports.literal(true)
|
|
35670
|
+
}).strict();
|
|
35568
35671
|
|
|
35569
|
-
// ../
|
|
35570
|
-
|
|
35571
|
-
|
|
35572
|
-
|
|
35573
|
-
|
|
35574
|
-
|
|
35672
|
+
// ../protocol/dist/envelopes/builders.js
|
|
35673
|
+
function resolveSchemaVersion(parts) {
|
|
35674
|
+
if ("schemaVersion" in parts) {
|
|
35675
|
+
return parts.schemaVersion;
|
|
35676
|
+
}
|
|
35677
|
+
return PROTOCOL_SCHEMA_VERSION;
|
|
35678
|
+
}
|
|
35679
|
+
function makeActionEnvelope(parts) {
|
|
35680
|
+
const envelope = {
|
|
35681
|
+
sessionId: parts.sessionId,
|
|
35682
|
+
type: parts.type
|
|
35683
|
+
};
|
|
35684
|
+
if (parts.payload !== void 0)
|
|
35685
|
+
envelope.payload = parts.payload;
|
|
35686
|
+
if (parts.clientSeq !== void 0)
|
|
35687
|
+
envelope.clientSeq = parts.clientSeq;
|
|
35688
|
+
const stamp = resolveSchemaVersion(parts);
|
|
35689
|
+
if (stamp !== void 0)
|
|
35690
|
+
envelope.schemaVersion = stamp;
|
|
35691
|
+
return envelope;
|
|
35692
|
+
}
|
|
35575
35693
|
|
|
35576
|
-
// ../
|
|
35577
|
-
var
|
|
35578
|
-
var
|
|
35579
|
-
var
|
|
35694
|
+
// ../mcp-apps-react/dist/index.mjs
|
|
35695
|
+
var import_react5 = __toESM(require_react(), 1);
|
|
35696
|
+
var import_react6 = __toESM(require_react(), 1);
|
|
35697
|
+
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
|
35580
35698
|
|
|
35581
35699
|
// ../wire/dist/index.js
|
|
35582
35700
|
var dist_exports = {};
|
|
@@ -35602,13 +35720,13 @@ __export(dist_exports, {
|
|
|
35602
35720
|
});
|
|
35603
35721
|
|
|
35604
35722
|
// ../wire/dist/WireProvider.js
|
|
35605
|
-
var
|
|
35723
|
+
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
|
35606
35724
|
|
|
35607
35725
|
// ../wire/dist/context.js
|
|
35608
|
-
var
|
|
35609
|
-
var WireContext = (0,
|
|
35726
|
+
var import_react = __toESM(require_react(), 1);
|
|
35727
|
+
var WireContext = (0, import_react.createContext)(null);
|
|
35610
35728
|
function useWireContext() {
|
|
35611
|
-
const ctx = (0,
|
|
35729
|
+
const ctx = (0, import_react.useContext)(WireContext);
|
|
35612
35730
|
if (!ctx) {
|
|
35613
35731
|
throw new Error("useWireContext must be used within a WireProvider. Ensure the component is rendered inside a GguiWireProvider.");
|
|
35614
35732
|
}
|
|
@@ -35617,11 +35735,11 @@ function useWireContext() {
|
|
|
35617
35735
|
|
|
35618
35736
|
// ../wire/dist/WireProvider.js
|
|
35619
35737
|
function GguiWireProvider({ config: config2, children }) {
|
|
35620
|
-
return (0,
|
|
35738
|
+
return (0, import_jsx_runtime.jsx)(WireContext.Provider, { value: config2, children });
|
|
35621
35739
|
}
|
|
35622
35740
|
|
|
35623
35741
|
// ../wire/dist/useAction.js
|
|
35624
|
-
var
|
|
35742
|
+
var import_react2 = __toESM(require_react(), 1);
|
|
35625
35743
|
|
|
35626
35744
|
// ../wire/dist/dispatch-dedup.js
|
|
35627
35745
|
var pendingDispatches = /* @__PURE__ */ new Set();
|
|
@@ -35655,7 +35773,7 @@ function tryAcceptDispatch(actionName, data) {
|
|
|
35655
35773
|
// ../wire/dist/useAction.js
|
|
35656
35774
|
function useAction(actionName) {
|
|
35657
35775
|
const { dispatch, onDispatchSuppressed } = useWireContext();
|
|
35658
|
-
return (0,
|
|
35776
|
+
return (0, import_react2.useCallback)((data) => {
|
|
35659
35777
|
const decision = tryAcceptDispatch(actionName, data);
|
|
35660
35778
|
if (decision.suppressed) {
|
|
35661
35779
|
console.warn(`[ggui] useAction('${actionName}') suppressed a duplicate dispatch (same name + payload, same event-loop task). This usually means two interactive elements nest and both wire to the same action (e.g. a Checkbox onChange inside a Card as={Clickable} onClick); the inner gesture bubbles to the outer handler so one user click would fire the action twice. Wire each useAction callback to exactly ONE interactive surface. Tier-0 'double-wired-action' warns on this at gen time; this runtime defense ensures the user-visible behavior stays correct regardless of code shape.`);
|
|
@@ -35678,7 +35796,7 @@ function useAction(actionName) {
|
|
|
35678
35796
|
}
|
|
35679
35797
|
|
|
35680
35798
|
// ../wire/dist/useGguiContext.js
|
|
35681
|
-
var
|
|
35799
|
+
var import_react3 = __toESM(require_react(), 1);
|
|
35682
35800
|
function useGguiContext(slotName) {
|
|
35683
35801
|
const contextName = slotName.length === 0 ? "Context" : slotName.charAt(0).toUpperCase() + slotName.slice(1) + "Context";
|
|
35684
35802
|
const registry2 = globalThis.__ggui__?.contexts;
|
|
@@ -35686,19 +35804,19 @@ function useGguiContext(slotName) {
|
|
|
35686
35804
|
if (!ctx) {
|
|
35687
35805
|
throw new Error(`[ggui] useGguiContext('${slotName}'): no Context registered. The contract must declare 'contextSpec.${slotName}' AND the runtime must have synthesized the per-slot React Context at boot. If you see this in production code generated by the LLM, the boilerplate's destructure line drifted from the contract.`);
|
|
35688
35806
|
}
|
|
35689
|
-
return (0,
|
|
35807
|
+
return (0, import_react3.useContext)(ctx);
|
|
35690
35808
|
}
|
|
35691
35809
|
|
|
35692
35810
|
// ../wire/dist/useStream.js
|
|
35693
|
-
var
|
|
35811
|
+
var import_react4 = __toESM(require_react(), 1);
|
|
35694
35812
|
function useStream(channelName) {
|
|
35695
35813
|
const { subscribe } = useWireContext();
|
|
35696
|
-
const [latest, setLatest] = (0,
|
|
35697
|
-
const [all, setAll] = (0,
|
|
35698
|
-
const [isComplete, setIsComplete] = (0,
|
|
35699
|
-
const allRef = (0,
|
|
35814
|
+
const [latest, setLatest] = (0, import_react4.useState)(null);
|
|
35815
|
+
const [all, setAll] = (0, import_react4.useState)([]);
|
|
35816
|
+
const [isComplete, setIsComplete] = (0, import_react4.useState)(false);
|
|
35817
|
+
const allRef = (0, import_react4.useRef)(all);
|
|
35700
35818
|
allRef.current = all;
|
|
35701
|
-
(0,
|
|
35819
|
+
(0, import_react4.useEffect)(() => {
|
|
35702
35820
|
return subscribe(channelName, (delivery) => {
|
|
35703
35821
|
const typed = delivery.payload;
|
|
35704
35822
|
setLatest(typed);
|
|
@@ -35871,243 +35989,104 @@ function buildWireConfig(opts) {
|
|
|
35871
35989
|
};
|
|
35872
35990
|
}
|
|
35873
35991
|
|
|
35874
|
-
// ../
|
|
35875
|
-
var
|
|
35876
|
-
|
|
35877
|
-
|
|
35878
|
-
var
|
|
35879
|
-
id: external_exports.string().min(1)
|
|
35880
|
-
});
|
|
35881
|
-
var ComponentRef = external_exports.string().min(1);
|
|
35882
|
-
var Align = external_exports.enum(["start", "center", "end", "stretch"]);
|
|
35883
|
-
var Justify = external_exports.enum([
|
|
35884
|
-
"start",
|
|
35885
|
-
"center",
|
|
35886
|
-
"end",
|
|
35887
|
-
"between",
|
|
35888
|
-
"around",
|
|
35889
|
-
"evenly"
|
|
35890
|
-
]);
|
|
35891
|
-
var RowComponent = ComponentBase.extend({
|
|
35892
|
-
component: external_exports.literal("Row"),
|
|
35893
|
-
children: external_exports.array(ComponentRef).optional(),
|
|
35894
|
-
gap: external_exports.string().optional(),
|
|
35895
|
-
align: Align.optional(),
|
|
35896
|
-
justify: Justify.optional()
|
|
35897
|
-
});
|
|
35898
|
-
var ColumnComponent = ComponentBase.extend({
|
|
35899
|
-
component: external_exports.literal("Column"),
|
|
35900
|
-
children: external_exports.array(ComponentRef).optional(),
|
|
35901
|
-
gap: external_exports.string().optional(),
|
|
35902
|
-
align: Align.optional(),
|
|
35903
|
-
justify: Justify.optional()
|
|
35904
|
-
});
|
|
35905
|
-
var CardComponent = ComponentBase.extend({
|
|
35906
|
-
component: external_exports.literal("Card"),
|
|
35907
|
-
child: ComponentRef.optional()
|
|
35908
|
-
});
|
|
35909
|
-
var ListComponent = ComponentBase.extend({
|
|
35910
|
-
component: external_exports.literal("List"),
|
|
35911
|
-
children: external_exports.array(ComponentRef).optional()
|
|
35912
|
-
});
|
|
35913
|
-
var DividerComponent = ComponentBase.extend({
|
|
35914
|
-
component: external_exports.literal("Divider"),
|
|
35915
|
-
orientation: external_exports.enum(["horizontal", "vertical"]).optional()
|
|
35916
|
-
});
|
|
35917
|
-
var TextComponent = ComponentBase.extend({
|
|
35918
|
-
component: external_exports.literal("Text"),
|
|
35919
|
-
text: external_exports.string(),
|
|
35920
|
-
variant: external_exports.string().optional()
|
|
35921
|
-
});
|
|
35922
|
-
var ImageComponent = ComponentBase.extend({
|
|
35923
|
-
component: external_exports.literal("Image"),
|
|
35924
|
-
src: external_exports.string().min(1),
|
|
35925
|
-
alt: external_exports.string().optional()
|
|
35926
|
-
});
|
|
35927
|
-
var IconComponent = ComponentBase.extend({
|
|
35928
|
-
component: external_exports.literal("Icon"),
|
|
35929
|
-
name: external_exports.string().min(1)
|
|
35930
|
-
});
|
|
35931
|
-
var ButtonComponent = ComponentBase.extend({
|
|
35932
|
-
component: external_exports.literal("Button"),
|
|
35933
|
-
label: external_exports.string()
|
|
35934
|
-
});
|
|
35935
|
-
var TextFieldComponent = ComponentBase.extend({
|
|
35936
|
-
component: external_exports.literal("TextField"),
|
|
35937
|
-
label: external_exports.string().optional(),
|
|
35938
|
-
placeholder: external_exports.string().optional(),
|
|
35939
|
-
value: external_exports.string().optional()
|
|
35940
|
-
});
|
|
35941
|
-
var CheckBoxComponent = ComponentBase.extend({
|
|
35942
|
-
component: external_exports.literal("CheckBox"),
|
|
35943
|
-
label: external_exports.string().optional(),
|
|
35944
|
-
checked: external_exports.boolean().optional()
|
|
35945
|
-
});
|
|
35946
|
-
var ChoicePickerOption = external_exports.object({
|
|
35947
|
-
label: external_exports.string(),
|
|
35948
|
-
value: external_exports.string()
|
|
35949
|
-
});
|
|
35950
|
-
var ChoicePickerComponent = ComponentBase.extend({
|
|
35951
|
-
component: external_exports.literal("ChoicePicker"),
|
|
35952
|
-
label: external_exports.string().optional(),
|
|
35953
|
-
options: external_exports.array(ChoicePickerOption).optional(),
|
|
35954
|
-
value: external_exports.string().optional()
|
|
35955
|
-
});
|
|
35956
|
-
var ComponentSchema = external_exports.discriminatedUnion("component", [
|
|
35957
|
-
RowComponent,
|
|
35958
|
-
ColumnComponent,
|
|
35959
|
-
CardComponent,
|
|
35960
|
-
ListComponent,
|
|
35961
|
-
DividerComponent,
|
|
35962
|
-
TextComponent,
|
|
35963
|
-
ImageComponent,
|
|
35964
|
-
IconComponent,
|
|
35965
|
-
ButtonComponent,
|
|
35966
|
-
TextFieldComponent,
|
|
35967
|
-
CheckBoxComponent,
|
|
35968
|
-
ChoicePickerComponent
|
|
35969
|
-
]);
|
|
35970
|
-
|
|
35971
|
-
// ../preview-a2ui/dist/messages.js
|
|
35972
|
-
var A2UI_MESSAGE_VERSION = "v0.9";
|
|
35973
|
-
var VersionLiteral = external_exports.literal(A2UI_MESSAGE_VERSION);
|
|
35974
|
-
var SurfaceId = external_exports.string().min(1);
|
|
35975
|
-
var CreateSurfaceMessageSchema = external_exports.object({
|
|
35976
|
-
version: VersionLiteral,
|
|
35977
|
-
createSurface: external_exports.object({
|
|
35978
|
-
surfaceId: SurfaceId,
|
|
35979
|
-
catalogId: external_exports.string().min(1)
|
|
35980
|
-
})
|
|
35981
|
-
});
|
|
35982
|
-
var UpdateComponentsMessageSchema = external_exports.object({
|
|
35983
|
-
version: VersionLiteral,
|
|
35984
|
-
updateComponents: external_exports.object({
|
|
35985
|
-
surfaceId: SurfaceId,
|
|
35986
|
-
components: external_exports.array(ComponentSchema)
|
|
35987
|
-
})
|
|
35988
|
-
});
|
|
35989
|
-
var DeleteSurfaceMessageSchema = external_exports.object({
|
|
35990
|
-
version: VersionLiteral,
|
|
35991
|
-
deleteSurface: external_exports.object({
|
|
35992
|
-
surfaceId: SurfaceId
|
|
35993
|
-
})
|
|
35994
|
-
});
|
|
35995
|
-
var ServerMessageSchema = external_exports.union([
|
|
35996
|
-
CreateSurfaceMessageSchema,
|
|
35997
|
-
UpdateComponentsMessageSchema,
|
|
35998
|
-
DeleteSurfaceMessageSchema
|
|
35999
|
-
]);
|
|
36000
|
-
|
|
36001
|
-
// ../ggui-react/dist/index.mjs
|
|
36002
|
-
var import_react11 = __toESM(require_react(), 1);
|
|
35992
|
+
// ../mcp-apps-react/dist/index.mjs
|
|
35993
|
+
var import_react7 = __toESM(require_react(), 1);
|
|
35994
|
+
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
|
35995
|
+
var import_react8 = __toESM(require_react(), 1);
|
|
35996
|
+
var import_react9 = __toESM(require_react(), 1);
|
|
36003
35997
|
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
|
|
36004
|
-
var import_react12 = __toESM(require_react(), 1);
|
|
36005
35998
|
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
|
|
36006
|
-
var import_react13 = __toESM(require_react(), 1);
|
|
36007
|
-
var import_react14 = __toESM(require_react(), 1);
|
|
36008
35999
|
var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
|
|
36000
|
+
var import_react10 = __toESM(require_react(), 1);
|
|
36001
|
+
var import_react11 = __toESM(require_react(), 1);
|
|
36009
36002
|
var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
|
|
36010
36003
|
var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
|
|
36011
|
-
var import_react15 = __toESM(require_react(), 1);
|
|
36012
|
-
var import_react16 = __toESM(require_react(), 1);
|
|
36013
36004
|
var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
|
|
36005
|
+
var import_react12 = __toESM(require_react(), 1);
|
|
36014
36006
|
var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
|
|
36007
|
+
var import_react13 = __toESM(require_react(), 1);
|
|
36015
36008
|
var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
|
|
36016
|
-
var
|
|
36009
|
+
var import_react14 = __toESM(require_react(), 1);
|
|
36017
36010
|
var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
|
|
36018
|
-
var import_react18 = __toESM(require_react(), 1);
|
|
36019
36011
|
var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
|
|
36020
|
-
var
|
|
36012
|
+
var import_react15 = __toESM(require_react(), 1);
|
|
36021
36013
|
var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
|
|
36014
|
+
var import_react16 = __toESM(require_react(), 1);
|
|
36022
36015
|
var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
|
|
36023
|
-
var
|
|
36016
|
+
var import_react17 = __toESM(require_react(), 1);
|
|
36024
36017
|
var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
|
|
36025
|
-
var import_react21 = __toESM(require_react(), 1);
|
|
36026
36018
|
var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
|
|
36027
|
-
var import_react22 = __toESM(require_react(), 1);
|
|
36028
36019
|
var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
|
|
36020
|
+
var import_react18 = __toESM(require_react(), 1);
|
|
36029
36021
|
var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
|
|
36030
36022
|
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
|
|
36031
|
-
var import_react23 = __toESM(require_react(), 1);
|
|
36032
36023
|
var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
|
|
36024
|
+
var import_react19 = __toESM(require_react(), 1);
|
|
36033
36025
|
var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
|
|
36026
|
+
var import_react20 = __toESM(require_react(), 1);
|
|
36034
36027
|
var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
|
|
36035
|
-
var import_react24 = __toESM(require_react(), 1);
|
|
36036
36028
|
var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
|
|
36037
|
-
var
|
|
36029
|
+
var import_react21 = __toESM(require_react(), 1);
|
|
36038
36030
|
var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
|
|
36031
|
+
var import_react22 = __toESM(require_react(), 1);
|
|
36039
36032
|
var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
|
|
36040
|
-
var
|
|
36033
|
+
var import_react23 = __toESM(require_react(), 1);
|
|
36041
36034
|
var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
|
|
36042
|
-
var
|
|
36035
|
+
var import_react24 = __toESM(require_react(), 1);
|
|
36043
36036
|
var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
|
|
36044
|
-
var
|
|
36037
|
+
var import_react25 = __toESM(require_react(), 1);
|
|
36038
|
+
var import_react26 = __toESM(require_react(), 1);
|
|
36045
36039
|
var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
|
|
36046
|
-
var
|
|
36040
|
+
var import_react27 = __toESM(require_react(), 1);
|
|
36047
36041
|
var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
|
|
36048
|
-
var import_react30 = __toESM(require_react(), 1);
|
|
36049
|
-
var import_react31 = __toESM(require_react(), 1);
|
|
36050
36042
|
var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
|
|
36051
|
-
var import_react32 = __toESM(require_react(), 1);
|
|
36052
36043
|
var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
|
|
36053
36044
|
var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
|
|
36045
|
+
var import_react28 = __toESM(require_react(), 1);
|
|
36054
36046
|
var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
|
|
36047
|
+
var import_react29 = __toESM(require_react(), 1);
|
|
36055
36048
|
var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
|
|
36056
|
-
var
|
|
36049
|
+
var import_react30 = __toESM(require_react(), 1);
|
|
36057
36050
|
var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
|
|
36058
|
-
var import_react34 = __toESM(require_react(), 1);
|
|
36059
36051
|
var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
|
|
36060
|
-
var import_react35 = __toESM(require_react(), 1);
|
|
36061
36052
|
var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1);
|
|
36062
36053
|
var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1);
|
|
36063
36054
|
var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1);
|
|
36064
36055
|
var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1);
|
|
36065
36056
|
var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1);
|
|
36057
|
+
var import_react31 = __toESM(require_react(), 1);
|
|
36066
36058
|
var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1);
|
|
36067
36059
|
var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1);
|
|
36068
|
-
var
|
|
36060
|
+
var import_react32 = __toESM(require_react(), 1);
|
|
36069
36061
|
var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1);
|
|
36070
36062
|
var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1);
|
|
36071
|
-
var
|
|
36063
|
+
var import_react33 = __toESM(require_react(), 1);
|
|
36072
36064
|
var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1);
|
|
36073
36065
|
var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1);
|
|
36074
|
-
var
|
|
36066
|
+
var import_react34 = __toESM(require_react(), 1);
|
|
36075
36067
|
var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1);
|
|
36076
36068
|
var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1);
|
|
36077
|
-
var
|
|
36069
|
+
var import_react35 = __toESM(require_react(), 1);
|
|
36078
36070
|
var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1);
|
|
36071
|
+
var import_react36 = __toESM(require_react(), 1);
|
|
36079
36072
|
var import_jsx_runtime52 = __toESM(require_jsx_runtime(), 1);
|
|
36080
|
-
var import_react40 = __toESM(require_react(), 1);
|
|
36081
36073
|
var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1);
|
|
36082
|
-
var import_react41 = __toESM(require_react(), 1);
|
|
36083
36074
|
var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1);
|
|
36075
|
+
var import_react37 = __toESM(require_react(), 1);
|
|
36084
36076
|
var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1);
|
|
36077
|
+
var import_react38 = __toESM(require_react(), 1);
|
|
36085
36078
|
var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1);
|
|
36086
|
-
var
|
|
36079
|
+
var import_react39 = __toESM(require_react(), 1);
|
|
36087
36080
|
var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1);
|
|
36088
|
-
var
|
|
36081
|
+
var import_react40 = __toESM(require_react(), 1);
|
|
36089
36082
|
var import_jsx_runtime58 = __toESM(require_jsx_runtime(), 1);
|
|
36090
|
-
var import_react44 = __toESM(require_react(), 1);
|
|
36091
36083
|
var import_jsx_runtime59 = __toESM(require_jsx_runtime(), 1);
|
|
36092
|
-
var
|
|
36084
|
+
var import_react41 = __toESM(require_react(), 1);
|
|
36093
36085
|
var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1);
|
|
36094
|
-
var import_react46 = __toESM(require_react(), 1);
|
|
36095
36086
|
var import_jsx_runtime61 = __toESM(require_jsx_runtime(), 1);
|
|
36096
|
-
var
|
|
36097
|
-
var
|
|
36098
|
-
var
|
|
36099
|
-
var import_jsx_runtime64 = __toESM(require_jsx_runtime(), 1);
|
|
36100
|
-
var import_react48 = __toESM(require_react(), 1);
|
|
36101
|
-
var import_react49 = __toESM(require_react(), 1);
|
|
36102
|
-
var import_jsx_runtime65 = __toESM(require_jsx_runtime(), 1);
|
|
36103
|
-
var import_react50 = __toESM(require_react(), 1);
|
|
36104
|
-
var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1);
|
|
36105
|
-
var import_jsx_runtime67 = __toESM(require_jsx_runtime(), 1);
|
|
36106
|
-
var import_react51 = __toESM(require_react(), 1);
|
|
36107
|
-
var import_jsx_runtime68 = __toESM(require_jsx_runtime(), 1);
|
|
36108
|
-
var import_react52 = __toESM(require_react(), 1);
|
|
36109
|
-
var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1);
|
|
36110
|
-
var StreamBusContext = (0, import_react11.createContext)(null);
|
|
36087
|
+
var import_react42 = __toESM(require_react(), 1);
|
|
36088
|
+
var GguiContext = (0, import_react6.createContext)(null);
|
|
36089
|
+
var KNOWN_PERMISSION_NAMES_SET2 = new Set(KNOWN_PERMISSION_NAMES);
|
|
36111
36090
|
var primitives_exports = {};
|
|
36112
36091
|
__export2(primitives_exports, {
|
|
36113
36092
|
Accordion: () => Accordion,
|
|
@@ -36220,7 +36199,7 @@ var maxWidthMap = {
|
|
|
36220
36199
|
function Container({ children, maxWidth: maxWidth2 = "lg", center = true, padding, style, className }) {
|
|
36221
36200
|
const resolvedMaxWidth = maxWidthMap[maxWidth2] || maxWidth2;
|
|
36222
36201
|
const resolvedPadding = resolveSpacing(padding);
|
|
36223
|
-
return (0,
|
|
36202
|
+
return (0, import_jsx_runtime3.jsx)("div", { className, style: {
|
|
36224
36203
|
maxWidth: resolvedMaxWidth,
|
|
36225
36204
|
margin: center ? "0 auto" : void 0,
|
|
36226
36205
|
padding: resolvedPadding,
|
|
@@ -36230,9 +36209,9 @@ function Container({ children, maxWidth: maxWidth2 = "lg", center = true, paddin
|
|
|
36230
36209
|
}
|
|
36231
36210
|
function renderWithTrait(trait, traitProps, root, children) {
|
|
36232
36211
|
if (trait === void 0) {
|
|
36233
|
-
return (0,
|
|
36212
|
+
return (0, import_react8.createElement)("div", { className: root.className, style: root.style }, children);
|
|
36234
36213
|
}
|
|
36235
|
-
return (0,
|
|
36214
|
+
return (0, import_react8.createElement)(trait, { ...traitProps, className: root.className, style: root.style }, children);
|
|
36236
36215
|
}
|
|
36237
36216
|
function resolveToneCss(tone) {
|
|
36238
36217
|
switch (tone) {
|
|
@@ -36250,7 +36229,7 @@ function resolveToneCss(tone) {
|
|
|
36250
36229
|
case "warning":
|
|
36251
36230
|
case "error":
|
|
36252
36231
|
case "info":
|
|
36253
|
-
return `var(--ggui-color-${tone}, ${SEMANTIC_TONE_FALLBACK[tone]})`;
|
|
36232
|
+
return `var(--ggui-color-${tone}-500, ${SEMANTIC_TONE_FALLBACK[tone]})`;
|
|
36254
36233
|
case "inverse":
|
|
36255
36234
|
return "var(--ggui-color-surface, #ffffff)";
|
|
36256
36235
|
case "inherit":
|
|
@@ -36357,7 +36336,7 @@ function Stack(props) {
|
|
|
36357
36336
|
return renderWithTrait(Trait, traitProps, { className, style: composedStyle }, children);
|
|
36358
36337
|
}
|
|
36359
36338
|
function Row(props) {
|
|
36360
|
-
return (0,
|
|
36339
|
+
return (0, import_react9.createElement)(Stack, { ...props, direction: "horizontal" });
|
|
36361
36340
|
}
|
|
36362
36341
|
var BREAKPOINTS = [
|
|
36363
36342
|
["sm", 640],
|
|
@@ -36401,7 +36380,7 @@ function Grid(props) {
|
|
|
36401
36380
|
gap: resolveSpacing(gap),
|
|
36402
36381
|
...style
|
|
36403
36382
|
};
|
|
36404
|
-
return renderWithTrait(Trait, traitProps, { className: className ? `${className} ${cls}` : cls, style: composedStyle2 }, (0,
|
|
36383
|
+
return renderWithTrait(Trait, traitProps, { className: className ? `${className} ${cls}` : cls, style: composedStyle2 }, (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [(0, import_jsx_runtime4.jsx)("style", { children: rules.join("") }), children] }));
|
|
36405
36384
|
}
|
|
36406
36385
|
const composedStyle = {
|
|
36407
36386
|
display: "grid",
|
|
@@ -36436,7 +36415,7 @@ function Divider({ orientation = "horizontal", margin = "var(--ggui-spacing-md,
|
|
|
36436
36415
|
const resolvedMargin = typeof margin === "number" ? `${margin}px` : margin;
|
|
36437
36416
|
const dividerColor = tone ? resolveToneCss(tone) : "var(--ggui-color-outlineVariant, #e4e4e7)";
|
|
36438
36417
|
if (orientation === "vertical") {
|
|
36439
|
-
return (0,
|
|
36418
|
+
return (0, import_jsx_runtime5.jsx)("div", { role: "separator", "aria-orientation": "vertical", className, style: {
|
|
36440
36419
|
width: "1px",
|
|
36441
36420
|
backgroundColor: dividerColor,
|
|
36442
36421
|
margin: `0 ${resolvedMargin}`,
|
|
@@ -36444,7 +36423,7 @@ function Divider({ orientation = "horizontal", margin = "var(--ggui-spacing-md,
|
|
|
36444
36423
|
...style
|
|
36445
36424
|
} });
|
|
36446
36425
|
}
|
|
36447
|
-
return (0,
|
|
36426
|
+
return (0, import_jsx_runtime5.jsx)("hr", { role: "separator", "aria-orientation": "horizontal", className, style: {
|
|
36448
36427
|
border: "none",
|
|
36449
36428
|
height: "1px",
|
|
36450
36429
|
backgroundColor: dividerColor,
|
|
@@ -36454,12 +36433,12 @@ function Divider({ orientation = "horizontal", margin = "var(--ggui-spacing-md,
|
|
|
36454
36433
|
}
|
|
36455
36434
|
function Spacer({ size = 16, style, className }) {
|
|
36456
36435
|
if (size === "flex") {
|
|
36457
|
-
return (0,
|
|
36436
|
+
return (0, import_jsx_runtime6.jsx)("div", { className, style: {
|
|
36458
36437
|
flex: 1,
|
|
36459
36438
|
...style
|
|
36460
36439
|
} });
|
|
36461
36440
|
}
|
|
36462
|
-
return (0,
|
|
36441
|
+
return (0, import_jsx_runtime6.jsx)("div", { className, style: {
|
|
36463
36442
|
width: `${size}px`,
|
|
36464
36443
|
height: `${size}px`,
|
|
36465
36444
|
flexShrink: 0,
|
|
@@ -36513,7 +36492,7 @@ function Text({ children, size = "base", weight = "normal", caps = false, tone,
|
|
|
36513
36492
|
...style
|
|
36514
36493
|
};
|
|
36515
36494
|
const elementProps = { id, htmlFor, className, style: textStyle };
|
|
36516
|
-
return (0,
|
|
36495
|
+
return (0, import_react10.createElement)(is, elementProps, children);
|
|
36517
36496
|
}
|
|
36518
36497
|
var fontSize = {
|
|
36519
36498
|
xs: "12px",
|
|
@@ -36596,7 +36575,7 @@ function Heading({ children, level = 2, tone, align, style, className }) {
|
|
|
36596
36575
|
const tag = `h${level}`;
|
|
36597
36576
|
const headingStyle = headingStyles[tag] || headingStyles.h2;
|
|
36598
36577
|
const resolvedColor = tone ? resolveToneCss(tone) : "var(--ggui-color-onSurface, #18181b)";
|
|
36599
|
-
return (0,
|
|
36578
|
+
return (0, import_react11.createElement)(tag, {
|
|
36600
36579
|
className,
|
|
36601
36580
|
style: {
|
|
36602
36581
|
...headingStyle,
|
|
@@ -36609,10 +36588,10 @@ function Heading({ children, level = 2, tone, align, style, className }) {
|
|
|
36609
36588
|
}
|
|
36610
36589
|
function Spinner({ size = 24, tone, style, className }) {
|
|
36611
36590
|
const spinnerColor = tone === "inherit" ? "currentColor" : tone ? resolveToneCss(tone) : "var(--ggui-color-primary-600, #0284c7)";
|
|
36612
|
-
return (0,
|
|
36591
|
+
return (0, import_jsx_runtime8.jsxs)("svg", { className, width: size, height: size, viewBox: "0 0 24 24", fill: "none", role: "status", "aria-label": "Loading", style: {
|
|
36613
36592
|
animation: "ggui-spin 1s linear infinite",
|
|
36614
36593
|
...style
|
|
36615
|
-
}, children: [(0,
|
|
36594
|
+
}, children: [(0, import_jsx_runtime8.jsx)("style", { children: `@keyframes ggui-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }` }), (0, import_jsx_runtime8.jsx)("circle", { cx: "12", cy: "12", r: "10", stroke: "var(--ggui-color-outlineVariant, #e4e4e7)", strokeWidth: "3", fill: "none" }), (0, import_jsx_runtime8.jsx)("path", { d: "M12 2a10 10 0 0 1 10 10", stroke: spinnerColor, strokeWidth: "3", strokeLinecap: "round", fill: "none" })] });
|
|
36616
36595
|
}
|
|
36617
36596
|
var duration3 = {
|
|
36618
36597
|
instant: "0ms",
|
|
@@ -36689,7 +36668,7 @@ var variantStyles = {
|
|
|
36689
36668
|
function Button({ children, variant = "primary", size = "md", fullWidth, loading, disabled, leftIcon, rightIcon, type = "button", onClick, onPress, style, className, ...rest }) {
|
|
36690
36669
|
const isDisabled = disabled || loading;
|
|
36691
36670
|
const handleClick = onClick ?? onPress;
|
|
36692
|
-
return (0,
|
|
36671
|
+
return (0, import_jsx_runtime7.jsx)("button", { type, onClick: isDisabled ? void 0 : handleClick, disabled: isDisabled, className, style: {
|
|
36693
36672
|
...sizeStyles[size],
|
|
36694
36673
|
...variantStyles[variant],
|
|
36695
36674
|
display: "inline-flex",
|
|
@@ -36704,7 +36683,7 @@ function Button({ children, variant = "primary", size = "md", fullWidth, loading
|
|
|
36704
36683
|
transition: `background-color ${duration3.normal} ${easing.easeInOut}, box-shadow ${duration3.normal} ${easing.easeInOut}, opacity ${duration3.normal} ${easing.easeInOut}`,
|
|
36705
36684
|
boxShadow: "var(--ggui-shape-shadow-sm, 0 1px 2px rgba(0,0,0,0.05))",
|
|
36706
36685
|
...style
|
|
36707
|
-
}, ...rest, children: loading ? (0,
|
|
36686
|
+
}, ...rest, children: loading ? (0, import_jsx_runtime7.jsx)(Spinner, { size: 16, tone: "inherit" }) : (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [leftIcon, children, rightIcon] }) });
|
|
36708
36687
|
}
|
|
36709
36688
|
var sizeStyles2 = {
|
|
36710
36689
|
sm: {
|
|
@@ -36721,21 +36700,21 @@ var sizeStyles2 = {
|
|
|
36721
36700
|
}
|
|
36722
36701
|
};
|
|
36723
36702
|
function Input({ label, placeholder, value, onChange, type = "text", error: error210, helperText, required: required2, disabled, size = "md", style, className, ...rest }) {
|
|
36724
|
-
const uniqueId = (0,
|
|
36703
|
+
const uniqueId = (0, import_react12.useId)();
|
|
36725
36704
|
const inputId = `${uniqueId}-input`;
|
|
36726
36705
|
const messageId = `${uniqueId}-message`;
|
|
36727
36706
|
const hasError = Boolean(error210);
|
|
36728
36707
|
const hasMessage = Boolean(error210 || helperText);
|
|
36729
|
-
return (0,
|
|
36708
|
+
return (0, import_jsx_runtime9.jsxs)("div", { className, style: {
|
|
36730
36709
|
display: "flex",
|
|
36731
36710
|
flexDirection: "column",
|
|
36732
36711
|
gap: "var(--ggui-spacing-1, 4px)",
|
|
36733
36712
|
...style
|
|
36734
|
-
}, children: [label && (0,
|
|
36713
|
+
}, children: [label && (0, import_jsx_runtime9.jsxs)("label", { htmlFor: inputId, style: {
|
|
36735
36714
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
36736
36715
|
fontWeight: "var(--ggui-font-weight-medium, 500)",
|
|
36737
36716
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36738
|
-
}, children: [label, required2 && (0,
|
|
36717
|
+
}, children: [label, required2 && (0, import_jsx_runtime9.jsx)("span", { "aria-hidden": "true", style: { color: "var(--ggui-color-error-500, #ef4444)", marginLeft: "2px" }, children: "*" })] }), (0, import_jsx_runtime9.jsx)("input", { id: inputId, type, placeholder, value, onChange: (e) => onChange?.(e.target.value), disabled, required: required2, "aria-invalid": hasError || void 0, "aria-describedby": hasMessage ? messageId : void 0, style: {
|
|
36739
36718
|
...sizeStyles2[size],
|
|
36740
36719
|
width: "100%",
|
|
36741
36720
|
borderRadius: "var(--ggui-shape-radius-md, 8px)",
|
|
@@ -36744,28 +36723,28 @@ function Input({ label, placeholder, value, onChange, type = "text", error: erro
|
|
|
36744
36723
|
color: "var(--ggui-color-onSurface, #18181b)",
|
|
36745
36724
|
transition: `border-color ${duration3.normal} ${easing.easeInOut}, box-shadow ${duration3.normal} ${easing.easeInOut}`,
|
|
36746
36725
|
boxSizing: "border-box"
|
|
36747
|
-
}, ...rest }), hasMessage && (0,
|
|
36726
|
+
}, ...rest }), hasMessage && (0, import_jsx_runtime9.jsx)("span", { id: messageId, role: hasError ? "alert" : void 0, style: {
|
|
36748
36727
|
fontSize: "var(--ggui-font-size-xs, 12px)",
|
|
36749
36728
|
color: hasError ? "var(--ggui-color-error-500, #ef4444)" : "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36750
36729
|
}, children: error210 || helperText })] });
|
|
36751
36730
|
}
|
|
36752
36731
|
function TextArea({ label, placeholder, value, onChange, rows = 4, error: error210, helperText, required: required2, disabled, maxLength, showCount, autoResize, style, className, ...rest }) {
|
|
36753
|
-
const uniqueId = (0,
|
|
36732
|
+
const uniqueId = (0, import_react13.useId)();
|
|
36754
36733
|
const textareaId = `${uniqueId}-textarea`;
|
|
36755
36734
|
const messageId = `${uniqueId}-message`;
|
|
36756
36735
|
const hasError = Boolean(error210);
|
|
36757
36736
|
const hasMessage = Boolean(error210 || helperText);
|
|
36758
36737
|
const charCount = value?.length || 0;
|
|
36759
|
-
return (0,
|
|
36738
|
+
return (0, import_jsx_runtime10.jsxs)("div", { className, style: {
|
|
36760
36739
|
display: "flex",
|
|
36761
36740
|
flexDirection: "column",
|
|
36762
36741
|
gap: "var(--ggui-spacing-1, 4px)",
|
|
36763
36742
|
...style
|
|
36764
|
-
}, children: [label && (0,
|
|
36743
|
+
}, children: [label && (0, import_jsx_runtime10.jsxs)("label", { htmlFor: textareaId, style: {
|
|
36765
36744
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
36766
36745
|
fontWeight: "var(--ggui-font-weight-medium, 500)",
|
|
36767
36746
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36768
|
-
}, children: [label, required2 && (0,
|
|
36747
|
+
}, children: [label, required2 && (0, import_jsx_runtime10.jsx)("span", { "aria-hidden": "true", style: { color: "var(--ggui-color-error-500, #ef4444)", marginLeft: "2px" }, children: "*" })] }), (0, import_jsx_runtime10.jsx)("textarea", { id: textareaId, placeholder, value, onChange: (e) => onChange?.(e.target.value), rows, disabled, required: required2, maxLength, "aria-invalid": hasError || void 0, "aria-describedby": hasMessage ? messageId : void 0, style: {
|
|
36769
36748
|
padding: "10px 12px",
|
|
36770
36749
|
width: "100%",
|
|
36771
36750
|
borderRadius: "var(--ggui-shape-radius-md, 8px)",
|
|
@@ -36777,10 +36756,10 @@ function TextArea({ label, placeholder, value, onChange, rows = 4, error: error2
|
|
|
36777
36756
|
transition: `border-color ${duration3.normal} ${easing.easeInOut}, box-shadow ${duration3.normal} ${easing.easeInOut}`,
|
|
36778
36757
|
boxSizing: "border-box",
|
|
36779
36758
|
resize: autoResize ? "none" : "vertical"
|
|
36780
|
-
}, ...rest }), (0,
|
|
36759
|
+
}, ...rest }), (0, import_jsx_runtime10.jsxs)("div", { style: { display: "flex", justifyContent: "space-between" }, children: [hasMessage && (0, import_jsx_runtime10.jsx)("span", { id: messageId, role: hasError ? "alert" : void 0, style: {
|
|
36781
36760
|
fontSize: "var(--ggui-font-size-xs, 12px)",
|
|
36782
36761
|
color: hasError ? "var(--ggui-color-error-500, #ef4444)" : "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36783
|
-
}, children: error210 || helperText }), showCount && maxLength && (0,
|
|
36762
|
+
}, children: error210 || helperText }), showCount && maxLength && (0, import_jsx_runtime10.jsxs)("span", { style: {
|
|
36784
36763
|
fontSize: "var(--ggui-font-size-xs, 12px)",
|
|
36785
36764
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)",
|
|
36786
36765
|
marginLeft: "auto"
|
|
@@ -36792,16 +36771,16 @@ var sizeStyles3 = {
|
|
|
36792
36771
|
lg: { padding: "12px 14px", fontSize: "var(--ggui-font-size-base, 16px)" }
|
|
36793
36772
|
};
|
|
36794
36773
|
function Select({ label, value, onChange, options, placeholder, error: error210, helperText, required: required2, disabled, size = "md", style, className, ...rest }) {
|
|
36795
|
-
const uniqueId = (0,
|
|
36774
|
+
const uniqueId = (0, import_react14.useId)();
|
|
36796
36775
|
const selectId = `${uniqueId}-select`;
|
|
36797
36776
|
const messageId = `${uniqueId}-message`;
|
|
36798
36777
|
const hasError = Boolean(error210);
|
|
36799
36778
|
const hasMessage = Boolean(error210 || helperText);
|
|
36800
|
-
return (0,
|
|
36779
|
+
return (0, import_jsx_runtime11.jsxs)("div", { className, style: { display: "flex", flexDirection: "column", gap: "var(--ggui-spacing-1, 4px)", ...style }, children: [label && (0, import_jsx_runtime11.jsxs)("label", { htmlFor: selectId, style: {
|
|
36801
36780
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
36802
36781
|
fontWeight: "var(--ggui-font-weight-medium, 500)",
|
|
36803
36782
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36804
|
-
}, children: [label, required2 && (0,
|
|
36783
|
+
}, children: [label, required2 && (0, import_jsx_runtime11.jsx)("span", { "aria-hidden": "true", style: { color: "var(--ggui-color-error-500, #ef4444)", marginLeft: "2px" }, children: "*" })] }), (0, import_jsx_runtime11.jsxs)("select", { id: selectId, value, onChange: (e) => onChange?.(e.target.value), disabled, required: required2, "aria-invalid": hasError || void 0, "aria-describedby": hasMessage ? messageId : void 0, style: {
|
|
36805
36784
|
...sizeStyles3[size],
|
|
36806
36785
|
width: "100%",
|
|
36807
36786
|
borderRadius: "var(--ggui-shape-radius-md, 8px)",
|
|
@@ -36816,26 +36795,26 @@ function Select({ label, value, onChange, options, placeholder, error: error210,
|
|
|
36816
36795
|
paddingRight: "36px",
|
|
36817
36796
|
boxSizing: "border-box",
|
|
36818
36797
|
transition: `border-color ${duration3.normal} ${easing.easeInOut}, box-shadow ${duration3.normal} ${easing.easeInOut}`
|
|
36819
|
-
}, ...rest, children: [placeholder && (0,
|
|
36798
|
+
}, ...rest, children: [placeholder && (0, import_jsx_runtime11.jsx)("option", { value: "", disabled: true, children: placeholder }), options.map((opt) => (0, import_jsx_runtime11.jsx)("option", { value: opt.value, disabled: opt.disabled, children: opt.label }, opt.value))] }), hasMessage && (0, import_jsx_runtime11.jsx)("span", { id: messageId, role: hasError ? "alert" : void 0, style: {
|
|
36820
36799
|
fontSize: "var(--ggui-font-size-xs, 12px)",
|
|
36821
36800
|
color: hasError ? "var(--ggui-color-error-500, #ef4444)" : "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36822
36801
|
}, children: error210 || helperText })] });
|
|
36823
36802
|
}
|
|
36824
36803
|
function Checkbox({ label, checked, onChange, disabled, description, indeterminate, style, className }) {
|
|
36825
|
-
return (0,
|
|
36804
|
+
return (0, import_jsx_runtime12.jsxs)("label", { className, style: {
|
|
36826
36805
|
display: "flex",
|
|
36827
36806
|
alignItems: "flex-start",
|
|
36828
36807
|
gap: "var(--ggui-spacing-2, 8px)",
|
|
36829
36808
|
cursor: disabled ? "not-allowed" : "pointer",
|
|
36830
36809
|
opacity: disabled ? 0.5 : 1,
|
|
36831
36810
|
...style
|
|
36832
|
-
}, children: [(0,
|
|
36811
|
+
}, children: [(0, import_jsx_runtime12.jsxs)("div", { style: {
|
|
36833
36812
|
position: "relative",
|
|
36834
36813
|
width: "18px",
|
|
36835
36814
|
height: "18px",
|
|
36836
36815
|
flexShrink: 0,
|
|
36837
36816
|
marginTop: "2px"
|
|
36838
|
-
}, children: [(0,
|
|
36817
|
+
}, children: [(0, import_jsx_runtime12.jsx)("input", { type: "checkbox", checked, onChange: (e) => onChange?.(e.target.checked), disabled, ref: (el) => {
|
|
36839
36818
|
if (el)
|
|
36840
36819
|
el.indeterminate = indeterminate || false;
|
|
36841
36820
|
}, style: {
|
|
@@ -36845,7 +36824,7 @@ function Checkbox({ label, checked, onChange, disabled, description, indetermina
|
|
|
36845
36824
|
margin: 0,
|
|
36846
36825
|
opacity: 0,
|
|
36847
36826
|
cursor: disabled ? "not-allowed" : "pointer"
|
|
36848
|
-
} }), (0,
|
|
36827
|
+
} }), (0, import_jsx_runtime12.jsx)("div", { style: {
|
|
36849
36828
|
width: "18px",
|
|
36850
36829
|
height: "18px",
|
|
36851
36830
|
borderRadius: "var(--ggui-shape-radius-sm, 4px)",
|
|
@@ -36855,11 +36834,11 @@ function Checkbox({ label, checked, onChange, disabled, description, indetermina
|
|
|
36855
36834
|
alignItems: "center",
|
|
36856
36835
|
justifyContent: "center",
|
|
36857
36836
|
transition: "all 0.2s"
|
|
36858
|
-
}, children: (checked || indeterminate) && (0,
|
|
36837
|
+
}, children: (checked || indeterminate) && (0, import_jsx_runtime12.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", style: { color: "#ffffff" }, children: indeterminate ? (0, import_jsx_runtime12.jsx)("path", { d: "M2.5 6H9.5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) : (0, import_jsx_runtime12.jsx)("path", { d: "M2.5 6L5 8.5L9.5 3.5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) })] }), (label || description) && (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: [label && (0, import_jsx_runtime12.jsx)("span", { style: {
|
|
36859
36838
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
36860
36839
|
fontWeight: "var(--ggui-font-weight-medium, 500)",
|
|
36861
36840
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36862
|
-
}, children: label }), description && (0,
|
|
36841
|
+
}, children: label }), description && (0, import_jsx_runtime12.jsx)("span", { style: {
|
|
36863
36842
|
fontSize: "var(--ggui-font-size-xs, 12px)",
|
|
36864
36843
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36865
36844
|
}, children: description })] })] });
|
|
@@ -36871,15 +36850,15 @@ var sizeConfig = {
|
|
|
36871
36850
|
};
|
|
36872
36851
|
function Toggle({ label, checked, onChange, disabled, size = "md", style, className }) {
|
|
36873
36852
|
const config2 = sizeConfig[size];
|
|
36874
|
-
const [focused, setFocused] = (0,
|
|
36875
|
-
return (0,
|
|
36853
|
+
const [focused, setFocused] = (0, import_react15.useState)(false);
|
|
36854
|
+
return (0, import_jsx_runtime13.jsxs)("label", { className, style: {
|
|
36876
36855
|
display: "flex",
|
|
36877
36856
|
alignItems: "center",
|
|
36878
36857
|
gap: "var(--ggui-spacing-2, 8px)",
|
|
36879
36858
|
cursor: disabled ? "not-allowed" : "pointer",
|
|
36880
36859
|
opacity: disabled ? 0.5 : 1,
|
|
36881
36860
|
...style
|
|
36882
|
-
}, children: [(0,
|
|
36861
|
+
}, children: [(0, import_jsx_runtime13.jsx)("div", { role: "switch", "aria-checked": checked, "aria-label": label, tabIndex: disabled ? -1 : 0, onClick: () => !disabled && onChange?.(!checked), onKeyDown: (e) => {
|
|
36883
36862
|
if (disabled)
|
|
36884
36863
|
return;
|
|
36885
36864
|
if (e.key === " " || e.key === "Enter") {
|
|
@@ -36896,7 +36875,7 @@ function Toggle({ label, checked, onChange, disabled, size = "md", style, classN
|
|
|
36896
36875
|
flexShrink: 0,
|
|
36897
36876
|
outline: "none",
|
|
36898
36877
|
boxShadow: focused ? "0 0 0 3px var(--ggui-color-primary-200, #bae6fd)" : void 0
|
|
36899
|
-
}, children: (0,
|
|
36878
|
+
}, children: (0, import_jsx_runtime13.jsx)("div", { style: {
|
|
36900
36879
|
width: config2.knob,
|
|
36901
36880
|
height: config2.knob,
|
|
36902
36881
|
borderRadius: "50%",
|
|
@@ -36906,23 +36885,23 @@ function Toggle({ label, checked, onChange, disabled, size = "md", style, classN
|
|
|
36906
36885
|
left: checked ? config2.width - config2.knob - (config2.height - config2.knob) / 2 : (config2.height - config2.knob) / 2,
|
|
36907
36886
|
transition: `left ${duration3.normal} ${easing.easeInOut}`,
|
|
36908
36887
|
boxShadow: "var(--ggui-shape-shadow-sm, 0 1px 2px rgba(0,0,0,0.05))"
|
|
36909
|
-
} }) }), label && (0,
|
|
36888
|
+
} }) }), label && (0, import_jsx_runtime13.jsx)("span", { style: {
|
|
36910
36889
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
36911
36890
|
fontWeight: "var(--ggui-font-weight-medium, 500)",
|
|
36912
36891
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36913
36892
|
}, children: label })] });
|
|
36914
36893
|
}
|
|
36915
36894
|
function RadioGroup({ label, value, onChange, options, direction = "vertical", disabled, error: error210, style, className }) {
|
|
36916
|
-
const uniqueId = (0,
|
|
36895
|
+
const uniqueId = (0, import_react16.useId)();
|
|
36917
36896
|
const labelId = `${uniqueId}-label`;
|
|
36918
36897
|
const errorId = `${uniqueId}-error`;
|
|
36919
36898
|
const groupName = `${uniqueId}-radio`;
|
|
36920
36899
|
const hasError = Boolean(error210);
|
|
36921
|
-
return (0,
|
|
36900
|
+
return (0, import_jsx_runtime14.jsxs)("div", { role: "radiogroup", "aria-labelledby": label ? labelId : void 0, "aria-describedby": hasError ? errorId : void 0, className, style: { display: "flex", flexDirection: "column", gap: "var(--ggui-spacing-2, 8px)", ...style }, children: [label && (0, import_jsx_runtime14.jsx)("span", { id: labelId, style: {
|
|
36922
36901
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
36923
36902
|
fontWeight: "var(--ggui-font-weight-medium, 500)",
|
|
36924
36903
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36925
|
-
}, children: label }), (0,
|
|
36904
|
+
}, children: label }), (0, import_jsx_runtime14.jsx)("div", { style: {
|
|
36926
36905
|
display: "flex",
|
|
36927
36906
|
flexDirection: direction === "vertical" ? "column" : "row",
|
|
36928
36907
|
gap: direction === "vertical" ? "var(--ggui-spacing-2, 8px)" : "var(--ggui-spacing-4, 16px)",
|
|
@@ -36930,26 +36909,26 @@ function RadioGroup({ label, value, onChange, options, direction = "vertical", d
|
|
|
36930
36909
|
}, children: options.map((option) => {
|
|
36931
36910
|
const isSelected = value === option.value;
|
|
36932
36911
|
const isDisabled = disabled || option.disabled;
|
|
36933
|
-
return (0,
|
|
36912
|
+
return (0, import_jsx_runtime14.jsxs)("label", { style: {
|
|
36934
36913
|
display: "flex",
|
|
36935
36914
|
alignItems: "flex-start",
|
|
36936
36915
|
gap: "var(--ggui-spacing-2, 8px)",
|
|
36937
36916
|
cursor: isDisabled ? "not-allowed" : "pointer",
|
|
36938
36917
|
opacity: isDisabled ? 0.5 : 1
|
|
36939
|
-
}, children: [(0,
|
|
36918
|
+
}, children: [(0, import_jsx_runtime14.jsxs)("div", { style: {
|
|
36940
36919
|
position: "relative",
|
|
36941
36920
|
width: "18px",
|
|
36942
36921
|
height: "18px",
|
|
36943
36922
|
flexShrink: 0,
|
|
36944
36923
|
marginTop: "2px"
|
|
36945
|
-
}, children: [(0,
|
|
36924
|
+
}, children: [(0, import_jsx_runtime14.jsx)("input", { type: "radio", name: groupName, value: option.value, checked: isSelected, onChange: () => onChange?.(option.value), disabled: isDisabled, style: {
|
|
36946
36925
|
position: "absolute",
|
|
36947
36926
|
width: "18px",
|
|
36948
36927
|
height: "18px",
|
|
36949
36928
|
margin: 0,
|
|
36950
36929
|
opacity: 0,
|
|
36951
36930
|
cursor: isDisabled ? "not-allowed" : "pointer"
|
|
36952
|
-
} }), (0,
|
|
36931
|
+
} }), (0, import_jsx_runtime14.jsx)("div", { style: {
|
|
36953
36932
|
width: "18px",
|
|
36954
36933
|
height: "18px",
|
|
36955
36934
|
borderRadius: "var(--ggui-shape-radius-full, 9999px)",
|
|
@@ -36959,51 +36938,51 @@ function RadioGroup({ label, value, onChange, options, direction = "vertical", d
|
|
|
36959
36938
|
alignItems: "center",
|
|
36960
36939
|
justifyContent: "center",
|
|
36961
36940
|
transition: "all 0.2s"
|
|
36962
|
-
}, children: isSelected && (0,
|
|
36941
|
+
}, children: isSelected && (0, import_jsx_runtime14.jsx)("div", { style: {
|
|
36963
36942
|
width: "8px",
|
|
36964
36943
|
height: "8px",
|
|
36965
36944
|
borderRadius: "var(--ggui-shape-radius-full, 9999px)",
|
|
36966
36945
|
backgroundColor: "var(--ggui-color-primary-600, #0284c7)"
|
|
36967
|
-
} }) })] }), (0,
|
|
36946
|
+
} }) })] }), (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: [(0, import_jsx_runtime14.jsx)("span", { style: {
|
|
36968
36947
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
36969
36948
|
fontWeight: "var(--ggui-font-weight-medium, 500)",
|
|
36970
36949
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36971
|
-
}, children: option.label }), option.description && (0,
|
|
36950
|
+
}, children: option.label }), option.description && (0, import_jsx_runtime14.jsx)("span", { style: {
|
|
36972
36951
|
fontSize: "var(--ggui-font-size-xs, 12px)",
|
|
36973
36952
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36974
36953
|
}, children: option.description })] })] }, option.value);
|
|
36975
|
-
}) }), error210 && (0,
|
|
36954
|
+
}) }), error210 && (0, import_jsx_runtime14.jsx)("span", { id: errorId, role: "alert", style: {
|
|
36976
36955
|
fontSize: "var(--ggui-font-size-xs, 12px)",
|
|
36977
36956
|
color: "var(--ggui-color-error-500, #ef4444)"
|
|
36978
36957
|
}, children: error210 })] });
|
|
36979
36958
|
}
|
|
36980
36959
|
function Slider({ label, value = 0, onChange, min = 0, max = 100, step = 1, disabled, showValue, style, className }) {
|
|
36981
|
-
const uniqueId = (0,
|
|
36960
|
+
const uniqueId = (0, import_react17.useId)();
|
|
36982
36961
|
const sliderId = `${uniqueId}-slider`;
|
|
36983
36962
|
const labelId = `${uniqueId}-label`;
|
|
36984
36963
|
const percentage = (value - min) / (max - min) * 100;
|
|
36985
|
-
return (0,
|
|
36964
|
+
return (0, import_jsx_runtime15.jsxs)("div", { className, style: { display: "flex", flexDirection: "column", gap: "var(--ggui-spacing-2, 8px)", ...style }, children: [(label || showValue) && (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [label && (0, import_jsx_runtime15.jsx)("span", { id: labelId, style: {
|
|
36986
36965
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
36987
36966
|
fontWeight: "var(--ggui-font-weight-medium, 500)",
|
|
36988
36967
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36989
|
-
}, children: label }), showValue && (0,
|
|
36968
|
+
}, children: label }), showValue && (0, import_jsx_runtime15.jsx)("span", { style: {
|
|
36990
36969
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
36991
36970
|
fontWeight: "var(--ggui-font-weight-medium, 500)",
|
|
36992
36971
|
color: "var(--ggui-color-primary-600, #0284c7)"
|
|
36993
|
-
}, children: value })] }), (0,
|
|
36972
|
+
}, children: value })] }), (0, import_jsx_runtime15.jsxs)("div", { style: { position: "relative", height: "20px", display: "flex", alignItems: "center" }, children: [(0, import_jsx_runtime15.jsx)("div", { style: {
|
|
36994
36973
|
position: "absolute",
|
|
36995
36974
|
width: "100%",
|
|
36996
36975
|
height: "6px",
|
|
36997
36976
|
borderRadius: "3px",
|
|
36998
36977
|
backgroundColor: "var(--ggui-color-outlineVariant, #e4e4e7)"
|
|
36999
|
-
} }), (0,
|
|
36978
|
+
} }), (0, import_jsx_runtime15.jsx)("div", { style: {
|
|
37000
36979
|
position: "absolute",
|
|
37001
36980
|
width: `${percentage}%`,
|
|
37002
36981
|
height: "6px",
|
|
37003
36982
|
borderRadius: "3px",
|
|
37004
36983
|
backgroundColor: disabled ? "var(--ggui-color-outline, #d4d4d8)" : "var(--ggui-color-primary-600, #0284c7)",
|
|
37005
36984
|
transition: "width 0.1s"
|
|
37006
|
-
} }), (0,
|
|
36985
|
+
} }), (0, import_jsx_runtime15.jsx)("input", { id: sliderId, type: "range", min, max, step, value, onChange: (e) => onChange?.(Number(e.target.value)), disabled, "aria-labelledby": label ? labelId : void 0, "aria-label": label ? void 0 : "Slider", "aria-valuenow": value, "aria-valuemin": min, "aria-valuemax": max, style: {
|
|
37007
36986
|
position: "absolute",
|
|
37008
36987
|
width: "100%",
|
|
37009
36988
|
height: "20px",
|
|
@@ -37011,7 +36990,7 @@ function Slider({ label, value = 0, onChange, min = 0, max = 100, step = 1, disa
|
|
|
37011
36990
|
opacity: 0,
|
|
37012
36991
|
cursor: disabled ? "not-allowed" : "pointer",
|
|
37013
36992
|
zIndex: 1
|
|
37014
|
-
} }), (0,
|
|
36993
|
+
} }), (0, import_jsx_runtime15.jsx)("div", { style: {
|
|
37015
36994
|
position: "absolute",
|
|
37016
36995
|
left: `calc(${percentage}% - 10px)`,
|
|
37017
36996
|
width: "20px",
|
|
@@ -37060,7 +37039,7 @@ var sizeStyles4 = {
|
|
|
37060
37039
|
lg: { padding: "4px 10px", fontSize: "var(--ggui-font-size-sm, 14px)" }
|
|
37061
37040
|
};
|
|
37062
37041
|
function Badge({ children, variant = "default", size = "md", pill = true, style, className }) {
|
|
37063
|
-
return (0,
|
|
37042
|
+
return (0, import_jsx_runtime16.jsx)("span", { className, style: {
|
|
37064
37043
|
...variantStyles2[variant],
|
|
37065
37044
|
...sizeStyles4[size],
|
|
37066
37045
|
display: "inline-flex",
|
|
@@ -37087,7 +37066,7 @@ function Skeleton({ variant = "rect", width, height, radius: radius2 = "sm", sty
|
|
|
37087
37066
|
animation: "ggui-skeleton-pulse 1.5s ease-in-out infinite",
|
|
37088
37067
|
...style
|
|
37089
37068
|
};
|
|
37090
|
-
return (0,
|
|
37069
|
+
return (0, import_jsx_runtime17.jsx)("div", { className, style: composedStyle, "aria-hidden": "true", children: (0, import_jsx_runtime17.jsx)("style", { children: `@keyframes ggui-skeleton-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }` }) });
|
|
37091
37070
|
}
|
|
37092
37071
|
var sizeMap2 = {
|
|
37093
37072
|
xs: 24,
|
|
@@ -37104,7 +37083,7 @@ var avatarColors = [
|
|
|
37104
37083
|
"var(--ggui-color-info-500, #06b6d4)"
|
|
37105
37084
|
];
|
|
37106
37085
|
function Avatar({ src, name, size = "md", shape = "circle", style, className }) {
|
|
37107
|
-
const [imageError, setImageError] = (0,
|
|
37086
|
+
const [imageError, setImageError] = (0, import_react18.useState)(false);
|
|
37108
37087
|
const resolvedSize = typeof size === "number" ? size : sizeMap2[size] || 40;
|
|
37109
37088
|
const initials = name ? name.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2) : "?";
|
|
37110
37089
|
const getColorFromName = (name2) => {
|
|
@@ -37114,7 +37093,7 @@ function Avatar({ src, name, size = "md", shape = "circle", style, className })
|
|
|
37114
37093
|
return avatarColors[hash2 % avatarColors.length];
|
|
37115
37094
|
};
|
|
37116
37095
|
const showInitials = !src || imageError;
|
|
37117
|
-
return (0,
|
|
37096
|
+
return (0, import_jsx_runtime18.jsx)("div", { role: "img", "aria-label": name || "Avatar", className, style: {
|
|
37118
37097
|
width: resolvedSize,
|
|
37119
37098
|
height: resolvedSize,
|
|
37120
37099
|
borderRadius: shape === "circle" ? "50%" : "var(--ggui-shape-radius-md, 8px)",
|
|
@@ -37128,7 +37107,7 @@ function Avatar({ src, name, size = "md", shape = "circle", style, className })
|
|
|
37128
37107
|
overflow: "hidden",
|
|
37129
37108
|
flexShrink: 0,
|
|
37130
37109
|
...style
|
|
37131
|
-
}, children: showInitials ? initials : (0,
|
|
37110
|
+
}, children: showInitials ? initials : (0, import_jsx_runtime18.jsx)("img", { src, alt: name || "Avatar", onError: () => setImageError(true), style: {
|
|
37132
37111
|
width: "100%",
|
|
37133
37112
|
height: "100%",
|
|
37134
37113
|
objectFit: "cover"
|
|
@@ -37161,14 +37140,14 @@ var variantStyles3 = {
|
|
|
37161
37140
|
}
|
|
37162
37141
|
};
|
|
37163
37142
|
var defaultIcons = {
|
|
37164
|
-
info: (0,
|
|
37165
|
-
success: (0,
|
|
37166
|
-
warning: (0,
|
|
37167
|
-
error: (0,
|
|
37143
|
+
info: (0, import_jsx_runtime19.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", children: (0, import_jsx_runtime19.jsx)("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" }) }),
|
|
37144
|
+
success: (0, import_jsx_runtime19.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", children: (0, import_jsx_runtime19.jsx)("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z", clipRule: "evenodd" }) }),
|
|
37145
|
+
warning: (0, import_jsx_runtime19.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", children: (0, import_jsx_runtime19.jsx)("path", { fillRule: "evenodd", d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }),
|
|
37146
|
+
error: (0, import_jsx_runtime19.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", children: (0, import_jsx_runtime19.jsx)("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z", clipRule: "evenodd" }) })
|
|
37168
37147
|
};
|
|
37169
37148
|
function Alert({ children, variant = "info", title, closable, onClose, icon, style, className }) {
|
|
37170
37149
|
const variantStyle = variantStyles3[variant];
|
|
37171
|
-
return (0,
|
|
37150
|
+
return (0, import_jsx_runtime19.jsxs)("div", { role: "alert", className, style: {
|
|
37172
37151
|
display: "flex",
|
|
37173
37152
|
gap: "12px",
|
|
37174
37153
|
padding: "12px 16px",
|
|
@@ -37177,10 +37156,10 @@ function Alert({ children, variant = "info", title, closable, onClose, icon, sty
|
|
|
37177
37156
|
border: `1px solid ${variantStyle.border}`,
|
|
37178
37157
|
color: variantStyle.text,
|
|
37179
37158
|
...style
|
|
37180
|
-
}, children: [(0,
|
|
37159
|
+
}, children: [(0, import_jsx_runtime19.jsx)("div", { style: { color: variantStyle.icon, flexShrink: 0 }, children: icon || defaultIcons[variant] }), (0, import_jsx_runtime19.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "var(--ggui-spacing-1, 4px)" }, children: [title && (0, import_jsx_runtime19.jsx)("div", { style: {
|
|
37181
37160
|
fontWeight: "var(--ggui-font-weight-semibold, 600)",
|
|
37182
37161
|
fontSize: "var(--ggui-font-size-sm, 14px)"
|
|
37183
|
-
}, children: title }), (0,
|
|
37162
|
+
}, children: title }), (0, import_jsx_runtime19.jsx)("div", { style: { fontSize: "var(--ggui-font-size-sm, 14px)" }, children })] }), closable && (0, import_jsx_runtime19.jsx)("button", { onClick: onClose, "aria-label": "Close", style: {
|
|
37184
37163
|
background: "none",
|
|
37185
37164
|
border: "none",
|
|
37186
37165
|
padding: "4px",
|
|
@@ -37195,7 +37174,7 @@ function Alert({ children, variant = "info", title, closable, onClose, icon, sty
|
|
|
37195
37174
|
alignItems: "center",
|
|
37196
37175
|
justifyContent: "center",
|
|
37197
37176
|
borderRadius: "var(--ggui-shape-radius-sm, 4px)"
|
|
37198
|
-
}, children: (0,
|
|
37177
|
+
}, children: (0, import_jsx_runtime19.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", children: (0, import_jsx_runtime19.jsx)("path", { fillRule: "evenodd", d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z", clipRule: "evenodd" }) }) })] });
|
|
37199
37178
|
}
|
|
37200
37179
|
var variantColors = {
|
|
37201
37180
|
default: "var(--ggui-color-primary-600, #0284c7)",
|
|
@@ -37213,17 +37192,17 @@ function Progress({ value, max = 100, variant = "default", size = "md", label, s
|
|
|
37213
37192
|
const height = sizeHeights[size];
|
|
37214
37193
|
const barColor = variantColors[variant];
|
|
37215
37194
|
const accessibleName = label ?? "Progress";
|
|
37216
|
-
return (0,
|
|
37195
|
+
return (0, import_jsx_runtime20.jsxs)("div", { className, style: { display: "flex", flexDirection: "column", gap: "var(--ggui-spacing-1, 4px)", ...style }, children: [showLabel && (0, import_jsx_runtime20.jsxs)("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [(0, import_jsx_runtime20.jsx)("span", { style: { fontSize: "var(--ggui-font-size-sm, 14px)", color: "var(--ggui-color-onSurfaceVariant, #52525b)" }, children: accessibleName }), (0, import_jsx_runtime20.jsxs)("span", { style: {
|
|
37217
37196
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
37218
37197
|
fontWeight: "var(--ggui-font-weight-medium, 500)",
|
|
37219
37198
|
color: "var(--ggui-color-onSurface, #18181b)"
|
|
37220
|
-
}, children: [Math.round(percentage), "%"] })] }), (0,
|
|
37199
|
+
}, children: [Math.round(percentage), "%"] })] }), (0, import_jsx_runtime20.jsxs)("div", { role: "progressbar", "aria-valuenow": indeterminate ? void 0 : value, "aria-valuemin": 0, "aria-valuemax": max, "aria-label": accessibleName, style: {
|
|
37221
37200
|
width: "100%",
|
|
37222
37201
|
height,
|
|
37223
37202
|
borderRadius: height / 2,
|
|
37224
37203
|
backgroundColor: "var(--ggui-color-outlineVariant, #e4e4e7)",
|
|
37225
37204
|
overflow: "hidden"
|
|
37226
|
-
}, children: [(0,
|
|
37205
|
+
}, children: [(0, import_jsx_runtime20.jsx)("div", { style: {
|
|
37227
37206
|
height: "100%",
|
|
37228
37207
|
borderRadius: height / 2,
|
|
37229
37208
|
backgroundColor: barColor,
|
|
@@ -37234,23 +37213,23 @@ function Progress({ value, max = 100, variant = "default", size = "md", label, s
|
|
|
37234
37213
|
} : {
|
|
37235
37214
|
width: `${percentage}%`
|
|
37236
37215
|
}
|
|
37237
|
-
} }), indeterminate && (0,
|
|
37216
|
+
} }), indeterminate && (0, import_jsx_runtime20.jsx)("style", { children: `@keyframes ggui-progress-indeterminate {
|
|
37238
37217
|
0% { transform: translateX(-100%); }
|
|
37239
37218
|
100% { transform: translateX(400%); }
|
|
37240
37219
|
}` })] })] });
|
|
37241
37220
|
}
|
|
37242
37221
|
function Image({ src, alt, width, height, objectFit = "cover", radius: radius2, fallback, style, className }) {
|
|
37243
|
-
const [error210, setError] = (0,
|
|
37222
|
+
const [error210, setError] = (0, import_react19.useState)(false);
|
|
37244
37223
|
const resolveSize2 = (value) => {
|
|
37245
37224
|
if (value === void 0)
|
|
37246
37225
|
return void 0;
|
|
37247
37226
|
return typeof value === "number" ? `${value}px` : value;
|
|
37248
37227
|
};
|
|
37249
37228
|
if (error210 && fallback) {
|
|
37250
|
-
return (0,
|
|
37229
|
+
return (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, { children: fallback });
|
|
37251
37230
|
}
|
|
37252
37231
|
if (error210) {
|
|
37253
|
-
return (0,
|
|
37232
|
+
return (0, import_jsx_runtime21.jsx)("div", { role: "img", "aria-label": `${alt} (failed to load)`, className, style: {
|
|
37254
37233
|
width: resolveSize2(width) || "100%",
|
|
37255
37234
|
height: resolveSize2(height) || "auto",
|
|
37256
37235
|
borderRadius: resolveRadius(radius2),
|
|
@@ -37260,9 +37239,9 @@ function Image({ src, alt, width, height, objectFit = "cover", radius: radius2,
|
|
|
37260
37239
|
justifyContent: "center",
|
|
37261
37240
|
color: "var(--ggui-color-outline, #d4d4d8)",
|
|
37262
37241
|
...style
|
|
37263
|
-
}, children: (0,
|
|
37242
|
+
}, children: (0, import_jsx_runtime21.jsx)("svg", { width: "48", height: "48", viewBox: "0 0 24 24", fill: "currentColor", children: (0, import_jsx_runtime21.jsx)("path", { d: "M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z" }) }) });
|
|
37264
37243
|
}
|
|
37265
|
-
return (0,
|
|
37244
|
+
return (0, import_jsx_runtime21.jsx)("img", { src, alt, onError: () => setError(true), className, style: {
|
|
37266
37245
|
width: resolveSize2(width) || "100%",
|
|
37267
37246
|
height: resolveSize2(height) || "auto",
|
|
37268
37247
|
objectFit,
|
|
@@ -41253,7 +41232,7 @@ function resolveLucideName(name) {
|
|
|
41253
41232
|
return LUCIDE_LOOKUP.get(normalized);
|
|
41254
41233
|
}
|
|
41255
41234
|
function renderLucideIcon(data, size, color) {
|
|
41256
|
-
return (0,
|
|
41235
|
+
return (0, import_jsx_runtime22.jsx)("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: data.map(([tag, attrs], i) => import_react20.default.createElement(tag, { key: i, ...attrs })) });
|
|
41257
41236
|
}
|
|
41258
41237
|
function Icon({ name, size = 24, tone, children, style, className, "aria-label": ariaLabel }) {
|
|
41259
41238
|
const iconColor = tone ? resolveToneCss(tone) : "currentColor";
|
|
@@ -41268,22 +41247,22 @@ function Icon({ name, size = 24, tone, children, style, className, "aria-label":
|
|
|
41268
41247
|
...style
|
|
41269
41248
|
};
|
|
41270
41249
|
if (children) {
|
|
41271
|
-
return (0,
|
|
41250
|
+
return (0, import_jsx_runtime22.jsx)("span", { className, style: wrapStyle, ...a11yProps, children });
|
|
41272
41251
|
}
|
|
41273
41252
|
if (name) {
|
|
41274
41253
|
const lucideKey = resolveLucideName(name);
|
|
41275
41254
|
if (lucideKey) {
|
|
41276
|
-
return (0,
|
|
41255
|
+
return (0, import_jsx_runtime22.jsx)("span", { className, style: wrapStyle, ...a11yProps, children: renderLucideIcon(LUCIDE_ICONS[lucideKey], size, iconColor) });
|
|
41277
41256
|
}
|
|
41278
41257
|
}
|
|
41279
41258
|
if (name && /[^\x00-\x7F]/.test(name)) {
|
|
41280
|
-
return (0,
|
|
41259
|
+
return (0, import_jsx_runtime22.jsx)("span", { className, ...a11yProps, style: {
|
|
41281
41260
|
...wrapStyle,
|
|
41282
41261
|
fontSize: size * 0.75,
|
|
41283
41262
|
lineHeight: 1
|
|
41284
41263
|
}, children: name });
|
|
41285
41264
|
}
|
|
41286
|
-
return (0,
|
|
41265
|
+
return (0, import_jsx_runtime22.jsx)("span", { className, ...a11yProps, style: {
|
|
41287
41266
|
...wrapStyle,
|
|
41288
41267
|
backgroundColor: "var(--ggui-color-outlineVariant, #e4e4e7)",
|
|
41289
41268
|
borderRadius: "var(--ggui-shape-radius-sm, 4px)",
|
|
@@ -41298,7 +41277,7 @@ function Link({ children, href, external, tone, underline = "hover", style, clas
|
|
|
41298
41277
|
hover: "none",
|
|
41299
41278
|
none: "none"
|
|
41300
41279
|
}[underline];
|
|
41301
|
-
return (0,
|
|
41280
|
+
return (0, import_jsx_runtime23.jsxs)("a", { href, target: external ? "_blank" : void 0, rel: external ? "noopener noreferrer" : void 0, className, style: {
|
|
41302
41281
|
color: linkColor,
|
|
41303
41282
|
textDecoration: underlineStyle,
|
|
41304
41283
|
cursor: "pointer",
|
|
@@ -41312,13 +41291,13 @@ function Link({ children, href, external, tone, underline = "hover", style, clas
|
|
|
41312
41291
|
if (underline === "hover") {
|
|
41313
41292
|
e.target.style.textDecoration = "none";
|
|
41314
41293
|
}
|
|
41315
|
-
}, ...rest, children: [children, external && (0,
|
|
41294
|
+
}, ...rest, children: [children, external && (0, import_jsx_runtime23.jsxs)("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", style: { marginLeft: "4px", verticalAlign: "middle" }, children: [(0, import_jsx_runtime23.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }), (0, import_jsx_runtime23.jsx)("polyline", { points: "15 3 21 3 21 9" }), (0, import_jsx_runtime23.jsx)("line", { x1: "10", y1: "14", x2: "21", y2: "3" })] })] });
|
|
41316
41295
|
}
|
|
41317
41296
|
function Tooltip({ children, content, position = "top", delay = 200, style, className }) {
|
|
41318
|
-
const [visible, setVisible] = (0,
|
|
41319
|
-
const [coords, setCoords] = (0,
|
|
41320
|
-
const triggerRef = (0,
|
|
41321
|
-
const timeoutRef = (0,
|
|
41297
|
+
const [visible, setVisible] = (0, import_react21.useState)(false);
|
|
41298
|
+
const [coords, setCoords] = (0, import_react21.useState)({ top: 0, left: 0 });
|
|
41299
|
+
const triggerRef = (0, import_react21.useRef)(null);
|
|
41300
|
+
const timeoutRef = (0, import_react21.useRef)(null);
|
|
41322
41301
|
const showTooltip = () => {
|
|
41323
41302
|
timeoutRef.current = setTimeout(() => {
|
|
41324
41303
|
setVisible(true);
|
|
@@ -41330,7 +41309,7 @@ function Tooltip({ children, content, position = "top", delay = 200, style, clas
|
|
|
41330
41309
|
}
|
|
41331
41310
|
setVisible(false);
|
|
41332
41311
|
};
|
|
41333
|
-
(0,
|
|
41312
|
+
(0, import_react21.useEffect)(() => {
|
|
41334
41313
|
if (visible && triggerRef.current) {
|
|
41335
41314
|
const rect = triggerRef.current.getBoundingClientRect();
|
|
41336
41315
|
const offset = 8;
|
|
@@ -41357,7 +41336,7 @@ function Tooltip({ children, content, position = "top", delay = 200, style, clas
|
|
|
41357
41336
|
setCoords({ top, left });
|
|
41358
41337
|
}
|
|
41359
41338
|
}, [visible, position]);
|
|
41360
|
-
(0,
|
|
41339
|
+
(0, import_react21.useEffect)(() => {
|
|
41361
41340
|
return () => {
|
|
41362
41341
|
if (timeoutRef.current) {
|
|
41363
41342
|
clearTimeout(timeoutRef.current);
|
|
@@ -41376,10 +41355,10 @@ function Tooltip({ children, content, position = "top", delay = 200, style, clas
|
|
|
41376
41355
|
return "translateY(-50%)";
|
|
41377
41356
|
}
|
|
41378
41357
|
};
|
|
41379
|
-
return (0,
|
|
41358
|
+
return (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [(0, import_jsx_runtime24.jsx)("div", { ref: triggerRef, onMouseEnter: showTooltip, onMouseLeave: hideTooltip, onFocus: showTooltip, onBlur: hideTooltip, className, style: {
|
|
41380
41359
|
display: "inline-block",
|
|
41381
41360
|
...style
|
|
41382
|
-
}, children }), visible && (0,
|
|
41361
|
+
}, children }), visible && (0, import_jsx_runtime24.jsx)("div", { role: "tooltip", style: {
|
|
41383
41362
|
position: "fixed",
|
|
41384
41363
|
top: coords.top,
|
|
41385
41364
|
left: coords.left,
|
|
@@ -41395,16 +41374,16 @@ function Tooltip({ children, content, position = "top", delay = 200, style, clas
|
|
|
41395
41374
|
whiteSpace: "nowrap"
|
|
41396
41375
|
}, children: content })] });
|
|
41397
41376
|
}
|
|
41398
|
-
var sortIndicator = (active, direction) => (0,
|
|
41377
|
+
var sortIndicator = (active, direction) => (0, import_jsx_runtime25.jsxs)("span", { "aria-hidden": "true", style: {
|
|
41399
41378
|
display: "inline-flex",
|
|
41400
41379
|
flexDirection: "column",
|
|
41401
41380
|
marginLeft: "4px",
|
|
41402
41381
|
fontSize: "10px",
|
|
41403
41382
|
lineHeight: 1,
|
|
41404
41383
|
opacity: active ? 1 : 0.3
|
|
41405
|
-
}, children: [(0,
|
|
41384
|
+
}, children: [(0, import_jsx_runtime25.jsx)("span", { style: { opacity: active && direction === "asc" ? 1 : 0.4 }, children: "\u25B2" }), (0, import_jsx_runtime25.jsx)("span", { style: { opacity: active && direction === "desc" ? 1 : 0.4 }, children: "\u25BC" })] });
|
|
41406
41385
|
function Table({ columns, data, sortKey, sortDirection = "asc", onSort, striped = false, hoverable = true, compact = false, bordered = false, caption, style, className }) {
|
|
41407
|
-
const [hoveredRow, setHoveredRow] = (0,
|
|
41386
|
+
const [hoveredRow, setHoveredRow] = (0, import_react22.useState)(null);
|
|
41408
41387
|
const cellPadding = compact ? "var(--ggui-spacing-1, 4px) var(--ggui-spacing-2, 8px)" : "var(--ggui-spacing-2, 8px) var(--ggui-spacing-4, 16px)";
|
|
41409
41388
|
const handleSort = (key) => {
|
|
41410
41389
|
if (!onSort)
|
|
@@ -41412,7 +41391,7 @@ function Table({ columns, data, sortKey, sortDirection = "asc", onSort, striped
|
|
|
41412
41391
|
const newDirection = sortKey === key && sortDirection === "asc" ? "desc" : "asc";
|
|
41413
41392
|
onSort(key, newDirection);
|
|
41414
41393
|
};
|
|
41415
|
-
const
|
|
41394
|
+
const headerStyle = {
|
|
41416
41395
|
padding: cellPadding,
|
|
41417
41396
|
textAlign: "left",
|
|
41418
41397
|
fontWeight: "var(--ggui-font-weight-semibold, 600)",
|
|
@@ -41424,36 +41403,36 @@ function Table({ columns, data, sortKey, sortDirection = "asc", onSort, striped
|
|
|
41424
41403
|
whiteSpace: "nowrap",
|
|
41425
41404
|
userSelect: "none"
|
|
41426
41405
|
};
|
|
41427
|
-
return (0,
|
|
41406
|
+
return (0, import_jsx_runtime25.jsx)("div", { className, style: {
|
|
41428
41407
|
overflowX: "auto",
|
|
41429
41408
|
borderRadius: "var(--ggui-shape-radius-lg, 8px)",
|
|
41430
41409
|
border: bordered ? "1px solid var(--ggui-color-outlineVariant, #e4e4e7)" : void 0,
|
|
41431
41410
|
...style
|
|
41432
|
-
}, children: (0,
|
|
41411
|
+
}, children: (0, import_jsx_runtime25.jsxs)("table", { role: "table", style: {
|
|
41433
41412
|
width: "100%",
|
|
41434
41413
|
borderCollapse: "collapse",
|
|
41435
41414
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
41436
41415
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
41437
|
-
}, children: [caption && (0,
|
|
41416
|
+
}, children: [caption && (0, import_jsx_runtime25.jsx)("caption", { style: {
|
|
41438
41417
|
padding: cellPadding,
|
|
41439
41418
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
41440
41419
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)",
|
|
41441
41420
|
textAlign: "left",
|
|
41442
41421
|
captionSide: "top"
|
|
41443
|
-
}, children: caption }), (0,
|
|
41422
|
+
}, children: caption }), (0, import_jsx_runtime25.jsx)("thead", { children: (0, import_jsx_runtime25.jsx)("tr", { children: columns.map((col) => (0, import_jsx_runtime25.jsx)("th", { scope: "col", "aria-sort": sortKey === col.key ? sortDirection === "asc" ? "ascending" : "descending" : void 0, onClick: col.sortable ? () => handleSort(col.key) : void 0, onKeyDown: col.sortable ? (e) => {
|
|
41444
41423
|
if (e.key === "Enter" || e.key === " ") {
|
|
41445
41424
|
e.preventDefault();
|
|
41446
41425
|
handleSort(col.key);
|
|
41447
41426
|
}
|
|
41448
41427
|
} : void 0, tabIndex: col.sortable ? 0 : void 0, style: {
|
|
41449
|
-
...
|
|
41428
|
+
...headerStyle,
|
|
41450
41429
|
textAlign: col.align || "left",
|
|
41451
41430
|
width: col.width,
|
|
41452
41431
|
cursor: col.sortable ? "pointer" : "default"
|
|
41453
|
-
}, children: (0,
|
|
41432
|
+
}, children: (0, import_jsx_runtime25.jsxs)("span", { style: { display: "inline-flex", alignItems: "center" }, children: [col.header, col.sortable && sortIndicator(sortKey === col.key, sortDirection)] }) }, col.key)) }) }), (0, import_jsx_runtime25.jsx)("tbody", { children: data.map((row, rowIndex) => (0, import_jsx_runtime25.jsx)("tr", { onMouseEnter: hoverable ? () => setHoveredRow(rowIndex) : void 0, onMouseLeave: hoverable ? () => setHoveredRow(null) : void 0, style: {
|
|
41454
41433
|
backgroundColor: hoverable && hoveredRow === rowIndex ? "var(--ggui-color-surface, #fafafa)" : striped && rowIndex % 2 === 1 ? "var(--ggui-color-surface, #fafafa)" : "transparent",
|
|
41455
41434
|
transition: "background-color 0.15s ease"
|
|
41456
|
-
}, children: columns.map((col) => (0,
|
|
41435
|
+
}, children: columns.map((col) => (0, import_jsx_runtime25.jsx)("td", { style: {
|
|
41457
41436
|
padding: cellPadding,
|
|
41458
41437
|
textAlign: col.align || "left",
|
|
41459
41438
|
borderBottom: "1px solid var(--ggui-color-surfaceVariant, #f4f4f5)",
|
|
@@ -41475,10 +41454,10 @@ var sizeStyles5 = {
|
|
|
41475
41454
|
}
|
|
41476
41455
|
};
|
|
41477
41456
|
function Tabs({ items, activeKey, onChange, variant = "line", size = "md", fullWidth = false, style, className }) {
|
|
41478
|
-
const uniqueId = (0,
|
|
41479
|
-
const [internalKey, setInternalKey] = (0,
|
|
41457
|
+
const uniqueId = (0, import_react23.useId)();
|
|
41458
|
+
const [internalKey, setInternalKey] = (0, import_react23.useState)(items[0]?.key);
|
|
41480
41459
|
const currentKey = activeKey ?? internalKey;
|
|
41481
|
-
const handleChange = (0,
|
|
41460
|
+
const handleChange = (0, import_react23.useCallback)((key) => {
|
|
41482
41461
|
if (onChange) {
|
|
41483
41462
|
onChange(key);
|
|
41484
41463
|
} else {
|
|
@@ -41486,8 +41465,8 @@ function Tabs({ items, activeKey, onChange, variant = "line", size = "md", fullW
|
|
|
41486
41465
|
}
|
|
41487
41466
|
}, [onChange]);
|
|
41488
41467
|
const activeItem = items.find((item) => item.key === currentKey);
|
|
41489
|
-
const tabListRef = (0,
|
|
41490
|
-
const handleTabKeyDown = (0,
|
|
41468
|
+
const tabListRef = (0, import_react23.useRef)(null);
|
|
41469
|
+
const handleTabKeyDown = (0, import_react23.useCallback)((e) => {
|
|
41491
41470
|
const enabledItems = items.filter((item) => !item.disabled);
|
|
41492
41471
|
const currentIndex = enabledItems.findIndex((item) => item.key === currentKey);
|
|
41493
41472
|
let nextIndex;
|
|
@@ -41561,11 +41540,11 @@ function Tabs({ items, activeKey, onChange, variant = "line", size = "md", fullW
|
|
|
41561
41540
|
borderRadius: variant === "pills" ? "var(--ggui-shape-radius-lg, 8px)" : void 0,
|
|
41562
41541
|
padding: variant === "pills" ? "var(--ggui-spacing-1, 4px)" : void 0
|
|
41563
41542
|
};
|
|
41564
|
-
return (0,
|
|
41543
|
+
return (0, import_jsx_runtime26.jsxs)("div", { className, style, children: [(0, import_jsx_runtime26.jsx)("div", { ref: tabListRef, role: "tablist", "aria-orientation": "horizontal", style: tabListStyle, children: items.map((item) => {
|
|
41565
41544
|
const isActive = item.key === currentKey;
|
|
41566
41545
|
const isDisabled = !!item.disabled;
|
|
41567
|
-
return (0,
|
|
41568
|
-
}) }), activeItem && (0,
|
|
41546
|
+
return (0, import_jsx_runtime26.jsxs)("button", { role: "tab", id: `${uniqueId}-tab-${item.key}`, "aria-selected": isActive, "aria-controls": `${uniqueId}-panel-${item.key}`, "aria-disabled": isDisabled, tabIndex: isActive ? 0 : -1, onClick: isDisabled ? void 0 : () => handleChange(item.key), onKeyDown: isDisabled ? void 0 : handleTabKeyDown, style: getTabStyle(isActive, isDisabled), children: [item.icon, item.label] }, item.key);
|
|
41547
|
+
}) }), activeItem && (0, import_jsx_runtime26.jsx)("div", { role: "tabpanel", id: `${uniqueId}-panel-${activeItem.key}`, "aria-labelledby": `${uniqueId}-tab-${activeItem.key}`, tabIndex: 0, style: {
|
|
41569
41548
|
padding: "var(--ggui-spacing-4, 16px) 0"
|
|
41570
41549
|
}, children: activeItem.content })] });
|
|
41571
41550
|
}
|
|
@@ -41745,20 +41724,20 @@ var variantStyles4 = {
|
|
|
41745
41724
|
}
|
|
41746
41725
|
};
|
|
41747
41726
|
var defaultIcons2 = {
|
|
41748
|
-
info: (0,
|
|
41749
|
-
success: (0,
|
|
41750
|
-
warning: (0,
|
|
41751
|
-
error: (0,
|
|
41727
|
+
info: (0, import_jsx_runtime27.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", children: (0, import_jsx_runtime27.jsx)("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" }) }),
|
|
41728
|
+
success: (0, import_jsx_runtime27.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", children: (0, import_jsx_runtime27.jsx)("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z", clipRule: "evenodd" }) }),
|
|
41729
|
+
warning: (0, import_jsx_runtime27.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", children: (0, import_jsx_runtime27.jsx)("path", { fillRule: "evenodd", d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }),
|
|
41730
|
+
error: (0, import_jsx_runtime27.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", children: (0, import_jsx_runtime27.jsx)("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z", clipRule: "evenodd" }) })
|
|
41752
41731
|
};
|
|
41753
41732
|
function Toast({ message, variant = "info", title, duration: duration22 = 5e3, onClose, visible = true, style, className }) {
|
|
41754
|
-
(0,
|
|
41733
|
+
(0, import_react24.useEffect)(() => {
|
|
41755
41734
|
if (!visible || duration22 === 0 || !onClose)
|
|
41756
41735
|
return;
|
|
41757
41736
|
const timer = setTimeout(onClose, duration22);
|
|
41758
41737
|
return () => clearTimeout(timer);
|
|
41759
41738
|
}, [visible, duration22, onClose]);
|
|
41760
41739
|
if (!visible) {
|
|
41761
|
-
return (0,
|
|
41740
|
+
return (0, import_jsx_runtime27.jsx)("div", { role: "alert", "aria-live": "assertive", className, style: {
|
|
41762
41741
|
position: "absolute",
|
|
41763
41742
|
width: "1px",
|
|
41764
41743
|
height: "1px",
|
|
@@ -41783,10 +41762,10 @@ function Toast({ message, variant = "info", title, duration: duration22 = 5e3, o
|
|
|
41783
41762
|
animation: animation.slideInUp,
|
|
41784
41763
|
...style
|
|
41785
41764
|
};
|
|
41786
|
-
return (0,
|
|
41765
|
+
return (0, import_jsx_runtime27.jsxs)("div", { role: "alert", "aria-live": "assertive", className, style: toastStyle, children: [(0, import_jsx_runtime27.jsx)("div", { style: { color: vs.icon, flexShrink: 0, marginTop: "2px" }, children: defaultIcons2[variant] }), (0, import_jsx_runtime27.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "2px" }, children: [title && (0, import_jsx_runtime27.jsx)("div", { style: {
|
|
41787
41766
|
fontWeight: "var(--ggui-font-weight-semibold, 600)",
|
|
41788
41767
|
fontSize: "var(--ggui-font-size-sm, 14px)"
|
|
41789
|
-
}, children: title }), (0,
|
|
41768
|
+
}, children: title }), (0, import_jsx_runtime27.jsx)("div", { style: { fontSize: "var(--ggui-font-size-sm, 14px)" }, children: message })] }), onClose && (0, import_jsx_runtime27.jsx)("button", { onClick: onClose, "aria-label": "Dismiss notification", style: {
|
|
41790
41769
|
background: "none",
|
|
41791
41770
|
border: "none",
|
|
41792
41771
|
padding: "4px",
|
|
@@ -41801,16 +41780,16 @@ function Toast({ message, variant = "info", title, duration: duration22 = 5e3, o
|
|
|
41801
41780
|
alignItems: "center",
|
|
41802
41781
|
justifyContent: "center",
|
|
41803
41782
|
borderRadius: "var(--ggui-shape-radius-sm, 4px)"
|
|
41804
|
-
}, children: (0,
|
|
41783
|
+
}, children: (0, import_jsx_runtime27.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "currentColor", children: (0, import_jsx_runtime27.jsx)("path", { fillRule: "evenodd", d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z", clipRule: "evenodd" }) }) })] });
|
|
41805
41784
|
}
|
|
41806
|
-
var chevron = (expanded) => (0,
|
|
41785
|
+
var chevron = (expanded) => (0, import_jsx_runtime28.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", style: {
|
|
41807
41786
|
transition: `transform ${duration3.normal} ${easing.easeInOut}`,
|
|
41808
41787
|
transform: expanded ? "rotate(180deg)" : "rotate(0deg)",
|
|
41809
41788
|
flexShrink: 0
|
|
41810
|
-
}, children: (0,
|
|
41789
|
+
}, children: (0, import_jsx_runtime28.jsx)("path", { fillRule: "evenodd", d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z", clipRule: "evenodd" }) });
|
|
41811
41790
|
function Accordion({ items, expandedKeys, onChange, multiple = false, variant = "default", style, className }) {
|
|
41812
|
-
const uniqueId = (0,
|
|
41813
|
-
const [internalExpanded, setInternalExpanded] = (0,
|
|
41791
|
+
const uniqueId = (0, import_react25.useId)();
|
|
41792
|
+
const [internalExpanded, setInternalExpanded] = (0, import_react25.useState)([]);
|
|
41814
41793
|
const currentExpanded = expandedKeys ?? internalExpanded;
|
|
41815
41794
|
const handleToggle = (key) => {
|
|
41816
41795
|
let newExpanded;
|
|
@@ -41858,12 +41837,12 @@ function Accordion({ items, expandedKeys, onChange, multiple = false, variant =
|
|
|
41858
41837
|
borderTop: isFirst ? "1px solid var(--ggui-color-outlineVariant, #e4e4e7)" : void 0
|
|
41859
41838
|
};
|
|
41860
41839
|
};
|
|
41861
|
-
return (0,
|
|
41840
|
+
return (0, import_jsx_runtime28.jsx)("div", { className, style: containerStyle, children: items.map((item, index) => {
|
|
41862
41841
|
const isExpanded = currentExpanded.includes(item.key);
|
|
41863
41842
|
const isDisabled = !!item.disabled;
|
|
41864
41843
|
const isFirst = index === 0;
|
|
41865
41844
|
const isLast = index === items.length - 1;
|
|
41866
|
-
return (0,
|
|
41845
|
+
return (0, import_jsx_runtime28.jsxs)("div", { style: getItemStyle(isFirst, isLast), children: [(0, import_jsx_runtime28.jsx)("h3", { style: { margin: 0 }, children: (0, import_jsx_runtime28.jsxs)("button", { id: `${uniqueId}-header-${item.key}`, "aria-expanded": isExpanded, "aria-controls": `${uniqueId}-panel-${item.key}`, "aria-disabled": isDisabled, onClick: isDisabled ? void 0 : () => handleToggle(item.key), style: {
|
|
41867
41846
|
display: "flex",
|
|
41868
41847
|
alignItems: "center",
|
|
41869
41848
|
justifyContent: "space-between",
|
|
@@ -41878,9 +41857,9 @@ function Accordion({ items, expandedKeys, onChange, multiple = false, variant =
|
|
|
41878
41857
|
color: "var(--ggui-color-onSurface, #18181b)",
|
|
41879
41858
|
textAlign: "left",
|
|
41880
41859
|
transition: `background-color ${duration3.fast} ${easing.easeInOut}`
|
|
41881
|
-
}, children: [(0,
|
|
41860
|
+
}, children: [(0, import_jsx_runtime28.jsx)("span", { children: item.title }), chevron(isExpanded)] }) }), (0, import_jsx_runtime28.jsx)("div", { id: `${uniqueId}-panel-${item.key}`, role: "region", "aria-labelledby": `${uniqueId}-header-${item.key}`, hidden: !isExpanded, style: {
|
|
41882
41861
|
overflow: "hidden"
|
|
41883
|
-
}, children: isExpanded && (0,
|
|
41862
|
+
}, children: isExpanded && (0, import_jsx_runtime28.jsx)("div", { style: {
|
|
41884
41863
|
padding: "0 var(--ggui-spacing-4, 16px) var(--ggui-spacing-4, 16px)",
|
|
41885
41864
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
41886
41865
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)",
|
|
@@ -41890,7 +41869,7 @@ function Accordion({ items, expandedKeys, onChange, multiple = false, variant =
|
|
|
41890
41869
|
}
|
|
41891
41870
|
var STYLE_ID = "ggui-motion-keyframes";
|
|
41892
41871
|
function MotionKeyframes() {
|
|
41893
|
-
(0,
|
|
41872
|
+
(0, import_react26.useEffect)(() => {
|
|
41894
41873
|
if (document.getElementById(STYLE_ID))
|
|
41895
41874
|
return;
|
|
41896
41875
|
const styleEl = document.createElement("style");
|
|
@@ -41907,12 +41886,12 @@ function MotionKeyframes() {
|
|
|
41907
41886
|
return null;
|
|
41908
41887
|
}
|
|
41909
41888
|
function useMotion() {
|
|
41910
|
-
const [motionEnabled, setMotionEnabled] = (0,
|
|
41889
|
+
const [motionEnabled, setMotionEnabled] = (0, import_react26.useState)(() => {
|
|
41911
41890
|
if (typeof window === "undefined")
|
|
41912
41891
|
return true;
|
|
41913
41892
|
return !window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
41914
41893
|
});
|
|
41915
|
-
(0,
|
|
41894
|
+
(0, import_react26.useEffect)(() => {
|
|
41916
41895
|
const mq = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
41917
41896
|
const handler = (e) => setMotionEnabled(!e.matches);
|
|
41918
41897
|
mq.addEventListener("change", handler);
|
|
@@ -41921,9 +41900,9 @@ function useMotion() {
|
|
|
41921
41900
|
return { motionEnabled };
|
|
41922
41901
|
}
|
|
41923
41902
|
function useAnimationKey(dep) {
|
|
41924
|
-
const [key, setKey] = (0,
|
|
41925
|
-
const isFirst = (0,
|
|
41926
|
-
(0,
|
|
41903
|
+
const [key, setKey] = (0, import_react26.useState)(0);
|
|
41904
|
+
const isFirst = (0, import_react26.useRef)(true);
|
|
41905
|
+
(0, import_react26.useEffect)(() => {
|
|
41927
41906
|
if (isFirst.current) {
|
|
41928
41907
|
isFirst.current = false;
|
|
41929
41908
|
return;
|
|
@@ -42061,7 +42040,7 @@ var colors = {
|
|
|
42061
42040
|
transparent: "transparent"
|
|
42062
42041
|
};
|
|
42063
42042
|
function SearchField({ value: controlledValue, onChange, onSearch, placeholder = "Search...", showButton = false, buttonText = "Search", loading, disabled, size = "md", style, className }) {
|
|
42064
|
-
const [internalValue, setInternalValue] = (0,
|
|
42043
|
+
const [internalValue, setInternalValue] = (0, import_react27.useState)("");
|
|
42065
42044
|
const value = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
42066
42045
|
const handleChange = (newValue) => {
|
|
42067
42046
|
if (controlledValue === void 0) {
|
|
@@ -42082,12 +42061,12 @@ function SearchField({ value: controlledValue, onChange, onSearch, placeholder =
|
|
|
42082
42061
|
md: "md",
|
|
42083
42062
|
lg: "md"
|
|
42084
42063
|
};
|
|
42085
|
-
return (0,
|
|
42064
|
+
return (0, import_jsx_runtime29.jsxs)("div", { className, style: {
|
|
42086
42065
|
display: "flex",
|
|
42087
42066
|
gap: "8px",
|
|
42088
42067
|
alignItems: "flex-end",
|
|
42089
42068
|
...style
|
|
42090
|
-
}, children: [(0,
|
|
42069
|
+
}, children: [(0, import_jsx_runtime29.jsxs)("div", { style: { position: "relative", flex: 1 }, children: [(0, import_jsx_runtime29.jsx)("div", { style: {
|
|
42091
42070
|
position: "absolute",
|
|
42092
42071
|
left: "12px",
|
|
42093
42072
|
top: "50%",
|
|
@@ -42096,7 +42075,7 @@ function SearchField({ value: controlledValue, onChange, onSearch, placeholder =
|
|
|
42096
42075
|
pointerEvents: "none",
|
|
42097
42076
|
display: "flex",
|
|
42098
42077
|
alignItems: "center"
|
|
42099
|
-
}, children: loading ? (0,
|
|
42078
|
+
}, children: loading ? (0, import_jsx_runtime29.jsx)(Spinner, { size: 16 }) : (0, import_jsx_runtime29.jsx)(Icon, { name: "search", size: 16 }) }), (0, import_jsx_runtime29.jsx)("input", { type: "search", value, onChange: (e) => handleChange(e.target.value), onKeyDown: handleKeyDown, placeholder, disabled: disabled || loading, style: {
|
|
42100
42079
|
width: "100%",
|
|
42101
42080
|
padding: size === "sm" ? "6px 10px 6px 36px" : size === "lg" ? "12px 14px 12px 40px" : "10px 12px 10px 38px",
|
|
42102
42081
|
paddingLeft: "36px",
|
|
@@ -42107,24 +42086,24 @@ function SearchField({ value: controlledValue, onChange, onSearch, placeholder =
|
|
|
42107
42086
|
color: colors.gray[900],
|
|
42108
42087
|
outline: "none",
|
|
42109
42088
|
boxSizing: "border-box"
|
|
42110
|
-
} })] }), showButton && (0,
|
|
42089
|
+
} })] }), showButton && (0, import_jsx_runtime29.jsx)(Button, { onClick: handleSubmit, disabled: disabled || loading, size: buttonSizes[size], loading, children: buttonText })] });
|
|
42111
42090
|
}
|
|
42112
42091
|
function FormField({ label, children, error: error210, helperText, required: required2, description, style, className }) {
|
|
42113
42092
|
const hasError = Boolean(error210);
|
|
42114
|
-
return (0,
|
|
42093
|
+
return (0, import_jsx_runtime30.jsxs)("div", { className, style: {
|
|
42115
42094
|
display: "flex",
|
|
42116
42095
|
flexDirection: "column",
|
|
42117
42096
|
gap: "4px",
|
|
42118
42097
|
...style
|
|
42119
|
-
}, children: [(0,
|
|
42098
|
+
}, children: [(0, import_jsx_runtime30.jsxs)("label", { style: {
|
|
42120
42099
|
fontSize: fontSize.sm,
|
|
42121
42100
|
fontWeight: fontWeight.medium,
|
|
42122
42101
|
color: colors.gray[700]
|
|
42123
|
-
}, children: [label, required2 && (0,
|
|
42102
|
+
}, children: [label, required2 && (0, import_jsx_runtime30.jsx)("span", { style: { color: colors.error[500], marginLeft: "2px" }, children: "*" })] }), description && (0, import_jsx_runtime30.jsx)("span", { style: {
|
|
42124
42103
|
fontSize: fontSize.xs,
|
|
42125
42104
|
color: colors.gray[500],
|
|
42126
42105
|
marginBottom: "4px"
|
|
42127
|
-
}, children: description }), children, (error210 || helperText) && (0,
|
|
42106
|
+
}, children: description }), children, (error210 || helperText) && (0, import_jsx_runtime30.jsx)("span", { style: {
|
|
42128
42107
|
fontSize: fontSize.xs,
|
|
42129
42108
|
color: hasError ? colors.error[500] : colors.gray[500]
|
|
42130
42109
|
}, children: error210 || helperText })] });
|
|
@@ -42133,7 +42112,7 @@ function MenuItem({ label, icon, rightElement, onClick, disabled, active, danger
|
|
|
42133
42112
|
const baseColor = danger ? colors.error[600] : colors.gray[700];
|
|
42134
42113
|
const hoverBg = danger ? colors.error[50] : colors.gray[100];
|
|
42135
42114
|
const activeBg = danger ? colors.error[100] : colors.primary[50];
|
|
42136
|
-
return (0,
|
|
42115
|
+
return (0, import_jsx_runtime31.jsxs)("button", { onClick: disabled ? void 0 : onClick, disabled, className, style: {
|
|
42137
42116
|
display: "flex",
|
|
42138
42117
|
alignItems: "center",
|
|
42139
42118
|
gap: "8px",
|
|
@@ -42157,7 +42136,7 @@ function MenuItem({ label, icon, rightElement, onClick, disabled, active, danger
|
|
|
42157
42136
|
if (!disabled && !active) {
|
|
42158
42137
|
e.target.style.backgroundColor = "transparent";
|
|
42159
42138
|
}
|
|
42160
|
-
}, children: [icon && (0,
|
|
42139
|
+
}, children: [icon && (0, import_jsx_runtime31.jsx)("span", { style: { display: "flex", flexShrink: 0 }, children: icon }), (0, import_jsx_runtime31.jsx)("span", { style: { flex: 1 }, children: label }), rightElement && (0, import_jsx_runtime31.jsx)("span", { style: { display: "flex", flexShrink: 0, color: colors.gray[400] }, children: rightElement })] });
|
|
42161
42140
|
}
|
|
42162
42141
|
var variantStyles5 = {
|
|
42163
42142
|
default: {
|
|
@@ -42198,7 +42177,7 @@ var sizeStyles6 = {
|
|
|
42198
42177
|
};
|
|
42199
42178
|
function Tag({ children, variant = "default", size = "md", closable, onClose, icon, style, className }) {
|
|
42200
42179
|
const sizeStyle = sizeStyles6[size];
|
|
42201
|
-
return (0,
|
|
42180
|
+
return (0, import_jsx_runtime32.jsxs)("span", { className, style: {
|
|
42202
42181
|
display: "inline-flex",
|
|
42203
42182
|
alignItems: "center",
|
|
42204
42183
|
gap: sizeStyle.gap,
|
|
@@ -42208,7 +42187,7 @@ function Tag({ children, variant = "default", size = "md", closable, onClose, ic
|
|
|
42208
42187
|
borderRadius: "6px",
|
|
42209
42188
|
...variantStyles5[variant],
|
|
42210
42189
|
...style
|
|
42211
|
-
}, children: [icon && (0,
|
|
42190
|
+
}, children: [icon && (0, import_jsx_runtime32.jsx)("span", { style: { display: "flex" }, children: icon }), children, closable && (0, import_jsx_runtime32.jsx)("button", { onClick: onClose, style: {
|
|
42212
42191
|
display: "flex",
|
|
42213
42192
|
alignItems: "center",
|
|
42214
42193
|
justifyContent: "center",
|
|
@@ -42219,12 +42198,12 @@ function Tag({ children, variant = "default", size = "md", closable, onClose, ic
|
|
|
42219
42198
|
cursor: "pointer",
|
|
42220
42199
|
opacity: 0.7,
|
|
42221
42200
|
marginLeft: "2px"
|
|
42222
|
-
}, "aria-label": "Remove", children: (0,
|
|
42201
|
+
}, "aria-label": "Remove", children: (0, import_jsx_runtime32.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "currentColor", children: (0, import_jsx_runtime32.jsx)("path", { d: "M9.5 3.205L8.795 2.5 6 5.295 3.205 2.5l-.705.705L5.295 6 2.5 8.795l.705.705L6 6.705 8.795 9.5l.705-.705L6.705 6 9.5 3.205z" }) }) })] });
|
|
42223
42202
|
}
|
|
42224
42203
|
function Dropdown({ trigger, options, value, onChange, placement = "bottom-start", disabled, style, className }) {
|
|
42225
|
-
const [isOpen, setIsOpen] = (0,
|
|
42226
|
-
const containerRef = (0,
|
|
42227
|
-
(0,
|
|
42204
|
+
const [isOpen, setIsOpen] = (0, import_react28.useState)(false);
|
|
42205
|
+
const containerRef = (0, import_react28.useRef)(null);
|
|
42206
|
+
(0, import_react28.useEffect)(() => {
|
|
42228
42207
|
const handleClickOutside = (event) => {
|
|
42229
42208
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
42230
42209
|
setIsOpen(false);
|
|
@@ -42235,7 +42214,7 @@ function Dropdown({ trigger, options, value, onChange, placement = "bottom-start
|
|
|
42235
42214
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
42236
42215
|
}
|
|
42237
42216
|
}, [isOpen]);
|
|
42238
|
-
(0,
|
|
42217
|
+
(0, import_react28.useEffect)(() => {
|
|
42239
42218
|
const handleEscape = (event) => {
|
|
42240
42219
|
if (event.key === "Escape") {
|
|
42241
42220
|
setIsOpen(false);
|
|
@@ -42264,11 +42243,11 @@ function Dropdown({ trigger, options, value, onChange, placement = "bottom-start
|
|
|
42264
42243
|
return { top: "100%", left: 0, marginTop: "4px" };
|
|
42265
42244
|
}
|
|
42266
42245
|
};
|
|
42267
|
-
return (0,
|
|
42246
|
+
return (0, import_jsx_runtime33.jsxs)("div", { ref: containerRef, className, style: {
|
|
42268
42247
|
position: "relative",
|
|
42269
42248
|
display: "inline-block",
|
|
42270
42249
|
...style
|
|
42271
|
-
}, children: [(0,
|
|
42250
|
+
}, children: [(0, import_jsx_runtime33.jsx)("div", { onClick: () => !disabled && setIsOpen(!isOpen), style: { cursor: disabled ? "not-allowed" : "pointer" }, children: trigger }), isOpen && (0, import_jsx_runtime33.jsx)("div", { style: {
|
|
42272
42251
|
position: "absolute",
|
|
42273
42252
|
...getMenuPosition(),
|
|
42274
42253
|
minWidth: "160px",
|
|
@@ -42278,19 +42257,19 @@ function Dropdown({ trigger, options, value, onChange, placement = "bottom-start
|
|
|
42278
42257
|
boxShadow: shadow.lg,
|
|
42279
42258
|
zIndex: zIndex.dropdown,
|
|
42280
42259
|
padding: "4px"
|
|
42281
|
-
}, children: options.map((option) => (0,
|
|
42260
|
+
}, children: options.map((option) => (0, import_jsx_runtime33.jsx)(MenuItem, { label: option.label, icon: option.icon, onClick: () => handleSelect(option.value), disabled: option.disabled, active: value === option.value, danger: option.danger }, option.value)) })] });
|
|
42282
42261
|
}
|
|
42283
42262
|
function Autocomplete({ value = "", onChange, onSelect, options, placeholder, label, loading, disabled, error: error210, noResultsText = "No results found", style, className }) {
|
|
42284
|
-
const [isOpen, setIsOpen] = (0,
|
|
42285
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
42286
|
-
const containerRef = (0,
|
|
42287
|
-
const filteredOptions = (0,
|
|
42263
|
+
const [isOpen, setIsOpen] = (0, import_react29.useState)(false);
|
|
42264
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react29.useState)(-1);
|
|
42265
|
+
const containerRef = (0, import_react29.useRef)(null);
|
|
42266
|
+
const filteredOptions = (0, import_react29.useMemo)(() => {
|
|
42288
42267
|
if (!value)
|
|
42289
42268
|
return options;
|
|
42290
42269
|
const lowerValue = value.toLowerCase();
|
|
42291
42270
|
return options.filter((opt) => opt.label.toLowerCase().includes(lowerValue) || opt.value.toLowerCase().includes(lowerValue));
|
|
42292
42271
|
}, [options, value]);
|
|
42293
|
-
(0,
|
|
42272
|
+
(0, import_react29.useEffect)(() => {
|
|
42294
42273
|
const handleClickOutside = (event) => {
|
|
42295
42274
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
42296
42275
|
setIsOpen(false);
|
|
@@ -42338,10 +42317,10 @@ function Autocomplete({ value = "", onChange, onSelect, options, placeholder, la
|
|
|
42338
42317
|
break;
|
|
42339
42318
|
}
|
|
42340
42319
|
};
|
|
42341
|
-
return (0,
|
|
42320
|
+
return (0, import_jsx_runtime34.jsxs)("div", { ref: containerRef, className, style: {
|
|
42342
42321
|
position: "relative",
|
|
42343
42322
|
...style
|
|
42344
|
-
}, children: [(0,
|
|
42323
|
+
}, children: [(0, import_jsx_runtime34.jsx)("div", { onKeyDown: handleKeyDown, children: (0, import_jsx_runtime34.jsx)(Input, { label, value, onChange: handleInputChange, onFocus: () => setIsOpen(true), placeholder, disabled, error: error210 }) }), isOpen && (0, import_jsx_runtime34.jsx)("div", { style: {
|
|
42345
42324
|
position: "absolute",
|
|
42346
42325
|
top: "100%",
|
|
42347
42326
|
left: 0,
|
|
@@ -42354,12 +42333,12 @@ function Autocomplete({ value = "", onChange, onSelect, options, placeholder, la
|
|
|
42354
42333
|
zIndex: zIndex.dropdown,
|
|
42355
42334
|
maxHeight: "240px",
|
|
42356
42335
|
overflow: "auto"
|
|
42357
|
-
}, children: loading ? (0,
|
|
42336
|
+
}, children: loading ? (0, import_jsx_runtime34.jsx)("div", { style: { padding: "12px", display: "flex", justifyContent: "center" }, children: (0, import_jsx_runtime34.jsx)(Spinner, { size: 20 }) }) : filteredOptions.length === 0 ? (0, import_jsx_runtime34.jsx)("div", { style: {
|
|
42358
42337
|
padding: "12px",
|
|
42359
42338
|
textAlign: "center",
|
|
42360
42339
|
color: colors.gray[500],
|
|
42361
42340
|
fontSize: fontSize.sm
|
|
42362
|
-
}, children: noResultsText }) : filteredOptions.map((option, index) => (0,
|
|
42341
|
+
}, children: noResultsText }) : filteredOptions.map((option, index) => (0, import_jsx_runtime34.jsxs)("div", { onClick: () => !option.disabled && handleSelect(option), style: {
|
|
42363
42342
|
padding: "8px 12px",
|
|
42364
42343
|
cursor: option.disabled ? "not-allowed" : "pointer",
|
|
42365
42344
|
backgroundColor: highlightedIndex === index ? colors.gray[100] : "transparent",
|
|
@@ -42368,10 +42347,10 @@ function Autocomplete({ value = "", onChange, onSelect, options, placeholder, la
|
|
|
42368
42347
|
display: "flex",
|
|
42369
42348
|
alignItems: "center",
|
|
42370
42349
|
gap: "8px"
|
|
42371
|
-
}, onMouseEnter: () => setHighlightedIndex(index), children: [option.icon && (0,
|
|
42350
|
+
}, onMouseEnter: () => setHighlightedIndex(index), children: [option.icon && (0, import_jsx_runtime34.jsx)("span", { style: { flexShrink: 0 }, children: option.icon }), (0, import_jsx_runtime34.jsxs)("div", { style: { flex: 1 }, children: [(0, import_jsx_runtime34.jsx)("div", { children: option.label }), option.description && (0, import_jsx_runtime34.jsx)("div", { style: { fontSize: fontSize.xs, color: colors.gray[500] }, children: option.description })] })] }, option.value)) })] });
|
|
42372
42351
|
}
|
|
42373
42352
|
function Breadcrumb({ items, separator = "/", onItemClick, style, className }) {
|
|
42374
|
-
return (0,
|
|
42353
|
+
return (0, import_jsx_runtime35.jsx)("nav", { "aria-label": "Breadcrumb", className, style: {
|
|
42375
42354
|
display: "flex",
|
|
42376
42355
|
alignItems: "center",
|
|
42377
42356
|
gap: "8px",
|
|
@@ -42379,19 +42358,19 @@ function Breadcrumb({ items, separator = "/", onItemClick, style, className }) {
|
|
|
42379
42358
|
...style
|
|
42380
42359
|
}, children: items.map((item, index) => {
|
|
42381
42360
|
const isLast = index === items.length - 1;
|
|
42382
|
-
return (0,
|
|
42361
|
+
return (0, import_jsx_runtime35.jsxs)(import_react30.Fragment, { children: [index > 0 && (0, import_jsx_runtime35.jsx)("span", { style: { color: colors.gray[400] }, children: separator }), item.icon && (0, import_jsx_runtime35.jsx)("span", { style: {
|
|
42383
42362
|
display: "flex",
|
|
42384
42363
|
alignItems: "center",
|
|
42385
42364
|
color: isLast ? colors.gray[900] : colors.gray[500]
|
|
42386
|
-
}, children: item.icon }), isLast ? (0,
|
|
42365
|
+
}, children: item.icon }), isLast ? (0, import_jsx_runtime35.jsx)("span", { style: {
|
|
42387
42366
|
color: colors.gray[900],
|
|
42388
42367
|
fontWeight: 500
|
|
42389
|
-
}, "aria-current": "page", children: item.label }) : item.href ? (0,
|
|
42368
|
+
}, "aria-current": "page", children: item.label }) : item.href ? (0, import_jsx_runtime35.jsx)(Link, { href: item.href, tone: "muted", underline: "hover", onClick: (e) => {
|
|
42390
42369
|
if (onItemClick) {
|
|
42391
42370
|
e.preventDefault();
|
|
42392
42371
|
onItemClick(item, index);
|
|
42393
42372
|
}
|
|
42394
|
-
}, children: item.label }) : (0,
|
|
42373
|
+
}, children: item.label }) : (0, import_jsx_runtime35.jsx)("button", { onClick: () => onItemClick?.(item, index), style: {
|
|
42395
42374
|
background: "none",
|
|
42396
42375
|
border: "none",
|
|
42397
42376
|
padding: 0,
|
|
@@ -42434,7 +42413,7 @@ function Pagination({ currentPage, totalPages, onPageChange, showFirstLast = tru
|
|
|
42434
42413
|
};
|
|
42435
42414
|
const buttonSize = size === "sm" ? "xs" : size === "lg" ? "md" : "sm";
|
|
42436
42415
|
const iconSize = size === "sm" ? 14 : size === "lg" ? 20 : 16;
|
|
42437
|
-
const PageButton = ({ page, active }) => (0,
|
|
42416
|
+
const PageButton = ({ page, active }) => (0, import_jsx_runtime36.jsx)("button", { onClick: () => !disabled && onPageChange?.(page), disabled, style: {
|
|
42438
42417
|
minWidth: size === "sm" ? "28px" : size === "lg" ? "40px" : "32px",
|
|
42439
42418
|
height: size === "sm" ? "28px" : size === "lg" ? "40px" : "32px",
|
|
42440
42419
|
padding: "0 8px",
|
|
@@ -42448,15 +42427,15 @@ function Pagination({ currentPage, totalPages, onPageChange, showFirstLast = tru
|
|
|
42448
42427
|
opacity: disabled ? 0.5 : 1,
|
|
42449
42428
|
transition: "all 0.15s"
|
|
42450
42429
|
}, children: page });
|
|
42451
|
-
return (0,
|
|
42430
|
+
return (0, import_jsx_runtime36.jsxs)("nav", { "aria-label": "Pagination", className, style: {
|
|
42452
42431
|
display: "flex",
|
|
42453
42432
|
alignItems: "center",
|
|
42454
42433
|
gap: "4px",
|
|
42455
42434
|
...style
|
|
42456
|
-
}, children: [showFirstLast && (0,
|
|
42435
|
+
}, children: [showFirstLast && (0, import_jsx_runtime36.jsxs)(Button, { variant: "ghost", size: buttonSize, onClick: () => onPageChange?.(1), disabled: disabled || currentPage === 1, "aria-label": "First page", children: [(0, import_jsx_runtime36.jsx)(Icon, { name: "chevron-left", size: iconSize }), (0, import_jsx_runtime36.jsx)(Icon, { name: "chevron-left", size: iconSize, style: { marginLeft: "-8px" } })] }), (0, import_jsx_runtime36.jsx)(Button, { variant: "ghost", size: buttonSize, onClick: () => onPageChange?.(currentPage - 1), disabled: disabled || currentPage === 1, "aria-label": "Previous page", children: (0, import_jsx_runtime36.jsx)(Icon, { name: "chevron-left", size: iconSize }) }), getVisiblePages().map((page, index) => page === "ellipsis" ? (0, import_jsx_runtime36.jsx)("span", { style: {
|
|
42457
42436
|
padding: "0 4px",
|
|
42458
42437
|
color: colors.gray[400]
|
|
42459
|
-
}, children: "..." }, `ellipsis-${index}`) : (0,
|
|
42438
|
+
}, children: "..." }, `ellipsis-${index}`) : (0, import_jsx_runtime36.jsx)(PageButton, { page, active: page === currentPage }, page)), (0, import_jsx_runtime36.jsx)(Button, { variant: "ghost", size: buttonSize, onClick: () => onPageChange?.(currentPage + 1), disabled: disabled || currentPage === totalPages, "aria-label": "Next page", children: (0, import_jsx_runtime36.jsx)(Icon, { name: "chevron-right", size: iconSize }) }), showFirstLast && (0, import_jsx_runtime36.jsxs)(Button, { variant: "ghost", size: buttonSize, onClick: () => onPageChange?.(totalPages), disabled: disabled || currentPage === totalPages, "aria-label": "Last page", children: [(0, import_jsx_runtime36.jsx)(Icon, { name: "chevron-right", size: iconSize }), (0, import_jsx_runtime36.jsx)(Icon, { name: "chevron-right", size: iconSize, style: { marginLeft: "-8px" } })] })] });
|
|
42460
42439
|
}
|
|
42461
42440
|
function EmptyState({ icon, title, description, action, style, className }) {
|
|
42462
42441
|
const composedStyle = {
|
|
@@ -42464,11 +42443,11 @@ function EmptyState({ icon, title, description, action, style, className }) {
|
|
|
42464
42443
|
padding: "var(--ggui-spacing-xl, 32px)",
|
|
42465
42444
|
...style
|
|
42466
42445
|
};
|
|
42467
|
-
return (0,
|
|
42446
|
+
return (0, import_jsx_runtime37.jsxs)(Stack, { align: "center", gap: "sm", className, style: composedStyle, children: [icon !== void 0 && (typeof icon === "string" ? (0, import_jsx_runtime37.jsx)(Icon, { name: icon, size: 40, tone: "subtle" }) : icon), (0, import_jsx_runtime37.jsx)(Heading, { level: 3, children: title }), description !== void 0 && (0, import_jsx_runtime37.jsx)(Text, { tone: "muted", children: description }), action !== void 0 && (0, import_jsx_runtime37.jsx)("div", { style: { marginTop: "var(--ggui-spacing-sm, 8px)" }, children: action })] });
|
|
42468
42447
|
}
|
|
42469
42448
|
function Stat({ label, value, delta, trend = "neutral", icon, style, className }) {
|
|
42470
42449
|
const deltaTone = trend === "up" ? "success" : trend === "down" ? "error" : "muted";
|
|
42471
|
-
return (0,
|
|
42450
|
+
return (0, import_jsx_runtime38.jsxs)(Stack, { gap: "xs", className, style, children: [(0, import_jsx_runtime38.jsxs)(Row, { gap: "xs", align: "center", children: [icon !== void 0 && (typeof icon === "string" ? (0, import_jsx_runtime38.jsx)(Icon, { name: icon, size: 16, tone: "muted" }) : icon), (0, import_jsx_runtime38.jsx)(Text, { size: "xs", weight: "semibold", caps: true, tone: "muted", children: label })] }), (0, import_jsx_runtime38.jsxs)(Row, { gap: "sm", align: "end", children: [(0, import_jsx_runtime38.jsx)(Text, { size: "3xl", weight: "bold", children: value }), delta !== void 0 && (0, import_jsx_runtime38.jsx)(Text, { size: "sm", weight: "semibold", tone: deltaTone, children: delta })] })] });
|
|
42472
42451
|
}
|
|
42473
42452
|
var MARKER_SIZE = 28;
|
|
42474
42453
|
function stepState(index, current) {
|
|
@@ -42496,7 +42475,7 @@ var markerStyles = {
|
|
|
42496
42475
|
}
|
|
42497
42476
|
};
|
|
42498
42477
|
function Marker({ index, state }) {
|
|
42499
|
-
return (0,
|
|
42478
|
+
return (0, import_jsx_runtime39.jsx)("span", { "aria-hidden": "true", style: {
|
|
42500
42479
|
width: MARKER_SIZE,
|
|
42501
42480
|
height: MARKER_SIZE,
|
|
42502
42481
|
borderRadius: "50%",
|
|
@@ -42507,19 +42486,19 @@ function Marker({ index, state }) {
|
|
|
42507
42486
|
boxSizing: "border-box",
|
|
42508
42487
|
transition: "background-color 0.2s, border-color 0.2s, color 0.2s",
|
|
42509
42488
|
...markerStyles[state]
|
|
42510
|
-
}, children: state === "completed" ? (0,
|
|
42489
|
+
}, children: state === "completed" ? (0, import_jsx_runtime39.jsx)(Icon, { name: "check", size: 16, tone: "inherit" }) : (0, import_jsx_runtime39.jsx)(Text, { is: "span", size: "sm", weight: "semibold", tone: "inherit", children: index + 1 }) });
|
|
42511
42490
|
}
|
|
42512
42491
|
function StepLabel({ label, state }) {
|
|
42513
|
-
return (0,
|
|
42492
|
+
return (0, import_jsx_runtime39.jsx)(Text, { is: "span", size: "sm", weight: state === "current" ? "semibold" : "normal", tone: state === "upcoming" ? "muted" : "default", children: label });
|
|
42514
42493
|
}
|
|
42515
42494
|
function Stepper({ steps, current, orientation = "horizontal", onStepClick, style, className }) {
|
|
42516
42495
|
const renderStep = (label, index) => {
|
|
42517
42496
|
const state = stepState(index, current);
|
|
42518
|
-
const content = (0,
|
|
42497
|
+
const content = (0, import_jsx_runtime39.jsxs)(Row, { gap: "sm", align: "center", children: [(0, import_jsx_runtime39.jsx)(Marker, { index, state }), (0, import_jsx_runtime39.jsx)(StepLabel, { label, state })] });
|
|
42519
42498
|
if (onStepClick === void 0) {
|
|
42520
|
-
return (0,
|
|
42499
|
+
return (0, import_jsx_runtime39.jsx)("span", { "aria-current": state === "current" ? "step" : void 0, children: content });
|
|
42521
42500
|
}
|
|
42522
|
-
return (0,
|
|
42501
|
+
return (0, import_jsx_runtime39.jsx)("button", { type: "button", onClick: () => onStepClick(index), "aria-current": state === "current" ? "step" : void 0, style: {
|
|
42523
42502
|
background: "none",
|
|
42524
42503
|
border: "none",
|
|
42525
42504
|
padding: 0,
|
|
@@ -42530,14 +42509,14 @@ function Stepper({ steps, current, orientation = "horizontal", onStepClick, styl
|
|
|
42530
42509
|
}, children: content });
|
|
42531
42510
|
};
|
|
42532
42511
|
if (orientation === "vertical") {
|
|
42533
|
-
return (0,
|
|
42512
|
+
return (0, import_jsx_runtime39.jsx)("nav", { "aria-label": "Progress", className, style, children: (0, import_jsx_runtime39.jsx)(Stack, { gap: "none", align: "start", children: steps.map((label, index) => (0, import_jsx_runtime39.jsxs)(Stack, { gap: "none", align: "start", children: [index > 0 && (0, import_jsx_runtime39.jsx)("span", { style: {
|
|
42534
42513
|
width: MARKER_SIZE,
|
|
42535
42514
|
height: 16,
|
|
42536
42515
|
display: "inline-flex",
|
|
42537
42516
|
justifyContent: "center"
|
|
42538
|
-
}, children: (0,
|
|
42517
|
+
}, children: (0, import_jsx_runtime39.jsx)(Divider, { orientation: "vertical", margin: 0 }) }), renderStep(label, index)] }, index)) }) });
|
|
42539
42518
|
}
|
|
42540
|
-
return (0,
|
|
42519
|
+
return (0, import_jsx_runtime39.jsx)("nav", { "aria-label": "Progress", className, style, children: (0, import_jsx_runtime39.jsx)(Row, { gap: "sm", align: "center", children: steps.map((label, index) => (0, import_jsx_runtime39.jsxs)(Row, { gap: "sm", align: "center", style: index > 0 ? { flex: 1 } : void 0, children: [index > 0 && (0, import_jsx_runtime39.jsx)(Divider, { style: { flex: 1, minWidth: 16, margin: 0 } }), renderStep(label, index)] }, index)) }) });
|
|
42541
42520
|
}
|
|
42542
42521
|
var SAFE_HREF = /^(?:https?:\/\/|mailto:)[^\s\x00-\x1f]+$/i;
|
|
42543
42522
|
function safeHref(raw) {
|
|
@@ -42846,16 +42825,16 @@ function renderRichTextInlines(inlines) {
|
|
|
42846
42825
|
case "text":
|
|
42847
42826
|
return node.text;
|
|
42848
42827
|
case "break":
|
|
42849
|
-
return (0,
|
|
42828
|
+
return (0, import_jsx_runtime40.jsx)("br", {}, i);
|
|
42850
42829
|
case "strong":
|
|
42851
|
-
return (0,
|
|
42830
|
+
return (0, import_jsx_runtime40.jsx)("strong", { children: renderRichTextInlines(node.children) }, i);
|
|
42852
42831
|
case "em":
|
|
42853
|
-
return (0,
|
|
42832
|
+
return (0, import_jsx_runtime40.jsx)("em", { children: renderRichTextInlines(node.children) }, i);
|
|
42854
42833
|
case "code":
|
|
42855
|
-
return (0,
|
|
42834
|
+
return (0, import_jsx_runtime40.jsx)("code", { style: CODE_INLINE, children: node.code }, i);
|
|
42856
42835
|
case "link": {
|
|
42857
42836
|
const children = renderRichTextInlines(node.children);
|
|
42858
|
-
return node.href !== void 0 ? (0,
|
|
42837
|
+
return node.href !== void 0 ? (0, import_jsx_runtime40.jsx)(Link, { href: node.href, external: true, children }, i) : (0, import_jsx_runtime40.jsx)("span", { style: LINK_INERT, children }, i);
|
|
42859
42838
|
}
|
|
42860
42839
|
}
|
|
42861
42840
|
});
|
|
@@ -42863,20 +42842,20 @@ function renderRichTextInlines(inlines) {
|
|
|
42863
42842
|
function renderBlock(block, key) {
|
|
42864
42843
|
switch (block.type) {
|
|
42865
42844
|
case "paragraph":
|
|
42866
|
-
return (0,
|
|
42845
|
+
return (0, import_jsx_runtime40.jsx)(Text, { children: renderRichTextInlines(block.children) }, key);
|
|
42867
42846
|
case "heading":
|
|
42868
|
-
return (0,
|
|
42847
|
+
return (0, import_jsx_runtime40.jsx)(Heading, { level: block.level, children: renderRichTextInlines(block.children) }, key);
|
|
42869
42848
|
case "code-fence":
|
|
42870
|
-
return (0,
|
|
42849
|
+
return (0, import_jsx_runtime40.jsx)("pre", { style: CODE_FENCE, "data-lang": block.lang, children: (0, import_jsx_runtime40.jsx)("code", { children: block.code }) }, key);
|
|
42871
42850
|
case "list": {
|
|
42872
|
-
const items = block.items.map((item, i) => (0,
|
|
42873
|
-
return block.ordered ? (0,
|
|
42851
|
+
const items = block.items.map((item, i) => (0, import_jsx_runtime40.jsx)("li", { children: renderRichTextInlines(item.children) }, i));
|
|
42852
|
+
return block.ordered ? (0, import_jsx_runtime40.jsx)("ol", { start: block.start, style: LIST, children: items }, key) : (0, import_jsx_runtime40.jsx)("ul", { style: LIST, children: items }, key);
|
|
42874
42853
|
}
|
|
42875
42854
|
}
|
|
42876
42855
|
}
|
|
42877
42856
|
function Markdown({ markdown, className, style }) {
|
|
42878
42857
|
const blocks = parseRichText(markdown);
|
|
42879
|
-
return (0,
|
|
42858
|
+
return (0, import_jsx_runtime40.jsx)("div", { className, "data-ggui-markdown": "", style: {
|
|
42880
42859
|
display: "flex",
|
|
42881
42860
|
flexDirection: "column",
|
|
42882
42861
|
gap: "var(--ggui-spacing-sm, 12px)",
|
|
@@ -42884,7 +42863,7 @@ function Markdown({ markdown, className, style }) {
|
|
|
42884
42863
|
}, children: blocks.map(renderBlock) });
|
|
42885
42864
|
}
|
|
42886
42865
|
function MarkdownInline({ markdown }) {
|
|
42887
|
-
return (0,
|
|
42866
|
+
return (0, import_jsx_runtime40.jsx)(import_jsx_runtime40.Fragment, { children: renderRichTextInlines(parseInlineRichText(markdown)) });
|
|
42888
42867
|
}
|
|
42889
42868
|
var compositions_exports = {};
|
|
42890
42869
|
__export2(compositions_exports, {
|
|
@@ -42903,7 +42882,7 @@ __export2(compositions_exports, {
|
|
|
42903
42882
|
Sidebar: () => Sidebar
|
|
42904
42883
|
});
|
|
42905
42884
|
function Header({ logo, navigation: navigation2, actions, sticky = false, background, bordered = true, style, className }) {
|
|
42906
|
-
return (0,
|
|
42885
|
+
return (0, import_jsx_runtime41.jsxs)("header", { className, style: {
|
|
42907
42886
|
display: "flex",
|
|
42908
42887
|
alignItems: "center",
|
|
42909
42888
|
justifyContent: "space-between",
|
|
@@ -42917,10 +42896,10 @@ function Header({ logo, navigation: navigation2, actions, sticky = false, backgr
|
|
|
42917
42896
|
boxShadow: shadow.sm
|
|
42918
42897
|
},
|
|
42919
42898
|
...style
|
|
42920
|
-
}, children: [logo && (0,
|
|
42899
|
+
}, children: [logo && (0, import_jsx_runtime41.jsx)("div", { style: { flexShrink: 0 }, children: logo }), navigation2 && (0, import_jsx_runtime41.jsx)("nav", { style: { display: "flex", alignItems: "center", flex: 1, marginLeft: "32px" }, children: navigation2 }), actions && (0, import_jsx_runtime41.jsx)("div", { style: { display: "flex", alignItems: "center", gap: "12px", flexShrink: 0 }, children: actions })] });
|
|
42921
42900
|
}
|
|
42922
42901
|
function SidebarItem({ item, activeId, onItemClick, collapsed, depth = 0 }) {
|
|
42923
|
-
const [expanded, setExpanded] = (0,
|
|
42902
|
+
const [expanded, setExpanded] = (0, import_react31.useState)(false);
|
|
42924
42903
|
const hasChildren = item.children && item.children.length > 0;
|
|
42925
42904
|
const isActive = activeId === item.id;
|
|
42926
42905
|
const handleClick = () => {
|
|
@@ -42929,7 +42908,7 @@ function SidebarItem({ item, activeId, onItemClick, collapsed, depth = 0 }) {
|
|
|
42929
42908
|
}
|
|
42930
42909
|
onItemClick?.(item);
|
|
42931
42910
|
};
|
|
42932
|
-
return (0,
|
|
42911
|
+
return (0, import_jsx_runtime42.jsxs)("div", { children: [(0, import_jsx_runtime42.jsxs)("button", { onClick: handleClick, disabled: item.disabled, style: {
|
|
42933
42912
|
display: "flex",
|
|
42934
42913
|
alignItems: "center",
|
|
42935
42914
|
gap: "12px",
|
|
@@ -42946,11 +42925,11 @@ function SidebarItem({ item, activeId, onItemClick, collapsed, depth = 0 }) {
|
|
|
42946
42925
|
cursor: item.disabled ? "not-allowed" : "pointer",
|
|
42947
42926
|
transition: "all 0.15s",
|
|
42948
42927
|
justifyContent: collapsed ? "center" : "flex-start"
|
|
42949
|
-
}, children: [item.icon && (0,
|
|
42928
|
+
}, children: [item.icon && (0, import_jsx_runtime42.jsx)("span", { style: { display: "flex", flexShrink: 0 }, children: item.icon }), !collapsed && (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [(0, import_jsx_runtime42.jsx)("span", { style: { flex: 1 }, children: item.label }), item.badge && (0, import_jsx_runtime42.jsx)("span", { children: item.badge }), hasChildren && (0, import_jsx_runtime42.jsx)(Icon, { name: expanded ? "chevron-down" : "chevron-right", size: 14, tone: "subtle" })] })] }), hasChildren && expanded && !collapsed && (0, import_jsx_runtime42.jsx)("div", { style: { marginTop: "4px" }, children: item.children.map((child) => (0, import_jsx_runtime42.jsx)(SidebarItem, { item: child, activeId, onItemClick, collapsed, depth: depth + 1 }, child.id)) })] });
|
|
42950
42929
|
}
|
|
42951
42930
|
function Sidebar({ items, activeId, onItemClick, collapsed = false, header, footer, width = 256, collapsedWidth = 64, style, className }) {
|
|
42952
42931
|
const currentWidth = collapsed ? collapsedWidth : width;
|
|
42953
|
-
return (0,
|
|
42932
|
+
return (0, import_jsx_runtime42.jsxs)("aside", { className, style: {
|
|
42954
42933
|
width: currentWidth,
|
|
42955
42934
|
minWidth: currentWidth,
|
|
42956
42935
|
height: "100%",
|
|
@@ -42961,15 +42940,15 @@ function Sidebar({ items, activeId, onItemClick, collapsed = false, header, foot
|
|
|
42961
42940
|
transition: "width 0.2s",
|
|
42962
42941
|
overflow: "hidden",
|
|
42963
42942
|
...style
|
|
42964
|
-
}, children: [header && (0,
|
|
42943
|
+
}, children: [header && (0, import_jsx_runtime42.jsx)("div", { style: {
|
|
42965
42944
|
padding: collapsed ? "16px 8px" : "16px",
|
|
42966
42945
|
borderBottom: `1px solid ${colors.gray[200]}`
|
|
42967
|
-
}, children: header }), (0,
|
|
42946
|
+
}, children: header }), (0, import_jsx_runtime42.jsx)("nav", { style: {
|
|
42968
42947
|
flex: 1,
|
|
42969
42948
|
padding: "8px",
|
|
42970
42949
|
overflowY: "auto",
|
|
42971
42950
|
overflowX: "hidden"
|
|
42972
|
-
}, children: (0,
|
|
42951
|
+
}, children: (0, import_jsx_runtime42.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: items.map((item) => (0, import_jsx_runtime42.jsx)(SidebarItem, { item, activeId, onItemClick, collapsed }, item.id)) }) }), footer && (0, import_jsx_runtime42.jsx)("div", { style: {
|
|
42973
42952
|
padding: collapsed ? "16px 8px" : "16px",
|
|
42974
42953
|
borderTop: `1px solid ${colors.gray[200]}`
|
|
42975
42954
|
}, children: footer })] });
|
|
@@ -42981,7 +42960,7 @@ function CardGrid({ children, columns = 3, gap = 16, style, className }) {
|
|
|
42981
42960
|
}
|
|
42982
42961
|
return `repeat(auto-fit, minmax(280px, 1fr))`;
|
|
42983
42962
|
};
|
|
42984
|
-
return (0,
|
|
42963
|
+
return (0, import_jsx_runtime43.jsx)("div", { className, style: {
|
|
42985
42964
|
display: "grid",
|
|
42986
42965
|
gridTemplateColumns: getGridColumns(),
|
|
42987
42966
|
gap: `${gap}px`,
|
|
@@ -42989,8 +42968,8 @@ function CardGrid({ children, columns = 3, gap = 16, style, className }) {
|
|
|
42989
42968
|
}, children });
|
|
42990
42969
|
}
|
|
42991
42970
|
function CommentItem({ comment, onReply, onReaction, depth = 0 }) {
|
|
42992
|
-
const [showReplyInput, setShowReplyInput] = (0,
|
|
42993
|
-
const [replyContent, setReplyContent] = (0,
|
|
42971
|
+
const [showReplyInput, setShowReplyInput] = (0, import_react32.useState)(false);
|
|
42972
|
+
const [replyContent, setReplyContent] = (0, import_react32.useState)("");
|
|
42994
42973
|
const handleSubmitReply = () => {
|
|
42995
42974
|
if (replyContent.trim()) {
|
|
42996
42975
|
onReply?.(comment.id, replyContent);
|
|
@@ -42999,30 +42978,30 @@ function CommentItem({ comment, onReply, onReaction, depth = 0 }) {
|
|
|
42999
42978
|
}
|
|
43000
42979
|
};
|
|
43001
42980
|
const timestamp = comment.timestamp instanceof Date ? comment.timestamp.toLocaleString() : comment.timestamp;
|
|
43002
|
-
return (0,
|
|
42981
|
+
return (0, import_jsx_runtime44.jsxs)("div", { style: { marginLeft: depth > 0 ? "40px" : 0 }, children: [(0, import_jsx_runtime44.jsxs)("div", { style: { display: "flex", gap: "12px" }, children: [(0, import_jsx_runtime44.jsx)(Avatar, { name: comment.author.name, src: comment.author.avatar, size: "sm" }), (0, import_jsx_runtime44.jsxs)("div", { style: { flex: 1 }, children: [(0, import_jsx_runtime44.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [(0, import_jsx_runtime44.jsx)("span", { style: { fontWeight: 500, fontSize: fontSize.sm }, children: comment.author.name }), (0, import_jsx_runtime44.jsx)("span", { style: { color: colors.gray[500], fontSize: fontSize.xs }, children: timestamp })] }), (0, import_jsx_runtime44.jsx)("p", { style: { margin: "4px 0 8px", fontSize: fontSize.sm, color: colors.gray[700] }, children: comment.content }), (0, import_jsx_runtime44.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [comment.reactions?.map((reaction) => (0, import_jsx_runtime44.jsxs)("button", { onClick: () => onReaction?.(comment.id, reaction.emoji), style: {
|
|
43003
42982
|
padding: "2px 8px",
|
|
43004
42983
|
border: `1px solid ${colors.gray[200]}`,
|
|
43005
42984
|
borderRadius: "12px",
|
|
43006
42985
|
backgroundColor: colors.gray[50],
|
|
43007
42986
|
fontSize: fontSize.xs,
|
|
43008
42987
|
cursor: "pointer"
|
|
43009
|
-
}, children: [reaction.emoji, " ", reaction.count] }, reaction.emoji)), (0,
|
|
42988
|
+
}, children: [reaction.emoji, " ", reaction.count] }, reaction.emoji)), (0, import_jsx_runtime44.jsx)("button", { onClick: () => setShowReplyInput(!showReplyInput), style: {
|
|
43010
42989
|
background: "none",
|
|
43011
42990
|
border: "none",
|
|
43012
42991
|
color: colors.gray[500],
|
|
43013
42992
|
fontSize: fontSize.xs,
|
|
43014
42993
|
cursor: "pointer"
|
|
43015
|
-
}, children: "Reply" })] }), showReplyInput && (0,
|
|
42994
|
+
}, children: "Reply" })] }), showReplyInput && (0, import_jsx_runtime44.jsxs)("div", { style: { marginTop: "12px" }, children: [(0, import_jsx_runtime44.jsx)(TextArea, { value: replyContent, onChange: setReplyContent, placeholder: "Write a reply...", rows: 2 }), (0, import_jsx_runtime44.jsxs)("div", { style: { display: "flex", gap: "8px", marginTop: "8px" }, children: [(0, import_jsx_runtime44.jsx)(Button, { size: "sm", onClick: handleSubmitReply, children: "Reply" }), (0, import_jsx_runtime44.jsx)(Button, { size: "sm", variant: "ghost", onClick: () => setShowReplyInput(false), children: "Cancel" })] })] })] })] }), comment.replies?.map((reply) => (0, import_jsx_runtime44.jsx)("div", { style: { marginTop: "16px" }, children: (0, import_jsx_runtime44.jsx)(CommentItem, { comment: reply, onReply, onReaction, depth: depth + 1 }) }, reply.id))] });
|
|
43016
42995
|
}
|
|
43017
42996
|
function CommentThread({ comments, currentUser, onAddComment, onReply, onReaction, loading, style, className }) {
|
|
43018
|
-
const [newComment, setNewComment] = (0,
|
|
42997
|
+
const [newComment, setNewComment] = (0, import_react32.useState)("");
|
|
43019
42998
|
const handleSubmit = () => {
|
|
43020
42999
|
if (newComment.trim()) {
|
|
43021
43000
|
onAddComment?.(newComment);
|
|
43022
43001
|
setNewComment("");
|
|
43023
43002
|
}
|
|
43024
43003
|
};
|
|
43025
|
-
return (0,
|
|
43004
|
+
return (0, import_jsx_runtime44.jsxs)("div", { className, style: { ...style }, children: [currentUser && (0, import_jsx_runtime44.jsxs)("div", { style: { display: "flex", gap: "12px", marginBottom: "24px" }, children: [(0, import_jsx_runtime44.jsx)(Avatar, { name: currentUser.name, src: currentUser.avatar, size: "sm" }), (0, import_jsx_runtime44.jsxs)("div", { style: { flex: 1 }, children: [(0, import_jsx_runtime44.jsx)(TextArea, { value: newComment, onChange: setNewComment, placeholder: "Write a comment...", rows: 3 }), (0, import_jsx_runtime44.jsx)("div", { style: { marginTop: "8px", display: "flex", justifyContent: "flex-end" }, children: (0, import_jsx_runtime44.jsx)(Button, { onClick: handleSubmit, disabled: !newComment.trim(), children: "Comment" }) })] })] }), loading ? (0, import_jsx_runtime44.jsx)("div", { style: { display: "flex", justifyContent: "center", padding: "24px" }, children: (0, import_jsx_runtime44.jsx)(Spinner, { size: 24 }) }) : (0, import_jsx_runtime44.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "20px" }, children: comments.map((comment) => (0, import_jsx_runtime44.jsx)(CommentItem, { comment, onReply, onReaction }, comment.id)) })] });
|
|
43026
43005
|
}
|
|
43027
43006
|
function DataTable({ columns, data, rowKey = "id", loading, emptyText = "No data", onSort, sortKey, sortDirection, onRowClick, selectable, selectedKeys = [], onSelectionChange, style, className }) {
|
|
43028
43007
|
const getRowKey = (row, index) => {
|
|
@@ -43047,16 +43026,16 @@ function DataTable({ columns, data, rowKey = "id", loading, emptyText = "No data
|
|
|
43047
43026
|
};
|
|
43048
43027
|
const allSelected = data.length > 0 && selectedKeys.length === data.length;
|
|
43049
43028
|
const someSelected = selectedKeys.length > 0 && selectedKeys.length < data.length;
|
|
43050
|
-
return (0,
|
|
43029
|
+
return (0, import_jsx_runtime45.jsx)("div", { className, style: {
|
|
43051
43030
|
border: `1px solid ${colors.gray[200]}`,
|
|
43052
43031
|
borderRadius: "8px",
|
|
43053
43032
|
overflow: "hidden",
|
|
43054
43033
|
...style
|
|
43055
|
-
}, children: (0,
|
|
43034
|
+
}, children: (0, import_jsx_runtime45.jsxs)("table", { style: {
|
|
43056
43035
|
width: "100%",
|
|
43057
43036
|
borderCollapse: "collapse",
|
|
43058
43037
|
fontSize: fontSize.sm
|
|
43059
|
-
}, children: [(0,
|
|
43038
|
+
}, children: [(0, import_jsx_runtime45.jsx)("thead", { children: (0, import_jsx_runtime45.jsxs)("tr", { style: { backgroundColor: colors.gray[50] }, children: [selectable && (0, import_jsx_runtime45.jsx)("th", { style: { width: "40px", padding: "12px" }, children: (0, import_jsx_runtime45.jsx)(Checkbox, { checked: allSelected, indeterminate: someSelected, onChange: handleSelectAll }) }), columns.map((col) => (0, import_jsx_runtime45.jsx)("th", { style: {
|
|
43060
43039
|
padding: "12px 16px",
|
|
43061
43040
|
textAlign: col.align || "left",
|
|
43062
43041
|
fontWeight: fontWeight.semibold,
|
|
@@ -43064,14 +43043,14 @@ function DataTable({ columns, data, rowKey = "id", loading, emptyText = "No data
|
|
|
43064
43043
|
borderBottom: `1px solid ${colors.gray[200]}`,
|
|
43065
43044
|
cursor: col.sortable ? "pointer" : void 0,
|
|
43066
43045
|
width: col.width
|
|
43067
|
-
}, onClick: () => col.sortable && onSort?.(col.key, sortKey === col.key && sortDirection === "asc" ? "desc" : "asc"), children: (0,
|
|
43046
|
+
}, onClick: () => col.sortable && onSort?.(col.key, sortKey === col.key && sortDirection === "asc" ? "desc" : "asc"), children: (0, import_jsx_runtime45.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [col.header, col.sortable && sortKey === col.key && (0, import_jsx_runtime45.jsx)(Icon, { name: sortDirection === "asc" ? "chevron-up" : "chevron-down", size: 14 })] }) }, col.key))] }) }), (0, import_jsx_runtime45.jsx)("tbody", { children: loading ? (0, import_jsx_runtime45.jsx)("tr", { children: (0, import_jsx_runtime45.jsx)("td", { colSpan: columns.length + (selectable ? 1 : 0), style: { padding: "48px", textAlign: "center" }, children: (0, import_jsx_runtime45.jsx)(Spinner, { size: 24 }) }) }) : data.length === 0 ? (0, import_jsx_runtime45.jsx)("tr", { children: (0, import_jsx_runtime45.jsx)("td", { colSpan: columns.length + (selectable ? 1 : 0), style: { padding: "48px", textAlign: "center", color: colors.gray[500] }, children: emptyText }) }) : data.map((row, index) => {
|
|
43068
43047
|
const key = getRowKey(row, index);
|
|
43069
43048
|
const isSelected = selectedKeys.includes(key);
|
|
43070
|
-
return (0,
|
|
43049
|
+
return (0, import_jsx_runtime45.jsxs)("tr", { onClick: () => onRowClick?.(row, index), style: {
|
|
43071
43050
|
backgroundColor: isSelected ? colors.primary[50] : void 0,
|
|
43072
43051
|
cursor: onRowClick ? "pointer" : void 0,
|
|
43073
43052
|
transition: "background-color 0.15s"
|
|
43074
|
-
}, children: [selectable && (0,
|
|
43053
|
+
}, children: [selectable && (0, import_jsx_runtime45.jsx)("td", { style: { padding: "12px" }, children: (0, import_jsx_runtime45.jsx)(Checkbox, { checked: isSelected, onChange: (checked) => handleSelectRow(key, checked) }) }), columns.map((col) => (0, import_jsx_runtime45.jsx)("td", { style: {
|
|
43075
43054
|
padding: "12px 16px",
|
|
43076
43055
|
textAlign: col.align || "left",
|
|
43077
43056
|
color: colors.gray[900],
|
|
@@ -43080,9 +43059,9 @@ function DataTable({ columns, data, rowKey = "id", loading, emptyText = "No data
|
|
|
43080
43059
|
}) })] }) });
|
|
43081
43060
|
}
|
|
43082
43061
|
function ChatWindow({ messages, currentUserId, onSendMessage, loading, typing, placeholder = "Type a message...", header, style, className }) {
|
|
43083
|
-
const [inputValue, setInputValue] = (0,
|
|
43084
|
-
const messagesEndRef = (0,
|
|
43085
|
-
(0,
|
|
43062
|
+
const [inputValue, setInputValue] = (0, import_react33.useState)("");
|
|
43063
|
+
const messagesEndRef = (0, import_react33.useRef)(null);
|
|
43064
|
+
(0, import_react33.useEffect)(() => {
|
|
43086
43065
|
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
43087
43066
|
}, [messages]);
|
|
43088
43067
|
const handleSend = () => {
|
|
@@ -43097,7 +43076,7 @@ function ChatWindow({ messages, currentUserId, onSendMessage, loading, typing, p
|
|
|
43097
43076
|
handleSend();
|
|
43098
43077
|
}
|
|
43099
43078
|
};
|
|
43100
|
-
return (0,
|
|
43079
|
+
return (0, import_jsx_runtime46.jsxs)("div", { className, style: {
|
|
43101
43080
|
display: "flex",
|
|
43102
43081
|
flexDirection: "column",
|
|
43103
43082
|
height: "100%",
|
|
@@ -43106,51 +43085,51 @@ function ChatWindow({ messages, currentUserId, onSendMessage, loading, typing, p
|
|
|
43106
43085
|
backgroundColor: colors.white,
|
|
43107
43086
|
overflow: "hidden",
|
|
43108
43087
|
...style
|
|
43109
|
-
}, children: [header && (0,
|
|
43088
|
+
}, children: [header && (0, import_jsx_runtime46.jsx)("div", { style: {
|
|
43110
43089
|
padding: "12px 16px",
|
|
43111
43090
|
borderBottom: `1px solid ${colors.gray[200]}`
|
|
43112
|
-
}, children: header }), (0,
|
|
43091
|
+
}, children: header }), (0, import_jsx_runtime46.jsxs)("div", { style: {
|
|
43113
43092
|
flex: 1,
|
|
43114
43093
|
padding: "16px",
|
|
43115
43094
|
overflowY: "auto",
|
|
43116
43095
|
display: "flex",
|
|
43117
43096
|
flexDirection: "column",
|
|
43118
43097
|
gap: "12px"
|
|
43119
|
-
}, children: [loading ? (0,
|
|
43098
|
+
}, children: [loading ? (0, import_jsx_runtime46.jsx)("div", { style: { display: "flex", justifyContent: "center", padding: "24px" }, children: (0, import_jsx_runtime46.jsx)(Spinner, { size: 24 }) }) : messages.map((message) => {
|
|
43120
43099
|
const isOwn = message.sender.id === currentUserId;
|
|
43121
43100
|
const timestamp = message.timestamp instanceof Date ? message.timestamp.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : message.timestamp;
|
|
43122
|
-
return (0,
|
|
43101
|
+
return (0, import_jsx_runtime46.jsxs)("div", { style: {
|
|
43123
43102
|
display: "flex",
|
|
43124
43103
|
flexDirection: isOwn ? "row-reverse" : "row",
|
|
43125
43104
|
alignItems: "flex-end",
|
|
43126
43105
|
gap: "8px"
|
|
43127
|
-
}, children: [!isOwn && (0,
|
|
43106
|
+
}, children: [!isOwn && (0, import_jsx_runtime46.jsx)(Avatar, { name: message.sender.name, src: message.sender.avatar, size: "xs" }), (0, import_jsx_runtime46.jsxs)("div", { style: {
|
|
43128
43107
|
maxWidth: "70%",
|
|
43129
43108
|
padding: "10px 14px",
|
|
43130
43109
|
borderRadius: radius.lg,
|
|
43131
43110
|
backgroundColor: isOwn ? colors.primary[600] : colors.gray[100],
|
|
43132
43111
|
color: isOwn ? colors.white : colors.gray[900]
|
|
43133
|
-
}, children: [(0,
|
|
43112
|
+
}, children: [(0, import_jsx_runtime46.jsx)("p", { style: { margin: 0, fontSize: fontSize.sm }, children: message.content }), (0, import_jsx_runtime46.jsxs)("div", { style: {
|
|
43134
43113
|
display: "flex",
|
|
43135
43114
|
alignItems: "center",
|
|
43136
43115
|
gap: "4px",
|
|
43137
43116
|
marginTop: "4px",
|
|
43138
43117
|
fontSize: fontSize.xs,
|
|
43139
43118
|
opacity: 0.7
|
|
43140
|
-
}, children: [(0,
|
|
43141
|
-
}), typing && (0,
|
|
43119
|
+
}, children: [(0, import_jsx_runtime46.jsx)("span", { children: timestamp }), isOwn && message.status && (0, import_jsx_runtime46.jsxs)("span", { children: [message.status === "sending" && "\u2022", message.status === "sent" && "\u2713", message.status === "delivered" && "\u2713\u2713", message.status === "read" && "\u2713\u2713", message.status === "error" && "!"] })] })] })] }, message.id);
|
|
43120
|
+
}), typing && (0, import_jsx_runtime46.jsx)("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: (0, import_jsx_runtime46.jsxs)("span", { style: { fontSize: fontSize.xs, color: colors.gray[500] }, children: [typing.name, " is typing..."] }) }), (0, import_jsx_runtime46.jsx)("div", { ref: messagesEndRef })] }), (0, import_jsx_runtime46.jsxs)("div", { style: {
|
|
43142
43121
|
padding: "12px 16px",
|
|
43143
43122
|
borderTop: `1px solid ${colors.gray[200]}`,
|
|
43144
43123
|
display: "flex",
|
|
43145
43124
|
gap: "8px"
|
|
43146
|
-
}, children: [(0,
|
|
43125
|
+
}, children: [(0, import_jsx_runtime46.jsx)("input", { type: "text", value: inputValue, onChange: (e) => setInputValue(e.target.value), onKeyDown: handleKeyDown, placeholder, style: {
|
|
43147
43126
|
flex: 1,
|
|
43148
43127
|
padding: "10px 14px",
|
|
43149
43128
|
border: `1px solid ${colors.gray[300]}`,
|
|
43150
43129
|
borderRadius: radius.full,
|
|
43151
43130
|
fontSize: fontSize.sm,
|
|
43152
43131
|
outline: "none"
|
|
43153
|
-
} }), (0,
|
|
43132
|
+
} }), (0, import_jsx_runtime46.jsx)(Button, { onClick: handleSend, disabled: !inputValue.trim(), children: (0, import_jsx_runtime46.jsx)(Icon, { name: "chevron-right", size: 18 }) })] })] });
|
|
43154
43133
|
}
|
|
43155
43134
|
function NavigationBar({ items, activeId, onItemClick, orientation = "horizontal", variant = "default", style, className }) {
|
|
43156
43135
|
const renderItem = (item) => {
|
|
@@ -43192,16 +43171,16 @@ function NavigationBar({ items, activeId, onItemClick, orientation = "horizontal
|
|
|
43192
43171
|
onItemClick?.(item);
|
|
43193
43172
|
}
|
|
43194
43173
|
};
|
|
43195
|
-
const content = (0,
|
|
43174
|
+
const content = (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [item.icon && (0, import_jsx_runtime47.jsx)("span", { style: { display: "flex" }, children: item.icon }), (0, import_jsx_runtime47.jsx)("span", { children: item.label })] });
|
|
43196
43175
|
if (item.href) {
|
|
43197
|
-
return (0,
|
|
43176
|
+
return (0, import_jsx_runtime47.jsx)("a", { href: item.href, onClick: (e) => {
|
|
43198
43177
|
e.preventDefault();
|
|
43199
43178
|
handleClick();
|
|
43200
43179
|
}, style: { ...baseStyle, ...variantStyles6[variant] }, children: content }, item.id);
|
|
43201
43180
|
}
|
|
43202
|
-
return (0,
|
|
43181
|
+
return (0, import_jsx_runtime47.jsx)("button", { onClick: handleClick, disabled: item.disabled, style: { ...baseStyle, ...variantStyles6[variant] }, children: content }, item.id);
|
|
43203
43182
|
};
|
|
43204
|
-
return (0,
|
|
43183
|
+
return (0, import_jsx_runtime47.jsx)("nav", { className, style: {
|
|
43205
43184
|
display: "flex",
|
|
43206
43185
|
flexDirection: orientation === "horizontal" ? "row" : "column",
|
|
43207
43186
|
gap: orientation === "horizontal" ? "4px" : "2px",
|
|
@@ -43220,8 +43199,8 @@ function formatFileSize(bytes) {
|
|
|
43220
43199
|
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(1))} ${sizes[i]}`;
|
|
43221
43200
|
}
|
|
43222
43201
|
function FileUploader({ files = [], onFilesSelected, onFileRemove, accept, multiple = true, maxSize, maxFiles, disabled, dragDrop = true, style, className }) {
|
|
43223
|
-
const [isDragOver, setIsDragOver] = (0,
|
|
43224
|
-
const inputRef = (0,
|
|
43202
|
+
const [isDragOver, setIsDragOver] = (0, import_react34.useState)(false);
|
|
43203
|
+
const inputRef = (0, import_react34.useRef)(null);
|
|
43225
43204
|
const handleFiles = (fileList) => {
|
|
43226
43205
|
if (!fileList)
|
|
43227
43206
|
return;
|
|
@@ -43250,7 +43229,7 @@ function FileUploader({ files = [], onFilesSelected, onFileRemove, accept, multi
|
|
|
43250
43229
|
const handleDragLeave = () => {
|
|
43251
43230
|
setIsDragOver(false);
|
|
43252
43231
|
};
|
|
43253
|
-
return (0,
|
|
43232
|
+
return (0, import_jsx_runtime48.jsxs)("div", { className, style: { ...style }, children: [(0, import_jsx_runtime48.jsxs)("div", { onClick: () => !disabled && inputRef.current?.click(), onDrop: handleDrop, onDragOver: handleDragOver, onDragLeave: handleDragLeave, style: {
|
|
43254
43233
|
border: `2px dashed ${isDragOver ? colors.primary[400] : colors.gray[300]}`,
|
|
43255
43234
|
borderRadius: radius.lg,
|
|
43256
43235
|
padding: "32px",
|
|
@@ -43259,7 +43238,7 @@ function FileUploader({ files = [], onFilesSelected, onFileRemove, accept, multi
|
|
|
43259
43238
|
cursor: disabled ? "not-allowed" : "pointer",
|
|
43260
43239
|
transition: "all 0.2s",
|
|
43261
43240
|
opacity: disabled ? 0.5 : 1
|
|
43262
|
-
}, children: [(0,
|
|
43241
|
+
}, children: [(0, import_jsx_runtime48.jsx)("input", { ref: inputRef, type: "file", accept, multiple, onChange: (e) => handleFiles(e.target.files), disabled, style: { display: "none" } }), (0, import_jsx_runtime48.jsx)(Icon, { name: "plus", size: 32, tone: "subtle" }), (0, import_jsx_runtime48.jsx)("p", { style: { margin: "12px 0 4px", color: colors.gray[700], fontSize: fontSize.sm }, children: dragDrop ? "Drag and drop files here, or click to browse" : "Click to browse files" }), (0, import_jsx_runtime48.jsxs)("p", { style: { margin: 0, color: colors.gray[500], fontSize: fontSize.xs }, children: [accept && `Accepted: ${accept}`, maxSize && ` \u2022 Max size: ${formatFileSize(maxSize)}`, maxFiles && ` \u2022 Max files: ${maxFiles}`] })] }), files.length > 0 && (0, import_jsx_runtime48.jsx)("div", { style: { marginTop: "16px", display: "flex", flexDirection: "column", gap: "8px" }, children: files.map((file2) => (0, import_jsx_runtime48.jsxs)("div", { style: {
|
|
43263
43242
|
display: "flex",
|
|
43264
43243
|
alignItems: "center",
|
|
43265
43244
|
gap: "12px",
|
|
@@ -43267,14 +43246,14 @@ function FileUploader({ files = [], onFilesSelected, onFileRemove, accept, multi
|
|
|
43267
43246
|
border: `1px solid ${colors.gray[200]}`,
|
|
43268
43247
|
borderRadius: radius.md,
|
|
43269
43248
|
backgroundColor: colors.white
|
|
43270
|
-
}, children: [(0,
|
|
43249
|
+
}, children: [(0, import_jsx_runtime48.jsx)(Icon, { name: "menu", size: 20, tone: "subtle" }), (0, import_jsx_runtime48.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [(0, import_jsx_runtime48.jsx)("p", { style: {
|
|
43271
43250
|
margin: 0,
|
|
43272
43251
|
fontSize: fontSize.sm,
|
|
43273
43252
|
color: colors.gray[900],
|
|
43274
43253
|
whiteSpace: "nowrap",
|
|
43275
43254
|
overflow: "hidden",
|
|
43276
43255
|
textOverflow: "ellipsis"
|
|
43277
|
-
}, children: file2.name }), (0,
|
|
43256
|
+
}, children: file2.name }), (0, import_jsx_runtime48.jsxs)("p", { style: { margin: "2px 0 0", fontSize: fontSize.xs, color: colors.gray[500] }, children: [formatFileSize(file2.size), file2.error && (0, import_jsx_runtime48.jsx)("span", { style: { color: colors.error[500], marginLeft: "8px" }, children: file2.error })] }), file2.status === "uploading" && file2.progress !== void 0 && (0, import_jsx_runtime48.jsx)(Progress, { value: file2.progress, size: "sm", style: { marginTop: "8px" } })] }), (0, import_jsx_runtime48.jsx)(Button, { variant: "ghost", size: "sm", onClick: () => onFileRemove?.(file2.id), children: (0, import_jsx_runtime48.jsx)(Icon, { name: "x", size: 16 }) })] }, file2.id)) })] });
|
|
43278
43257
|
}
|
|
43279
43258
|
var variantColors2 = {
|
|
43280
43259
|
info: colors.info[500],
|
|
@@ -43285,44 +43264,44 @@ var variantColors2 = {
|
|
|
43285
43264
|
function NotificationItem({ notification, onMarkAsRead, onDismiss }) {
|
|
43286
43265
|
const timestamp = notification.timestamp instanceof Date ? notification.timestamp.toLocaleString() : notification.timestamp;
|
|
43287
43266
|
const typeColor = variantColors2[notification.type || "info"];
|
|
43288
|
-
return (0,
|
|
43267
|
+
return (0, import_jsx_runtime49.jsxs)("div", { style: {
|
|
43289
43268
|
display: "flex",
|
|
43290
43269
|
gap: "12px",
|
|
43291
43270
|
padding: "12px",
|
|
43292
43271
|
backgroundColor: notification.read ? "transparent" : colors.primary[50],
|
|
43293
43272
|
borderRadius: radius.md,
|
|
43294
43273
|
transition: "background-color 0.15s"
|
|
43295
|
-
}, children: [(0,
|
|
43274
|
+
}, children: [(0, import_jsx_runtime49.jsx)("div", { style: {
|
|
43296
43275
|
width: "8px",
|
|
43297
43276
|
height: "8px",
|
|
43298
43277
|
borderRadius: "50%",
|
|
43299
43278
|
backgroundColor: notification.read ? "transparent" : typeColor,
|
|
43300
43279
|
flexShrink: 0,
|
|
43301
43280
|
marginTop: "6px"
|
|
43302
|
-
} }), (0,
|
|
43281
|
+
} }), (0, import_jsx_runtime49.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [(0, import_jsx_runtime49.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: "8px" }, children: [(0, import_jsx_runtime49.jsx)("p", { style: {
|
|
43303
43282
|
margin: 0,
|
|
43304
43283
|
fontWeight: fontWeight.medium,
|
|
43305
43284
|
color: colors.gray[900],
|
|
43306
43285
|
fontSize: fontSize.sm
|
|
43307
|
-
}, children: notification.title }), (0,
|
|
43286
|
+
}, children: notification.title }), (0, import_jsx_runtime49.jsx)("button", { onClick: () => onDismiss?.(notification.id), style: {
|
|
43308
43287
|
background: "none",
|
|
43309
43288
|
border: "none",
|
|
43310
43289
|
padding: "2px",
|
|
43311
43290
|
cursor: "pointer",
|
|
43312
43291
|
color: colors.gray[400],
|
|
43313
43292
|
flexShrink: 0
|
|
43314
|
-
}, children: (0,
|
|
43293
|
+
}, children: (0, import_jsx_runtime49.jsx)(Icon, { name: "x", size: 14 }) })] }), notification.message && (0, import_jsx_runtime49.jsx)("p", { style: {
|
|
43315
43294
|
margin: "4px 0 0",
|
|
43316
43295
|
color: colors.gray[600],
|
|
43317
43296
|
fontSize: fontSize.xs
|
|
43318
|
-
}, children: notification.message }), (0,
|
|
43297
|
+
}, children: notification.message }), (0, import_jsx_runtime49.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "12px", marginTop: "8px" }, children: [(0, import_jsx_runtime49.jsx)("span", { style: { color: colors.gray[400], fontSize: fontSize.xs }, children: timestamp }), !notification.read && (0, import_jsx_runtime49.jsx)("button", { onClick: () => onMarkAsRead?.(notification.id), style: {
|
|
43319
43298
|
background: "none",
|
|
43320
43299
|
border: "none",
|
|
43321
43300
|
padding: 0,
|
|
43322
43301
|
color: colors.primary[600],
|
|
43323
43302
|
fontSize: fontSize.xs,
|
|
43324
43303
|
cursor: "pointer"
|
|
43325
|
-
}, children: "Mark as read" }), notification.action && (0,
|
|
43304
|
+
}, children: "Mark as read" }), notification.action && (0, import_jsx_runtime49.jsx)("button", { onClick: notification.action.onClick, style: {
|
|
43326
43305
|
background: "none",
|
|
43327
43306
|
border: "none",
|
|
43328
43307
|
padding: 0,
|
|
@@ -43333,24 +43312,24 @@ function NotificationItem({ notification, onMarkAsRead, onDismiss }) {
|
|
|
43333
43312
|
}
|
|
43334
43313
|
function NotificationCenter({ notifications, onMarkAsRead, onMarkAllAsRead, onDismiss, onClearAll, emptyText = "No notifications", loading, style, className }) {
|
|
43335
43314
|
const unreadCount = notifications.filter((n) => !n.read).length;
|
|
43336
|
-
return (0,
|
|
43315
|
+
return (0, import_jsx_runtime49.jsxs)("div", { className, style: {
|
|
43337
43316
|
display: "flex",
|
|
43338
43317
|
flexDirection: "column",
|
|
43339
43318
|
...style
|
|
43340
|
-
}, children: [(0,
|
|
43319
|
+
}, children: [(0, import_jsx_runtime49.jsxs)("div", { style: {
|
|
43341
43320
|
display: "flex",
|
|
43342
43321
|
alignItems: "center",
|
|
43343
43322
|
justifyContent: "space-between",
|
|
43344
43323
|
padding: "12px 16px",
|
|
43345
43324
|
borderBottom: `1px solid ${colors.gray[200]}`
|
|
43346
|
-
}, children: [(0,
|
|
43325
|
+
}, children: [(0, import_jsx_runtime49.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [(0, import_jsx_runtime49.jsx)("span", { style: { fontWeight: fontWeight.semibold, color: colors.gray[900] }, children: "Notifications" }), unreadCount > 0 && (0, import_jsx_runtime49.jsx)("span", { style: {
|
|
43347
43326
|
padding: "2px 8px",
|
|
43348
43327
|
borderRadius: "12px",
|
|
43349
43328
|
backgroundColor: colors.primary[100],
|
|
43350
43329
|
color: colors.primary[700],
|
|
43351
43330
|
fontSize: fontSize.xs,
|
|
43352
43331
|
fontWeight: fontWeight.medium
|
|
43353
|
-
}, children: unreadCount })] }), (0,
|
|
43332
|
+
}, children: unreadCount })] }), (0, import_jsx_runtime49.jsxs)("div", { style: { display: "flex", gap: "8px" }, children: [unreadCount > 0 && (0, import_jsx_runtime49.jsx)(Button, { variant: "ghost", size: "sm", onClick: onMarkAllAsRead, children: "Mark all read" }), notifications.length > 0 && (0, import_jsx_runtime49.jsx)(Button, { variant: "ghost", size: "sm", onClick: onClearAll, children: "Clear all" })] })] }), (0, import_jsx_runtime49.jsx)("div", { style: { flex: 1, overflowY: "auto", padding: "8px" }, children: loading ? (0, import_jsx_runtime49.jsx)("div", { style: { display: "flex", justifyContent: "center", padding: "32px" }, children: (0, import_jsx_runtime49.jsx)(Spinner, { size: 24 }) }) : notifications.length === 0 ? (0, import_jsx_runtime49.jsx)("div", { style: { textAlign: "center", padding: "32px", color: colors.gray[500] }, children: emptyText }) : (0, import_jsx_runtime49.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: notifications.map((notification) => (0, import_jsx_runtime49.jsx)(NotificationItem, { notification, onMarkAsRead, onDismiss }, notification.id)) }) })] });
|
|
43354
43333
|
}
|
|
43355
43334
|
var sizeWidths = {
|
|
43356
43335
|
sm: "400px",
|
|
@@ -43360,12 +43339,12 @@ var sizeWidths = {
|
|
|
43360
43339
|
full: "100vw"
|
|
43361
43340
|
};
|
|
43362
43341
|
function Modal({ open, onClose, title, children, footer, size = "md", closeOnOverlayClick = true, closeOnEscape = true, showCloseButton = true, style, className }) {
|
|
43363
|
-
const handleEscape = (0,
|
|
43342
|
+
const handleEscape = (0, import_react35.useCallback)((e) => {
|
|
43364
43343
|
if (e.key === "Escape" && closeOnEscape) {
|
|
43365
43344
|
onClose();
|
|
43366
43345
|
}
|
|
43367
43346
|
}, [closeOnEscape, onClose]);
|
|
43368
|
-
(0,
|
|
43347
|
+
(0, import_react35.useEffect)(() => {
|
|
43369
43348
|
if (open) {
|
|
43370
43349
|
document.addEventListener("keydown", handleEscape);
|
|
43371
43350
|
document.body.style.overflow = "hidden";
|
|
@@ -43383,7 +43362,7 @@ function Modal({ open, onClose, title, children, footer, size = "md", closeOnOve
|
|
|
43383
43362
|
}
|
|
43384
43363
|
};
|
|
43385
43364
|
const isFullscreen = size === "full";
|
|
43386
|
-
return (0,
|
|
43365
|
+
return (0, import_jsx_runtime50.jsxs)("div", { style: {
|
|
43387
43366
|
position: "fixed",
|
|
43388
43367
|
inset: 0,
|
|
43389
43368
|
zIndex: zIndex.modal,
|
|
@@ -43391,12 +43370,12 @@ function Modal({ open, onClose, title, children, footer, size = "md", closeOnOve
|
|
|
43391
43370
|
alignItems: isFullscreen ? "stretch" : "center",
|
|
43392
43371
|
justifyContent: "center",
|
|
43393
43372
|
padding: isFullscreen ? 0 : "24px"
|
|
43394
|
-
}, children: [(0,
|
|
43373
|
+
}, children: [(0, import_jsx_runtime50.jsx)("div", { onClick: handleOverlayClick, style: {
|
|
43395
43374
|
position: "absolute",
|
|
43396
43375
|
inset: 0,
|
|
43397
43376
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
43398
43377
|
animation: animation.fadeIn
|
|
43399
|
-
} }), (0,
|
|
43378
|
+
} }), (0, import_jsx_runtime50.jsxs)("div", { role: "dialog", "aria-modal": "true", className, style: {
|
|
43400
43379
|
position: "relative",
|
|
43401
43380
|
width: sizeWidths[size],
|
|
43402
43381
|
maxWidth: isFullscreen ? "100%" : "calc(100vw - 48px)",
|
|
@@ -43409,17 +43388,17 @@ function Modal({ open, onClose, title, children, footer, size = "md", closeOnOve
|
|
|
43409
43388
|
overflow: "hidden",
|
|
43410
43389
|
animation: animation.scaleIn,
|
|
43411
43390
|
...style
|
|
43412
|
-
}, children: [(title || showCloseButton) && (0,
|
|
43391
|
+
}, children: [(title || showCloseButton) && (0, import_jsx_runtime50.jsxs)("div", { style: {
|
|
43413
43392
|
display: "flex",
|
|
43414
43393
|
alignItems: "center",
|
|
43415
43394
|
justifyContent: "space-between",
|
|
43416
43395
|
padding: "16px 20px",
|
|
43417
43396
|
borderBottom: `1px solid ${colors.gray[200]}`
|
|
43418
|
-
}, children: [title && (0,
|
|
43397
|
+
}, children: [title && (0, import_jsx_runtime50.jsx)(Heading, { level: 4, children: title }), showCloseButton && (0, import_jsx_runtime50.jsx)(Button, { variant: "ghost", size: "sm", onClick: onClose, "aria-label": "Close modal", style: { marginLeft: "auto" }, children: (0, import_jsx_runtime50.jsx)(Icon, { name: "x", size: 20 }) })] }), (0, import_jsx_runtime50.jsx)("div", { style: {
|
|
43419
43398
|
flex: 1,
|
|
43420
43399
|
padding: "20px",
|
|
43421
43400
|
overflowY: "auto"
|
|
43422
|
-
}, children }), footer && (0,
|
|
43401
|
+
}, children }), footer && (0, import_jsx_runtime50.jsx)("div", { style: {
|
|
43423
43402
|
display: "flex",
|
|
43424
43403
|
alignItems: "center",
|
|
43425
43404
|
justifyContent: "flex-end",
|
|
@@ -43429,9 +43408,9 @@ function Modal({ open, onClose, title, children, footer, size = "md", closeOnOve
|
|
|
43429
43408
|
}, children: footer })] })] });
|
|
43430
43409
|
}
|
|
43431
43410
|
function CommandPalette({ open, onClose, commands, onSelect, placeholder = "Search commands...", recentIds = [], loading, style, className }) {
|
|
43432
|
-
const [query, setQuery] = (0,
|
|
43433
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
43434
|
-
const filteredCommands = (0,
|
|
43411
|
+
const [query, setQuery] = (0, import_react36.useState)("");
|
|
43412
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react36.useState)(0);
|
|
43413
|
+
const filteredCommands = (0, import_react36.useMemo)(() => {
|
|
43435
43414
|
const filtered = query ? commands.filter((cmd) => cmd.label.toLowerCase().includes(query.toLowerCase()) || cmd.description?.toLowerCase().includes(query.toLowerCase())) : commands;
|
|
43436
43415
|
const groups = /* @__PURE__ */ new Map();
|
|
43437
43416
|
if (!query && recentIds.length > 0) {
|
|
@@ -43452,21 +43431,21 @@ function CommandPalette({ open, onClose, commands, onSelect, placeholder = "Sear
|
|
|
43452
43431
|
});
|
|
43453
43432
|
return groups;
|
|
43454
43433
|
}, [commands, query, recentIds]);
|
|
43455
|
-
const flatCommands = (0,
|
|
43434
|
+
const flatCommands = (0, import_react36.useMemo)(() => {
|
|
43456
43435
|
const flat = [];
|
|
43457
43436
|
filteredCommands.forEach((cmds) => flat.push(...cmds));
|
|
43458
43437
|
return flat;
|
|
43459
43438
|
}, [filteredCommands]);
|
|
43460
|
-
(0,
|
|
43439
|
+
(0, import_react36.useEffect)(() => {
|
|
43461
43440
|
setSelectedIndex(0);
|
|
43462
43441
|
}, [query]);
|
|
43463
|
-
(0,
|
|
43442
|
+
(0, import_react36.useEffect)(() => {
|
|
43464
43443
|
if (open) {
|
|
43465
43444
|
setQuery("");
|
|
43466
43445
|
setSelectedIndex(0);
|
|
43467
43446
|
}
|
|
43468
43447
|
}, [open]);
|
|
43469
|
-
const handleKeyDown = (0,
|
|
43448
|
+
const handleKeyDown = (0, import_react36.useCallback)((e) => {
|
|
43470
43449
|
if (e.key === "Escape") {
|
|
43471
43450
|
onClose();
|
|
43472
43451
|
return;
|
|
@@ -43486,7 +43465,7 @@ function CommandPalette({ open, onClose, commands, onSelect, placeholder = "Sear
|
|
|
43486
43465
|
}
|
|
43487
43466
|
}
|
|
43488
43467
|
}, [flatCommands, selectedIndex, onSelect, onClose]);
|
|
43489
|
-
(0,
|
|
43468
|
+
(0, import_react36.useEffect)(() => {
|
|
43490
43469
|
if (open) {
|
|
43491
43470
|
document.addEventListener("keydown", handleKeyDown);
|
|
43492
43471
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
@@ -43495,7 +43474,7 @@ function CommandPalette({ open, onClose, commands, onSelect, placeholder = "Sear
|
|
|
43495
43474
|
if (!open)
|
|
43496
43475
|
return null;
|
|
43497
43476
|
let currentIndex = 0;
|
|
43498
|
-
return (0,
|
|
43477
|
+
return (0, import_jsx_runtime51.jsxs)("div", { style: {
|
|
43499
43478
|
position: "fixed",
|
|
43500
43479
|
inset: 0,
|
|
43501
43480
|
zIndex: zIndex.modal,
|
|
@@ -43503,11 +43482,11 @@ function CommandPalette({ open, onClose, commands, onSelect, placeholder = "Sear
|
|
|
43503
43482
|
alignItems: "flex-start",
|
|
43504
43483
|
justifyContent: "center",
|
|
43505
43484
|
paddingTop: "15vh"
|
|
43506
|
-
}, children: [(0,
|
|
43485
|
+
}, children: [(0, import_jsx_runtime51.jsx)("div", { onClick: onClose, style: {
|
|
43507
43486
|
position: "absolute",
|
|
43508
43487
|
inset: 0,
|
|
43509
43488
|
backgroundColor: "rgba(0, 0, 0, 0.5)"
|
|
43510
|
-
} }), (0,
|
|
43489
|
+
} }), (0, import_jsx_runtime51.jsxs)("div", { role: "dialog", className, style: {
|
|
43511
43490
|
position: "relative",
|
|
43512
43491
|
width: "560px",
|
|
43513
43492
|
maxWidth: "calc(100vw - 48px)",
|
|
@@ -43519,19 +43498,19 @@ function CommandPalette({ open, onClose, commands, onSelect, placeholder = "Sear
|
|
|
43519
43498
|
display: "flex",
|
|
43520
43499
|
flexDirection: "column",
|
|
43521
43500
|
...style
|
|
43522
|
-
}, children: [(0,
|
|
43501
|
+
}, children: [(0, import_jsx_runtime51.jsx)("div", { style: { padding: "12px", borderBottom: `1px solid ${colors.gray[200]}` }, children: (0, import_jsx_runtime51.jsxs)("div", { style: { position: "relative" }, children: [(0, import_jsx_runtime51.jsx)(Icon, { name: "search", size: 18, tone: "subtle", style: {
|
|
43523
43502
|
position: "absolute",
|
|
43524
43503
|
left: "12px",
|
|
43525
43504
|
top: "50%",
|
|
43526
43505
|
transform: "translateY(-50%)"
|
|
43527
|
-
} }), (0,
|
|
43506
|
+
} }), (0, import_jsx_runtime51.jsx)("input", { type: "text", value: query, onChange: (e) => setQuery(e.target.value), placeholder, autoFocus: true, style: {
|
|
43528
43507
|
width: "100%",
|
|
43529
43508
|
padding: "12px 12px 12px 42px",
|
|
43530
43509
|
border: "none",
|
|
43531
43510
|
fontSize: fontSize.base,
|
|
43532
43511
|
outline: "none",
|
|
43533
43512
|
backgroundColor: "transparent"
|
|
43534
|
-
} })] }) }), (0,
|
|
43513
|
+
} })] }) }), (0, import_jsx_runtime51.jsx)("div", { style: { flex: 1, overflowY: "auto", padding: "8px" }, children: loading ? (0, import_jsx_runtime51.jsx)("div", { style: { display: "flex", justifyContent: "center", padding: "32px" }, children: (0, import_jsx_runtime51.jsx)(Spinner, { size: 24 }) }) : flatCommands.length === 0 ? (0, import_jsx_runtime51.jsx)("div", { style: { textAlign: "center", padding: "32px", color: colors.gray[500] }, children: "No commands found" }) : Array.from(filteredCommands.entries()).map(([group, cmds]) => (0, import_jsx_runtime51.jsxs)("div", { style: { marginBottom: "8px" }, children: [(0, import_jsx_runtime51.jsx)("div", { style: {
|
|
43535
43514
|
padding: "8px 12px",
|
|
43536
43515
|
fontSize: fontSize.xs,
|
|
43537
43516
|
fontWeight: fontWeight.semibold,
|
|
@@ -43541,7 +43520,7 @@ function CommandPalette({ open, onClose, commands, onSelect, placeholder = "Sear
|
|
|
43541
43520
|
}, children: group }), cmds.map((cmd) => {
|
|
43542
43521
|
const index = currentIndex++;
|
|
43543
43522
|
const isSelected = index === selectedIndex;
|
|
43544
|
-
return (0,
|
|
43523
|
+
return (0, import_jsx_runtime51.jsxs)("button", { onClick: () => {
|
|
43545
43524
|
if (!cmd.disabled) {
|
|
43546
43525
|
onSelect(cmd);
|
|
43547
43526
|
onClose();
|
|
@@ -43558,7 +43537,7 @@ function CommandPalette({ open, onClose, commands, onSelect, placeholder = "Sear
|
|
|
43558
43537
|
color: cmd.disabled ? colors.gray[400] : colors.gray[900],
|
|
43559
43538
|
textAlign: "left",
|
|
43560
43539
|
cursor: cmd.disabled ? "not-allowed" : "pointer"
|
|
43561
|
-
}, children: [cmd.icon && (0,
|
|
43540
|
+
}, children: [cmd.icon && (0, import_jsx_runtime51.jsx)("span", { style: { display: "flex", color: colors.gray[500] }, children: cmd.icon }), (0, import_jsx_runtime51.jsxs)("div", { style: { flex: 1 }, children: [(0, import_jsx_runtime51.jsx)("div", { style: { fontSize: fontSize.sm }, children: cmd.label }), cmd.description && (0, import_jsx_runtime51.jsx)("div", { style: { fontSize: fontSize.xs, color: colors.gray[500] }, children: cmd.description })] }), cmd.shortcut && (0, import_jsx_runtime51.jsx)("kbd", { style: {
|
|
43562
43541
|
padding: "2px 6px",
|
|
43563
43542
|
backgroundColor: colors.gray[100],
|
|
43564
43543
|
borderRadius: radius.sm,
|
|
@@ -43566,7 +43545,7 @@ function CommandPalette({ open, onClose, commands, onSelect, placeholder = "Sear
|
|
|
43566
43545
|
color: colors.gray[500],
|
|
43567
43546
|
fontFamily: "inherit"
|
|
43568
43547
|
}, children: cmd.shortcut })] }, cmd.id);
|
|
43569
|
-
})] }, group)) }), (0,
|
|
43548
|
+
})] }, group)) }), (0, import_jsx_runtime51.jsxs)("div", { style: {
|
|
43570
43549
|
padding: "8px 12px",
|
|
43571
43550
|
borderTop: `1px solid ${colors.gray[200]}`,
|
|
43572
43551
|
display: "flex",
|
|
@@ -43574,35 +43553,35 @@ function CommandPalette({ open, onClose, commands, onSelect, placeholder = "Sear
|
|
|
43574
43553
|
gap: "16px",
|
|
43575
43554
|
fontSize: fontSize.xs,
|
|
43576
43555
|
color: colors.gray[500]
|
|
43577
|
-
}, children: [(0,
|
|
43556
|
+
}, children: [(0, import_jsx_runtime51.jsx)("span", { children: "\u2191\u2193 Navigate" }), (0, import_jsx_runtime51.jsx)("span", { children: "\u21B5 Select" }), (0, import_jsx_runtime51.jsx)("span", { children: "Esc Close" })] })] })] });
|
|
43578
43557
|
}
|
|
43579
43558
|
function Footer({ brand, columns, socialLinks, bottomText, bottomLinks, background, bordered = true, style, className }) {
|
|
43580
|
-
return (0,
|
|
43559
|
+
return (0, import_jsx_runtime52.jsxs)("footer", { className, role: "contentinfo", style: {
|
|
43581
43560
|
backgroundColor: background || colors.gray[50],
|
|
43582
43561
|
borderTop: bordered ? `1px solid ${colors.gray[200]}` : void 0,
|
|
43583
43562
|
...style
|
|
43584
|
-
}, children: [(0,
|
|
43563
|
+
}, children: [(0, import_jsx_runtime52.jsxs)("div", { style: {
|
|
43585
43564
|
display: "flex",
|
|
43586
43565
|
flexWrap: "wrap",
|
|
43587
43566
|
gap: "48px",
|
|
43588
43567
|
padding: "48px 24px",
|
|
43589
43568
|
maxWidth: "1280px",
|
|
43590
43569
|
margin: "0 auto"
|
|
43591
|
-
}, children: [brand && (0,
|
|
43570
|
+
}, children: [brand && (0, import_jsx_runtime52.jsx)("div", { style: { flex: "1 1 280px", minWidth: "200px" }, children: brand }), columns?.map((column, colIdx) => (0, import_jsx_runtime52.jsxs)("div", { style: { flex: "0 1 180px", minWidth: "140px" }, children: [column.title && (0, import_jsx_runtime52.jsx)("h4", { style: {
|
|
43592
43571
|
fontSize: fontSize.sm,
|
|
43593
43572
|
fontWeight: fontWeight.semibold,
|
|
43594
43573
|
color: colors.gray[900],
|
|
43595
43574
|
lineHeight: lineHeight.normal,
|
|
43596
43575
|
margin: "0 0 16px 0",
|
|
43597
43576
|
padding: 0
|
|
43598
|
-
}, children: column.title }), (0,
|
|
43577
|
+
}, children: column.title }), (0, import_jsx_runtime52.jsx)("ul", { style: {
|
|
43599
43578
|
listStyle: "none",
|
|
43600
43579
|
margin: 0,
|
|
43601
43580
|
padding: 0,
|
|
43602
43581
|
display: "flex",
|
|
43603
43582
|
flexDirection: "column",
|
|
43604
43583
|
gap: "10px"
|
|
43605
|
-
}, children: column.links.map((link, linkIdx) => (0,
|
|
43584
|
+
}, children: column.links.map((link, linkIdx) => (0, import_jsx_runtime52.jsx)("li", { children: (0, import_jsx_runtime52.jsx)("a", { href: link.href, onClick: link.onClick ? (e) => {
|
|
43606
43585
|
e.preventDefault();
|
|
43607
43586
|
link.onClick?.();
|
|
43608
43587
|
} : void 0, style: {
|
|
@@ -43611,7 +43590,7 @@ function Footer({ brand, columns, socialLinks, bottomText, bottomLinks, backgrou
|
|
|
43611
43590
|
textDecoration: "none",
|
|
43612
43591
|
transition: "color 0.15s",
|
|
43613
43592
|
lineHeight: lineHeight.normal
|
|
43614
|
-
}, "aria-label": link.label, children: link.label }) }, linkIdx)) })] }, colIdx))] }), (bottomText || bottomLinks || socialLinks) && (0,
|
|
43593
|
+
}, "aria-label": link.label, children: link.label }) }, linkIdx)) })] }, colIdx))] }), (bottomText || bottomLinks || socialLinks) && (0, import_jsx_runtime52.jsxs)("div", { style: {
|
|
43615
43594
|
display: "flex",
|
|
43616
43595
|
flexWrap: "wrap",
|
|
43617
43596
|
alignItems: "center",
|
|
@@ -43621,17 +43600,17 @@ function Footer({ brand, columns, socialLinks, bottomText, bottomLinks, backgrou
|
|
|
43621
43600
|
maxWidth: "1280px",
|
|
43622
43601
|
margin: "0 auto",
|
|
43623
43602
|
borderTop: `1px solid ${colors.gray[200]}`
|
|
43624
|
-
}, children: [bottomText && (0,
|
|
43603
|
+
}, children: [bottomText && (0, import_jsx_runtime52.jsx)("span", { style: {
|
|
43625
43604
|
fontSize: fontSize.sm,
|
|
43626
43605
|
color: colors.gray[500],
|
|
43627
43606
|
lineHeight: lineHeight.normal
|
|
43628
|
-
}, children: bottomText }), (0,
|
|
43607
|
+
}, children: bottomText }), (0, import_jsx_runtime52.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "20px" }, children: [socialLinks?.map((social, idx) => (0, import_jsx_runtime52.jsx)("a", { href: social.href, "aria-label": social.label, style: {
|
|
43629
43608
|
display: "flex",
|
|
43630
43609
|
alignItems: "center",
|
|
43631
43610
|
justifyContent: "center",
|
|
43632
43611
|
color: colors.gray[500],
|
|
43633
43612
|
transition: "color 0.15s"
|
|
43634
|
-
}, children: social.icon }, idx)), bottomLinks?.map((link, idx) => (0,
|
|
43613
|
+
}, children: social.icon }, idx)), bottomLinks?.map((link, idx) => (0, import_jsx_runtime52.jsx)("a", { href: link.href, onClick: link.onClick ? (e) => {
|
|
43635
43614
|
e.preventDefault();
|
|
43636
43615
|
link.onClick?.();
|
|
43637
43616
|
} : void 0, style: {
|
|
@@ -43650,7 +43629,7 @@ function Hero({ heading, description, primaryAction, secondaryAction, media, ali
|
|
|
43650
43629
|
const sizeConfig2 = sizeStyles7[size] || sizeStyles7.md;
|
|
43651
43630
|
const hasImage = !!backgroundImage;
|
|
43652
43631
|
const showOverlay = hasImage && overlay;
|
|
43653
|
-
return (0,
|
|
43632
|
+
return (0, import_jsx_runtime53.jsxs)("section", { className, style: {
|
|
43654
43633
|
position: "relative",
|
|
43655
43634
|
backgroundColor: background || (hasImage ? void 0 : colors.white),
|
|
43656
43635
|
...hasImage && {
|
|
@@ -43660,11 +43639,11 @@ function Hero({ heading, description, primaryAction, secondaryAction, media, ali
|
|
|
43660
43639
|
},
|
|
43661
43640
|
overflow: "hidden",
|
|
43662
43641
|
...style
|
|
43663
|
-
}, children: [showOverlay && (0,
|
|
43642
|
+
}, children: [showOverlay && (0, import_jsx_runtime53.jsx)("div", { "aria-hidden": "true", style: {
|
|
43664
43643
|
position: "absolute",
|
|
43665
43644
|
inset: 0,
|
|
43666
43645
|
backgroundColor: "rgba(0, 0, 0, 0.5)"
|
|
43667
|
-
} }), (0,
|
|
43646
|
+
} }), (0, import_jsx_runtime53.jsxs)("div", { style: {
|
|
43668
43647
|
position: "relative",
|
|
43669
43648
|
maxWidth: "1280px",
|
|
43670
43649
|
margin: "0 auto",
|
|
@@ -43674,10 +43653,10 @@ function Hero({ heading, description, primaryAction, secondaryAction, media, ali
|
|
|
43674
43653
|
alignItems: align === "center" ? "center" : "center",
|
|
43675
43654
|
gap: "48px",
|
|
43676
43655
|
textAlign: align === "center" ? "center" : "left"
|
|
43677
|
-
}, children: [(0,
|
|
43656
|
+
}, children: [(0, import_jsx_runtime53.jsxs)("div", { style: {
|
|
43678
43657
|
flex: align === "left" && media ? "1 1 50%" : void 0,
|
|
43679
43658
|
maxWidth: align === "center" ? "800px" : void 0
|
|
43680
|
-
}, children: [heading && (0,
|
|
43659
|
+
}, children: [heading && (0, import_jsx_runtime53.jsx)("h1", { style: {
|
|
43681
43660
|
fontSize: sizeConfig2.headingSize,
|
|
43682
43661
|
fontWeight: fontWeight.bold,
|
|
43683
43662
|
lineHeight: lineHeight.tight,
|
|
@@ -43685,7 +43664,7 @@ function Hero({ heading, description, primaryAction, secondaryAction, media, ali
|
|
|
43685
43664
|
color: showOverlay ? colors.white : colors.gray[900],
|
|
43686
43665
|
margin: "0 0 16px 0",
|
|
43687
43666
|
padding: 0
|
|
43688
|
-
}, children: heading }), description && (0,
|
|
43667
|
+
}, children: heading }), description && (0, import_jsx_runtime53.jsx)("p", { style: {
|
|
43689
43668
|
fontSize: sizeConfig2.descSize,
|
|
43690
43669
|
lineHeight: lineHeight.relaxed,
|
|
43691
43670
|
color: showOverlay ? "rgba(255,255,255,0.9)" : colors.gray[600],
|
|
@@ -43693,12 +43672,12 @@ function Hero({ heading, description, primaryAction, secondaryAction, media, ali
|
|
|
43693
43672
|
padding: 0,
|
|
43694
43673
|
maxWidth: align === "center" ? "640px" : void 0,
|
|
43695
43674
|
...align === "center" && { marginLeft: "auto", marginRight: "auto" }
|
|
43696
|
-
}, children: description }), (primaryAction || secondaryAction) && (0,
|
|
43675
|
+
}, children: description }), (primaryAction || secondaryAction) && (0, import_jsx_runtime53.jsxs)("div", { style: {
|
|
43697
43676
|
display: "flex",
|
|
43698
43677
|
flexWrap: "wrap",
|
|
43699
43678
|
gap: "12px",
|
|
43700
43679
|
justifyContent: align === "center" ? "center" : "flex-start"
|
|
43701
|
-
}, children: [primaryAction && (0,
|
|
43680
|
+
}, children: [primaryAction && (0, import_jsx_runtime53.jsx)("button", { onClick: primaryAction.onClick, style: {
|
|
43702
43681
|
padding: "12px 28px",
|
|
43703
43682
|
fontSize: fontSize.base,
|
|
43704
43683
|
fontWeight: fontWeight.semibold,
|
|
@@ -43709,7 +43688,7 @@ function Hero({ heading, description, primaryAction, secondaryAction, media, ali
|
|
|
43709
43688
|
cursor: "pointer",
|
|
43710
43689
|
transition: "background-color 0.15s",
|
|
43711
43690
|
lineHeight: lineHeight.normal
|
|
43712
|
-
}, children: primaryAction.label }), secondaryAction && (0,
|
|
43691
|
+
}, children: primaryAction.label }), secondaryAction && (0, import_jsx_runtime53.jsx)("button", { onClick: secondaryAction.onClick, style: {
|
|
43713
43692
|
padding: "12px 28px",
|
|
43714
43693
|
fontSize: fontSize.base,
|
|
43715
43694
|
fontWeight: fontWeight.semibold,
|
|
@@ -43720,7 +43699,7 @@ function Hero({ heading, description, primaryAction, secondaryAction, media, ali
|
|
|
43720
43699
|
cursor: "pointer",
|
|
43721
43700
|
transition: "all 0.15s",
|
|
43722
43701
|
lineHeight: lineHeight.normal
|
|
43723
|
-
}, children: secondaryAction.label })] })] }), media && (0,
|
|
43702
|
+
}, children: secondaryAction.label })] })] }), media && (0, import_jsx_runtime53.jsx)("div", { style: {
|
|
43724
43703
|
flex: align === "left" ? "1 1 50%" : void 0,
|
|
43725
43704
|
display: "flex",
|
|
43726
43705
|
justifyContent: "center",
|
|
@@ -43734,9 +43713,9 @@ __export2(interact_exports, {
|
|
|
43734
43713
|
Hoverable: () => Hoverable,
|
|
43735
43714
|
Pressable: () => Pressable
|
|
43736
43715
|
});
|
|
43737
|
-
var Clickable = (0,
|
|
43738
|
-
const [hovered, setHovered] = (0,
|
|
43739
|
-
const [active, setActive] = (0,
|
|
43716
|
+
var Clickable = (0, import_react37.forwardRef)(function Clickable2({ children, onClick, onDoubleClick, hoverStyle, activeStyle, cursor, transition: transition2 = "all 200ms ease", disabled = false, role, "aria-label": ariaLabel, tabIndex, style, className, ...rest }, ref) {
|
|
43717
|
+
const [hovered, setHovered] = (0, import_react37.useState)(false);
|
|
43718
|
+
const [active, setActive] = (0, import_react37.useState)(false);
|
|
43740
43719
|
const hasClick = !!onClick;
|
|
43741
43720
|
const resolvedCursor = disabled ? "not-allowed" : cursor ?? (hasClick ? "pointer" : void 0);
|
|
43742
43721
|
const resolvedRole = role ?? (hasClick ? "button" : void 0);
|
|
@@ -43757,19 +43736,19 @@ var Clickable = (0, import_react42.forwardRef)(function Clickable2({ children, o
|
|
|
43757
43736
|
...hovered && !disabled ? hoverStyle : {},
|
|
43758
43737
|
...active && !disabled ? activeStyle : {}
|
|
43759
43738
|
};
|
|
43760
|
-
return (0,
|
|
43739
|
+
return (0, import_jsx_runtime54.jsx)("div", { ref, className, style: mergedStyle, onClick: disabled ? void 0 : onClick, onDoubleClick: disabled ? void 0 : onDoubleClick, onMouseEnter: () => setHovered(true), onMouseLeave: () => {
|
|
43761
43740
|
setHovered(false);
|
|
43762
43741
|
setActive(false);
|
|
43763
43742
|
}, onMouseDown: () => setActive(true), onMouseUp: () => setActive(false), onKeyDown: handleKeyDown, role: resolvedRole, "aria-label": ariaLabel, "aria-disabled": disabled || void 0, tabIndex: resolvedTabIndex, ...rest, children });
|
|
43764
43743
|
});
|
|
43765
|
-
var Hoverable = (0,
|
|
43766
|
-
const [hovered, setHovered] = (0,
|
|
43744
|
+
var Hoverable = (0, import_react38.forwardRef)(function Hoverable2({ children, hoverStyle, onHoverChange, transition: transition2 = "all 200ms ease", style, className, ...rest }, ref) {
|
|
43745
|
+
const [hovered, setHovered] = (0, import_react38.useState)(false);
|
|
43767
43746
|
const mergedStyle = {
|
|
43768
43747
|
...style,
|
|
43769
43748
|
transition: transition2,
|
|
43770
43749
|
...hovered ? hoverStyle : {}
|
|
43771
43750
|
};
|
|
43772
|
-
return (0,
|
|
43751
|
+
return (0, import_jsx_runtime55.jsx)("div", { ref, className, style: mergedStyle, onMouseEnter: () => {
|
|
43773
43752
|
setHovered(true);
|
|
43774
43753
|
onHoverChange?.(true);
|
|
43775
43754
|
}, onMouseLeave: () => {
|
|
@@ -43777,10 +43756,10 @@ var Hoverable = (0, import_react43.forwardRef)(function Hoverable2({ children, h
|
|
|
43777
43756
|
onHoverChange?.(false);
|
|
43778
43757
|
}, ...rest, children });
|
|
43779
43758
|
});
|
|
43780
|
-
var Pressable = (0,
|
|
43781
|
-
const [hovered, setHovered] = (0,
|
|
43782
|
-
const [pressed, setPressed] = (0,
|
|
43783
|
-
const [longPressTimer, setLongPressTimer] = (0,
|
|
43759
|
+
var Pressable = (0, import_react39.forwardRef)(function Pressable2({ children, onPress, onLongPress, longPressDelay = 500, hoverStyle, pressStyle, disabled = false, transition: transition2 = "all 150ms ease", role, "aria-label": ariaLabel, tabIndex, style, className, ...rest }, ref) {
|
|
43760
|
+
const [hovered, setHovered] = (0, import_react39.useState)(false);
|
|
43761
|
+
const [pressed, setPressed] = (0, import_react39.useState)(false);
|
|
43762
|
+
const [longPressTimer, setLongPressTimer] = (0, import_react39.useState)(null);
|
|
43784
43763
|
const hasPress = !!onPress || !!onLongPress;
|
|
43785
43764
|
const handleMouseDown = (e) => {
|
|
43786
43765
|
if (disabled)
|
|
@@ -43823,7 +43802,7 @@ var Pressable = (0, import_react44.forwardRef)(function Pressable2({ children, o
|
|
|
43823
43802
|
...pressed && !disabled ? pressStyle : {}
|
|
43824
43803
|
};
|
|
43825
43804
|
const content = typeof children === "function" ? children({ pressed, hovered }) : children;
|
|
43826
|
-
return (0,
|
|
43805
|
+
return (0, import_jsx_runtime56.jsx)("div", { ref, className, style: mergedStyle, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onMouseEnter: () => setHovered(true), onMouseLeave: () => {
|
|
43827
43806
|
setHovered(false);
|
|
43828
43807
|
setPressed(false);
|
|
43829
43808
|
if (longPressTimer)
|
|
@@ -46667,7 +46646,7 @@ function getTheme(id, mode = "light") {
|
|
|
46667
46646
|
function getDefaultThemeId() {
|
|
46668
46647
|
return "ggui";
|
|
46669
46648
|
}
|
|
46670
|
-
var ThemeContext = (0,
|
|
46649
|
+
var ThemeContext = (0, import_react40.createContext)(null);
|
|
46671
46650
|
var COLOR_MIX_SUPPORTS = "@supports (color: color-mix(in srgb, red, blue))";
|
|
46672
46651
|
function resolvePrimary500Hex(cssVariables) {
|
|
46673
46652
|
const match = cssVariables.match(/--ggui-color-primary-500:\s*(#[0-9a-fA-F]{3}|#[0-9a-fA-F]{6})\s*;/);
|
|
@@ -46992,19 +46971,26 @@ function replaceSpecifier(code, specifier, replacement) {
|
|
|
46992
46971
|
function globalExpr(gguiKey, legacyName) {
|
|
46993
46972
|
return `(globalThis.__ggui__&&globalThis.__ggui__["${gguiKey}"]||window["${legacyName}"])`;
|
|
46994
46973
|
}
|
|
46995
|
-
function
|
|
46974
|
+
function toDataUrl(js) {
|
|
46975
|
+
return `data:text/javascript,${encodeURIComponent(js)}`;
|
|
46976
|
+
}
|
|
46977
|
+
function jsReactShim(globalName) {
|
|
46996
46978
|
const namedExports = REACT_EXPORTS.map((e) => `export const ${e} = R.${e};`).join(" ");
|
|
46997
46979
|
const resolve = globalExpr("react", globalName);
|
|
46998
|
-
|
|
46999
|
-
return `data:text/javascript,${encodeURIComponent(js)}`;
|
|
46980
|
+
return `const R = ${resolve}; export default R; ${namedExports}`;
|
|
47000
46981
|
}
|
|
47001
|
-
function
|
|
46982
|
+
function buildDataUrlReactShim(globalName) {
|
|
46983
|
+
return toDataUrl(jsReactShim(globalName));
|
|
46984
|
+
}
|
|
46985
|
+
function jsReactDomShim() {
|
|
47002
46986
|
const REACT_DOM_EXPORTS = ["createPortal", "flushSync", "unstable_batchedUpdates"];
|
|
47003
46987
|
const namedExports = REACT_DOM_EXPORTS.map((e) => `export const ${e} = D.${e};`).join(" ");
|
|
47004
|
-
|
|
47005
|
-
return `data:text/javascript,${encodeURIComponent(js)}`;
|
|
46988
|
+
return `const D = globalThis.__ggui__["reactDom"]; export default D; ${namedExports}`;
|
|
47006
46989
|
}
|
|
47007
|
-
function
|
|
46990
|
+
function buildDataUrlReactDomShim() {
|
|
46991
|
+
return toDataUrl(jsReactDomShim());
|
|
46992
|
+
}
|
|
46993
|
+
function jsJsxShim(globalName) {
|
|
47008
46994
|
const resolve = globalExpr("react", globalName);
|
|
47009
46995
|
const js = [
|
|
47010
46996
|
`const R = ${resolve};`,
|
|
@@ -47017,9 +47003,12 @@ function buildDataUrlJsxShim(globalName) {
|
|
|
47017
47003
|
`export{jsx,jsx as jsxs,jsx as jsxDEV};`,
|
|
47018
47004
|
`export const Fragment=R.Fragment;`
|
|
47019
47005
|
].join("");
|
|
47020
|
-
return
|
|
47006
|
+
return js;
|
|
47021
47007
|
}
|
|
47022
|
-
function
|
|
47008
|
+
function buildDataUrlJsxShim(globalName) {
|
|
47009
|
+
return toDataUrl(jsJsxShim(globalName));
|
|
47010
|
+
}
|
|
47011
|
+
function jsGlobalShim(globalName, gguiKey, exportNames, fallbackGlobals, fallbackGguiKeys) {
|
|
47023
47012
|
if (exportNames && exportNames.length > 0) {
|
|
47024
47013
|
const globals = [globalName, ...fallbackGlobals || []];
|
|
47025
47014
|
const gguiKeys = [gguiKey, ...fallbackGguiKeys || []];
|
|
@@ -47030,17 +47019,20 @@ function buildDataUrlGlobalShim(globalName, gguiKey, exportNames, fallbackGlobal
|
|
|
47030
47019
|
));
|
|
47031
47020
|
const mergeExpr = resolveExprs.join(",");
|
|
47032
47021
|
const named = exportNames.map((n) => `export const ${n} = M["${n}"];`).join(" ");
|
|
47033
|
-
|
|
47034
|
-
return `data:text/javascript,${encodeURIComponent(js2)}`;
|
|
47022
|
+
return resolveExprs.length > 1 ? `const M = Object.assign({}, ${mergeExpr}); ${named} export default M;` : `const M = ${resolveExprs[0]}; ${named} export default M;`;
|
|
47035
47023
|
}
|
|
47036
47024
|
const resolve = globalExpr(gguiKey, globalName);
|
|
47037
|
-
|
|
47038
|
-
return `data:text/javascript,${encodeURIComponent(js)}`;
|
|
47025
|
+
return `const M = ${resolve} || {}; const handler = { get(_, key) { return M[key]; } }; export default new Proxy({}, handler);`;
|
|
47039
47026
|
}
|
|
47040
|
-
function
|
|
47027
|
+
function buildDataUrlGlobalShim(globalName, gguiKey, exportNames, fallbackGlobals, fallbackGguiKeys) {
|
|
47028
|
+
return toDataUrl(jsGlobalShim(globalName, gguiKey, exportNames, fallbackGlobals, fallbackGguiKeys));
|
|
47029
|
+
}
|
|
47030
|
+
function jsWireShim() {
|
|
47041
47031
|
const named = WIRE_EXPORTS.map((e) => `export const ${e} = w.${e};`).join(" ");
|
|
47042
|
-
|
|
47043
|
-
|
|
47032
|
+
return `const w = globalThis.__ggui__.wire; ${named} export default w;`;
|
|
47033
|
+
}
|
|
47034
|
+
function buildDataUrlWireShim() {
|
|
47035
|
+
return toDataUrl(jsWireShim());
|
|
47044
47036
|
}
|
|
47045
47037
|
function extractNamedImports(code, specifier) {
|
|
47046
47038
|
const esc2 = specifier.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -47057,7 +47049,7 @@ function extractNamedImports(code, specifier) {
|
|
|
47057
47049
|
}
|
|
47058
47050
|
return [...names];
|
|
47059
47051
|
}
|
|
47060
|
-
function
|
|
47052
|
+
function jsGadgetPackageShim(packageName, exportNames) {
|
|
47061
47053
|
const pkgLit = JSON.stringify(packageName);
|
|
47062
47054
|
const hasComponent = exportNames.some((n) => /^[A-Z]/.test(n));
|
|
47063
47055
|
const parts = [];
|
|
@@ -47074,7 +47066,10 @@ function buildGadgetPackageShim(packageName, exportNames) {
|
|
|
47074
47066
|
parts.push(`export const ${name}=${factory}(${JSON.stringify(name)});`);
|
|
47075
47067
|
}
|
|
47076
47068
|
parts.push(`export default new Proxy({},{get:function(_,k){return NS()[k];}});`);
|
|
47077
|
-
return
|
|
47069
|
+
return parts.join("");
|
|
47070
|
+
}
|
|
47071
|
+
function buildGadgetPackageShim(packageName, exportNames) {
|
|
47072
|
+
return toDataUrl(jsGadgetPackageShim(packageName, exportNames));
|
|
47078
47073
|
}
|
|
47079
47074
|
function rewriteDataUrl(code, opts) {
|
|
47080
47075
|
const reactGlobal = opts.reactGlobal ?? "__REACT";
|
|
@@ -47109,6 +47104,29 @@ function rewriteDataUrl(code, opts) {
|
|
|
47109
47104
|
}
|
|
47110
47105
|
return code;
|
|
47111
47106
|
}
|
|
47107
|
+
var ASSET_SHIM_FOR_SPECIFIER = {
|
|
47108
|
+
"react/jsx-runtime": "jsx-runtime",
|
|
47109
|
+
"react/jsx-dev-runtime": "jsx-runtime",
|
|
47110
|
+
"react-dom": "react-dom",
|
|
47111
|
+
react: "react",
|
|
47112
|
+
"@ggui-ai/design/primitives": "primitives",
|
|
47113
|
+
"@ggui-ai/design/components": "components",
|
|
47114
|
+
"@ggui-ai/design/compositions": "compositions",
|
|
47115
|
+
"@ggui-ai/design/interact": "interact",
|
|
47116
|
+
"@ggui-ai/design/templates": "templates",
|
|
47117
|
+
"@ggui-ai/design/app-components": "app-components",
|
|
47118
|
+
"@ggui-ai/design/tokens": "tokens",
|
|
47119
|
+
"@ggui-ai/design": "design",
|
|
47120
|
+
"@ggui-ai/wire": "wire",
|
|
47121
|
+
"@ggui-ai/gadgets": "gadgets"
|
|
47122
|
+
};
|
|
47123
|
+
function rewriteAssetUrl(code, opts) {
|
|
47124
|
+
const base = opts.shimBaseUrl.replace(/\/$/, "");
|
|
47125
|
+
for (const [specifier, shimName] of Object.entries(ASSET_SHIM_FOR_SPECIFIER)) {
|
|
47126
|
+
code = replaceSpecifier(code, specifier, `${base}/${shimName}.js`);
|
|
47127
|
+
}
|
|
47128
|
+
return code;
|
|
47129
|
+
}
|
|
47112
47130
|
function rewriteImportmap(code, opts) {
|
|
47113
47131
|
const base = opts.reactBaseUrl ?? "https://esm.sh/react@18.2.0";
|
|
47114
47132
|
code = replaceSpecifier(code, "react/jsx-runtime", `${base}/jsx-runtime`);
|
|
@@ -47122,6 +47140,8 @@ function rewriteImports(code, options) {
|
|
|
47122
47140
|
return rewriteDataUrl(code, options);
|
|
47123
47141
|
case "importmap":
|
|
47124
47142
|
return rewriteImportmap(code, options);
|
|
47143
|
+
case "asset-url":
|
|
47144
|
+
return rewriteAssetUrl(code, options);
|
|
47125
47145
|
}
|
|
47126
47146
|
}
|
|
47127
47147
|
function hoistImports(code) {
|
|
@@ -47159,7 +47179,7 @@ function makeScopeClass(reactId) {
|
|
|
47159
47179
|
}
|
|
47160
47180
|
var AUTO_RETRY_LIMIT = 1;
|
|
47161
47181
|
var AUTO_RETRY_DELAY = 500;
|
|
47162
|
-
var ErrorBoundary = class extends
|
|
47182
|
+
var ErrorBoundary = class extends import_react7.default.Component {
|
|
47163
47183
|
state = { error: null, catchCount: 0, autoRetrying: false };
|
|
47164
47184
|
retryTimer = null;
|
|
47165
47185
|
static getDerivedStateFromError(error210) {
|
|
@@ -47181,10 +47201,10 @@ var ErrorBoundary = class extends import_react12.default.Component {
|
|
|
47181
47201
|
if (this.retryTimer) clearTimeout(this.retryTimer);
|
|
47182
47202
|
}
|
|
47183
47203
|
render() {
|
|
47184
|
-
const { error: error210, autoRetrying
|
|
47204
|
+
const { error: error210, autoRetrying } = this.state;
|
|
47185
47205
|
if (!error210) return this.props.children;
|
|
47186
47206
|
if (autoRetrying) {
|
|
47187
|
-
return /* @__PURE__ */ (0,
|
|
47207
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { style: {
|
|
47188
47208
|
display: "flex",
|
|
47189
47209
|
alignItems: "center",
|
|
47190
47210
|
justifyContent: "center",
|
|
@@ -47193,21 +47213,22 @@ var ErrorBoundary = class extends import_react12.default.Component {
|
|
|
47193
47213
|
gap: 8,
|
|
47194
47214
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
47195
47215
|
fontSize: 13,
|
|
47196
|
-
color: "
|
|
47216
|
+
color: "var(--ggui-color-onSurface, inherit)",
|
|
47217
|
+
opacity: 0.6
|
|
47197
47218
|
}, children: [
|
|
47198
|
-
/* @__PURE__ */ (0,
|
|
47219
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { style: {
|
|
47199
47220
|
width: 16,
|
|
47200
47221
|
height: 16,
|
|
47201
|
-
border: "2px solid rgba(
|
|
47202
|
-
borderTopColor: "
|
|
47222
|
+
border: "2px solid rgba(128,128,128,0.25)",
|
|
47223
|
+
borderTopColor: "currentColor",
|
|
47203
47224
|
borderRadius: "50%",
|
|
47204
47225
|
animation: "ggui-err-spin 0.6s linear infinite"
|
|
47205
47226
|
} }),
|
|
47206
47227
|
"Retrying...",
|
|
47207
|
-
/* @__PURE__ */ (0,
|
|
47228
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("style", { children: `@keyframes ggui-err-spin { to { transform: rotate(360deg); } }` })
|
|
47208
47229
|
] });
|
|
47209
47230
|
}
|
|
47210
|
-
return /* @__PURE__ */ (0,
|
|
47231
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { style: {
|
|
47211
47232
|
display: "flex",
|
|
47212
47233
|
flexDirection: "column",
|
|
47213
47234
|
alignItems: "center",
|
|
@@ -47216,21 +47237,23 @@ var ErrorBoundary = class extends import_react12.default.Component {
|
|
|
47216
47237
|
minHeight: 120,
|
|
47217
47238
|
gap: 12,
|
|
47218
47239
|
textAlign: "center",
|
|
47219
|
-
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'
|
|
47240
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
47241
|
+
color: "var(--ggui-color-onSurface, inherit)"
|
|
47220
47242
|
}, children: [
|
|
47221
|
-
/* @__PURE__ */ (0,
|
|
47243
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { style: {
|
|
47222
47244
|
width: 48,
|
|
47223
47245
|
height: 48,
|
|
47224
47246
|
borderRadius: 14,
|
|
47225
47247
|
background: "rgba(239, 68, 68, 0.1)",
|
|
47248
|
+
color: "#ef4444",
|
|
47226
47249
|
display: "flex",
|
|
47227
47250
|
alignItems: "center",
|
|
47228
47251
|
justifyContent: "center",
|
|
47229
47252
|
fontSize: 22
|
|
47230
47253
|
}, children: "!" }),
|
|
47231
|
-
/* @__PURE__ */ (0,
|
|
47232
|
-
/* @__PURE__ */ (0,
|
|
47233
|
-
/* @__PURE__ */ (0,
|
|
47254
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { style: { fontSize: 14, fontWeight: 600, opacity: 0.9 }, children: "Something went wrong" }),
|
|
47255
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { style: { fontSize: 12, opacity: 0.6, maxWidth: 280, lineHeight: 1.4 }, children: "This component encountered an error. Try asking for a different view." }),
|
|
47256
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
47234
47257
|
"button",
|
|
47235
47258
|
{
|
|
47236
47259
|
onClick: () => this.setState({ error: null, catchCount: 0 }),
|
|
@@ -47238,9 +47261,10 @@ var ErrorBoundary = class extends import_react12.default.Component {
|
|
|
47238
47261
|
marginTop: 4,
|
|
47239
47262
|
padding: "8px 20px",
|
|
47240
47263
|
borderRadius: 8,
|
|
47241
|
-
border: "1px solid
|
|
47242
|
-
background: "
|
|
47243
|
-
color: "
|
|
47264
|
+
border: "1px solid currentColor",
|
|
47265
|
+
background: "transparent",
|
|
47266
|
+
color: "inherit",
|
|
47267
|
+
opacity: 0.75,
|
|
47244
47268
|
fontSize: 13,
|
|
47245
47269
|
fontWeight: 500,
|
|
47246
47270
|
cursor: "pointer"
|
|
@@ -47248,7 +47272,18 @@ var ErrorBoundary = class extends import_react12.default.Component {
|
|
|
47248
47272
|
children: "Retry"
|
|
47249
47273
|
}
|
|
47250
47274
|
),
|
|
47251
|
-
|
|
47275
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("details", { style: { marginTop: 8, maxWidth: 320, width: "100%", textAlign: "left", opacity: 0.65 }, children: [
|
|
47276
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("summary", { style: { fontSize: 11, cursor: "pointer" }, children: "Error details" }),
|
|
47277
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("pre", { style: {
|
|
47278
|
+
fontSize: 11,
|
|
47279
|
+
fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
47280
|
+
whiteSpace: "pre-wrap",
|
|
47281
|
+
overflowWrap: "anywhere",
|
|
47282
|
+
margin: "6px 0 0",
|
|
47283
|
+
maxHeight: 140,
|
|
47284
|
+
overflow: "auto"
|
|
47285
|
+
}, children: error210.message })
|
|
47286
|
+
] })
|
|
47252
47287
|
] });
|
|
47253
47288
|
}
|
|
47254
47289
|
};
|
|
@@ -47257,15 +47292,15 @@ function ReactComponentRenderer({
|
|
|
47257
47292
|
props = {},
|
|
47258
47293
|
themeId,
|
|
47259
47294
|
cssOverrides,
|
|
47260
|
-
fallback = /* @__PURE__ */ (0,
|
|
47295
|
+
fallback = /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { children: "Loading component..." }),
|
|
47261
47296
|
onError
|
|
47262
47297
|
}) {
|
|
47263
|
-
const reactId = (0,
|
|
47264
|
-
const [scopeClass] = (0,
|
|
47265
|
-
const [
|
|
47266
|
-
const [error210, setError] = (0,
|
|
47267
|
-
const [loading, setLoading] = (0,
|
|
47268
|
-
(0,
|
|
47298
|
+
const reactId = (0, import_react7.useId)();
|
|
47299
|
+
const [scopeClass] = (0, import_react7.useState)(() => makeScopeClass(reactId) || `ggui-rcr-${++scopeCounter}`);
|
|
47300
|
+
const [Component, setComponent] = (0, import_react7.useState)(null);
|
|
47301
|
+
const [error210, setError] = (0, import_react7.useState)(null);
|
|
47302
|
+
const [loading, setLoading] = (0, import_react7.useState)(true);
|
|
47303
|
+
(0, import_react7.useEffect)(() => {
|
|
47269
47304
|
if (!code || code.trim().length === 0) {
|
|
47270
47305
|
setComponent(null);
|
|
47271
47306
|
setLoading(false);
|
|
@@ -47293,7 +47328,7 @@ function ReactComponentRenderer({
|
|
|
47293
47328
|
} catch {
|
|
47294
47329
|
}
|
|
47295
47330
|
w.__ggui__ = {
|
|
47296
|
-
react:
|
|
47331
|
+
react: import_react7.default,
|
|
47297
47332
|
reactDom: reactDomModule,
|
|
47298
47333
|
primitives: primitives_exports,
|
|
47299
47334
|
components: components_exports,
|
|
@@ -47301,7 +47336,7 @@ function ReactComponentRenderer({
|
|
|
47301
47336
|
interact: interact_exports,
|
|
47302
47337
|
wire: dist_exports
|
|
47303
47338
|
};
|
|
47304
|
-
w.__REACT =
|
|
47339
|
+
w.__REACT = import_react7.default;
|
|
47305
47340
|
w.__GGUI_PRIMITIVES = primitives_exports;
|
|
47306
47341
|
w.__GGUI_COMPONENTS = components_exports;
|
|
47307
47342
|
w.__GGUI_COMPOSITIONS = compositions_exports;
|
|
@@ -47337,13 +47372,13 @@ function ReactComponentRenderer({
|
|
|
47337
47372
|
}, [code]);
|
|
47338
47373
|
const themeCss = themeId ? getScopedThemeCss(themeId, scopeClass) : getScopedCssTokens(scopeClass);
|
|
47339
47374
|
if (!code || code.trim().length === 0) {
|
|
47340
|
-
return /* @__PURE__ */ (0,
|
|
47375
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { children: fallback });
|
|
47341
47376
|
}
|
|
47342
47377
|
if (loading) {
|
|
47343
|
-
return /* @__PURE__ */ (0,
|
|
47378
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { children: fallback });
|
|
47344
47379
|
}
|
|
47345
47380
|
if (error210) {
|
|
47346
|
-
return /* @__PURE__ */ (0,
|
|
47381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { style: {
|
|
47347
47382
|
display: "flex",
|
|
47348
47383
|
flexDirection: "column",
|
|
47349
47384
|
alignItems: "center",
|
|
@@ -47354,7 +47389,7 @@ function ReactComponentRenderer({
|
|
|
47354
47389
|
textAlign: "center",
|
|
47355
47390
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'
|
|
47356
47391
|
}, children: [
|
|
47357
|
-
/* @__PURE__ */ (0,
|
|
47392
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { style: {
|
|
47358
47393
|
width: 48,
|
|
47359
47394
|
height: 48,
|
|
47360
47395
|
borderRadius: 14,
|
|
@@ -47364,52 +47399,26 @@ function ReactComponentRenderer({
|
|
|
47364
47399
|
justifyContent: "center",
|
|
47365
47400
|
fontSize: 22
|
|
47366
47401
|
}, children: "!" }),
|
|
47367
|
-
/* @__PURE__ */ (0,
|
|
47368
|
-
/* @__PURE__ */ (0,
|
|
47402
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { style: { fontSize: 14, fontWeight: 600, color: "rgba(255,255,255,0.8)" }, children: "Failed to load component" }),
|
|
47403
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { style: { fontSize: 12, color: "rgba(255,255,255,0.4)", maxWidth: 280, lineHeight: 1.4 }, children: error210.message })
|
|
47369
47404
|
] });
|
|
47370
47405
|
}
|
|
47371
|
-
if (!
|
|
47372
|
-
return /* @__PURE__ */ (0,
|
|
47406
|
+
if (!Component) {
|
|
47407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { children: fallback });
|
|
47373
47408
|
}
|
|
47374
|
-
return /* @__PURE__ */ (0,
|
|
47375
|
-
/* @__PURE__ */ (0,
|
|
47409
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: scopeClass, children: [
|
|
47410
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("style", { children: [
|
|
47376
47411
|
themeCss,
|
|
47377
47412
|
cssOverrides ?? ""
|
|
47378
47413
|
] }),
|
|
47379
|
-
/* @__PURE__ */ (0,
|
|
47414
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(ErrorBoundary, { onError, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Component, { ...props }) }, code.length)
|
|
47380
47415
|
] });
|
|
47381
47416
|
}
|
|
47382
|
-
var previewShimmerKeyframes = `@keyframes ggui-preview-shimmer {
|
|
47383
|
-
0% { transform: translateX(-100%); }
|
|
47384
|
-
100% { transform: translateX(100%); }
|
|
47385
|
-
}`;
|
|
47386
|
-
var previewCaretKeyframes = `@keyframes ggui-preview-caret {
|
|
47387
|
-
0%, 45% { opacity: 1; }
|
|
47388
|
-
55%, 100% { opacity: 0; }
|
|
47389
|
-
}`;
|
|
47390
|
-
var previewFragmentEnterKeyframes = `@keyframes ggui-preview-fragment-enter {
|
|
47391
|
-
from { opacity: 0; transform: scale(0.97); }
|
|
47392
|
-
to { opacity: 1; transform: scale(1); }
|
|
47393
|
-
}`;
|
|
47394
|
-
var previewReducedMotionCSS = `@media (prefers-reduced-motion: reduce) {
|
|
47395
|
-
[data-ggui-preview] *,
|
|
47396
|
-
[data-ggui-preview]::before,
|
|
47397
|
-
[data-ggui-preview]::after {
|
|
47398
|
-
animation-duration: 0.01ms !important;
|
|
47399
|
-
animation-iteration-count: 1 !important;
|
|
47400
|
-
transition-duration: 0.01ms !important;
|
|
47401
|
-
}
|
|
47402
|
-
}`;
|
|
47403
|
-
var previewKeyframesCss = [
|
|
47404
|
-
previewShimmerKeyframes,
|
|
47405
|
-
previewCaretKeyframes,
|
|
47406
|
-
previewFragmentEnterKeyframes,
|
|
47407
|
-
previewReducedMotionCSS
|
|
47408
|
-
].join("\n\n");
|
|
47409
47417
|
var DynamicComponent = ReactComponentRenderer;
|
|
47418
|
+
var DECODER = new TextDecoder();
|
|
47410
47419
|
|
|
47411
47420
|
// hub-preview-client/main.tsx
|
|
47412
|
-
var
|
|
47421
|
+
var import_jsx_runtime62 = __toESM(require_jsx_runtime(), 1);
|
|
47413
47422
|
function bootstrap() {
|
|
47414
47423
|
const boot = window.__GGUI_DEV_PREVIEW__;
|
|
47415
47424
|
return {
|
|
@@ -47473,11 +47482,11 @@ function PreviewApp({
|
|
|
47473
47482
|
token,
|
|
47474
47483
|
selectedId
|
|
47475
47484
|
}) {
|
|
47476
|
-
const [state, setState] = (0,
|
|
47485
|
+
const [state, setState] = (0, import_react43.useState)(
|
|
47477
47486
|
selectedId ? { kind: "loading" } : { kind: "idle" }
|
|
47478
47487
|
);
|
|
47479
|
-
const [version2, setVersion] = (0,
|
|
47480
|
-
(0,
|
|
47488
|
+
const [version2, setVersion] = (0, import_react43.useState)(0);
|
|
47489
|
+
(0, import_react43.useEffect)(() => {
|
|
47481
47490
|
if (!selectedId) {
|
|
47482
47491
|
setState({ kind: "idle" });
|
|
47483
47492
|
return;
|
|
@@ -47490,7 +47499,7 @@ function PreviewApp({
|
|
|
47490
47499
|
});
|
|
47491
47500
|
return () => controller.abort();
|
|
47492
47501
|
}, [selectedId, token, version2]);
|
|
47493
|
-
(0,
|
|
47502
|
+
(0, import_react43.useEffect)(() => {
|
|
47494
47503
|
if (!selectedId) return;
|
|
47495
47504
|
const controller = new AbortController();
|
|
47496
47505
|
subscribeToRegistry(token, controller.signal, (event) => {
|
|
@@ -47500,90 +47509,90 @@ function PreviewApp({
|
|
|
47500
47509
|
return () => controller.abort();
|
|
47501
47510
|
}, [selectedId, token]);
|
|
47502
47511
|
if (state.kind === "idle") {
|
|
47503
|
-
return /* @__PURE__ */ (0,
|
|
47504
|
-
/* @__PURE__ */ (0,
|
|
47505
|
-
/* @__PURE__ */ (0,
|
|
47512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Pane, { children: [
|
|
47513
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Meta, { children: "No UI selected" }),
|
|
47514
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Status, { children: "Pick a UI from the Discovered UIs panel to preview it here." })
|
|
47506
47515
|
] });
|
|
47507
47516
|
}
|
|
47508
47517
|
if (state.kind === "loading") {
|
|
47509
|
-
return /* @__PURE__ */ (0,
|
|
47510
|
-
/* @__PURE__ */ (0,
|
|
47518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Pane, { children: [
|
|
47519
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Meta, { children: [
|
|
47511
47520
|
"Preview of ",
|
|
47512
|
-
/* @__PURE__ */ (0,
|
|
47521
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("code", { children: selectedId })
|
|
47513
47522
|
] }),
|
|
47514
|
-
/* @__PURE__ */ (0,
|
|
47523
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Status, { children: "Loading bundle\u2026" })
|
|
47515
47524
|
] });
|
|
47516
47525
|
}
|
|
47517
47526
|
if (state.kind === "ready") {
|
|
47518
|
-
return /* @__PURE__ */ (0,
|
|
47527
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "surface", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(DynamicComponent, { code: state.code }) });
|
|
47519
47528
|
}
|
|
47520
47529
|
if (state.kind === "not-found") {
|
|
47521
|
-
return /* @__PURE__ */ (0,
|
|
47522
|
-
/* @__PURE__ */ (0,
|
|
47530
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Pane, { children: [
|
|
47531
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Meta, { children: [
|
|
47523
47532
|
"Preview of ",
|
|
47524
|
-
/* @__PURE__ */ (0,
|
|
47533
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("code", { children: selectedId })
|
|
47525
47534
|
] }),
|
|
47526
|
-
/* @__PURE__ */ (0,
|
|
47535
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Status, { children: "The server doesn't know this id. It may have been removed from the registry." })
|
|
47527
47536
|
] });
|
|
47528
47537
|
}
|
|
47529
47538
|
if (state.kind === "missing") {
|
|
47530
|
-
return /* @__PURE__ */ (0,
|
|
47531
|
-
/* @__PURE__ */ (0,
|
|
47532
|
-
/* @__PURE__ */ (0,
|
|
47539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Pane, { children: [
|
|
47540
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Meta, { children: "No renderable entry" }),
|
|
47541
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Status, { children: [
|
|
47533
47542
|
"Declare ",
|
|
47534
|
-
/* @__PURE__ */ (0,
|
|
47543
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("code", { children: "entryPoint" }),
|
|
47535
47544
|
" in ",
|
|
47536
|
-
/* @__PURE__ */ (0,
|
|
47545
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("code", { children: "ggui.ui.json" }),
|
|
47537
47546
|
", or colocate a ",
|
|
47538
|
-
/* @__PURE__ */ (0,
|
|
47547
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("code", { children: "ggui.ui.tsx" }),
|
|
47539
47548
|
" beside the manifest."
|
|
47540
47549
|
] }),
|
|
47541
|
-
state.tried.length > 0 && /* @__PURE__ */ (0,
|
|
47550
|
+
state.tried.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("pre", { className: "tried", children: state.tried.join("\n") })
|
|
47542
47551
|
] });
|
|
47543
47552
|
}
|
|
47544
47553
|
if (state.kind === "compile") {
|
|
47545
|
-
return /* @__PURE__ */ (0,
|
|
47546
|
-
/* @__PURE__ */ (0,
|
|
47547
|
-
/* @__PURE__ */ (0,
|
|
47554
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Pane, { children: [
|
|
47555
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Meta, { children: "Local compile failed" }),
|
|
47556
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("ul", { className: "errors", children: state.detail.errors.map((err, i) => {
|
|
47548
47557
|
const loc = err.location;
|
|
47549
47558
|
const locLine = loc ? `${loc.file ?? state.detail.entry}:${loc.line ?? "?"}:${loc.column ?? "?"}` : state.detail.entry;
|
|
47550
|
-
return /* @__PURE__ */ (0,
|
|
47551
|
-
/* @__PURE__ */ (0,
|
|
47552
|
-
/* @__PURE__ */ (0,
|
|
47553
|
-
loc?.lineText && /* @__PURE__ */ (0,
|
|
47559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("li", { children: [
|
|
47560
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("pre", { className: "location", children: locLine }),
|
|
47561
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("pre", { className: "error", children: err.text }),
|
|
47562
|
+
loc?.lineText && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("pre", { className: "line-text", children: loc.lineText })
|
|
47554
47563
|
] }, i);
|
|
47555
47564
|
}) })
|
|
47556
47565
|
] });
|
|
47557
47566
|
}
|
|
47558
47567
|
if (state.kind === "http") {
|
|
47559
|
-
return /* @__PURE__ */ (0,
|
|
47560
|
-
/* @__PURE__ */ (0,
|
|
47568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Pane, { children: [
|
|
47569
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Meta, { children: [
|
|
47561
47570
|
"Bundle fetch failed (HTTP ",
|
|
47562
47571
|
state.status,
|
|
47563
47572
|
")"
|
|
47564
47573
|
] }),
|
|
47565
|
-
/* @__PURE__ */ (0,
|
|
47574
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Status, { children: state.message })
|
|
47566
47575
|
] });
|
|
47567
47576
|
}
|
|
47568
|
-
return /* @__PURE__ */ (0,
|
|
47569
|
-
/* @__PURE__ */ (0,
|
|
47570
|
-
/* @__PURE__ */ (0,
|
|
47577
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Pane, { children: [
|
|
47578
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Meta, { children: "Local ggui dev server is unreachable" }),
|
|
47579
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Status, { children: [
|
|
47571
47580
|
"Studio could not reach the server \u2014 is ",
|
|
47572
|
-
/* @__PURE__ */ (0,
|
|
47581
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("code", { children: "ggui dev" }),
|
|
47573
47582
|
" still running?",
|
|
47574
|
-
/* @__PURE__ */ (0,
|
|
47575
|
-
/* @__PURE__ */ (0,
|
|
47583
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("br", {}),
|
|
47584
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "dim", children: state.message })
|
|
47576
47585
|
] })
|
|
47577
47586
|
] });
|
|
47578
47587
|
}
|
|
47579
47588
|
function Pane({ children }) {
|
|
47580
|
-
return /* @__PURE__ */ (0,
|
|
47589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "frame", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "pane", children }) });
|
|
47581
47590
|
}
|
|
47582
47591
|
function Meta({ children }) {
|
|
47583
|
-
return /* @__PURE__ */ (0,
|
|
47592
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "meta", children });
|
|
47584
47593
|
}
|
|
47585
47594
|
function Status({ children }) {
|
|
47586
|
-
return /* @__PURE__ */ (0,
|
|
47595
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "status", children });
|
|
47587
47596
|
}
|
|
47588
47597
|
async function subscribeToRegistry(token, signal, onEvent) {
|
|
47589
47598
|
let backoff = 500;
|
|
@@ -47652,7 +47661,7 @@ function mount() {
|
|
|
47652
47661
|
if (!root) throw new Error("preview-root element not found in shell");
|
|
47653
47662
|
const { token, selectedId } = bootstrap();
|
|
47654
47663
|
(0, import_client.createRoot)(root).render(
|
|
47655
|
-
/* @__PURE__ */ (0,
|
|
47664
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react43.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(PreviewApp, { token, selectedId }) })
|
|
47656
47665
|
);
|
|
47657
47666
|
}
|
|
47658
47667
|
mount();
|