bi-sdk-react 0.0.10 → 0.0.11

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.
@@ -84,7 +84,7 @@ const Container = styled.div`
84
84
  box-sizing: border-box;
85
85
  }
86
86
  & > div {
87
- height: calc(100vh - 40px);
87
+ height: calc(100vh - 49px);
88
88
  display: flex;
89
89
  flex-direction: column;
90
90
  }
@@ -167,6 +167,29 @@ const Container = styled.div`
167
167
  border-right: solid 2px #1890ff;
168
168
  background: linear-gradient(to left, #1890ff1a, #ffffff);
169
169
  }
170
+
171
+ .beautified_scrollbar {
172
+ overflow: auto;
173
+ scrollbar-width: none;
174
+ &::-webkit-scrollbar {
175
+ width: 0;
176
+ height: 0;
177
+ }
178
+ &:hover {
179
+ scrollbar-width: thin;
180
+ }
181
+ &:hover::-webkit-scrollbar {
182
+ width: 8px;
183
+ height: 8px;
184
+ }
185
+ &:hover::-webkit-scrollbar-thumb {
186
+ background: var(--ant-color-border);
187
+ border-radius: 4px;
188
+ }
189
+ &:hover::-webkit-scrollbar-track {
190
+ background: transparent;
191
+ }
192
+ }
170
193
  `;
171
194
 
172
195
  const ImportModal: React.FC<{
@@ -181,7 +204,7 @@ const ImportModal: React.FC<{
181
204
  scripts: [],
182
205
  variables: [],
183
206
  items: [],
184
- })
207
+ }),
185
208
  );
186
209
  return (
187
210
  <Modal
@@ -227,7 +250,7 @@ export const PageDesigner = React.forwardRef<any, PageDesignerProps>(
227
250
  onSave,
228
251
  loading = false,
229
252
  },
230
- ref
253
+ ref,
231
254
  ) => {
232
255
  const pageCanvasRef = useRef<any>(null);
233
256
  const datasetPanelRef = useRef<any>(null);
@@ -253,7 +276,7 @@ export const PageDesigner = React.forwardRef<any, PageDesignerProps>(
253
276
  const [showLeft, setShowLeft] = useState(true);
254
277
  const [showRight, setShowRight] = useState(true);
255
278
  const [selectedItem, setSelectedItem] = useState<SchemaItemType | null>(
256
- null
279
+ null,
257
280
  );
258
281
  const [schema, setSchema] = useState<PageSchema>({
259
282
  info: {},
@@ -272,11 +295,11 @@ export const PageDesigner = React.forwardRef<any, PageDesignerProps>(
272
295
  }, [showLeft, showRight]);
273
296
  const leftStyle = useMemo(
274
297
  () => ({ display: showLeft ? "flex" : "none" }),
275
- [showLeft]
298
+ [showLeft],
276
299
  );
277
300
  const rightStyle = useMemo(
278
301
  () => ({ display: showRight ? "flex" : "none" }),
279
- [showRight]
302
+ [showRight],
280
303
  );
281
304
  useDeepCompareEffect(() => {
282
305
  if (isReplaying) return;
@@ -310,7 +333,7 @@ export const PageDesigner = React.forwardRef<any, PageDesignerProps>(
310
333
  if (Array.isArray(item.children[k])) {
311
334
  ensureIds(
312
335
  item.children[k],
313
- Math.random().toString(36).slice(2, 10)
336
+ Math.random().toString(36).slice(2, 10),
314
337
  );
315
338
  }
316
339
  });
@@ -375,7 +398,7 @@ export const PageDesigner = React.forwardRef<any, PageDesignerProps>(
375
398
  setSchema(effect.schema);
376
399
  } else if (effect.pageItems?.length) {
377
400
  const effectItemMap = new Map(
378
- effect.pageItems.map((item) => [item.id, item])
401
+ effect.pageItems.map((item) => [item.id, item]),
379
402
  );
380
403
  const cloneSchema = JSON.parse(JSON.stringify(schema));
381
404
  const loop = (list: any[] = []) => {
@@ -640,7 +663,9 @@ export const PageDesigner = React.forwardRef<any, PageDesignerProps>(
640
663
  </Space>
641
664
  }
642
665
  />
643
- <div className={["body", deviceType].join(" ")}>
666
+ <div
667
+ className={["body beautified_scrollbar", deviceType].join(" ")}
668
+ >
644
669
  <div
645
670
  style={{
646
671
  transform: `scale(${zoom})`,
@@ -664,9 +689,14 @@ export const PageDesigner = React.forwardRef<any, PageDesignerProps>(
664
689
  width: "calc(100% - 47px)",
665
690
  }}
666
691
  >
667
- {rightActiveKey === "ai" && fetch?.ai && (
668
- <AiPanel agentList={agentList} onEffect={handleAiEffect} />
669
- )}
692
+ <AiPanel
693
+ agentList={agentList}
694
+ onEffect={handleAiEffect}
695
+ style={{
696
+ display:
697
+ rightActiveKey === "ai" && fetch?.ai ? undefined : "none",
698
+ }}
699
+ />
670
700
  {rightActiveKey === "props" && (
671
701
  <PropertiesPanel datasourceEnable={datasourceEnable} />
672
702
  )}
@@ -782,7 +812,7 @@ export const PageDesigner = React.forwardRef<any, PageDesignerProps>(
782
812
  </Drawer>
783
813
  </PageProvider>
784
814
  );
785
- }
815
+ },
786
816
  );
787
817
 
788
818
  export default PageDesigner;
@@ -473,26 +473,7 @@ const MessageRoot = styled.div`
473
473
  flex-direction: column;
