@mercurjs/dashboard-sdk 2.3.6-canary.8 → 2.3.6-canary.9

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.d.cts CHANGED
@@ -39,6 +39,11 @@ interface WidgetConfig {
39
39
  * one is enough.
40
40
  */
41
41
  permission?: Permission | Permission[];
42
+ /**
43
+ * i18n key or literal naming the tab. Required for a `*.tabs.*` zone, where
44
+ * the widget renders as a tab's panel; ignored elsewhere.
45
+ */
46
+ label?: string;
42
47
  }
43
48
  /** Override for a single built-in navigation item. */
44
49
  interface NavItemOverride {
package/dist/index.d.ts CHANGED
@@ -39,6 +39,11 @@ interface WidgetConfig {
39
39
  * one is enough.
40
40
  */
41
41
  permission?: Permission | Permission[];
42
+ /**
43
+ * i18n key or literal naming the tab. Required for a `*.tabs.*` zone, where
44
+ * the widget renders as a tab's panel; ignored elsewhere.
45
+ */
46
+ label?: string;
42
47
  }
43
48
  /** Override for a single built-in navigation item. */
44
49
  interface NavItemOverride {
package/dist/vite.cjs CHANGED
@@ -678,6 +678,7 @@ function readWidgetConfig(properties) {
678
678
  const zones = [];
679
679
  const permissions = [];
680
680
  let id;
681
+ let label;
681
682
  for (const prop of properties) {
682
683
  if (!(0, import_types.isObjectProperty)(prop)) continue;
683
684
  if ((0, import_types.isIdentifier)(prop.key, { name: "zone" })) {
@@ -689,9 +690,12 @@ function readWidgetConfig(properties) {
689
690
  if ((0, import_types.isIdentifier)(prop.key, { name: "id" }) && (0, import_types.isStringLiteral)(prop.value)) {
690
691
  id = prop.value.value;
691
692
  }
693
+ if ((0, import_types.isIdentifier)(prop.key, { name: "label" }) && (0, import_types.isStringLiteral)(prop.value)) {
694
+ label = prop.value.value;
695
+ }
692
696
  }
693
697
  if (zones.length === 0) return null;
694
- return { zones, id, permissions };
698
+ return { zones, id, label, permissions };
695
699
  }
696
700
  function getConfigProperties(node) {
697
701
  if ((0, import_types.isCallExpression)(node) && node.arguments.length > 0 && (0, import_types.isObjectExpression)(node.arguments[0])) {
@@ -755,7 +759,7 @@ function parseWidgetFile(file, widgetsDir, index) {
755
759
  import: `import ${name} from "${importPath}"`,
756
760
  entry: ` { Component: ${name}, zone: ${zonesLiteral}, widgetId: ${JSON.stringify(
757
761
  id
758
- )}${info.permissions.length ? `, permission: ${JSON.stringify(info.permissions)}` : ""} }`
762
+ )}${info.label ? `, label: ${JSON.stringify(info.label)}` : ""}${info.permissions.length ? `, permission: ${JSON.stringify(info.permissions)}` : ""} }`
759
763
  };
760
764
  }
761
765
  function collectWidgets(srcDir, startIndex = 0) {
package/dist/vite.js CHANGED
@@ -658,6 +658,7 @@ function readWidgetConfig(properties) {
658
658
  const zones = [];
659
659
  const permissions = [];
660
660
  let id;
661
+ let label;
661
662
  for (const prop of properties) {
662
663
  if (!isObjectProperty(prop)) continue;
663
664
  if (isIdentifier(prop.key, { name: "zone" })) {
@@ -669,9 +670,12 @@ function readWidgetConfig(properties) {
669
670
  if (isIdentifier(prop.key, { name: "id" }) && isStringLiteral(prop.value)) {
670
671
  id = prop.value.value;
671
672
  }
673
+ if (isIdentifier(prop.key, { name: "label" }) && isStringLiteral(prop.value)) {
674
+ label = prop.value.value;
675
+ }
672
676
  }
673
677
  if (zones.length === 0) return null;
674
- return { zones, id, permissions };
678
+ return { zones, id, label, permissions };
675
679
  }
676
680
  function getConfigProperties(node) {
677
681
  if (isCallExpression(node) && node.arguments.length > 0 && isObjectExpression(node.arguments[0])) {
@@ -735,7 +739,7 @@ function parseWidgetFile(file, widgetsDir, index) {
735
739
  import: `import ${name} from "${importPath}"`,
736
740
  entry: ` { Component: ${name}, zone: ${zonesLiteral}, widgetId: ${JSON.stringify(
737
741
  id
738
- )}${info.permissions.length ? `, permission: ${JSON.stringify(info.permissions)}` : ""} }`
742
+ )}${info.label ? `, label: ${JSON.stringify(info.label)}` : ""}${info.permissions.length ? `, permission: ${JSON.stringify(info.permissions)}` : ""} }`
739
743
  };
740
744
  }
741
745
  function collectWidgets(srcDir, startIndex = 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mercurjs/dashboard-sdk",
3
- "version": "2.3.6-canary.8",
3
+ "version": "2.3.6-canary.9",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/mercurjs/mercur",