analytica-frontend-lib 1.2.83 → 1.2.84

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.
Files changed (37) hide show
  1. package/dist/ActivitiesHistory/index.js +156 -147
  2. package/dist/ActivitiesHistory/index.js.map +1 -1
  3. package/dist/ActivitiesHistory/index.mjs +155 -146
  4. package/dist/ActivitiesHistory/index.mjs.map +1 -1
  5. package/dist/ActivityCardQuestionBanks/index.d.ts +6 -4
  6. package/dist/ActivityCardQuestionBanks/index.d.ts.map +1 -1
  7. package/dist/ActivityCardQuestionBanks/index.js.map +1 -1
  8. package/dist/ActivityCardQuestionBanks/index.mjs.map +1 -1
  9. package/dist/RecommendedLessonsHistory/index.js +129 -127
  10. package/dist/RecommendedLessonsHistory/index.js.map +1 -1
  11. package/dist/RecommendedLessonsHistory/index.mjs +128 -126
  12. package/dist/RecommendedLessonsHistory/index.mjs.map +1 -1
  13. package/dist/hooks/useActivitiesHistory/index.js.map +1 -1
  14. package/dist/hooks/useActivitiesHistory/index.mjs.map +1 -1
  15. package/dist/hooks/useActivityModels/index.d.ts +1 -1
  16. package/dist/hooks/useActivityModels/index.d.ts.map +1 -1
  17. package/dist/hooks/useActivityModels/index.js +13 -2
  18. package/dist/hooks/useActivityModels/index.js.map +1 -1
  19. package/dist/hooks/useActivityModels/index.mjs +13 -2
  20. package/dist/hooks/useActivityModels/index.mjs.map +1 -1
  21. package/dist/hooks/useActivityModels.d.ts +1 -1
  22. package/dist/hooks/useActivityModels.d.ts.map +1 -1
  23. package/dist/index.d.ts +4 -0
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/index.js +2045 -1057
  26. package/dist/index.js.map +1 -1
  27. package/dist/index.mjs +1994 -1008
  28. package/dist/index.mjs.map +1 -1
  29. package/dist/types/activitiesHistory/index.d.ts +11 -1
  30. package/dist/types/activitiesHistory/index.d.ts.map +1 -1
  31. package/dist/types/activitiesHistory/index.js.map +1 -1
  32. package/dist/types/activitiesHistory/index.mjs.map +1 -1
  33. package/dist/types/activitiesHistory.d.ts +11 -1
  34. package/dist/types/activitiesHistory.d.ts.map +1 -1
  35. package/dist/types/questions.d.ts +1 -0
  36. package/dist/types/questions.d.ts.map +1 -1
  37. package/package.json +3 -1
@@ -5469,6 +5469,120 @@ var getSubjectInfo = (subject) => {
5469
5469
  };
5470
5470
  };
5471
5471
 
