@juicemantics/veloiq-ui 0.6.0 → 0.7.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/index.js CHANGED
@@ -1019,7 +1019,7 @@ var CommandCenterPortal = ({
1019
1019
  }, [query, parsedCommand, search, clear]);
1020
1020
  const allModelChildren = React5.useMemo(
1021
1021
  () => menuItems.flatMap(
1022
- (m) => (m.children || []).map((c) => ({ ...c, moduleLabel: String(m.label || m.name || "") }))
1022
+ (m) => (m.children || []).filter((c) => !c.meta?.hide).map((c) => ({ ...c, moduleLabel: String(m.label || m.name || "") }))
1023
1023
  ),
1024
1024
  [menuItems]
1025
1025
  );
@@ -1037,8 +1037,8 @@ var CommandCenterPortal = ({
1037
1037
  }, [allModelChildren]);
1038
1038
  const modules = React5.useMemo(() => {
1039
1039
  const q2 = parsedCommand ? parsedCommand.modelQuery : query.toLowerCase().trim();
1040
- const moduleItems = menuItems.filter((item) => item.children && item.children.length > 0);
1041
- const sorted = navConfig.length > 0 ? sortItemsByNavConfig(moduleItems, navConfig) : moduleItems;
1040
+ const visibleModules = menuItems.filter((item) => item.children && item.children.length > 0).map((item) => ({ ...item, children: (item.children || []).filter((c) => !c.meta?.hide) })).filter((item) => item.children && item.children.length > 0);
1041
+ const sorted = navConfig.length > 0 ? sortItemsByNavConfig(visibleModules, navConfig) : visibleModules;
1042
1042
  if (!q2) return sorted;
1043
1043
  return sorted.map((module) => {
1044
1044
  const moduleMatch = (module.label || "").toLowerCase().includes(q2);
@@ -20157,18 +20157,38 @@ var DynamicList = ({ model: modelProp, allModels, filter, relationConfig, isEmbe
20157
20157
 
20158
20158
  // src/components/MultiPane/paneUtils.ts
20159
20159
  function parsePanes(searchParams) {
20160
- return searchParams.getAll("pane").map((param) => {
20161
- const colonIdx = param.indexOf(":");
20162
- if (colonIdx < 1) return null;
20163
- const resource = param.slice(0, colonIdx);
20164
- const id = param.slice(colonIdx + 1);
20165
- if (!resource || !id) return null;
20166
- return { resource, id };
20167
- }).filter((p) => p !== null);
20160
+ const standard = searchParams.getAll("pane");
20161
+ if (standard.length > 0) {
20162
+ return standard.map((param) => {
20163
+ const colonIdx = param.indexOf(":");
20164
+ if (colonIdx < 1) return null;
20165
+ const resource = param.slice(0, colonIdx);
20166
+ const id = param.slice(colonIdx + 1);
20167
+ if (!resource || !id) return null;
20168
+ return { resource, id };
20169
+ }).filter((p) => p !== null);
20170
+ }
20171
+ const legacy = [];
20172
+ for (const [key, value] of searchParams.entries()) {
20173
+ if (/^pane(?:\[\d*\])?$/.test(key)) {
20174
+ const colonIdx = value.indexOf(":");
20175
+ if (colonIdx < 1) continue;
20176
+ const resource = value.slice(0, colonIdx);
20177
+ const id = value.slice(colonIdx + 1);
20178
+ if (resource && id) {
20179
+ legacy.push({ resource, id });
20180
+ }
20181
+ }
20182
+ }
20183
+ return legacy;
20168
20184
  }
20169
20185
  function applyPanesToSearchParams(existing, panes) {
20170
20186
  const next = new URLSearchParams(existing);
20171
- next.delete("pane");
20187
+ for (const [key] of existing.entries()) {
20188
+ if (key === "pane" || /^pane\[\d+\]$/.test(key)) {
20189
+ next.delete(key);
20190
+ }
20191
+ }
20172
20192
  panes.forEach((p) => next.append("pane", `${p.resource}:${p.id}`));
20173
20193
  return next;
20174
20194
  }
@@ -20321,11 +20341,15 @@ var MultiPaneLayout = ({ children }) => {
20321
20341
  React5.useEffect(() => {
20322
20342
  const newCount = panes.length;
20323
20343
  const prevCount = prevPaneCountRef.current;
20324
- prevPaneCountRef.current = newCount;
20325
- if (newCount <= prevCount || !pendingLayoutRef.current || !groupRef.current) {
20344
+ if (!pendingLayoutRef.current || !groupRef.current) {
20326
20345
  pendingLayoutRef.current = null;
20327
20346
  return;
20328
20347
  }
20348
+ if (newCount <= prevCount) {
20349
+ pendingLayoutRef.current = null;
20350
+ return;
20351
+ }
20352
+ prevPaneCountRef.current = newCount;
20329
20353
  const prevLayout = pendingLayoutRef.current;
20330
20354
  pendingLayoutRef.current = null;
20331
20355
  const donorId = prevCount === 0 ? LIST_PANEL_ID : detailPanelId(prevCount - 1);
@@ -21780,7 +21804,7 @@ function generateResources(models, moduleName, options = {}) {
21780
21804
  };
21781
21805
  const children = (models || []).map((model) => {
21782
21806
  const resource = model.resource || model.name;
21783
- const isRelation = hideRelations && (resource.toLowerCase().endsWith("_relation") || resource.toLowerCase().endsWith("_rela") || Array.isArray(model.fields) && model.fields.some((f) => f?.key === "eid_from") && model.fields.some((f) => f?.key === "eid_to"));
21807
+ const isRelation = hideRelations && (resource.toLowerCase().endsWith("_relation") || resource.toLowerCase().endsWith("_rela") || (Array.isArray(model.fields) && model.fields.some((f) => f?.key === "eid_from") && model.fields.some((f) => f?.key === "eid_to") || model.fields.length > 0 && model.fields.every((f) => !!f?.reference)));
21784
21808
  return {
21785
21809
  name: resource,
21786
21810
  list: `/${resource}`,