@blocklet/ui-react 3.4.15 → 3.5.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/lib/common/org-switch/use-org.d.ts +4 -4
- package/package.json +9 -6
- package/.aigne/doc-smith/.local/afs-storage.sqlite3 +0 -0
- package/.aigne/doc-smith/config.yaml +0 -78
- package/.aigne/doc-smith/history.yaml +0 -14
- package/.aigne/doc-smith/media-description.yaml +0 -11
- package/.aigne/doc-smith/output/structure-plan.json +0 -255
- package/.aigne/doc-smith/translation-cache.yaml +0 -11
- package/.aigne/doc-smith/upload-cache.yaml +0 -528
- package/build.config.ts +0 -24
- package/docs/_sidebar.md +0 -19
- package/docs/assets/diagram/component-installer-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/component-installer-diagram-0.jpg +0 -0
- package/docs/assets/diagram/component-installer-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/component-installer-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/component-management-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/component-management-diagram-0.jpg +0 -0
- package/docs/assets/diagram/component-management-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/component-management-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/core-concepts-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/core-concepts-diagram-0.jpg +0 -0
- package/docs/assets/diagram/core-concepts-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/core-concepts-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/dashboard-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/dashboard-diagram-0.jpg +0 -0
- package/docs/assets/diagram/dashboard-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/dashboard-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/header-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/header-diagram-0.jpg +0 -0
- package/docs/assets/diagram/header-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/header-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/layout-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/layout-diagram-0.jpg +0 -0
- package/docs/assets/diagram/layout-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/layout-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/notifications-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/notifications-diagram-0.jpg +0 -0
- package/docs/assets/diagram/notifications-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/notifications-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/overview-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/overview-diagram-0.jpg +0 -0
- package/docs/assets/diagram/overview-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/overview-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/user-center-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/user-center-diagram-0.jpg +0 -0
- package/docs/assets/diagram/user-center-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/user-center-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/user-management-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/user-management-diagram-0.jpg +0 -0
- package/docs/assets/diagram/user-management-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/user-management-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/user-sessions-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/user-sessions-diagram-0.jpg +0 -0
- package/docs/assets/diagram/user-sessions-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/user-sessions-diagram-0.zh.jpg +0 -0
- package/docs/components-component-management-blocklet-studio.ja.md +0 -194
- package/docs/components-component-management-blocklet-studio.md +0 -194
- package/docs/components-component-management-blocklet-studio.zh-TW.md +0 -194
- package/docs/components-component-management-blocklet-studio.zh.md +0 -194
- package/docs/components-component-management-component-installer.ja.md +0 -182
- package/docs/components-component-management-component-installer.md +0 -182
- package/docs/components-component-management-component-installer.zh-TW.md +0 -182
- package/docs/components-component-management-component-installer.zh.md +0 -182
- package/docs/components-component-management.ja.md +0 -30
- package/docs/components-component-management.md +0 -30
- package/docs/components-component-management.zh-TW.md +0 -30
- package/docs/components-component-management.zh.md +0 -30
- package/docs/components-layout-dashboard.ja.md +0 -185
- package/docs/components-layout-dashboard.md +0 -187
- package/docs/components-layout-dashboard.zh-TW.md +0 -185
- package/docs/components-layout-dashboard.zh.md +0 -185
- package/docs/components-layout-footer.ja.md +0 -165
- package/docs/components-layout-footer.md +0 -165
- package/docs/components-layout-footer.zh-TW.md +0 -165
- package/docs/components-layout-footer.zh.md +0 -165
- package/docs/components-layout-header.ja.md +0 -183
- package/docs/components-layout-header.md +0 -183
- package/docs/components-layout-header.zh-TW.md +0 -183
- package/docs/components-layout-header.zh.md +0 -183
- package/docs/components-layout.ja.md +0 -31
- package/docs/components-layout.md +0 -31
- package/docs/components-layout.zh-TW.md +0 -31
- package/docs/components-layout.zh.md +0 -31
- package/docs/components-notifications.ja.md +0 -125
- package/docs/components-notifications.md +0 -125
- package/docs/components-notifications.zh-TW.md +0 -125
- package/docs/components-notifications.zh.md +0 -125
- package/docs/components-user-management-user-center.ja.md +0 -148
- package/docs/components-user-management-user-center.md +0 -147
- package/docs/components-user-management-user-center.zh-TW.md +0 -148
- package/docs/components-user-management-user-center.zh.md +0 -148
- package/docs/components-user-management-user-sessions.ja.md +0 -121
- package/docs/components-user-management-user-sessions.md +0 -123
- package/docs/components-user-management-user-sessions.zh-TW.md +0 -121
- package/docs/components-user-management-user-sessions.zh.md +0 -121
- package/docs/components-user-management.ja.md +0 -49
- package/docs/components-user-management.md +0 -51
- package/docs/components-user-management.zh-TW.md +0 -49
- package/docs/components-user-management.zh.md +0 -49
- package/docs/components-utilities-icon.ja.md +0 -106
- package/docs/components-utilities-icon.md +0 -106
- package/docs/components-utilities-icon.zh-TW.md +0 -106
- package/docs/components-utilities-icon.zh.md +0 -106
- package/docs/components-utilities.ja.md +0 -136
- package/docs/components-utilities.md +0 -136
- package/docs/components-utilities.zh-TW.md +0 -136
- package/docs/components-utilities.zh.md +0 -136
- package/docs/components.ja.md +0 -27
- package/docs/components.md +0 -27
- package/docs/components.zh-TW.md +0 -27
- package/docs/components.zh.md +0 -27
- package/docs/core-concepts.ja.md +0 -134
- package/docs/core-concepts.md +0 -135
- package/docs/core-concepts.zh-TW.md +0 -134
- package/docs/core-concepts.zh.md +0 -134
- package/docs/getting-started.ja.md +0 -132
- package/docs/getting-started.md +0 -132
- package/docs/getting-started.zh-TW.md +0 -132
- package/docs/getting-started.zh.md +0 -132
- package/docs/hooks-api.ja.md +0 -214
- package/docs/hooks-api.md +0 -214
- package/docs/hooks-api.zh-TW.md +0 -214
- package/docs/hooks-api.zh.md +0 -214
- package/docs/how-to-guides.ja.md +0 -413
- package/docs/how-to-guides.md +0 -413
- package/docs/how-to-guides.zh-TW.md +0 -413
- package/docs/how-to-guides.zh.md +0 -413
- package/docs/overview.ja.md +0 -51
- package/docs/overview.md +0 -51
- package/docs/overview.zh-TW.md +0 -51
- package/docs/overview.zh.md +0 -51
- package/glossary.md +0 -12
- package/src/@types/index.ts +0 -230
- package/src/@types/shims.d.ts +0 -18
- package/src/BlockletStudio/README.md +0 -116
- package/src/BlockletStudio/index.tsx +0 -145
- package/src/ComponentInstaller/ComponentInstaller.stories.jsx +0 -16
- package/src/ComponentInstaller/index.jsx +0 -207
- package/src/ComponentInstaller/installer-item.jsx +0 -129
- package/src/ComponentInstaller/locales.js +0 -22
- package/src/ComponentInstaller/use-component-installed.js +0 -88
- package/src/ComponentManager/components/add-component.tsx +0 -136
- package/src/ComponentManager/components/check-component.tsx +0 -3
- package/src/ComponentManager/components/publish-component.tsx +0 -90
- package/src/ComponentManager/components/resource-dialog.tsx +0 -91
- package/src/ComponentManager/index.tsx +0 -3
- package/src/ComponentManager/libs/locales.ts +0 -15
- package/src/Dashboard/Dashboard.stories.jsx +0 -20
- package/src/Dashboard/app-shell/app-badge.stories.tsx +0 -64
- package/src/Dashboard/app-shell/app-badge.tsx +0 -94
- package/src/Dashboard/app-shell/app-header.tsx +0 -104
- package/src/Dashboard/app-shell/app-info-context.tsx +0 -182
- package/src/Dashboard/app-shell/badges/app-badge-default.tsx +0 -130
- package/src/Dashboard/app-shell/badges/app-badge-did.tsx +0 -28
- package/src/Dashboard/app-shell/badges/app-badge-state.tsx +0 -40
- package/src/Dashboard/app-shell/badges/app-badge-switch.tsx +0 -72
- package/src/Dashboard/app-shell/badges/app-badge-version.tsx +0 -60
- package/src/Dashboard/app-shell/index.ts +0 -5
- package/src/Dashboard/index.jsx +0 -184
- package/src/Footer/Footer.stories.jsx +0 -33
- package/src/Footer/brand.jsx +0 -81
- package/src/Footer/copyright.jsx +0 -22
- package/src/Footer/index.jsx +0 -111
- package/src/Footer/internal-footer.jsx +0 -139
- package/src/Footer/layout/plain.jsx +0 -55
- package/src/Footer/layout/row.jsx +0 -43
- package/src/Footer/layout/standard.jsx +0 -114
- package/src/Footer/links.jsx +0 -321
- package/src/Footer/social-media.jsx +0 -55
- package/src/Header/Header.stories.jsx +0 -30
- package/src/Header/index.tsx +0 -259
- package/src/Icon/Icon.stories.jsx +0 -12
- package/src/Icon/index.tsx +0 -87
- package/src/Notifications/Snackbar.tsx +0 -261
- package/src/Notifications/hooks/use-title.tsx +0 -254
- package/src/Notifications/hooks/use-width.tsx +0 -16
- package/src/Notifications/utils.ts +0 -246
- package/src/UserCenter/assets/banner.png +0 -0
- package/src/UserCenter/components/config-inviter.tsx +0 -48
- package/src/UserCenter/components/config-profile.tsx +0 -99
- package/src/UserCenter/components/danger-zone.tsx +0 -82
- package/src/UserCenter/components/editable-field.tsx +0 -273
- package/src/UserCenter/components/fallback.tsx +0 -57
- package/src/UserCenter/components/nft-preview.tsx +0 -84
- package/src/UserCenter/components/nft.tsx +0 -279
- package/src/UserCenter/components/notification.tsx +0 -319
- package/src/UserCenter/components/passport.tsx +0 -107
- package/src/UserCenter/components/privacy.tsx +0 -120
- package/src/UserCenter/components/settings.tsx +0 -170
- package/src/UserCenter/components/status-dialog/date-picker.tsx +0 -77
- package/src/UserCenter/components/status-dialog/index.tsx +0 -293
- package/src/UserCenter/components/status-selector/duration-menu.tsx +0 -90
- package/src/UserCenter/components/status-selector/index.tsx +0 -58
- package/src/UserCenter/components/status-selector/menu-item.tsx +0 -56
- package/src/UserCenter/components/storage/action.tsx +0 -49
- package/src/UserCenter/components/storage/connected.tsx +0 -61
- package/src/UserCenter/components/storage/delete.tsx +0 -72
- package/src/UserCenter/components/storage/disconnect.tsx +0 -40
- package/src/UserCenter/components/storage/icons/empty-spaces-nft.svg +0 -1
- package/src/UserCenter/components/storage/icons/long-arrow.svg +0 -5
- package/src/UserCenter/components/storage/icons/space-connected.svg +0 -3
- package/src/UserCenter/components/storage/icons/space-disconnect.svg +0 -3
- package/src/UserCenter/components/storage/index.tsx +0 -41
- package/src/UserCenter/components/storage/preview-nft.tsx +0 -72
- package/src/UserCenter/components/third-party-login/index.tsx +0 -199
- package/src/UserCenter/components/third-party-login/third-party-item.tsx +0 -296
- package/src/UserCenter/components/user-center.tsx +0 -787
- package/src/UserCenter/components/user-info/address.tsx +0 -143
- package/src/UserCenter/components/user-info/index.tsx +0 -4
- package/src/UserCenter/components/user-info/link-preview-input.tsx +0 -274
- package/src/UserCenter/components/user-info/metadata.tsx +0 -658
- package/src/UserCenter/components/user-info/social-actions/chat.tsx +0 -43
- package/src/UserCenter/components/user-info/social-actions/follow.tsx +0 -23
- package/src/UserCenter/components/user-info/social-actions/index.tsx +0 -17
- package/src/UserCenter/components/user-info/switch-role.tsx +0 -42
- package/src/UserCenter/components/user-info/timezone-select.tsx +0 -119
- package/src/UserCenter/components/user-info/user-basic-info.tsx +0 -292
- package/src/UserCenter/components/user-info/user-info-item.tsx +0 -54
- package/src/UserCenter/components/user-info/user-info.tsx +0 -91
- package/src/UserCenter/components/user-info/user-status.tsx +0 -234
- package/src/UserCenter/components/user-info/utils.ts +0 -320
- package/src/UserCenter/components/webhook-item.tsx +0 -248
- package/src/UserCenter/index.tsx +0 -1
- package/src/UserCenter/libs/locales.ts +0 -378
- package/src/UserCenter/libs/utils.ts +0 -30
- package/src/UserSessions/components/user-session-info.tsx +0 -78
- package/src/UserSessions/components/user-sessions.tsx +0 -545
- package/src/UserSessions/index.tsx +0 -1
- package/src/UserSessions/libs/locales.ts +0 -60
- package/src/UserSessions/libs/utils.ts +0 -82
- package/src/blocklets.js +0 -195
- package/src/common/domain-warning.jsx +0 -178
- package/src/common/header-addons.jsx +0 -119
- package/src/common/link-blocker.jsx +0 -20
- package/src/common/notification-addon.jsx +0 -135
- package/src/common/org-switch/avatar-uploader.jsx +0 -271
- package/src/common/org-switch/create.jsx +0 -267
- package/src/common/org-switch/index.jsx +0 -407
- package/src/common/org-switch/locales.js +0 -52
- package/src/common/org-switch/use-org.jsx +0 -79
- package/src/common/overridable-theme-provider.jsx +0 -17
- package/src/common/wallet-hidden-topbar.js +0 -14
- package/src/common/wizard-modal.jsx +0 -200
- package/src/common/ws.js +0 -68
- package/src/contexts/config-user-space.tsx +0 -88
- package/src/contexts/user-followers.tsx +0 -54
- package/src/hooks/use-follow.tsx +0 -75
- package/src/hooks/use-mobile.tsx +0 -6
- package/src/index.ts +0 -16
- package/src/libs/constant.ts +0 -1
- package/src/libs/spaces.tsx +0 -18
- package/src/libs/with-hide-when-embed.tsx +0 -24
- package/src/types.js +0 -45
- package/src/utils.js +0 -161
- package/vite.config.mjs +0 -34
package/src/utils.js
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
export const mapRecursive = (array, fn, childrenKey = 'children') => {
|
|
2
|
-
return array.map((item) => {
|
|
3
|
-
if (Array.isArray(item[childrenKey])) {
|
|
4
|
-
return fn({
|
|
5
|
-
...item,
|
|
6
|
-
[childrenKey]: mapRecursive(item[childrenKey], fn, childrenKey),
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
return fn(item);
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
// 展平有层级结构的 array
|
|
14
|
-
export const flatRecursive = (array, childrenKey = 'children') => {
|
|
15
|
-
const result = [];
|
|
16
|
-
mapRecursive(array, (item) => result.push(item), childrenKey);
|
|
17
|
-
return result;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
// 对有层级结构的 array 元素计数
|
|
21
|
-
export const countRecursive = (array, childrenKey = 'children') => {
|
|
22
|
-
let counter = 0;
|
|
23
|
-
mapRecursive(array, () => counter++, childrenKey);
|
|
24
|
-
return counter;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
// 对有层级结构的 array 进行 filter 处理
|
|
28
|
-
// 因为是 DFS 遍历, 可以借助 context.filteredChildren 在过滤/保留子结的同时保持父子结构 (即使父结点不满足筛选条件)
|
|
29
|
-
export const filterRecursive = (array, predicate, childrenKey = 'children') => {
|
|
30
|
-
return array
|
|
31
|
-
.map((item) => ({ ...item }))
|
|
32
|
-
.filter((item) => {
|
|
33
|
-
const children = item[childrenKey];
|
|
34
|
-
if (Array.isArray(children)) {
|
|
35
|
-
const filtered = filterRecursive(children, predicate, childrenKey);
|
|
36
|
-
item[childrenKey] = filtered?.length ? filtered : undefined;
|
|
37
|
-
}
|
|
38
|
-
const context = { filteredChildren: item[childrenKey], isLeaf: !children?.length };
|
|
39
|
-
return predicate(item, context);
|
|
40
|
-
});
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
// "http://", "https://" 2 种情况
|
|
44
|
-
export const isUrl = (str) => {
|
|
45
|
-
return /^https?:\/\//.test(str);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
// 链接是否是 mailto 协议
|
|
49
|
-
export const isMailProtocol = (str) => {
|
|
50
|
-
return /^mailto:/i.test(str.trim());
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* @description 检测是否是 Iconify 格式的字符串
|
|
55
|
-
* @deprecated
|
|
56
|
-
*/
|
|
57
|
-
export const isIconifyString = (str) => {
|
|
58
|
-
return /^[\w-]+:[\w-]+$/.test(str);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* 检测 path 是否匹配当前 location, path 只考虑 "/" 开头的相对路径
|
|
63
|
-
*/
|
|
64
|
-
export const matchPath = (path) => {
|
|
65
|
-
if (!path || !path?.startsWith('/')) {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
const ensureTrailingSlash = (str) => (str.endsWith('/') ? str : `${str}/`);
|
|
69
|
-
const pathname = ensureTrailingSlash(window.location.pathname);
|
|
70
|
-
const normalizedPath = ensureTrailingSlash(new URL(path, window.location.origin).pathname);
|
|
71
|
-
return pathname.startsWith(normalizedPath);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* 从一组 paths 中, 找到匹配当前 location 的 path, 返回序号
|
|
76
|
-
*/
|
|
77
|
-
export const matchPaths = (paths = []) => {
|
|
78
|
-
const matched = paths.map((item, index) => ({ path: item, index })).filter((item) => matchPath(item.path));
|
|
79
|
-
if (!matched?.length) {
|
|
80
|
-
return -1;
|
|
81
|
-
}
|
|
82
|
-
// 多个 path 都匹配时, 取一个最具体 (最长的) path
|
|
83
|
-
const mostSpecific = matched.slice(1).reduce((prev, cur) => {
|
|
84
|
-
return prev.path.length >= cur.path.length ? prev : cur;
|
|
85
|
-
}, matched[0]);
|
|
86
|
-
return mostSpecific.index;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
/** 导航列表分列 */
|
|
90
|
-
export const splitNavColumns = (items, options = {}) => {
|
|
91
|
-
const { columns = 1, breakInside = false, groupHeight = 48, itemHeight = 24, childrenKey = 'items' } = options;
|
|
92
|
-
// 分组数
|
|
93
|
-
const groups = items.length;
|
|
94
|
-
|
|
95
|
-
// 高度预估
|
|
96
|
-
const totalHeight = items.reduce((height, group) => {
|
|
97
|
-
return height + groupHeight + (group[childrenKey]?.length || 0) * itemHeight;
|
|
98
|
-
}, 0);
|
|
99
|
-
const targetHeight = Math.ceil(totalHeight / columns);
|
|
100
|
-
|
|
101
|
-
// 使用贪心策略进行分列
|
|
102
|
-
const result = [[]];
|
|
103
|
-
let currentColumn = 0;
|
|
104
|
-
let currentHeight = 0;
|
|
105
|
-
|
|
106
|
-
// 允许的高度偏差范围(有利于得到高度相差不大的列)
|
|
107
|
-
const heightVariance = targetHeight * 0.2;
|
|
108
|
-
|
|
109
|
-
// 是否应该分列
|
|
110
|
-
const shouldBreakColumn = (nextHeight) => {
|
|
111
|
-
return (
|
|
112
|
-
currentHeight > targetHeight - heightVariance &&
|
|
113
|
-
currentColumn < columns - 1 &&
|
|
114
|
-
currentHeight + nextHeight > targetHeight + heightVariance
|
|
115
|
-
);
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
items.forEach((group) => {
|
|
119
|
-
// 当前分组的预估高度
|
|
120
|
-
const groupTotalHeight = groupHeight + (group[childrenKey]?.length || 0) * itemHeight;
|
|
121
|
-
|
|
122
|
-
// 允许截断分组,可以在任何子项处换列,尽可能利用当前列的剩余空间
|
|
123
|
-
if (breakInside && shouldBreakColumn(groupHeight)) {
|
|
124
|
-
currentColumn++;
|
|
125
|
-
currentHeight = 0;
|
|
126
|
-
result[currentColumn] = [];
|
|
127
|
-
}
|
|
128
|
-
// 不允许截断分组,只能在分组边界换列,优先分列,列不够用再考虑充分利用剩余空间
|
|
129
|
-
if (!breakInside && currentHeight > 0 && (groups <= columns || shouldBreakColumn(groupTotalHeight))) {
|
|
130
|
-
currentColumn++;
|
|
131
|
-
currentHeight = 0;
|
|
132
|
-
result[currentColumn] = [];
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// 添加分组标题
|
|
136
|
-
result[currentColumn].push({
|
|
137
|
-
...group,
|
|
138
|
-
group: true,
|
|
139
|
-
});
|
|
140
|
-
currentHeight += groupHeight;
|
|
141
|
-
|
|
142
|
-
// 添加子项
|
|
143
|
-
if (group[childrenKey]) {
|
|
144
|
-
group[childrenKey].forEach((child) => {
|
|
145
|
-
if (breakInside && shouldBreakColumn(itemHeight)) {
|
|
146
|
-
currentColumn++;
|
|
147
|
-
currentHeight = 0;
|
|
148
|
-
result[currentColumn] = [];
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
result[currentColumn].push({
|
|
152
|
-
...child,
|
|
153
|
-
group: false,
|
|
154
|
-
});
|
|
155
|
-
currentHeight += itemHeight;
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
return result;
|
|
161
|
-
};
|
package/vite.config.mjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite';
|
|
2
|
-
import svgr from 'vite-plugin-svgr';
|
|
3
|
-
import react from '@vitejs/plugin-react';
|
|
4
|
-
import noBundlePlugin from 'vite-plugin-no-bundle';
|
|
5
|
-
import fg from 'fast-glob';
|
|
6
|
-
import dts from 'vite-plugin-dts';
|
|
7
|
-
|
|
8
|
-
export default defineConfig({
|
|
9
|
-
plugins: [
|
|
10
|
-
react({ jsxRuntime: 'automatic' }),
|
|
11
|
-
svgr({
|
|
12
|
-
include: ['**/*.svg', '**/*.svg?react'],
|
|
13
|
-
}),
|
|
14
|
-
dts({
|
|
15
|
-
entryRoot: 'src',
|
|
16
|
-
exclude: ['**/*.stories.*', '**/*.test.*', '**/demo/**'],
|
|
17
|
-
}),
|
|
18
|
-
noBundlePlugin({
|
|
19
|
-
root: 'src',
|
|
20
|
-
copy: ['**/*.png', '**/*.gif', '**/*.jpg', '**/*.jpeg'],
|
|
21
|
-
}),
|
|
22
|
-
],
|
|
23
|
-
build: {
|
|
24
|
-
lib: {
|
|
25
|
-
entry: fg.sync('src/**/*.{tsx,ts,jsx,js}', {
|
|
26
|
-
ignore: ['**/stories/**', '**/demo/**', '**/*.d.ts', '**/*.stories.*'],
|
|
27
|
-
}),
|
|
28
|
-
formats: ['es'],
|
|
29
|
-
fileName: (format, entryName) => `${entryName}.js`,
|
|
30
|
-
},
|
|
31
|
-
outDir: 'lib',
|
|
32
|
-
emptyOutDir: true,
|
|
33
|
-
},
|
|
34
|
-
});
|