5472
+ // src/components/shared/ModelsTabBase/createModelsTableColumnsBase.tsx
5473
+ var import_phosphor_react14 = require("phosphor-react");
5474
+
5475
+ // src/utils/renderSubjectCell.tsx
5476
+ var import_jsx_runtime33 = require("react/jsx-runtime");
5477
+ var renderSubjectCell = (subjectName, mapSubjectNameToEnum, showEmptyDash = false) => {
5478
+ if (!subjectName) {
5479
+ return showEmptyDash ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text_default, { size: "sm", color: "text-text-400", children: "-" }) : null;
5480
+ }
5481
+ const subjectEnum = mapSubjectNameToEnum?.(subjectName);
5482
+ if (!subjectEnum) {
5483
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text_default, { size: "sm", className: "truncate", title: subjectName, children: subjectName });
5484
+ }
5485
+ const subjectInfo = getSubjectInfo(subjectEnum);
5486
+ return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "flex items-center gap-2", title: subjectName, children: [
5487
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
5488
+ "span",
5489
+ {
5490
+ className: cn(
5491
+ "w-[21px] h-[21px] flex items-center justify-center rounded-sm text-text-950 shrink-0",
5492
+ subjectInfo.colorClass
5493
+ ),
5494
+ children: subjectInfo.icon
5495
+ }
5496
+ ),
5497
+ /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text_default, { size: "sm", className: "truncate", children: subjectName })
5498
+ ] });
5499
+ };
5500
+
5501
+ // src/components/shared/ModelsTabBase/createModelsTableColumnsBase.tsx
5502
+ var import_jsx_runtime34 = require("react/jsx-runtime");
5503
+ var createModelsTableColumnsBase = (mapSubjectNameToEnum, onSend, onEdit, onDelete, config) => [
5504
+ {
5505
+ key: "title",
5506
+ label: "T\xEDtulo",
5507
+ sortable: true,
5508
+ className: "max-w-[400px]",
5509
+ render: (value) => {
5510
+ const title = typeof value === "string" ? value : "";
5511
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text_default, { size: "sm", title, className: "truncate block", children: title });
5512
+ }
5513
+ },
5514
+ {
5515
+ key: "savedAt",
5516
+ label: "Salvo em",
5517
+ sortable: true,
5518
+ className: "w-[120px]"
5519
+ },
5520
+ {
5521
+ key: "subject",
5522
+ label: "Mat\xE9ria",
5523
+ sortable: true,
5524
+ className: "max-w-[160px]",
5525
+ render: (value) => {
5526
+ const subjectName = typeof value === "string" ? value : "";
5527
+ return renderSubjectCell(subjectName, mapSubjectNameToEnum, true);
5528
+ }
5529
+ },
5530
+ {
5531
+ key: "actions",
5532
+ label: "",
5533
+ sortable: false,
5534
+ className: "w-[220px]",
5535
+ render: (_value, row) => {
5536
+ const handleSend = (e) => {
5537
+ e.stopPropagation();
5538
+ onSend?.(row);
5539
+ };
5540
+ const handleEdit = (e) => {
5541
+ e.stopPropagation();
5542
+ onEdit?.(row);
5543
+ };
5544
+ const handleDelete = (e) => {
5545
+ e.stopPropagation();
5546
+ onDelete(row);
5547
+ };
5548
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center gap-2 justify-end", children: [
5549
+ onSend && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5550
+ Button_default,
5551
+ {
5552
+ variant: "outline",
5553
+ action: "primary",
5554
+ size: "small",
5555
+ iconLeft: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_phosphor_react14.PaperPlaneTilt, { size: 16 }),
5556
+ onClick: handleSend,
5557
+ "aria-label": config.sendButtonAriaLabel,
5558
+ children: config.sendButtonLabel
5559
+ }
5560
+ ),
5561
+ /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5562
+ IconButton_default,
5563
+ {
5564
+ icon: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_phosphor_react14.Trash, { size: 20 }),
5565
+ size: "md",
5566
+ onClick: handleDelete,
5567
+ "aria-label": config.deleteButtonAriaLabel,
5568
+ className: "text-text-600 hover:text-error-500 hover:bg-transparent"
5569
+ }
5570
+ ),
5571
+ onEdit && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5572
+ IconButton_default,
5573
+ {
5574
+ icon: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_phosphor_react14.PencilSimple, { size: 20 }),
5575
+ size: "md",
5576
+ onClick: handleEdit,
5577
+ "aria-label": config.editButtonAriaLabel,
5578
+ className: "text-text-600 hover:text-primary-700 hover:bg-transparent"
5579
+ }
5580
+ )
5581
+ ] });
5582
+ }
5583
+ }
5584
+ ];
5585
+
5472
5586
  // src/types/common.ts