474
474
  gap: 12px;
475
475
  padding-right: 8px;
476
- overflow: auto;
477
- scrollbar-width: none;
478
- &::-webkit-scrollbar {
479
- width: 0;
480
- height: 0;
481
- }
482
- &:hover {
483
- scrollbar-width: thin;
484
- }
485
- &:hover::-webkit-scrollbar {
486
- width: 8px;
487
- height: 8px;
488
- }
489
- &:hover::-webkit-scrollbar-thumb {
490
- background: var(--ant-color-border);
491
- border-radius: 4px;
492
- }
493
- &:hover::-webkit-scrollbar-track {
494
- background: transparent;
495
- }
476
+
496
477
  .msg {
497
478
  display: flex;
498
479
  flex-direction: column;
@@ -636,7 +617,7 @@ const MessageList = forwardRef<
636
617
  }));
637
618
 
638
619
  return (
639
- <MessageRoot className="message-list" ref={ref}>
620
+ <MessageRoot className="message-list beautified_scrollbar" ref={ref}>
640
621
  {list.map((msg) => (
641
622
  <div className="msg" key={msg.id}>
642
623
  <div className="user-message">
@@ -127,7 +127,7 @@ export const CascadePanel: React.FC = ({}) => {
127
127
  ) : null
128
128
  }
129
129
  />
130
- <div className="body">
130
+ <div className="body beautified_scrollbar">
131
131
  {selectedItem?.cascadeIds && (
132
132
  <ul>
133
133
  {(selectedItem.cascadeIds || []).map(
@@ -102,7 +102,7 @@ export const ComponentPanel: React.FC = () => {
102
102
  return (
103
103
  <Root className="component-panel">
104
104
  <PaneHeader title="组件库" />
105
- <div className="body">
105
+ <div className="body beautified_scrollbar">
106
106
  {grouped.map((group) => (
107
107
  <div className="plugin-group" key={group.group}>
108
108
  <div className="group-title">{group.group}</div>
@@ -57,7 +57,7 @@ export const DatasetPanel = React.forwardRef<
57
57
  </Space>
58
58
  }
59
59
  />
60
- <div className="body">
60
+ <div className="body beautified_scrollbar">
61
61
  <DatasetPanelComponent ref={ref} />
62
62
  </div>
63
63
  </Root>
@@ -223,7 +223,7 @@ export const DatasourcePanel: React.FC = () => {
223
223
  </Space>
224
224
  }
225
225
  />
226
- <div className="body">
226
+ <div className="body beautified_scrollbar">
227
227
  <ul>
228
228
  {list.map((item, index) => (
229
229
  <li key={item.id}>
@@ -214,7 +214,7 @@ export const LayerPanel: React.FC = () => {
214
214
  </Space>
215
215
  }
216
216
  />
217
- <div className="body">
217
+ <div className="body beautified_scrollbar">
218
218
  <DraggableTree
219
219
  draggable={{
220
220
  icon: false,
@@ -156,7 +156,7 @@ export const PropertiesPanel: React.FC<{
156
156
  </Radio.Group>
157
157
  }
158
158
  />
159
- <div className="body">
159
+ <div className="body beautified_scrollbar">
160
160
  {activeTab === "1" && (
161
161
  <Form
162
162
  labelCol={{ span: 24 }}
@@ -88,7 +88,7 @@ export const ScriptPanel: React.FC = () => {
88
88
  </Space>
89
89
  }
90
90
  />
91
- <div className="body">
91
+ <div className="body beautified_scrollbar">
92
92
  <ul>
93
93
  {list.map((item, index) => (
94
94
  <li key={item.id || index}>
@@ -104,7 +104,7 @@ export const VariablesPanel: React.FC = () => {
104
104
  </Space>
105
105
  }
106
106
  />
107
- <div className="body">
107
+ <div className="body beautified_scrollbar">
108
108
  <Table
109
109
  rowKey={(r) => r.id || r.name}
110
110
  dataSource={list}
@@ -56,7 +56,7 @@ export const HtmlRender: React.FC<HtmlRenderProps> = ({
56
56
  const html = useMemo(
57
57
  () =>
58
58
  (template || "").replace(
59
- /{{\s*([^}]+)\s*}}/g,
59
+ /{ *{\s*([^}]+)\s*} *}/g,
60
60
  (_match: any, p1: string) => {
61
61
  try {
62
62
  return (func(p1) as any)(...args);