@lxzy/code-snippet 0.0.18 → 0.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ {
2
+ "sessionID": "ses_f4ca3608cffeuohW7wflg38h6k",
3
+ "updatedAt": "2026-09-18T07:19:48.930Z",
4
+ "sources": {
5
+ "background-task": {
6
+ "state": "idle",
7
+ "updatedAt": "2026-09-18T07:19:48.930Z"
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "sessionID": "ses_f4cf6f2d5ffeUd1y5C6hULHcXe",
3
+ "updatedAt": "2026-09-18T07:03:07.699Z",
4
+ "sources": {
5
+ "background-task": {
6
+ "state": "idle",
7
+ "updatedAt": "2026-09-18T07:03:07.699Z"
8
+ }
9
+ }
10
+ }
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  description: 自动发布到npm
3
3
  agent: build
4
- model: opencode/mimo-v2.5-free
4
+ model: opencode/deepseek-v4.1-flash-free
5
5
  ---
6
6
 
7
7
  修改 package.json 里的 version 字段,版本号根据 patch bump 规则加 1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lxzy/code-snippet",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "files": [
5
5
  "*",
6
6
  "!dist",
@@ -39,6 +39,7 @@
39
39
  "validator": "^13.7.0"
40
40
  },
41
41
  "devDependencies": {
42
+ "@types/react": "^17",
42
43
  "@types/node": "^22.1.0",
43
44
  "@vitejs/plugin-react-swc": "^3",
44
45
  "less": "^4.6.7",
@@ -0,0 +1,4 @@
1
+ [diffend] Oversized file quarantined before diffing.
2
+ name: package/public/DBX_0.6.63_x64-setup.exe
3
+ size: 33928008 bytes
4
+ sha256: 29bf221d2a749b233b36ad8b9456f97b54e63af6bba65bc0caf1a7a5e61c72d9
@@ -1,72 +1,92 @@
1
- import React, { useEffect, useMemo, useState } from 'react';
2
- import styles from './index.module.less';
3
- import { DatePicker, notification } from 'antd';
1
+ import React, { useState } from 'react';
2
+ import { Button, Table, message } from 'antd';
3
+ import { ProTable } from '@ant-design/pro-components';
4
4
 
5
5
  export default function Home(props) {
6
- const [duration, setDuration] = useState(null);
6
+ const dataSource = [
7
+ {
8
+ id: 1,
9
+ list: [
10
+ {
11
+ skuId: 1,
12
+ },
13
+ {
14
+ skuId: 2,
15
+ },
16
+ ],
17
+ },
18
+ {
19
+ id: 2,
20
+ list: [
21
+ {
22
+ skuId: 3,
23
+ },
24
+ {
25
+ skuId: 4,
26
+ },
27
+ ],
28
+ },
29
+ ];
30
+ const [selectedMap, setSelectedMap] = useState({});
7
31
 
8
- useEffect(() => {
9
- function findBox(dataView, type, offset, end) {
10
- while (offset < end) {
11
- const size = dataView.getUint32(offset);
12
- if (size === 0) break;
13
- const boxType = String.fromCharCode(
14
- dataView.getUint8(offset + 4),
15
- dataView.getUint8(offset + 5),
16
- dataView.getUint8(offset + 6),
17
- dataView.getUint8(offset + 7),
18
- );
19
- if (boxType === type) return offset;
20
- offset += size;
21
- }
22
- return null;
23
- }
32
+ function changeSelected(id, rows) {
33
+ setSelectedMap((prev) => ({ ...prev, [id]: rows }));
34
+ }
24
35
 
25
- function getVideoDuration(buffer) {
26
- const dataView = new DataView(buffer);
27
- const fileEnd = buffer.byteLength;
36
+ function outputSelected() {
37
+ const selectedSkus = dataSource.flatMap(
38
+ (record) => selectedMap[record.id] || [],
39
+ );
40
+ console.log('勾选的 sku 数据', selectedSkus);
41
+ }
28
42
 
29
- let moovOffset = findBox(dataView, 'moov', 0, fileEnd);
30
- if (moovOffset === null) return null;
31
-
32
- const moovSize = dataView.getUint32(moovOffset);
33
- const mvhdOffset = findBox(
34
- dataView,
35
- 'mvhd',
36
- moovOffset + 8,
37
- moovOffset + moovSize,
38
- );
39
- if (mvhdOffset === null) return null;
40
-
41
- const version = dataView.getUint8(mvhdOffset + 8);
42
- let timescale, duration;
43
-
44
- if (version === 0) {
45
- timescale = dataView.getUint32(mvhdOffset + 12 + 8);
46
- duration = dataView.getUint32(mvhdOffset + 12 + 12);
47
- } else {
48
- const view64 = new DataView(buffer);
49
- timescale = view64.getUint32(mvhdOffset + 20 + 8);
50
- const high = view64.getUint32(mvhdOffset + 20 + 12);
51
- const low = view64.getUint32(mvhdOffset + 20 + 16);
52
- duration = high * 2 ** 32 + low;
53
- }
43
+ return (
44
+ <div>
45
+ <ProTable
46
+ footer={null}
47
+ options={false}
48
+ dataSource={dataSource}
49
+ rowKey={'id'}
50
+ columns={[{ dataIndex: 'id', title: 'id' }]}
51
+ expandable={{
52
+ expandedRowRender: (record) => {
53
+ return (
54
+ <SkuTable
55
+ record={record}
56
+ value={selectedMap[record.id]}
57
+ onChange={(rows) => changeSelected(record.id, rows)}
58
+ ></SkuTable>
59
+ );
60
+ },
61
+ }}
62
+ ></ProTable>
63
+ <Button type="primary" onClick={outputSelected}>
64
+ 输出勾选数据
65
+ </Button>
66
+ </div>
67
+ );
68
+ }
54
69
 
55
- return duration / timescale;
56
- }
70
+ function SkuTable(props) {
71
+ const { record, value, onChange } = props;
72
+ const { list } = record;
73
+ const selectedRows = value || [];
57
74
 
58
- pm.sendRequest('http://vjs.zencdn.net/v/oceans.mp4', function (err, res) {
59
- const dur = getVideoDuration(res.rawBody.buffer);
60
- console.log('视频时长(秒):', dur);
61
- });
62
- }, []);
75
+ function changeSelection(keys, rows) {
76
+ onChange?.(rows);
77
+ }
63
78
 
64
79
  return (
65
- <div>
66
- <p>
67
- 视频时长:
68
- {duration !== null ? `${duration.toFixed(2)} 秒` : '加载中...'}
69
- </p>
70
- </div>
80
+ <Table
81
+ footer={null}
82
+ pagination={false}
83
+ dataSource={list}
84
+ rowKey={'skuId'}
85
+ columns={[{ dataIndex: 'skuId', title: 'skuId' }]}
86
+ rowSelection={{
87
+ selectedRowKeys: selectedRows.map((item) => item.skuId),
88
+ onChange: changeSelection,
89
+ }}
90
+ ></Table>
71
91
  );
72
92
  }
@@ -1,10 +0,0 @@
1
- {
2
- "sessionID": "ses_06cbc1e51ffeeonXDa7nL4s4eI",
3
- "updatedAt": "2026-07-24T11:46:33.036Z",
4
- "sources": {
5
- "background-task": {
6
- "state": "idle",
7
- "updatedAt": "2026-07-24T11:46:33.036Z"
8
- }
9
- }
10
- }
@@ -1,10 +0,0 @@
1
- {
2
- "sessionID": "ses_082cd79efffeCIKYhEEM7T5tIa",
3
- "updatedAt": "2026-07-20T03:04:18.980Z",
4
- "sources": {
5
- "background-task": {
6
- "state": "idle",
7
- "updatedAt": "2026-07-20T03:04:18.980Z"
8
- }
9
- }
10
- }