5473
5587
  var getStatusBadgeAction = (status) => {
5474
5588
  const actionMap = {
@@ -5762,39 +5876,13 @@ var createUseGoalModels = (fetchGoalModels, deleteGoalModel) => {
5762
5876
  };
5763
5877
 
5764
5878
  // src/components/ActivitiesHistory/components/ErrorDisplay.tsx
5765
- var import_jsx_runtime33 = require("react/jsx-runtime");
5766
- var ErrorDisplay = ({ error }) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Text_default, { size: "lg", color: "text-error-500", children: error }) });
5767
-
5768
- // src/utils/renderSubjectCell.tsx
5769
- var import_jsx_runtime34 = require("react/jsx-runtime");
5770
- var renderSubjectCell = (subjectName, mapSubjectNameToEnum, showEmptyDash = false) => {
5771
- if (!subjectName) {
5772
- return showEmptyDash ? /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text_default, { size: "sm", color: "text-text-400", children: "-" }) : null;
5773
- }
5774
- const subjectEnum = mapSubjectNameToEnum?.(subjectName);
5775
- if (!subjectEnum) {
5776
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text_default, { size: "sm", className: "truncate", title: subjectName, children: subjectName });
5777
- }
5778
- const subjectInfo = getSubjectInfo(subjectEnum);
5779
- return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "flex items-center gap-2", title: subjectName, children: [
5780
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5781
- "span",
5782
- {
5783
- className: cn(
5784
- "w-[21px] h-[21px] flex items-center justify-center rounded-sm text-text-950 shrink-0",
5785
- subjectInfo.colorClass
5786
- ),
5787
- children: subjectInfo.icon
5788
- }
5789
- ),
5790
- /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Text_default, { size: "sm", className: "truncate", children: subjectName })
5791
- ] });
5792
- };
5879
+ var import_jsx_runtime35 = require("react/jsx-runtime");
5880
+ var ErrorDisplay = ({ error }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "flex items-center justify-center bg-background rounded-xl w-full min-h-[705px]", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text_default, { size: "lg", color: "text-error-500", children: error }) });
5793
5881
 
5794
5882
  // src/components/shared/ModelsTabBase/ModelsTabBase.tsx
5795
5883
  var import_react20 = require("react");
5796
- var import_phosphor_react14 = require("phosphor-react");
5797
- var import_jsx_runtime35 = require("react/jsx-runtime");
5884
+ var import_phosphor_react15 = require("phosphor-react");
5885
+ var import_jsx_runtime36 = require("react/jsx-runtime");
5798
5886
  var ModelsTabBase = ({
5799
5887
  fetchModels: fetchModelsProp,
5800
5888
  deleteModel: deleteModelProp,
@@ -5886,9 +5974,9 @@ var ModelsTabBase = ({
5886
5974
  setDeleteDialogOpen(false);
5887
5975
  setModelToDelete(null);
5888
5976
  }, []);
5889
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
5890
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Toaster_default, {}),
5891
- modelsError ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ErrorDisplay, { error: modelsError }) : /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "w-full", "data-testid": config.testId, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5977
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
5978
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Toaster_default, {}),
5979
+ modelsError ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ErrorDisplay, { error: modelsError }) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "w-full", "data-testid": config.testId, children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5892
5980
  TableProvider,
5893
5981
  {
5894
5982
  data: models,
@@ -5912,14 +6000,14 @@ var ModelsTabBase = ({
5912
6000
  image: noSearchImage
5913
6001
  },
5914
6002
  emptyState: {
5915
- component: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
6003
+ component: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5916
6004
  EmptyState_default,
5917
6005
  {
5918
6006
  image: emptyStateImage,
5919
6007
  title: config.emptyStateTitle,
5920
6008
  description: config.emptyStateDescription,
5921
6009
  buttonText: "Criar modelo",
5922
- buttonIcon: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_phosphor_react14.Plus, { size: 18 }),
6010
+ buttonIcon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_phosphor_react15.Plus, { size: 18 }),
5923
6011
  buttonVariant: "outline",
5924
6012
  buttonAction: "primary",
5925
6013
  onButtonClick: onCreateModel
@@ -5933,22 +6021,22 @@ var ModelsTabBase = ({
5933
6021
  table,
5934
6022
  pagination: paginationComponent
5935
6023
  } = renderProps;
5936
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "space-y-4", children: [
5937
- /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
5938
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
6024
+ return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "space-y-4", children: [
6025
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center justify-between gap-4", children: [
6026
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5939
6027
  Button_default,
5940
6028
  {
5941
6029
  variant: "solid",
5942
6030
  action: "primary",
5943
6031
  size: "medium",
5944
6032
  onClick: onCreateModel,
5945
- iconLeft: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_phosphor_react14.Plus, { size: 18, weight: "bold" }),
6033
+ iconLeft: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_phosphor_react15.Plus, { size: 18, weight: "bold" }),
5946
6034
  children: "Criar modelo"
5947
6035
  }
5948
6036
  ),
5949
6037
  controls
5950
6038
  ] }),
5951
- /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "bg-background rounded-xl p-6 space-y-4", children: [
6039
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "bg-background rounded-xl p-6 space-y-4", children: [
5952
6040
  table,
5953
6041
  paginationComponent
5954
6042
  ] })
@@ -5956,7 +6044,7 @@ var ModelsTabBase = ({
5956
6044
  }
5957
6045
  }
5958
6046
  ) }),
5959
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
6047
+ /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5960
6048
  AlertDialog,
5961
6049
  {
5962
6050
  isOpen: deleteDialogOpen,
@@ -5972,92 +6060,6 @@ var ModelsTabBase = ({
5972
6060
  ] });
5973
6061
  };
5974
6062
 
5975
- // src/components/shared/ModelsTabBase/createModelsTableColumnsBase.tsx
5976
- var import_phosphor_react15 = require("phosphor-react");
5977
- var import_jsx_runtime36 = require("react/jsx-runtime");
5978
- var createModelsTableColumnsBase = (mapSubjectNameToEnum, onSend, onEdit, onDelete, config) => [
5979
- {
5980
- key: "title",
5981
- label: "T\xEDtulo",
5982
- sortable: true,
5983
- className: "max-w-[400px]",
5984
- render: (value) => {
5985
- const title = typeof value === "string" ? value : "";
5986
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text_default, { size: "sm", title, className: "truncate block", children: title });
5987
- }
5988
- },
5989
- {
5990
- key: "savedAt",
5991
- label: "Salvo em",
5992
- sortable: true,
5993
- className: "w-[120px]"
5994
- },
5995
- {
5996
- key: "subject",
5997
- label: "Mat\xE9ria",
5998
- sortable: true,
5999
- className: "max-w-[160px]",
6000
- render: (value) => {
6001
- const subjectName = typeof value === "string" ? value : "";
6002
- return renderSubjectCell(subjectName, mapSubjectNameToEnum, true);
6003
- }
6004
- },
6005
- {
6006
- key: "actions",
6007
- label: "",
6008
- sortable: false,
6009
- className: "w-[220px]",
6010
- render: (_value, row) => {
6011
- const handleSend = (e) => {
6012
- e.stopPropagation();
6013
- onSend?.(row);
6014
- };
6015
- const handleEdit = (e) => {
6016
- e.stopPropagation();
6017
- onEdit?.(row);
6018
- };
6019
- const handleDelete = (e) => {
6020
- e.stopPropagation();
6021
- onDelete(row);
6022
- };
6023
- return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: "flex items-center gap-2 justify-end", children: [
6024
- onSend && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
6025
- Button_default,
6026
- {
6027
- variant: "outline",
6028
- action: "primary",
6029
- size: "small",
6030
- iconLeft: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_phosphor_react15.PaperPlaneTilt, { size: 16 }),
6031
- onClick: handleSend,
6032
- "aria-label": config.sendButtonAriaLabel,
6033
- children: config.sendButtonLabel
6034
- }
6035
- ),
6036
- /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
6037
- IconButton_default,
6038
- {
6039
- icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_phosphor_react15.Trash, { size: 20 }),
6040
- size: "md",
6041
- onClick: handleDelete,
6042
- "aria-label": config.deleteButtonAriaLabel,
6043
- className: "text-text-600 hover:text-error-500 hover:bg-transparent"
6044
- }
6045
- ),
6046
- onEdit && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
6047
- IconButton_default,
6048
- {
6049
- icon: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_phosphor_react15.PencilSimple, { size: 20 }),
6050
- size: "md",
6051
- onClick: handleEdit,
6052
- "aria-label": config.editButtonAriaLabel,
6053
- className: "text-text-600 hover:text-primary-700 hover:bg-transparent"
6054
- }
6055
- )
6056
- ] });
6057
- }
6058
- }
6059
- ];
6060
-
6061
6063
  // src/components/CheckBoxGroup/CheckBoxGroup.helpers.ts
6062
6064
  var areSelectedIdsEqual = (ids1, ids2) => {
6063
6065
  if (ids1 === ids2) return true;