@procore/saved-views 5.1.0-alpha.1 → 5.1.0-alpha.2

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.
@@ -2017,9 +2017,9 @@ var require_dist = __commonJS({
2017
2017
  }
2018
2018
  });
2019
2019
 
2020
- // node_modules/react-is/cjs/react-is.production.min.js
2020
+ // ../../node_modules/styled-components/node_modules/react-is/cjs/react-is.production.min.js
2021
2021
  var require_react_is_production_min = __commonJS({
2022
- "node_modules/react-is/cjs/react-is.production.min.js"(exports) {
2022
+ "../../node_modules/styled-components/node_modules/react-is/cjs/react-is.production.min.js"(exports) {
2023
2023
  "use strict";
2024
2024
  var b2 = 60103;
2025
2025
  var c2 = 60106;
@@ -2155,9 +2155,9 @@ var require_react_is_production_min = __commonJS({
2155
2155
  }
2156
2156
  });
2157
2157
 
2158
- // node_modules/react-is/cjs/react-is.development.js
2158
+ // ../../node_modules/styled-components/node_modules/react-is/cjs/react-is.development.js
2159
2159
  var require_react_is_development = __commonJS({
2160
- "node_modules/react-is/cjs/react-is.development.js"(exports) {
2160
+ "../../node_modules/styled-components/node_modules/react-is/cjs/react-is.development.js"(exports) {
2161
2161
  "use strict";
2162
2162
  if (process.env.NODE_ENV !== "production") {
2163
2163
  (function() {
@@ -2347,9 +2347,9 @@ var require_react_is_development = __commonJS({
2347
2347
  }
2348
2348
  });
2349
2349
 
2350
- // node_modules/react-is/index.js
2350
+ // ../../node_modules/styled-components/node_modules/react-is/index.js
2351
2351
  var require_react_is = __commonJS({
2352
- "node_modules/react-is/index.js"(exports, module) {
2352
+ "../../node_modules/styled-components/node_modules/react-is/index.js"(exports, module) {
2353
2353
  "use strict";
2354
2354
  if (process.env.NODE_ENV === "production") {
2355
2355
  module.exports = require_react_is_production_min();
@@ -8802,7 +8802,8 @@ var en_default = {
8802
8802
  viewTemporarily: "View Temporarily",
8803
8803
  createView: "Create View",
8804
8804
  copyShareLink: "Copy Share Link",
8805
- linkCopied: "Share link copied to clipboard"
8805
+ linkCopied: "Share link copied to clipboard",
8806
+ clearTemporary: "Remove"
8806
8807
  },
8807
8808
  modal: {
8808
8809
  edit: {
@@ -8816,8 +8817,7 @@ var en_default = {
8816
8817
  description: "This view cannot be restored once it has been deleted."
8817
8818
  },
8818
8819
  copyConfirmation: {
8819
- headline: 'Create "{{savedViewName}}" as a personal saved view?',
8820
- description: "You pasted a link to a saved view that does not yet exist for you. You can create it as a personal saved view or just view it temporarily."
8820
+ description: "You pasted a link to a saved view that does not yet exist for you.\nYou can create it as a personal saved view or just view it\ntemporarily."
8821
8821
  },
8822
8822
  fields: {
8823
8823
  name: "Name",
@@ -8865,6 +8865,7 @@ var en_default = {
8865
8865
  rfi: "All RFIs",
8866
8866
  submittal_log: "All Submittals"
8867
8867
  },
8868
+ temporaryViewName: "Temporary View",
8868
8869
  viewLevel: {
8869
8870
  company: "Company Views",
8870
8871
  project: "Project Views",
@@ -9710,7 +9711,7 @@ function __rest(s2, e2) {
9710
9711
  return t2;
9711
9712
  }
9712
9713
 
9713
- // ../../node_modules/@procore/core-icons/dist/Icon.js
9714
+ // node_modules/@procore/core-icons/dist/Icon.js
9714
9715
  import * as React from "react";
9715
9716
  function getSize(size) {
9716
9717
  if (size === "sm") {
@@ -9729,7 +9730,7 @@ function Icon(_a) {
9729
9730
  return React.isValidElement(children) ? React.cloneElement(children, __assign(__assign({ "aria-hidden": true, "data-qa": "ci-".concat(props.name) }, props), { width: getSize(props.size), height: getSize(props.size), focusable: false, style: __assign(__assign({}, props.style), { flex: "0 0 auto" }) })) : null;
9730
9731
  }
9731
9732
 
9732
- // ../../node_modules/@procore/core-icons/dist/icons/Building.js
9733
+ // node_modules/@procore/core-icons/dist/icons/Building.js
9733
9734
  import * as React2 from "react";
9734
9735
  var Building = React2.forwardRef(function Building2(props, ref) {
9735
9736
  return React2.createElement(
@@ -9745,7 +9746,7 @@ var Building = React2.forwardRef(function Building2(props, ref) {
9745
9746
  Building.displayName = "Building";
9746
9747
  var Building_default = Building;
9747
9748
 
9748
- // ../../node_modules/@procore/core-icons/dist/icons/ChevronDown.js
9749
+ // node_modules/@procore/core-icons/dist/icons/ChevronDown.js
9749
9750
  import * as React3 from "react";
9750
9751
  var ChevronDown = React3.forwardRef(function ChevronDown2(props, ref) {
9751
9752
  return React3.createElement(
@@ -9761,7 +9762,7 @@ var ChevronDown = React3.forwardRef(function ChevronDown2(props, ref) {
9761
9762
  ChevronDown.displayName = "ChevronDown";
9762
9763
  var ChevronDown_default = ChevronDown;
9763
9764
 
9764
- // ../../node_modules/@procore/core-icons/dist/icons/ChevronRight.js
9765
+ // node_modules/@procore/core-icons/dist/icons/ChevronRight.js
9765
9766
  import * as React4 from "react";
9766
9767
  var ChevronRight = React4.forwardRef(function ChevronRight2(props, ref) {
9767
9768
  return React4.createElement(
@@ -9777,100 +9778,116 @@ var ChevronRight = React4.forwardRef(function ChevronRight2(props, ref) {
9777
9778
  ChevronRight.displayName = "ChevronRight";
9778
9779
  var ChevronRight_default = ChevronRight;
9779
9780
 
9780
- // ../../node_modules/@procore/core-icons/dist/icons/Excavator.js
9781
+ // node_modules/@procore/core-icons/dist/icons/Clear.js
9781
9782
  import * as React5 from "react";
9782
- var Excavator = React5.forwardRef(function Excavator2(props, ref) {
9783
+ var Clear = React5.forwardRef(function Clear2(props, ref) {
9783
9784
  return React5.createElement(
9784
9785
  Icon,
9785
- __assign({}, props, { name: "Excavator" }),
9786
+ __assign({}, props, { name: "Clear" }),
9786
9787
  React5.createElement(
9787
9788
  "svg",
9788
9789
  { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ref },
9789
- React5.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.54979 2H8.26065L11.4955 8H17.5V12.5L20 14.5V16H9.5V8.5L7.27126 3.72125H6.64878L3.82536 10.525H7.55556L6.32099 13.9675H2V10.525V10.5L5.54979 2ZM15.3333 10.0325H12V12.3275H15.3333V10.0325Z", fill: "currentColor" }),
9790
- React5.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.55556 19.705C7.55556 18.4375 8.55048 17.41 9.77778 17.41H19.7778C21.0051 17.41 22 18.4375 22 19.705C22 20.9725 21.0051 22 19.7778 22H9.77778C8.55048 22 7.55556 20.9725 7.55556 19.705ZM10.6111 20.4844C11.0713 20.4844 11.4444 20.0991 11.4444 19.6238C11.4444 19.1484 11.0713 18.7631 10.6111 18.7631C10.1509 18.7631 9.77778 19.1484 9.77778 19.6238C9.77778 20.0991 10.1509 20.4844 10.6111 20.4844ZM14.2222 19.6238C14.2222 20.0991 13.8491 20.4844 13.3889 20.4844C12.9287 20.4844 12.5556 20.0991 12.5556 19.6238C12.5556 19.1484 12.9287 18.7631 13.3889 18.7631C13.8491 18.7631 14.2222 19.1484 14.2222 19.6238ZM16.1667 20.4844C16.6269 20.4844 17 20.0991 17 19.6238C17 19.1484 16.6269 18.7631 16.1667 18.7631C15.7064 18.7631 15.3333 19.1484 15.3333 19.6238C15.3333 20.0991 15.7064 20.4844 16.1667 20.4844ZM19.7778 19.6238C19.7778 20.0991 19.4047 20.4844 18.9444 20.4844C18.4842 20.4844 18.1111 20.0991 18.1111 19.6238C18.1111 19.1484 18.4842 18.7631 18.9444 18.7631C19.4047 18.7631 19.7778 19.1484 19.7778 19.6238Z", fill: "currentColor" })
9790
+ React5.createElement("path", { d: "M14.3686 12.0003L21.0003 5.36856L18.6317 3L12 9.63169L5.36856 3.00025L3 5.36881L9.63144 12.0003L3 18.6317L5.36856 21.0003L12 14.3688L18.6317 21.0005L21.0003 18.6319L14.3686 12.0003Z", fill: "currentColor" })
9791
9791
  )
9792
9792
  );
9793
9793
  });
9794
- Excavator.displayName = "Excavator";
9795
- var Excavator_default = Excavator;
9794
+ Clear.displayName = "Clear";
9795
+ var Clear_default = Clear;
9796
9796
 
9797
- // ../../node_modules/@procore/core-icons/dist/icons/ExpandSidebar.js
9797
+ // node_modules/@procore/core-icons/dist/icons/Excavator.js
9798
9798
  import * as React6 from "react";
9799
- var ExpandSidebar = React6.forwardRef(function ExpandSidebar2(props, ref) {
9799
+ var Excavator = React6.forwardRef(function Excavator2(props, ref) {
9800
9800
  return React6.createElement(
9801
9801
  Icon,
9802
- __assign({}, props, { name: "ExpandSidebar" }),
9802
+ __assign({}, props, { name: "Excavator" }),
9803
9803
  React6.createElement(
9804
9804
  "svg",
9805
9805
  { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ref },
9806
- React6.createElement("path", { d: "M3 6.5H11V9H3V6.5Z", fill: "currentColor" }),
9807
- React6.createElement("path", { d: "M3 15H11V17.5H3V15Z", fill: "currentColor" }),
9808
- React6.createElement("path", { d: "M16.2319 13.25H3V10.75H16.2336L12.2665 6.78227L14.0344 5.01465L21.0179 11.9993L14.034 18.9839L12.2661 17.2162L16.2319 13.25Z", fill: "currentColor" })
9806
+ React6.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.54979 2H8.26065L11.4955 8H17.5V12.5L20 14.5V16H9.5V8.5L7.27126 3.72125H6.64878L3.82536 10.525H7.55556L6.32099 13.9675H2V10.525V10.5L5.54979 2ZM15.3333 10.0325H12V12.3275H15.3333V10.0325Z", fill: "currentColor" }),
9807
+ React6.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7.55556 19.705C7.55556 18.4375 8.55048 17.41 9.77778 17.41H19.7778C21.0051 17.41 22 18.4375 22 19.705C22 20.9725 21.0051 22 19.7778 22H9.77778C8.55048 22 7.55556 20.9725 7.55556 19.705ZM10.6111 20.4844C11.0713 20.4844 11.4444 20.0991 11.4444 19.6238C11.4444 19.1484 11.0713 18.7631 10.6111 18.7631C10.1509 18.7631 9.77778 19.1484 9.77778 19.6238C9.77778 20.0991 10.1509 20.4844 10.6111 20.4844ZM14.2222 19.6238C14.2222 20.0991 13.8491 20.4844 13.3889 20.4844C12.9287 20.4844 12.5556 20.0991 12.5556 19.6238C12.5556 19.1484 12.9287 18.7631 13.3889 18.7631C13.8491 18.7631 14.2222 19.1484 14.2222 19.6238ZM16.1667 20.4844C16.6269 20.4844 17 20.0991 17 19.6238C17 19.1484 16.6269 18.7631 16.1667 18.7631C15.7064 18.7631 15.3333 19.1484 15.3333 19.6238C15.3333 20.0991 15.7064 20.4844 16.1667 20.4844ZM19.7778 19.6238C19.7778 20.0991 19.4047 20.4844 18.9444 20.4844C18.4842 20.4844 18.1111 20.0991 18.1111 19.6238C18.1111 19.1484 18.4842 18.7631 18.9444 18.7631C19.4047 18.7631 19.7778 19.1484 19.7778 19.6238Z", fill: "currentColor" })
9809
9808
  )
9810
9809
  );
9811
9810
  });
9812
- ExpandSidebar.displayName = "ExpandSidebar";
9813
- var ExpandSidebar_default = ExpandSidebar;
9811
+ Excavator.displayName = "Excavator";
9812
+ var Excavator_default = Excavator;
9814
9813
 
9815
- // ../../node_modules/@procore/core-icons/dist/icons/Help.js
9814
+ // node_modules/@procore/core-icons/dist/icons/ExpandSidebar.js
9816
9815
  import * as React7 from "react";
9817
- var Help = React7.forwardRef(function Help2(props, ref) {
9816
+ var ExpandSidebar = React7.forwardRef(function ExpandSidebar2(props, ref) {
9818
9817
  return React7.createElement(
9819
9818
  Icon,
9820
- __assign({}, props, { name: "Help" }),
9819
+ __assign({}, props, { name: "ExpandSidebar" }),
9821
9820
  React7.createElement(
9822
9821
  "svg",
9823
9822
  { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ref },
9824
- React7.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M22.5 12C22.5 17.799 17.799 22.5 12 22.5C6.20101 22.5 1.5 17.799 1.5 12C1.5 6.20101 6.20101 1.5 12 1.5C17.799 1.5 22.5 6.20101 22.5 12ZM10.5263 7.95937C10.2808 8.36033 10.1916 8.91994 10.1916 9.37657H7.5C7.5 8.66165 7.62111 7.4859 8.25879 6.44439C8.95769 5.30289 10.172 4.5 11.9579 4.5C13.5589 4.5 14.7796 4.98286 15.5728 5.91817C16.3382 6.82071 16.5 7.90665 16.5 8.67364C16.5 10.8341 15.0595 12.1455 13.8423 12.7536C13.5724 12.8885 13.381 13.0989 13.2617 13.2697V14.25H10.5701V13.1798C10.5701 12.8171 10.6368 12.3478 10.903 11.8984C11.162 11.4612 11.7165 10.699 12.681 10.2171C13.3984 9.85866 13.8084 9.32492 13.8084 8.67364C13.8084 8.26908 13.7179 7.97113 13.5581 7.78266C13.426 7.62697 13.0486 7.31172 11.9579 7.31172C11.0523 7.31172 10.7105 7.65841 10.5263 7.95937ZM11.954 19.5059C12.925 19.5059 13.7121 18.7187 13.7121 17.7477C13.7121 16.7767 12.925 15.9895 11.954 15.9895C10.9829 15.9895 10.1958 16.7767 10.1958 17.7477C10.1958 18.7187 10.9829 19.5059 11.954 19.5059Z", fill: "currentColor" })
9823
+ React7.createElement("path", { d: "M3 6.5H11V9H3V6.5Z", fill: "currentColor" }),
9824
+ React7.createElement("path", { d: "M3 15H11V17.5H3V15Z", fill: "currentColor" }),
9825
+ React7.createElement("path", { d: "M16.2319 13.25H3V10.75H16.2336L12.2665 6.78227L14.0344 5.01465L21.0179 11.9993L14.034 18.9839L12.2661 17.2162L16.2319 13.25Z", fill: "currentColor" })
9825
9826
  )
9826
9827
  );
9827
9828
  });
9828
- Help.displayName = "Help";
9829
- var Help_default = Help;
9829
+ ExpandSidebar.displayName = "ExpandSidebar";
9830
+ var ExpandSidebar_default = ExpandSidebar;
9830
9831
 
9831
- // ../../node_modules/@procore/core-icons/dist/icons/Link.js
9832
+ // node_modules/@procore/core-icons/dist/icons/Help.js
9832
9833
  import * as React8 from "react";
9833
- var Link = React8.forwardRef(function Link2(props, ref) {
9834
+ var Help = React8.forwardRef(function Help2(props, ref) {
9834
9835
  return React8.createElement(
9835
9836
  Icon,
9836
- __assign({}, props, { name: "Link" }),
9837
+ __assign({}, props, { name: "Help" }),
9837
9838
  React8.createElement(
9838
9839
  "svg",
9839
9840
  { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ref },
9840
- React8.createElement("path", { d: "M6.01273 13.106C6.21565 9.97594 8.81868 7.5 12 7.5H13.5V10.5L12 10.5C10.3431 10.5 9 11.8431 9 13.5L9 16.5C9 18.1569 10.3431 19.5 12 19.5H16.5C18.1569 19.5 19.5 18.1569 19.5 16.5L19.5 8.30269C21.2934 9.34012 22.5 11.2792 22.5 13.5V16.5C22.5 19.8137 19.8137 22.5 16.5 22.5H12C8.68629 22.5 6 19.8137 6 16.5L6 13.0987L6.01273 13.106Z", fill: "currentColor" }),
9841
- React8.createElement("path", { d: "M15 10.5C15 10.501 15 10.502 15 10.503V10.5269C14.9854 12.1712 13.6478 13.5 12 13.5L10.5 13.5V16.5H12C15.1813 16.5 17.7844 14.0241 17.9873 10.894L18.0086 10.9064L18.0001 10.8343L18 7.5C18 4.18629 15.3137 1.5 12 1.5H7.5C4.18629 1.5 1.5 4.18629 1.5 7.5V10.5C1.5 12.7208 2.7066 14.6599 4.5 15.6973L4.5 7.5C4.5 5.84315 5.84315 4.5 7.5 4.5L12 4.5C13.6569 4.5 15 5.84315 15 7.5H14.9867L15 7.52707L15 10.5Z", fill: "currentColor" })
9841
+ React8.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M22.5 12C22.5 17.799 17.799 22.5 12 22.5C6.20101 22.5 1.5 17.799 1.5 12C1.5 6.20101 6.20101 1.5 12 1.5C17.799 1.5 22.5 6.20101 22.5 12ZM10.5263 7.95937C10.2808 8.36033 10.1916 8.91994 10.1916 9.37657H7.5C7.5 8.66165 7.62111 7.4859 8.25879 6.44439C8.95769 5.30289 10.172 4.5 11.9579 4.5C13.5589 4.5 14.7796 4.98286 15.5728 5.91817C16.3382 6.82071 16.5 7.90665 16.5 8.67364C16.5 10.8341 15.0595 12.1455 13.8423 12.7536C13.5724 12.8885 13.381 13.0989 13.2617 13.2697V14.25H10.5701V13.1798C10.5701 12.8171 10.6368 12.3478 10.903 11.8984C11.162 11.4612 11.7165 10.699 12.681 10.2171C13.3984 9.85866 13.8084 9.32492 13.8084 8.67364C13.8084 8.26908 13.7179 7.97113 13.5581 7.78266C13.426 7.62697 13.0486 7.31172 11.9579 7.31172C11.0523 7.31172 10.7105 7.65841 10.5263 7.95937ZM11.954 19.5059C12.925 19.5059 13.7121 18.7187 13.7121 17.7477C13.7121 16.7767 12.925 15.9895 11.954 15.9895C10.9829 15.9895 10.1958 16.7767 10.1958 17.7477C10.1958 18.7187 10.9829 19.5059 11.954 19.5059Z", fill: "currentColor" })
9842
9842
  )
9843
9843
  );
9844
9844
  });
9845
- Link.displayName = "Link";
9846
- var Link_default = Link;
9845
+ Help.displayName = "Help";
9846
+ var Help_default = Help;
9847
9847
 
9848
- // ../../node_modules/@procore/core-icons/dist/icons/Person.js
9848
+ // node_modules/@procore/core-icons/dist/icons/Link.js
9849
9849
  import * as React9 from "react";
9850
- var Person = React9.forwardRef(function Person2(props, ref) {
9850
+ var Link = React9.forwardRef(function Link2(props, ref) {
9851
9851
  return React9.createElement(
9852
9852
  Icon,
9853
- __assign({}, props, { name: "Person" }),
9853
+ __assign({}, props, { name: "Link" }),
9854
9854
  React9.createElement(
9855
9855
  "svg",
9856
9856
  { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ref },
9857
- React9.createElement("path", { d: "M12 12C14.21 12 16 10.21 16 8C16 5.79 14.21 4 12 4C9.79 4 8 5.79 8 8C8 10.21 9.79 12 12 12ZM12 14C9.33 14 4 15.34 4 18V20H20V18C20 15.34 14.67 14 12 14Z", fill: "currentColor" })
9857
+ React9.createElement("path", { d: "M6.01273 13.106C6.21565 9.97594 8.81868 7.5 12 7.5H13.5V10.5L12 10.5C10.3431 10.5 9 11.8431 9 13.5L9 16.5C9 18.1569 10.3431 19.5 12 19.5H16.5C18.1569 19.5 19.5 18.1569 19.5 16.5L19.5 8.30269C21.2934 9.34012 22.5 11.2792 22.5 13.5V16.5C22.5 19.8137 19.8137 22.5 16.5 22.5H12C8.68629 22.5 6 19.8137 6 16.5L6 13.0987L6.01273 13.106Z", fill: "currentColor" }),
9858
+ React9.createElement("path", { d: "M15 10.5C15 10.501 15 10.502 15 10.503V10.5269C14.9854 12.1712 13.6478 13.5 12 13.5L10.5 13.5V16.5H12C15.1813 16.5 17.7844 14.0241 17.9873 10.894L18.0086 10.9064L18.0001 10.8343L18 7.5C18 4.18629 15.3137 1.5 12 1.5H7.5C4.18629 1.5 1.5 4.18629 1.5 7.5V10.5C1.5 12.7208 2.7066 14.6599 4.5 15.6973L4.5 7.5C4.5 5.84315 5.84315 4.5 7.5 4.5L12 4.5C13.6569 4.5 15 5.84315 15 7.5H14.9867L15 7.52707L15 10.5Z", fill: "currentColor" })
9858
9859
  )
9859
9860
  );
9860
9861
  });
9861
- Person.displayName = "Person";
9862
- var Person_default = Person;
9862
+ Link.displayName = "Link";
9863
+ var Link_default = Link;
9863
9864
 
9864
- // ../../node_modules/@procore/core-icons/dist/icons/Plus.js
9865
+ // node_modules/@procore/core-icons/dist/icons/Person.js
9865
9866
  import * as React10 from "react";
9866
- var Plus = React10.forwardRef(function Plus2(props, ref) {
9867
+ var Person = React10.forwardRef(function Person2(props, ref) {
9867
9868
  return React10.createElement(
9868
9869
  Icon,
9869
- __assign({}, props, { name: "Plus" }),
9870
+ __assign({}, props, { name: "Person" }),
9870
9871
  React10.createElement(
9871
9872
  "svg",
9872
9873
  { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ref },
9873
- React10.createElement("path", { d: "M13.25 5H10.75V10.75H5V13.25H10.75V19H13.25V13.25H19V10.75H13.25V5Z", fill: "currentColor" })
9874
+ React10.createElement("path", { d: "M12 12C14.21 12 16 10.21 16 8C16 5.79 14.21 4 12 4C9.79 4 8 5.79 8 8C8 10.21 9.79 12 12 12ZM12 14C9.33 14 4 15.34 4 18V20H20V18C20 15.34 14.67 14 12 14Z", fill: "currentColor" })
9875
+ )
9876
+ );
9877
+ });
9878
+ Person.displayName = "Person";
9879
+ var Person_default = Person;
9880
+
9881
+ // node_modules/@procore/core-icons/dist/icons/Plus.js
9882
+ import * as React11 from "react";
9883
+ var Plus = React11.forwardRef(function Plus2(props, ref) {
9884
+ return React11.createElement(
9885
+ Icon,
9886
+ __assign({}, props, { name: "Plus" }),
9887
+ React11.createElement(
9888
+ "svg",
9889
+ { width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", ref },
9890
+ React11.createElement("path", { d: "M13.25 5H10.75V10.75H5V13.25H10.75V19H13.25V13.25H19V10.75H13.25V5Z", fill: "currentColor" })
9874
9891
  )
9875
9892
  );
9876
9893
  });
@@ -9879,9 +9896,9 @@ var Plus_default = Plus;
9879
9896
 
9880
9897
  // src/SavedViews/components/Buttons/SavedViewsButton.tsx
9881
9898
  import { Button } from "@procore/core-react";
9882
- import React12 from "react";
9899
+ import React13 from "react";
9883
9900
 
9884
- // node_modules/styled-components/dist/styled-components.esm.js
9901
+ // ../../node_modules/styled-components/dist/styled-components.esm.js
9885
9902
  var import_react_is = __toESM(require_react_is());
9886
9903
  var import_shallowequal = __toESM(require_shallowequal());
9887
9904
  import r, { useState as o, useContext as s, useMemo as i, useEffect as a, useRef as c, createElement as u } from "react";
@@ -10436,7 +10453,7 @@ function memoize(fn) {
10436
10453
  };
10437
10454
  }
10438
10455
 
10439
- // ../../node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js
10456
+ // ../../node_modules/styled-components/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js
10440
10457
  var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
10441
10458
  var isPropValid = /* @__PURE__ */ memoize(
10442
10459
  function(prop) {
@@ -10445,7 +10462,7 @@ var isPropValid = /* @__PURE__ */ memoize(
10445
10462
  /* Z+1 */
10446
10463
  );
10447
10464
 
10448
- // node_modules/styled-components/dist/styled-components.esm.js
10465
+ // ../../node_modules/styled-components/dist/styled-components.esm.js
10449
10466
  var import_hoist_non_react_statics = __toESM(require_hoist_non_react_statics_cjs());
10450
10467
  function m() {
10451
10468
  return (m = Object.assign || function(e2) {
@@ -11093,7 +11110,7 @@ var Ue = function() {
11093
11110
  var styled_components_esm_default = Ye;
11094
11111
 
11095
11112
  // src/SavedViews/components/EnvironmentI18nProvider.tsx
11096
- import React11 from "react";
11113
+ import React12 from "react";
11097
11114
  import { I18nContext, useI18n, useI18nContext } from "@procore/core-react";
11098
11115
  import { useRequestTranslations } from "@procore/cdn-translations";
11099
11116
  var useCDNTranslations = () => {
@@ -11119,7 +11136,7 @@ var useCDNTranslations = () => {
11119
11136
  };
11120
11137
  var EnvironmentI18nProvider = ({ children }) => {
11121
11138
  const i18n = useCDNTranslations();
11122
- return /* @__PURE__ */ React11.createElement(I18nContext.Provider, { value: i18n }, children);
11139
+ return /* @__PURE__ */ React12.createElement(I18nContext.Provider, { value: i18n }, children);
11123
11140
  };
11124
11141
 
11125
11142
  // src/SavedViews/components/Buttons/SavedViewsButton.tsx
@@ -11146,12 +11163,12 @@ var SavedViewsButton = ({
11146
11163
  isOpen
11147
11164
  }) => {
11148
11165
  const I18n = useCDNTranslations();
11149
- return /* @__PURE__ */ React12.createElement(Container, null, /* @__PURE__ */ React12.createElement(
11166
+ return /* @__PURE__ */ React13.createElement(Container, null, /* @__PURE__ */ React13.createElement(
11150
11167
  StyledButton,
11151
11168
  {
11152
11169
  variant: "secondary",
11153
11170
  onClick: handleClick,
11154
- icon: /* @__PURE__ */ React12.createElement(StyledIcon, { left: isOpen }),
11171
+ icon: /* @__PURE__ */ React13.createElement(StyledIcon, { left: isOpen }),
11155
11172
  "data-testid": "saved-views-button"
11156
11173
  },
11157
11174
  I18n.t("savedViews.button.title")
@@ -11159,7 +11176,7 @@ var SavedViewsButton = ({
11159
11176
  };
11160
11177
 
11161
11178
  // src/SavedViews/components/Buttons/useSavedViewsPanel.tsx
11162
- import React13 from "react";
11179
+ import React14 from "react";
11163
11180
  var useSavedViewsPanel = (domain, tableName) => {
11164
11181
  const key = (domain2, tableName2) => `savedViewsPanel-${domain2}-${tableName2}`;
11165
11182
  const [isOpen, setIsOpen] = useState(
@@ -11169,7 +11186,7 @@ var useSavedViewsPanel = (domain, tableName) => {
11169
11186
  setIsOpen(!isOpen);
11170
11187
  localStorage.setItem(key(domain, tableName), JSON.stringify(!isOpen));
11171
11188
  };
11172
- const Button7 = () => /* @__PURE__ */ React13.createElement(SavedViewsButton, { handleClick, isOpen });
11189
+ const Button7 = () => /* @__PURE__ */ React14.createElement(SavedViewsButton, { handleClick, isOpen });
11173
11190
  return { isOpen, SavedViewsButton: Button7 };
11174
11191
  };
11175
11192
  var useSavedViewsPanel_default = useSavedViewsPanel;
@@ -11182,7 +11199,7 @@ import {
11182
11199
  Flex,
11183
11200
  useI18nContext as useI18nContext2
11184
11201
  } from "@procore/core-react";
11185
- import * as React14 from "react";
11202
+ import * as React15 from "react";
11186
11203
  import { useToastAlertContext } from "@procore/toast-alert";
11187
11204
  var RowActionsBox = styled_components_esm_default(Flex)`
11188
11205
  justify-content: center;
@@ -11199,7 +11216,7 @@ var Container2 = styled_components_esm_default(Flex)`
11199
11216
  ${({ "aria-selected": selected }) => selected ? "color: hsl(218, 75%, 45%);" : ""}
11200
11217
  `;
11201
11218
  var SavedViewCollectionMenuItem = (props) => {
11202
- const onClick = React14.useCallback(
11219
+ const onClick = React15.useCallback(
11203
11220
  (a2) => {
11204
11221
  if (!props.item) {
11205
11222
  return;
@@ -11226,11 +11243,12 @@ var SavedViewCollectionMenuItem = (props) => {
11226
11243
  const copyShareLink = async (event) => {
11227
11244
  event.stopPropagation();
11228
11245
  try {
11229
- const currentUrl = new URL(window.location.href);
11230
- await navigator.clipboard.writeText(currentUrl.toString());
11246
+ const { origin, pathname } = window.location;
11247
+ const shareUrl = new URL(`${origin}${pathname}`);
11248
+ shareUrl.searchParams.set("saved-view", props.item.share_token);
11249
+ await navigator.clipboard.writeText(shareUrl.toString());
11231
11250
  showToast.success(i18n.t("savedViews.actions.linkCopied"));
11232
11251
  } catch (error) {
11233
- console.error("Failed to copy link:", error);
11234
11252
  showToast.error(i18n.t("savedViews.errors.copyFailed"));
11235
11253
  }
11236
11254
  };
@@ -11244,7 +11262,7 @@ var SavedViewCollectionMenuItem = (props) => {
11244
11262
  label: i18n.t("savedViews.actions.delete")
11245
11263
  }
11246
11264
  ];
11247
- return /* @__PURE__ */ React14.createElement(
11265
+ return /* @__PURE__ */ React15.createElement(
11248
11266
  Container2,
11249
11267
  {
11250
11268
  "aria-selected": Boolean(props.selected),
@@ -11255,7 +11273,7 @@ var SavedViewCollectionMenuItem = (props) => {
11255
11273
  }),
11256
11274
  "data-testid": "saved-view-collection-menu-item"
11257
11275
  },
11258
- /* @__PURE__ */ React14.createElement(
11276
+ /* @__PURE__ */ React15.createElement(
11259
11277
  "span",
11260
11278
  {
11261
11279
  "data-testid": "saved-view-display-name",
@@ -11263,7 +11281,7 @@ var SavedViewCollectionMenuItem = (props) => {
11263
11281
  },
11264
11282
  props.item.name
11265
11283
  ),
11266
- /* @__PURE__ */ React14.createElement(RowActionsBox, null, /* @__PURE__ */ React14.createElement(Box, { justifyContent: "space-between" }, props.item.id !== "default" && props.canUpdate && /* @__PURE__ */ React14.createElement("div", null, /* @__PURE__ */ React14.createElement(
11284
+ /* @__PURE__ */ React15.createElement(RowActionsBox, null, /* @__PURE__ */ React15.createElement(Box, { justifyContent: "space-between" }, props.item.id !== "default" && props.canUpdate && /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement(
11267
11285
  Button2,
11268
11286
  {
11269
11287
  onClick: updateItem,
@@ -11274,7 +11292,7 @@ var SavedViewCollectionMenuItem = (props) => {
11274
11292
  loading: props.isUpdateProcessing
11275
11293
  },
11276
11294
  i18n.t("savedViews.actions.update")
11277
- )), props.item.id !== "default" && props.selected && !props.canUpdate && props.item.id !== "temporary" && /* @__PURE__ */ React14.createElement("div", null, /* @__PURE__ */ React14.createElement(
11295
+ )), props.item.id !== "default" && props.selected && !props.canUpdate && props.item.id !== "temporary" && /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement(
11278
11296
  Button2,
11279
11297
  {
11280
11298
  onClick: copyShareLink,
@@ -11283,8 +11301,22 @@ var SavedViewCollectionMenuItem = (props) => {
11283
11301
  "aria-label": i18n.t("savedViews.actions.copyShareLink"),
11284
11302
  "data-testid": "copy-share-link-button"
11285
11303
  },
11286
- /* @__PURE__ */ React14.createElement(Link_default, { size: "sm" })
11287
- ))), /* @__PURE__ */ React14.createElement(Box, null, props.item.id !== "default" && props.canEditOrDelete && /* @__PURE__ */ React14.createElement("div", { onClick: (e2) => e2.stopPropagation() }, /* @__PURE__ */ React14.createElement(
11304
+ /* @__PURE__ */ React15.createElement(Link_default, { size: "sm" })
11305
+ )), props.item.id === "temporary" && /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement(
11306
+ Button2,
11307
+ {
11308
+ onClick: (e2) => {
11309
+ e2.stopPropagation();
11310
+ props.onClearTemporary?.();
11311
+ },
11312
+ variant: "tertiary",
11313
+ size: "sm",
11314
+ "aria-label": i18n.t("savedViews.actions.clearTemporary"),
11315
+ title: i18n.t("savedViews.actions.clearTemporary"),
11316
+ "data-testid": "clear-temporary-view-button"
11317
+ },
11318
+ /* @__PURE__ */ React15.createElement(Clear_default, { size: "sm" })
11319
+ ))), /* @__PURE__ */ React15.createElement(Box, null, props.item.id !== "default" && props.canEditOrDelete && /* @__PURE__ */ React15.createElement("div", { onClick: (e2) => e2.stopPropagation() }, /* @__PURE__ */ React15.createElement(
11288
11320
  DropdownFlyout,
11289
11321
  {
11290
11322
  "data-testid": "saved-view-overflow-button",
@@ -11317,9 +11349,9 @@ import {
11317
11349
  useI18nContext as useI18nContext5
11318
11350
  } from "@procore/core-react";
11319
11351
  import { useToastAlertContext as useToastAlertContext2 } from "@procore/toast-alert";
11320
- import React16 from "react";
11352
+ import React17 from "react";
11321
11353
 
11322
- // ../../node_modules/@procore/core-http/dist/modern/index.js
11354
+ // node_modules/@procore/core-http/dist/modern/index.js
11323
11355
  function getCSRFToken() {
11324
11356
  const token = document.cookie.match("(^|;)\\s*csrf_token\\s*=\\s*([^;]+)");
11325
11357
  return token ? decodeURIComponent(token.pop() || "") : "";
@@ -11376,7 +11408,7 @@ var useApiRequest = (props, method, mutationKey) => {
11376
11408
  mutationFn: async (savedView) => {
11377
11409
  let url = "";
11378
11410
  if (method === "DELETE" || method === "PUT") {
11379
- url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/${savedView.id}?permissions_domain=${domain}`;
11411
+ url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/${savedView.share_token}?permissions_domain=${domain}`;
11380
11412
  } else {
11381
11413
  url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views?table_name=${tableName}&permissions_domain=${domain}`;
11382
11414
  }
@@ -11405,7 +11437,9 @@ var useApiRequest = (props, method, mutationKey) => {
11405
11437
  domain,
11406
11438
  tableName
11407
11439
  ]);
11408
- const oldView = oldData?.find((item) => item.id === savedView.id);
11440
+ const oldView = oldData?.find(
11441
+ (item) => item.share_token === savedView.share_token
11442
+ );
11409
11443
  if (oldView?.name !== savedView.name) {
11410
11444
  queryClient2.invalidateQueries({
11411
11445
  queryKey: ["savedViews", domain, tableName]
@@ -11419,7 +11453,7 @@ var useApiRequest = (props, method, mutationKey) => {
11419
11453
  if (!oldData)
11420
11454
  return [savedView];
11421
11455
  return oldData.map(
11422
- (item) => item.id === savedView.id ? savedView : item
11456
+ (item) => item.share_token === savedView.share_token ? savedView : item
11423
11457
  );
11424
11458
  }
11425
11459
  );
@@ -11436,7 +11470,6 @@ var useSavedViewsQuery = (props) => {
11436
11470
  const { projectId, companyId, domain, tableName } = props;
11437
11471
  const url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views?table_name=${tableName}&permissions_domain=${domain}`;
11438
11472
  return useQuery({
11439
- enabled: props.enableSavedViews,
11440
11473
  queryKey: ["savedViews", domain, tableName],
11441
11474
  queryFn: async () => {
11442
11475
  const getUrl2 = `${url}&per_page=${PAGE_SIZE}`;
@@ -11449,7 +11482,6 @@ var useSavedViewsPermissions = (props) => {
11449
11482
  const { projectId, companyId, domain } = props;
11450
11483
  const url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/permissions?permissions_domain=${domain}`;
11451
11484
  return useQuery({
11452
- enabled: props.enableSavedViews,
11453
11485
  queryKey: ["savedViewsConfig", domain],
11454
11486
  queryFn: async () => {
11455
11487
  const response = await requestJSON(url);
@@ -11472,13 +11504,13 @@ var useDeleteSavedView = (props) => useApiRequest(props, "DELETE", [
11472
11504
  props.domain,
11473
11505
  props.tableName
11474
11506
  ]);
11475
- var useFetchSavedViewById = (savedViewId, queryInput, enabled = true) => {
11507
+ var useFetchSavedViewById = (savedViewToken, queryInput, enabled = true) => {
11476
11508
  const { projectId, companyId } = queryInput;
11477
11509
  return useQuery({
11478
- enabled: enabled && Boolean(savedViewId),
11479
- queryKey: ["savedView", savedViewId],
11510
+ enabled: enabled && Boolean(savedViewToken),
11511
+ queryKey: ["savedView", savedViewToken],
11480
11512
  queryFn: async () => {
11481
- const url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/${savedViewId}`;
11513
+ const url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/${savedViewToken}`;
11482
11514
  const response = await requestJSON(url);
11483
11515
  return response.data;
11484
11516
  }
@@ -11557,7 +11589,7 @@ var getColumnIdentifier = (col) => {
11557
11589
  }
11558
11590
  return "";
11559
11591
  };
11560
- var updateTableConfig = (view, tableApi, provider, onTableConfigChange) => {
11592
+ var updateTableConfig = (view, tableApi, provider) => {
11561
11593
  if (provider === "smart-grid") {
11562
11594
  setSmartGridConfig(
11563
11595
  tableApi,
@@ -11572,9 +11604,6 @@ var updateTableConfig = (view, tableApi, provider, onTableConfigChange) => {
11572
11604
  dataTableApi?.setRowHeight(rowHeight);
11573
11605
  }
11574
11606
  dataTableApi?.setTableConfiguration(tableConfig);
11575
- if (onTableConfigChange) {
11576
- onTableConfigChange(tableConfig);
11577
- }
11578
11607
  }
11579
11608
  }
11580
11609
  };
@@ -11694,15 +11723,15 @@ import {
11694
11723
  Typography,
11695
11724
  useI18nContext as useI18nContext4
11696
11725
  } from "@procore/core-react";
11697
- import React15 from "react";
11726
+ import React16 from "react";
11698
11727
  var groupIcon = (group) => {
11699
11728
  switch (group) {
11700
11729
  case "personal":
11701
- return /* @__PURE__ */ React15.createElement(Person_default, null);
11730
+ return /* @__PURE__ */ React16.createElement(Person_default, null);
11702
11731
  case "project":
11703
- return /* @__PURE__ */ React15.createElement(Excavator_default, null);
11732
+ return /* @__PURE__ */ React16.createElement(Excavator_default, null);
11704
11733
  case "company":
11705
- return /* @__PURE__ */ React15.createElement(Building_default, null);
11734
+ return /* @__PURE__ */ React16.createElement(Building_default, null);
11706
11735
  }
11707
11736
  };
11708
11737
  var Header = styled_components_esm_default(Flex2)`
@@ -11713,7 +11742,7 @@ var Header = styled_components_esm_default(Flex2)`
11713
11742
  `;
11714
11743
  var ViewLevelHeader = ({ expanded, toggleGroup, group }) => {
11715
11744
  const I18n = useI18nContext4();
11716
- return /* @__PURE__ */ React15.createElement(
11745
+ return /* @__PURE__ */ React16.createElement(
11717
11746
  Header,
11718
11747
  {
11719
11748
  alignItems: "center",
@@ -11722,9 +11751,9 @@ var ViewLevelHeader = ({ expanded, toggleGroup, group }) => {
11722
11751
  style: { cursor: "pointer" },
11723
11752
  onClick: () => toggleGroup(group)
11724
11753
  },
11725
- expanded ? /* @__PURE__ */ React15.createElement(ChevronDown_default, { size: "sm" }) : /* @__PURE__ */ React15.createElement(ChevronRight_default, { size: "sm" }),
11754
+ expanded ? /* @__PURE__ */ React16.createElement(ChevronDown_default, { size: "sm" }) : /* @__PURE__ */ React16.createElement(ChevronRight_default, { size: "sm" }),
11726
11755
  groupIcon(group),
11727
- /* @__PURE__ */ React15.createElement(Typography, { weight: "semibold" }, I18n.t(`savedViews.viewLevel.${group}`))
11756
+ /* @__PURE__ */ React16.createElement(Typography, { weight: "semibold" }, I18n.t(`savedViews.viewLevel.${group}`))
11728
11757
  );
11729
11758
  };
11730
11759
  var ViewLevelHeader_default = ViewLevelHeader;
@@ -11762,17 +11791,16 @@ var PanelContent = (props) => {
11762
11791
  const { showToast } = useToastAlertContext2();
11763
11792
  const I18n = useI18nContext5();
11764
11793
  const { mutate: updateSavedView, isPending: isUpdateLoading } = useUpdateSavedView(props.queryInput);
11765
- const { data: savedViewsFromQuery, error: savedViewsError } = useSavedViewsQuery(props.queryInput);
11766
- const savedViews = props.savedViews ?? savedViewsFromQuery;
11767
- const errorToastRef = React16.useRef(null);
11768
- React16.useEffect(() => {
11794
+ const { error: savedViewsError } = useSavedViewsQuery(props.queryInput);
11795
+ const errorToastRef = React17.useRef(null);
11796
+ React17.useEffect(() => {
11769
11797
  if (savedViewsError && savedViewsError !== errorToastRef.current) {
11770
11798
  showToast.error(I18n.t("savedViews.errors.fetch"));
11771
11799
  errorToastRef.current = savedViewsError;
11772
11800
  }
11773
11801
  }, [savedViewsError, showToast, I18n]);
11774
11802
  const { data: permissions } = useSavedViewsPermissions(props.queryInput);
11775
- const selectedRowRef = useScrollToRef(savedViews);
11803
+ const selectedRowRef = useScrollToRef(props.savedViews);
11776
11804
  const onUpdate = (data) => {
11777
11805
  const newSavedView = {
11778
11806
  ...data,
@@ -11782,8 +11810,7 @@ var PanelContent = (props) => {
11782
11810
  updateSavedView(newSavedView, {
11783
11811
  onSuccess: () => {
11784
11812
  showToast.success(I18n.t("savedViews.update.success"));
11785
- props.updateLocalStorage(newSavedView);
11786
- props.setSelectedSavedView(newSavedView);
11813
+ props.onSelect({ item: newSavedView });
11787
11814
  },
11788
11815
  onError: () => {
11789
11816
  showToast.error(I18n.t("savedViews.errors.update"));
@@ -11793,29 +11820,32 @@ var PanelContent = (props) => {
11793
11820
  const { groups, toggleGroup } = useGroups();
11794
11821
  const isDefaultSelected = props.selectedSavedView?.id === "default";
11795
11822
  const isTemporarySelected = props.selectedSavedView?.id === "temporary";
11796
- const temporaryView = savedViews?.find((view) => view.id === "temporary");
11797
- return /* @__PURE__ */ React16.createElement(Panel2, { "data-testid": "inner-panel" }, /* @__PURE__ */ React16.createElement(Flex3, { direction: "column", style: { height: "100%", width: "100%" } }, temporaryView && /* @__PURE__ */ React16.createElement(
11823
+ const temporaryView = props.savedViews?.find(
11824
+ (view) => view.id === "temporary"
11825
+ );
11826
+ return /* @__PURE__ */ React17.createElement(Panel2, { "data-testid": "inner-panel" }, /* @__PURE__ */ React17.createElement(Flex3, { direction: "column", style: { height: "100%", width: "100%" } }, temporaryView && /* @__PURE__ */ React17.createElement(
11798
11827
  Row,
11799
11828
  {
11800
11829
  selected: isTemporarySelected,
11801
11830
  onClick: () => props.onSelect({ item: temporaryView }),
11802
11831
  ref: isTemporarySelected ? selectedRowRef : null
11803
11832
  },
11804
- /* @__PURE__ */ React16.createElement(
11833
+ /* @__PURE__ */ React17.createElement(
11805
11834
  SavedViewCollectionMenuItem,
11806
11835
  {
11807
11836
  item: temporaryView,
11808
- selected: isTemporarySelected
11837
+ selected: isTemporarySelected,
11838
+ onClearTemporary: props.onClearTemporary
11809
11839
  }
11810
11840
  )
11811
- ), /* @__PURE__ */ React16.createElement(
11841
+ ), /* @__PURE__ */ React17.createElement(
11812
11842
  Row,
11813
11843
  {
11814
11844
  selected: isDefaultSelected,
11815
11845
  onClick: () => props.onSelect({ item: props.defaultView }),
11816
11846
  ref: isDefaultSelected ? selectedRowRef : null
11817
11847
  },
11818
- /* @__PURE__ */ React16.createElement(
11848
+ /* @__PURE__ */ React17.createElement(
11819
11849
  SavedViewCollectionMenuItem,
11820
11850
  {
11821
11851
  item: props.defaultView,
@@ -11824,10 +11854,10 @@ var PanelContent = (props) => {
11824
11854
  )
11825
11855
  ), VIEW_LEVELS.map((level) => {
11826
11856
  const isExpanded = groups[level];
11827
- const views = isExpanded && savedViews ? savedViews.filter(
11857
+ const views = isExpanded && props.savedViews ? props.savedViews.filter(
11828
11858
  (view) => view.view_level === level && view.id !== "temporary"
11829
11859
  ) : [];
11830
- return /* @__PURE__ */ React16.createElement(React16.Fragment, { key: level }, /* @__PURE__ */ React16.createElement(
11860
+ return /* @__PURE__ */ React17.createElement(React17.Fragment, { key: level }, /* @__PURE__ */ React17.createElement(
11831
11861
  ViewLevelHeader_default,
11832
11862
  {
11833
11863
  group: level,
@@ -11843,7 +11873,7 @@ var PanelContent = (props) => {
11843
11873
  props.provider
11844
11874
  );
11845
11875
  const canEditOrDelete = isSelected && hasPermissionForViewLevel(view.view_level, permissions);
11846
- return /* @__PURE__ */ React16.createElement(
11876
+ return /* @__PURE__ */ React17.createElement(
11847
11877
  Row,
11848
11878
  {
11849
11879
  key: view.id,
@@ -11854,7 +11884,7 @@ var PanelContent = (props) => {
11854
11884
  },
11855
11885
  ref: isSelected ? selectedRowRef : null
11856
11886
  },
11857
- /* @__PURE__ */ React16.createElement(
11887
+ /* @__PURE__ */ React17.createElement(
11858
11888
  SavedViewCollectionMenuItem,
11859
11889
  {
11860
11890
  item: view,
@@ -11875,7 +11905,7 @@ var PanelContent = (props) => {
11875
11905
  };
11876
11906
 
11877
11907
  // src/SavedViews/components/SavedViews/SmartGrid/SmartGridSavedViews.tsx
11878
- import React23 from "react";
11908
+ import React23, { useCallback as useCallback4 } from "react";
11879
11909
 
11880
11910
  // src/SavedViews/components/SavedViews/SmartGrid/SmartGridDefaultSavedView.tsx
11881
11911
  import { useI18nContext as useI18nContext6 } from "@procore/core-react";
@@ -11938,12 +11968,12 @@ var useSmartGridConfig = (gridApi) => {
11938
11968
  import {
11939
11969
  Box as Box2,
11940
11970
  Button as Button6,
11941
- Flex as Flex5,
11971
+ Flex as Flex6,
11942
11972
  Panel as Panel3,
11943
11973
  Tooltip,
11944
11974
  useI18nContext as useI18nContext11
11945
11975
  } from "@procore/core-react";
11946
- import React22 from "react";
11976
+ import React22, { useState as useState5, useEffect as useEffect4, useCallback as useCallback3 } from "react";
11947
11977
  import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
11948
11978
 
11949
11979
  // src/SavedViews/components/SavedViewsModals/SavedViewsDeleteConfirmationModalShared.tsx
@@ -11954,14 +11984,14 @@ import {
11954
11984
  P as P2,
11955
11985
  useI18nContext as useI18nContext7
11956
11986
  } from "@procore/core-react";
11957
- import React17 from "react";
11987
+ import React18 from "react";
11958
11988
  var SavedViewsDeleteConfirmationModalShared = ({
11959
11989
  onCancel,
11960
11990
  onDelete,
11961
11991
  open
11962
11992
  }) => {
11963
11993
  const i18n = useI18nContext7();
11964
- return /* @__PURE__ */ React17.createElement(
11994
+ return /* @__PURE__ */ React18.createElement(
11965
11995
  ConfirmModal,
11966
11996
  {
11967
11997
  "data-testid": "delete-confirmation-modal",
@@ -11971,13 +12001,13 @@ var SavedViewsDeleteConfirmationModalShared = ({
11971
12001
  onClose: onCancel,
11972
12002
  style: { overflowWrap: "anywhere" }
11973
12003
  },
11974
- /* @__PURE__ */ React17.createElement(Modal.Body, null, /* @__PURE__ */ React17.createElement(P2, null, i18n.t("savedViews.modal.delete.description"))),
11975
- /* @__PURE__ */ React17.createElement(Modal.Footer, null, /* @__PURE__ */ React17.createElement(Modal.FooterButtons, null, /* @__PURE__ */ React17.createElement(Button3, { variant: "secondary", onClick: onCancel }, i18n.t("savedViews.actions.cancel")), /* @__PURE__ */ React17.createElement(Button3, { variant: "primary", onClick: onDelete }, i18n.t("savedViews.actions.delete"))))
12004
+ /* @__PURE__ */ React18.createElement(Modal.Body, null, /* @__PURE__ */ React18.createElement(P2, null, i18n.t("savedViews.modal.delete.description"))),
12005
+ /* @__PURE__ */ React18.createElement(Modal.Footer, null, /* @__PURE__ */ React18.createElement(Modal.FooterButtons, null, /* @__PURE__ */ React18.createElement(Button3, { variant: "secondary", onClick: onCancel }, i18n.t("savedViews.actions.cancel")), /* @__PURE__ */ React18.createElement(Button3, { variant: "primary", onClick: onDelete }, i18n.t("savedViews.actions.delete"))))
11976
12006
  );
11977
12007
  };
11978
12008
 
11979
12009
  // src/SavedViews/components/SavedViewsModals/SavedViewsFormModal.tsx
11980
- import React19 from "react";
12010
+ import React20 from "react";
11981
12011
 
11982
12012
  // src/SavedViews/components/SavedViewsModals/SavedViewsCreateUpdateModalBase.tsx
11983
12013
  import {
@@ -11993,7 +12023,7 @@ import {
11993
12023
  Typography as Typography2,
11994
12024
  useI18nContext as useI18nContext8
11995
12025
  } from "@procore/core-react";
11996
- import * as React18 from "react";
12026
+ import * as React19 from "react";
11997
12027
 
11998
12028
  // ../../node_modules/yup/index.esm.js
11999
12029
  var import_property_expr = __toESM(require_property_expr());
@@ -14336,7 +14366,6 @@ var SavedViewsCreateUpdateModalBase = ({
14336
14366
  tableName,
14337
14367
  defaultView,
14338
14368
  selectedSavedView,
14339
- setSelectedSavedView,
14340
14369
  setOpenEditCreateModal,
14341
14370
  onSelect
14342
14371
  }) => {
@@ -14374,8 +14403,8 @@ var SavedViewsCreateUpdateModalBase = ({
14374
14403
  };
14375
14404
  updateSavedView(body, {
14376
14405
  onSuccess: (updatedSavedView) => {
14406
+ onSelect(updatedSavedView);
14377
14407
  setOpenEditCreateModal(false);
14378
- setSelectedSavedView(updatedSavedView);
14379
14408
  }
14380
14409
  });
14381
14410
  } else {
@@ -14394,7 +14423,7 @@ var SavedViewsCreateUpdateModalBase = ({
14394
14423
  }
14395
14424
  };
14396
14425
  const viewLevelOptions = getViewLevelOptions(permissions, I18n);
14397
- return /* @__PURE__ */ React18.createElement(
14426
+ return /* @__PURE__ */ React19.createElement(
14398
14427
  Modal2,
14399
14428
  {
14400
14429
  "aria-label": I18n.t("savedViews.ariaLabels.modal"),
@@ -14403,14 +14432,14 @@ var SavedViewsCreateUpdateModalBase = ({
14403
14432
  style: { width: "540px" },
14404
14433
  "data-testid": "create-update-modal"
14405
14434
  },
14406
- /* @__PURE__ */ React18.createElement(ScrollContainer, null, /* @__PURE__ */ React18.createElement(
14435
+ /* @__PURE__ */ React19.createElement(ScrollContainer, null, /* @__PURE__ */ React19.createElement(
14407
14436
  Modal2.Header,
14408
14437
  {
14409
14438
  onClose,
14410
14439
  style: { borderBottom: `1px solid ${colors3.gray85}` }
14411
14440
  },
14412
- /* @__PURE__ */ React18.createElement(H2, null, header)
14413
- ), /* @__PURE__ */ React18.createElement(
14441
+ /* @__PURE__ */ React19.createElement(H2, null, header)
14442
+ ), /* @__PURE__ */ React19.createElement(
14414
14443
  Form,
14415
14444
  {
14416
14445
  initialValues: {
@@ -14436,13 +14465,13 @@ var SavedViewsCreateUpdateModalBase = ({
14436
14465
  onReset: onCancel,
14437
14466
  validateOnChange: true
14438
14467
  },
14439
- /* @__PURE__ */ React18.createElement(Form.Form, { name: header }, /* @__PURE__ */ React18.createElement(
14468
+ /* @__PURE__ */ React19.createElement(Form.Form, { name: header }, /* @__PURE__ */ React19.createElement(
14440
14469
  Modal2.Body,
14441
14470
  {
14442
14471
  style: { paddingTop: 0, paddingBottom: 0, marginTop: spacing3.lg }
14443
14472
  },
14444
- errors && /* @__PURE__ */ React18.createElement(ErrorBanner, { style: { marginBottom: spacing3.xl } }, /* @__PURE__ */ React18.createElement(Banner.Content, null, /* @__PURE__ */ React18.createElement(Banner.Title, null, I18n.t("savedViews.modal.errors.title", { mode })), /* @__PURE__ */ React18.createElement(Banner.Body, null, errors?.form || I18n.t(`savedViews.modal.errors.description.${mode}`)))),
14445
- /* @__PURE__ */ React18.createElement(Form.Row, null, /* @__PURE__ */ React18.createElement(
14473
+ errors && /* @__PURE__ */ React19.createElement(ErrorBanner, { style: { marginBottom: spacing3.xl } }, /* @__PURE__ */ React19.createElement(Banner.Content, null, /* @__PURE__ */ React19.createElement(Banner.Title, null, I18n.t("savedViews.modal.errors.title", { mode })), /* @__PURE__ */ React19.createElement(Banner.Body, null, errors?.form || I18n.t(`savedViews.modal.errors.description.${mode}`)))),
14474
+ /* @__PURE__ */ React19.createElement(Form.Row, null, /* @__PURE__ */ React19.createElement(
14446
14475
  Form.Text,
14447
14476
  {
14448
14477
  name: "name",
@@ -14453,12 +14482,12 @@ var SavedViewsCreateUpdateModalBase = ({
14453
14482
  onChange: () => resetMutations()
14454
14483
  }
14455
14484
  )),
14456
- /* @__PURE__ */ React18.createElement(
14485
+ /* @__PURE__ */ React19.createElement(
14457
14486
  Form.Row,
14458
14487
  {
14459
14488
  style: { marginTop: errors?.name ? spacing3.xl : spacing3.none }
14460
14489
  },
14461
- /* @__PURE__ */ React18.createElement(
14490
+ /* @__PURE__ */ React19.createElement(
14462
14491
  Form.TextArea,
14463
14492
  {
14464
14493
  name: "description",
@@ -14469,7 +14498,7 @@ var SavedViewsCreateUpdateModalBase = ({
14469
14498
  }
14470
14499
  )
14471
14500
  ),
14472
- viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */ React18.createElement(Form.Row, null, /* @__PURE__ */ React18.createElement(
14501
+ viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */ React19.createElement(Form.Row, null, /* @__PURE__ */ React19.createElement(
14473
14502
  Form.Select,
14474
14503
  {
14475
14504
  name: "view_level",
@@ -14479,8 +14508,8 @@ var SavedViewsCreateUpdateModalBase = ({
14479
14508
  onSearch: false,
14480
14509
  onClear: false
14481
14510
  }
14482
- )) : /* @__PURE__ */ React18.createElement(React18.Fragment, null)
14483
- ), /* @__PURE__ */ React18.createElement(Modal2.Footer, { style: { borderTop: `1px solid ${colors3.gray85}` } }, /* @__PURE__ */ React18.createElement(Flex4, { grow: "1", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React18.createElement(Typography2, { color: "gray45", italic: true }, /* @__PURE__ */ React18.createElement(Typography2, { color: "red45" }, "*"), " ", I18n.t("savedViews.modal.info.required_fields")), /* @__PURE__ */ React18.createElement(Modal2.FooterButtons, null, /* @__PURE__ */ React18.createElement(Button4, { type: "reset", variant: "tertiary", disabled: isLoading }, I18n.t("savedViews.actions.cancel")), /* @__PURE__ */ React18.createElement(
14511
+ )) : /* @__PURE__ */ React19.createElement(React19.Fragment, null)
14512
+ ), /* @__PURE__ */ React19.createElement(Modal2.Footer, { style: { borderTop: `1px solid ${colors3.gray85}` } }, /* @__PURE__ */ React19.createElement(Flex4, { grow: "1", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React19.createElement(Typography2, { color: "gray45", italic: true }, /* @__PURE__ */ React19.createElement(Typography2, { color: "red45" }, "*"), " ", I18n.t("savedViews.modal.info.required_fields")), /* @__PURE__ */ React19.createElement(Modal2.FooterButtons, null, /* @__PURE__ */ React19.createElement(Button4, { type: "reset", variant: "tertiary", disabled: isLoading }, I18n.t("savedViews.actions.cancel")), /* @__PURE__ */ React19.createElement(
14484
14513
  Button4,
14485
14514
  {
14486
14515
  "data-testid": "create-update-modal-button",
@@ -14505,13 +14534,12 @@ var SavedViewsFormModal = ({
14505
14534
  tableName,
14506
14535
  queryInput,
14507
14536
  selectedSavedView,
14508
- setSelectedSavedView,
14509
14537
  setOpenEditCreateModal,
14510
14538
  onSelect,
14511
14539
  defaultView
14512
14540
  }) => {
14513
14541
  const i18n = useI18nContext9();
14514
- return /* @__PURE__ */ React19.createElement(
14542
+ return /* @__PURE__ */ React20.createElement(
14515
14543
  SavedViewsCreateUpdateModalBase,
14516
14544
  {
14517
14545
  open,
@@ -14524,7 +14552,6 @@ var SavedViewsFormModal = ({
14524
14552
  tableConfig,
14525
14553
  tableName,
14526
14554
  selectedSavedView,
14527
- setSelectedSavedView,
14528
14555
  setOpenEditCreateModal,
14529
14556
  onSelect,
14530
14557
  defaultView
@@ -14532,274 +14559,301 @@ var SavedViewsFormModal = ({
14532
14559
  );
14533
14560
  };
14534
14561
 
14535
- // src/SavedViews/components/SavedViewsModals/CopyViewConfirmationModal.tsx
14536
- import { Button as Button5, Modal as Modal3, P as P3, useI18nContext as useI18nContext10 } from "@procore/core-react";
14537
- import React20 from "react";
14538
- var CreateViewConfirmationModal = ({ open, savedViewName, onClose, onViewTemporarily, onCreateView }) => {
14539
- const i18n = useI18nContext10();
14540
- const handleViewTemporarily = () => {
14541
- onViewTemporarily?.();
14562
+ // src/SavedViews/components/SavedViewsModals/SharedViewFormModal.tsx
14563
+ import {
14564
+ Banner as Banner2,
14565
+ Button as Button5,
14566
+ colors as colors4,
14567
+ ErrorBanner as ErrorBanner2,
14568
+ Flex as Flex5,
14569
+ Form as Form2,
14570
+ Modal as Modal3,
14571
+ P as P3,
14572
+ spacing as spacing4,
14573
+ Typography as Typography3,
14574
+ useI18nContext as useI18nContext10
14575
+ } from "@procore/core-react";
14576
+ import * as React21 from "react";
14577
+ var SharedViewFormModal = ({
14578
+ open,
14579
+ fetchedView,
14580
+ onClose,
14581
+ onCreateTemporaryView,
14582
+ onCreateView,
14583
+ createError,
14584
+ isCreating,
14585
+ resetCreateError
14586
+ }) => {
14587
+ const I18n = useI18nContext10();
14588
+ const NAME_MAX_LENGTH = 150;
14589
+ const errors = extractMessage(createError, I18n);
14590
+ const handleNameChange = () => {
14591
+ if (resetCreateError) {
14592
+ resetCreateError();
14593
+ }
14542
14594
  };
14543
- const handleCreateView = () => {
14544
- onCreateView?.();
14595
+ const handleOnSubmit = (data) => {
14596
+ onCreateView(data.name, data.description);
14545
14597
  };
14546
- return /* @__PURE__ */ React20.createElement(
14598
+ return /* @__PURE__ */ React21.createElement(
14547
14599
  Modal3,
14548
14600
  {
14549
- "data-testid": "create-view-confirmation-modal",
14601
+ "data-testid": "shared-view-form-modal",
14550
14602
  open,
14551
- onClickOverlay: onClose
14552
- },
14553
- /* @__PURE__ */ React20.createElement(Modal3.Header, { onClose }, i18n.t("savedViews.modal.copyConfirmation.headline", {
14554
- savedViewName
14555
- })),
14556
- /* @__PURE__ */ React20.createElement(Modal3.Body, null, /* @__PURE__ */ React20.createElement(P3, null, i18n.t("savedViews.modal.copyConfirmation.description"))),
14557
- /* @__PURE__ */ React20.createElement(Modal3.Footer, null, /* @__PURE__ */ React20.createElement(Modal3.FooterButtons, null, /* @__PURE__ */ React20.createElement(
14558
- Button5,
14603
+ onClickOverlay: onClose,
14604
+ style: { width: "540px" }
14605
+ },
14606
+ /* @__PURE__ */ React21.createElement(
14607
+ Modal3.Header,
14559
14608
  {
14560
- variant: "secondary",
14561
- onClick: handleViewTemporarily,
14562
- "data-testid": "view-temporarily-button"
14609
+ onClose,
14610
+ style: {
14611
+ paddingTop: spacing4.lg,
14612
+ paddingBottom: spacing4.xs,
14613
+ paddingLeft: spacing4.xl,
14614
+ paddingRight: spacing4.xl
14615
+ }
14616
+ },
14617
+ I18n.t("savedViews.modal.create.title")
14618
+ ),
14619
+ /* @__PURE__ */ React21.createElement(
14620
+ P3,
14621
+ {
14622
+ style: {
14623
+ paddingLeft: spacing4.xl,
14624
+ paddingRight: spacing4.xl,
14625
+ paddingBottom: spacing4.lg,
14626
+ paddingTop: spacing4.none,
14627
+ margin: 0,
14628
+ color: colors4.gray45,
14629
+ whiteSpace: "pre-line"
14630
+ }
14563
14631
  },
14564
- i18n.t("savedViews.actions.viewTemporarily")
14565
- ), /* @__PURE__ */ React20.createElement(
14566
- Button5,
14632
+ I18n.t("savedViews.modal.copyConfirmation.description")
14633
+ ),
14634
+ /* @__PURE__ */ React21.createElement(
14635
+ Form2,
14567
14636
  {
14568
- variant: "primary",
14569
- onClick: handleCreateView,
14570
- "data-testid": "create-view-button"
14637
+ initialValues: {
14638
+ name: fetchedView.name,
14639
+ description: fetchedView.description ?? ""
14640
+ },
14641
+ view: "create",
14642
+ validationSchema: create$3().shape({
14643
+ name: create$6().trim().max(
14644
+ NAME_MAX_LENGTH,
14645
+ I18n.t("savedViews.modal.errors.maxLengthName", {
14646
+ maxLength: NAME_MAX_LENGTH
14647
+ })
14648
+ ).required(I18n.t("savedViews.modal.errors.required"))
14649
+ }),
14650
+ onSubmit: handleOnSubmit,
14651
+ validateOnChange: true
14571
14652
  },
14572
- i18n.t("savedViews.actions.createView")
14573
- )))
14653
+ /* @__PURE__ */ React21.createElement(Form2.Form, { name: "share-view-form" }, /* @__PURE__ */ React21.createElement(
14654
+ Modal3.Body,
14655
+ {
14656
+ style: {
14657
+ paddingTop: spacing4.lg,
14658
+ paddingBottom: 0,
14659
+ borderTop: `1px solid ${colors4.gray85}`
14660
+ }
14661
+ },
14662
+ errors && /* @__PURE__ */ React21.createElement(ErrorBanner2, { style: { marginBottom: spacing4.xl } }, /* @__PURE__ */ React21.createElement(Banner2.Content, null, /* @__PURE__ */ React21.createElement(Banner2.Title, null, I18n.t("savedViews.modal.errors.title", {
14663
+ mode: "create"
14664
+ })), /* @__PURE__ */ React21.createElement(Banner2.Body, null, errors?.form || I18n.t("savedViews.modal.errors.description.create")))),
14665
+ /* @__PURE__ */ React21.createElement(Form2.Row, null, /* @__PURE__ */ React21.createElement(
14666
+ Form2.Text,
14667
+ {
14668
+ name: "name",
14669
+ error: errors?.name,
14670
+ placeholder: I18n.t("savedViews.modal.fields.name"),
14671
+ label: I18n.t("savedViews.modal.fields.name"),
14672
+ colWidth: 12,
14673
+ onChange: handleNameChange
14674
+ }
14675
+ )),
14676
+ /* @__PURE__ */ React21.createElement(
14677
+ Form2.Row,
14678
+ {
14679
+ style: { marginTop: errors?.name ? spacing4.xl : spacing4.none }
14680
+ },
14681
+ /* @__PURE__ */ React21.createElement(
14682
+ Form2.TextArea,
14683
+ {
14684
+ name: "description",
14685
+ placeholder: I18n.t("savedViews.modal.fields.description"),
14686
+ label: I18n.t("savedViews.modal.fields.description"),
14687
+ colWidth: 12,
14688
+ resize: "vertical"
14689
+ }
14690
+ )
14691
+ )
14692
+ ), /* @__PURE__ */ React21.createElement(Modal3.Footer, { style: { borderTop: `1px solid ${colors4.gray85}` } }, /* @__PURE__ */ React21.createElement(Flex5, { grow: "1", justifyContent: "space-between", alignItems: "center" }, /* @__PURE__ */ React21.createElement(Typography3, { color: "gray45", italic: true }, /* @__PURE__ */ React21.createElement(Typography3, { color: "red45" }, "*"), " ", I18n.t("savedViews.modal.info.required_fields")), /* @__PURE__ */ React21.createElement(Modal3.FooterButtons, null, /* @__PURE__ */ React21.createElement(
14693
+ Button5,
14694
+ {
14695
+ variant: "secondary",
14696
+ onClick: onCreateTemporaryView,
14697
+ "data-testid": "view-temporarily-button",
14698
+ disabled: isCreating
14699
+ },
14700
+ I18n.t("savedViews.actions.viewTemporarily")
14701
+ ), /* @__PURE__ */ React21.createElement(
14702
+ Button5,
14703
+ {
14704
+ type: "submit",
14705
+ variant: "primary",
14706
+ "data-testid": "create-view-button",
14707
+ disabled: isCreating,
14708
+ loading: isCreating
14709
+ },
14710
+ I18n.t("savedViews.actions.create")
14711
+ )))))
14712
+ )
14574
14713
  );
14575
14714
  };
14576
14715
 
14577
14716
  // src/utils/Hooks/useViewSelection.ts
14578
- import { useState as useState4, useCallback as useCallback2 } from "react";
14579
-
14580
- // src/utils/Hooks/useUrlSync.ts
14581
- import { useEffect as useEffect3 } from "react";
14717
+ import { useState as useState4, useCallback as useCallback2, useEffect as useEffect3 } from "react";
14582
14718
  import { useSearchParams } from "react-router-dom";
14583
- var useUrlSync = (selectedView, availableViews, defaultView, onViewFound, onViewNotFound) => {
14584
- const [searchParams, setSearchParams] = useSearchParams();
14585
- const applySavedViewFromUrl = (savedViewId) => {
14586
- if (savedViewId === "default") {
14587
- if (defaultView.id !== selectedView?.id) {
14588
- onViewFound(defaultView);
14589
- }
14590
- return;
14591
- }
14592
- const viewInUserViews = availableViews.find((v2) => v2.id === savedViewId);
14593
- if (viewInUserViews) {
14594
- if (viewInUserViews.id !== selectedView?.id) {
14595
- onViewFound(viewInUserViews);
14596
- }
14597
- } else {
14598
- onViewNotFound(savedViewId);
14599
- }
14600
- };
14601
- const applyListView = (viewParam) => {
14602
- if (viewParam === "list" && defaultView.id !== selectedView?.id) {
14603
- onViewFound(defaultView);
14604
- }
14605
- };
14606
- useEffect3(() => {
14607
- if (!availableViews.length)
14608
- return;
14609
- const savedViewId = searchParams.get("saved-view");
14610
- const viewParamFromConsumer = searchParams.get("view");
14611
- if (savedViewId) {
14612
- applySavedViewFromUrl(savedViewId);
14613
- return;
14614
- }
14615
- if (viewParamFromConsumer) {
14616
- applyListView(viewParamFromConsumer);
14719
+
14720
+ // src/utils/viewStorage.ts
14721
+ var ViewStorage = {
14722
+ save(key, view) {
14723
+ localStorage.setItem(key, JSON.stringify(view));
14724
+ },
14725
+ load(key) {
14726
+ try {
14727
+ const stored = localStorage.getItem(key);
14728
+ return stored ? JSON.parse(stored) : null;
14729
+ } catch (e2) {
14730
+ return null;
14617
14731
  }
14618
- }, [
14619
- searchParams,
14620
- availableViews,
14621
- defaultView,
14622
- selectedView,
14623
- onViewFound,
14624
- onViewNotFound
14625
- ]);
14626
- const updateUrl = (view) => {
14627
- setSearchParams(
14628
- (currentParams) => {
14629
- const updatedParams = new URLSearchParams(currentParams);
14630
- if (view.id === "default") {
14631
- updatedParams.delete("saved-view");
14632
- } else {
14633
- updatedParams.set("saved-view", view.id);
14634
- }
14635
- return updatedParams;
14636
- },
14637
- { replace: true }
14638
- );
14639
- };
14640
- return { updateUrl };
14732
+ },
14733
+ remove(key) {
14734
+ localStorage.removeItem(key);
14735
+ }
14641
14736
  };
14642
14737
 
14643
14738
  // src/utils/Hooks/useViewSelection.ts
14644
- var useViewSelection = (config, savedViews, openCrossUserModal) => {
14739
+ var getUpdatedSearchParams = (currentParams, view) => {
14740
+ const updatedParams = new URLSearchParams(currentParams);
14741
+ if (view.id === "default") {
14742
+ updatedParams.delete("saved-view");
14743
+ } else if (view.id === "temporary") {
14744
+ updatedParams.set("saved-view", "temporary");
14745
+ } else {
14746
+ updatedParams.set("saved-view", view.share_token);
14747
+ }
14748
+ return updatedParams;
14749
+ };
14750
+ var checkIsViewSelected = (selectedView, viewId) => {
14751
+ return selectedView?.share_token === viewId || selectedView?.id === viewId;
14752
+ };
14753
+ var useViewSelection = (config, savedViews, openSharedViewModal) => {
14754
+ const storageKey = `${config.domain}_${config.tableName}_${config.stickyViewsKey}_${config.projectId}_${config.userId}`;
14755
+ const temporaryStorageKey = `${storageKey}_temporary`;
14756
+ const [searchParams, setSearchParams] = useSearchParams();
14645
14757
  const [selectedSavedView, setSelectedSavedView] = useState4(() => {
14646
- try {
14647
- const savedView = JSON.parse(
14648
- localStorage.getItem(
14649
- `${config.domain}_${config.tableName}_${config.stickyViewsKey}_${config.projectId}_${config.userId}`
14650
- )
14651
- );
14652
- return savedView || config.defaultView;
14653
- } catch (e2) {
14654
- return config.defaultView;
14655
- }
14758
+ const stored = ViewStorage.load(storageKey);
14759
+ return stored ?? config.defaultView;
14760
+ });
14761
+ const [temporaryView, setTemporaryView] = useState4(() => {
14762
+ return ViewStorage.load(temporaryStorageKey);
14656
14763
  });
14657
- const [temporaryView, setTemporaryView] = useState4(null);
14658
- const createTemporaryView = useCallback2((fetchedView) => {
14659
- const tempView = {
14660
- ...fetchedView,
14661
- id: "temporary",
14662
- name: "Temporary View"
14663
- };
14664
- setTemporaryView(tempView);
14665
- return tempView;
14666
- }, []);
14667
- const clearTemporaryView = useCallback2(() => setTemporaryView(null), []);
14668
14764
  const updateLocalStorage = useCallback2(
14669
14765
  (view) => {
14670
14766
  if (config.stickyViewsKey) {
14671
- localStorage.setItem(
14672
- `${config.domain}_${config.tableName}_${config.stickyViewsKey}_${config.projectId}_${config.userId}`,
14673
- JSON.stringify(view)
14674
- );
14767
+ ViewStorage.save(storageKey, view);
14675
14768
  }
14676
14769
  },
14677
- [
14678
- config.domain,
14679
- config.tableName,
14680
- config.stickyViewsKey,
14681
- config.projectId,
14682
- config.userId
14683
- ]
14770
+ [config.stickyViewsKey, storageKey]
14684
14771
  );
14685
- const allViews = temporaryView ? [...savedViews ?? [], temporaryView] : savedViews ?? [];
14686
- const onUrlViewFound = (foundView) => {
14687
- selectView(foundView);
14688
- };
14689
- const onUrlViewNotFound = (viewId) => {
14690
- if (viewId === selectedSavedView?.id) {
14691
- return;
14692
- }
14693
- openCrossUserModal(viewId);
14694
- };
14695
- const { updateUrl } = useUrlSync(
14696
- selectedSavedView,
14697
- allViews,
14698
- config.defaultView,
14699
- onUrlViewFound,
14700
- onUrlViewNotFound
14772
+ const updateUrlForView = useCallback2(
14773
+ (view) => {
14774
+ setSearchParams(
14775
+ (currentParams) => getUpdatedSearchParams(currentParams, view),
14776
+ { replace: true }
14777
+ );
14778
+ },
14779
+ [setSearchParams]
14701
14780
  );
14781
+ const baseViews = savedViews ?? [];
14782
+ const allViews = temporaryView ? [...baseViews, temporaryView] : baseViews;
14702
14783
  const selectView = useCallback2(
14703
14784
  (view) => {
14704
- if (view.id !== "temporary" && temporaryView) {
14705
- clearTemporaryView();
14706
- }
14707
14785
  const viewToSelect = config.onSelect({ item: view });
14708
14786
  setSelectedSavedView(viewToSelect);
14709
14787
  updateLocalStorage(viewToSelect);
14710
- updateUrl(viewToSelect);
14788
+ updateUrlForView(viewToSelect);
14711
14789
  return viewToSelect;
14712
14790
  },
14713
- [config, temporaryView, clearTemporaryView, updateLocalStorage, updateUrl]
14791
+ [config, updateLocalStorage, updateUrlForView]
14714
14792
  );
14715
- return {
14716
- selectedView: selectedSavedView,
14717
- selectView,
14718
- updateLocalStorage,
14719
- temporaryView,
14720
- createTemporaryView
14721
- };
14722
- };
14723
-
14724
- // src/utils/Hooks/useCrossUserSharing.ts
14725
- import React21 from "react";
14726
- var useCrossUserSharing = (queryInput, viewId, selectedSavedView, defaultView, actions, tableName) => {
14727
- const { data: fetchedView, isError: fetchError } = useFetchSavedViewById(
14728
- viewId,
14729
- queryInput,
14730
- Boolean(viewId)
14731
- );
14732
- const { mutate: createSavedView } = useCreateSavedView(queryInput);
14733
- React21.useEffect(() => {
14734
- if (fetchError && viewId) {
14735
- actions.selectView(selectedSavedView ?? defaultView);
14736
- actions.closeModal();
14737
- }
14738
- }, [fetchError, viewId, actions, selectedSavedView, defaultView]);
14739
- const viewSharedViewTemporarily = () => {
14740
- if (fetchedView) {
14741
- const tempView = actions.createTemporaryView(fetchedView);
14742
- actions.selectView(tempView);
14743
- actions.closeModal();
14744
- }
14745
- };
14746
- const createPersonalCopyOfSharedView = () => {
14747
- if (fetchedView) {
14748
- const viewToCreate = {
14749
- name: fetchedView.name,
14750
- description: fetchedView.description,
14751
- table_name: tableName,
14752
- table_config: fetchedView.table_config,
14753
- view_level: "personal"
14793
+ const createTemporaryView = useCallback2(
14794
+ (fetchedView) => {
14795
+ const tempView = {
14796
+ ...fetchedView,
14797
+ id: "temporary",
14798
+ name: "Temporary View"
14754
14799
  };
14755
- createSavedView(viewToCreate, {
14756
- onSuccess: (newView) => {
14757
- actions.selectView(newView);
14758
- actions.closeModal();
14759
- }
14760
- });
14761
- }
14762
- };
14763
- const selectCurrentViewAndCloseModal = () => {
14764
- actions.selectView(selectedSavedView ?? defaultView);
14765
- actions.closeModal();
14766
- };
14767
- return {
14768
- fetchedView,
14769
- viewSharedViewTemporarily,
14770
- createPersonalCopyOfSharedView,
14771
- selectCurrentViewAndCloseModal
14772
- };
14773
- };
14774
-
14775
- // src/utils/Hooks/useModalState.ts
14776
- import { useState as useState5, useCallback as useCallback3 } from "react";
14777
- var useModalState = () => {
14778
- const [activeModal, setActiveModal] = useState5(null);
14779
- const [modalData, setModalData] = useState5(null);
14780
- const openModal = useCallback3(
14781
- (type, data) => {
14782
- setActiveModal(type);
14783
- setModalData(data ?? null);
14800
+ ViewStorage.save(temporaryStorageKey, tempView);
14801
+ setTemporaryView(tempView);
14802
+ selectView(tempView);
14803
+ return tempView;
14784
14804
  },
14785
- []
14805
+ [temporaryStorageKey, selectView]
14786
14806
  );
14787
- const closeModal = useCallback3(() => {
14788
- setActiveModal(null);
14789
- setModalData(null);
14790
- }, []);
14791
- const isModalOpen = useCallback3(
14792
- (type) => {
14793
- return activeModal === type;
14807
+ const clearTemporaryView = useCallback2(() => {
14808
+ ViewStorage.remove(temporaryStorageKey);
14809
+ setTemporaryView(null);
14810
+ selectView(config.defaultView);
14811
+ }, [temporaryStorageKey, config.defaultView, selectView]);
14812
+ const isViewAlreadySelected = useCallback2(
14813
+ (viewId) => checkIsViewSelected(selectedSavedView, viewId),
14814
+ [selectedSavedView]
14815
+ );
14816
+ const handleSavedViewFromUrl = useCallback2(
14817
+ (viewId) => {
14818
+ if (isViewAlreadySelected(viewId)) {
14819
+ return;
14820
+ }
14821
+ openSharedViewModal(viewId);
14794
14822
  },
14795
- [activeModal]
14823
+ [isViewAlreadySelected, openSharedViewModal]
14796
14824
  );
14825
+ const handleListViewFromUrl = useCallback2(() => {
14826
+ if (config.defaultView.id !== selectedSavedView?.id) {
14827
+ selectView(config.defaultView);
14828
+ }
14829
+ }, [config.defaultView, selectedSavedView, selectView]);
14830
+ useEffect3(() => {
14831
+ if (!allViews.length)
14832
+ return;
14833
+ const savedViewId = searchParams.get("saved-view");
14834
+ const viewParamFromConsumer = searchParams.get("view");
14835
+ if (savedViewId) {
14836
+ handleSavedViewFromUrl(savedViewId);
14837
+ return;
14838
+ }
14839
+ if (viewParamFromConsumer === "list") {
14840
+ handleListViewFromUrl();
14841
+ }
14842
+ }, [
14843
+ searchParams,
14844
+ savedViews,
14845
+ temporaryView,
14846
+ handleSavedViewFromUrl,
14847
+ handleListViewFromUrl,
14848
+ allViews.length
14849
+ ]);
14797
14850
  return {
14798
- openModal,
14799
- closeModal,
14800
- isModalOpen,
14801
- modalData,
14802
- activeModal
14851
+ selectedView: selectedSavedView,
14852
+ selectView,
14853
+ temporaryView,
14854
+ createTemporaryView,
14855
+ clearTemporaryView,
14856
+ allViews
14803
14857
  };
14804
14858
  };
14805
14859
 
@@ -14819,16 +14873,26 @@ var SavedViewsContent = (props) => {
14819
14873
  };
14820
14874
  const { data: savedViews } = useSavedViewsQuery(queryInput);
14821
14875
  const { mutate: deleteSavedView } = useDeleteSavedView(queryInput);
14822
- const { openModal, closeModal, isModalOpen, modalData, activeModal } = useModalState();
14823
- const openCrossUserModal = (viewId) => {
14824
- openModal("crossUser" /* CROSS_USER */, { viewId });
14876
+ const [activeModal, setActiveModal] = useState5(null);
14877
+ const [modalData, setModalData] = useState5(null);
14878
+ const openModal = (type, data) => {
14879
+ setActiveModal(type);
14880
+ setModalData(data ?? null);
14881
+ };
14882
+ const closeModal = useCallback3(() => {
14883
+ setActiveModal(null);
14884
+ setModalData(null);
14885
+ }, []);
14886
+ const isModalOpen = (type) => activeModal === type;
14887
+ const openSharedViewModal = (viewId) => {
14888
+ openModal("sharedView" /* SHARED_VIEW */, { viewId });
14825
14889
  };
14826
14890
  const {
14827
14891
  selectedView,
14828
14892
  selectView,
14829
- updateLocalStorage,
14830
- temporaryView,
14831
- createTemporaryView
14893
+ createTemporaryView,
14894
+ clearTemporaryView,
14895
+ allViews
14832
14896
  } = useViewSelection(
14833
14897
  {
14834
14898
  domain: props.domain,
@@ -14840,25 +14904,54 @@ var SavedViewsContent = (props) => {
14840
14904
  onSelect: props.onSelect
14841
14905
  },
14842
14906
  savedViews,
14843
- openCrossUserModal
14907
+ openSharedViewModal
14844
14908
  );
14845
- const {
14846
- fetchedView,
14847
- viewSharedViewTemporarily,
14848
- createPersonalCopyOfSharedView,
14849
- selectCurrentViewAndCloseModal
14850
- } = useCrossUserSharing(
14851
- queryInput,
14909
+ const { data: fetchedView, isError: fetchError } = useFetchSavedViewById(
14852
14910
  modalData?.viewId ?? null,
14853
- selectedView,
14854
- props.defaultView,
14855
- {
14856
- selectView,
14857
- createTemporaryView,
14858
- closeModal
14859
- },
14860
- props.tableName
14911
+ queryInput,
14912
+ Boolean(modalData?.viewId)
14861
14913
  );
14914
+ const {
14915
+ mutate: createSavedView,
14916
+ isPending: isCreating,
14917
+ error: createError,
14918
+ reset: resetCreateError
14919
+ } = useCreateSavedView(queryInput);
14920
+ useEffect4(() => {
14921
+ if (fetchError) {
14922
+ selectView(selectedView ?? props.defaultView);
14923
+ closeModal();
14924
+ }
14925
+ }, [fetchError, selectedView, props.defaultView, selectView, closeModal]);
14926
+ const viewSharedViewTemporarily = () => {
14927
+ if (fetchedView) {
14928
+ createTemporaryView(fetchedView);
14929
+ closeModal();
14930
+ }
14931
+ };
14932
+ const createPersonalCopyOfSharedView = (name, description) => {
14933
+ if (fetchedView) {
14934
+ const viewToCreate = {
14935
+ id: "",
14936
+ name,
14937
+ description,
14938
+ table_name: props.tableName,
14939
+ table_config: fetchedView.table_config,
14940
+ view_level: "personal",
14941
+ share_token: ""
14942
+ };
14943
+ createSavedView(viewToCreate, {
14944
+ onSuccess: (newView) => {
14945
+ selectView(newView);
14946
+ closeModal();
14947
+ }
14948
+ });
14949
+ }
14950
+ };
14951
+ const selectCurrentViewAndCloseModal = () => {
14952
+ selectView(selectedView ?? props.defaultView);
14953
+ closeModal();
14954
+ };
14862
14955
  const deleteSelectedView = () => {
14863
14956
  if (selectedView) {
14864
14957
  deleteSavedView(selectedView, {
@@ -14871,18 +14964,13 @@ var SavedViewsContent = (props) => {
14871
14964
  closeModal();
14872
14965
  };
14873
14966
  const i18n = useI18nContext11();
14874
- const selectSavedViewFromList = ({ item }) => selectView(item);
14875
- const setSelectedSavedView = (view) => {
14876
- selectView(view);
14877
- };
14878
- const allViews = temporaryView ? [...savedViews ?? [], temporaryView] : savedViews ?? [];
14879
14967
  return /* @__PURE__ */ React22.createElement(StyledPanel, { provider: props.provider }, /* @__PURE__ */ React22.createElement(
14880
14968
  ExpandedPanel,
14881
14969
  {
14882
14970
  "data-testid": "saved-view-expanded-panel",
14883
14971
  provider: props.provider
14884
14972
  },
14885
- /* @__PURE__ */ React22.createElement(Panel3.Header, { id: "saved-views-collections-panel-header" }, /* @__PURE__ */ React22.createElement(Panel3.Title, null, /* @__PURE__ */ React22.createElement(Flex5, { alignItems: "center" }, /* @__PURE__ */ React22.createElement(Box2, { paddingRight: "sm" }, i18n.t("savedViews.title")), /* @__PURE__ */ React22.createElement(Tooltip, { showDelay: 200, overlay: i18n.t("savedViews.tooltip") }, /* @__PURE__ */ React22.createElement(Help_default, { size: "sm" })))), /* @__PURE__ */ React22.createElement(
14973
+ /* @__PURE__ */ React22.createElement(Panel3.Header, { id: "saved-views-collections-panel-header" }, /* @__PURE__ */ React22.createElement(Panel3.Title, null, /* @__PURE__ */ React22.createElement(Flex6, { alignItems: "center" }, /* @__PURE__ */ React22.createElement(Box2, { paddingRight: "sm" }, i18n.t("savedViews.title")), /* @__PURE__ */ React22.createElement(Tooltip, { showDelay: 200, overlay: i18n.t("savedViews.tooltip") }, /* @__PURE__ */ React22.createElement(Help_default, { size: "sm" })))), /* @__PURE__ */ React22.createElement(
14886
14974
  Tooltip,
14887
14975
  {
14888
14976
  overlay: i18n.t("savedViews.actions.create"),
@@ -14903,11 +14991,9 @@ var SavedViewsContent = (props) => {
14903
14991
  /* @__PURE__ */ React22.createElement(Panel3.Body, { style: { display: "flex", flexFlow: "column" } }, /* @__PURE__ */ React22.createElement(
14904
14992
  PanelContent,
14905
14993
  {
14906
- onSelect: selectSavedViewFromList,
14994
+ onSelect: ({ item }) => selectView(item),
14907
14995
  openModal,
14908
14996
  onDelete: () => openModal("delete" /* DELETE */),
14909
- updateLocalStorage,
14910
- setSelectedSavedView,
14911
14997
  queryInput,
14912
14998
  selectedSavedView: selectedView,
14913
14999
  tableConfig: props.tableConfig,
@@ -14915,7 +15001,8 @@ var SavedViewsContent = (props) => {
14915
15001
  stickyViewsKey: props.stickyViewsKey,
14916
15002
  savedViews: allViews,
14917
15003
  provider: props.provider,
14918
- userId: props.userId
15004
+ userId: props.userId,
15005
+ onClearTemporary: clearTemporaryView
14919
15006
  }
14920
15007
  ))
14921
15008
  ), (isModalOpen("create" /* CREATE */) || isModalOpen("update" /* UPDATE */)) && /* @__PURE__ */ React22.createElement(
@@ -14928,7 +15015,6 @@ var SavedViewsContent = (props) => {
14928
15015
  tableConfig: props.tableConfig,
14929
15016
  tableName: props.tableName,
14930
15017
  selectedSavedView: selectedView,
14931
- setSelectedSavedView,
14932
15018
  onSelect: selectView,
14933
15019
  setOpenEditCreateModal: closeModal,
14934
15020
  defaultView: props.defaultView
@@ -14940,14 +15026,17 @@ var SavedViewsContent = (props) => {
14940
15026
  onDelete: confirmDeleteAndCloseModal,
14941
15027
  onCancel: closeModal
14942
15028
  }
14943
- ), fetchedView && isModalOpen("crossUser" /* CROSS_USER */) && /* @__PURE__ */ React22.createElement(
14944
- CreateViewConfirmationModal,
15029
+ ), fetchedView && isModalOpen("sharedView" /* SHARED_VIEW */) && /* @__PURE__ */ React22.createElement(
15030
+ SharedViewFormModal,
14945
15031
  {
14946
15032
  open: true,
14947
- savedViewName: fetchedView.name,
15033
+ fetchedView,
14948
15034
  onClose: selectCurrentViewAndCloseModal,
14949
- onViewTemporarily: viewSharedViewTemporarily,
14950
- onCreateView: createPersonalCopyOfSharedView
15035
+ onCreateTemporaryView: viewSharedViewTemporarily,
15036
+ onCreateView: createPersonalCopyOfSharedView,
15037
+ createError,
15038
+ isCreating,
15039
+ resetCreateError
14951
15040
  }
14952
15041
  ));
14953
15042
  };
@@ -14957,59 +15046,77 @@ var SavedViews = (props) => {
14957
15046
 
14958
15047
  // src/SavedViews/components/SavedViews/SmartGrid/SmartGridSavedViews.tsx
14959
15048
  import { ToastAlertProvider } from "@procore/toast-alert";
15049
+ var generateStickyViewsKey = (domain, tableName, userId, projectId, companyId) => {
15050
+ return `savedView-${domain}-${tableName}-${companyId}-${projectId}-${userId}`;
15051
+ };
14960
15052
  var SmartGridSavedViews = (props) => {
14961
- const { gridApi, projectId, companyId } = props;
15053
+ const { gridApi, userId, projectId, companyId } = props;
14962
15054
  const { config: tableConfig, setConfig: setTableConfig } = useSmartGridConfig(gridApi);
14963
15055
  const defaultView = useDefaultView({
14964
15056
  defaultViewName: props.defaultViewName,
14965
15057
  domain: props.domain
14966
15058
  });
14967
- const onSelect = ({ item }) => {
14968
- if (!gridApi)
14969
- return item;
14970
- if (item.id === "default") {
14971
- gridApi.autoSizeAllColumns();
14972
- gridApi.resetColumnState();
14973
- gridApi.setFilterModel(props.defaultViewFilters);
14974
- gridApi.setGridOption("rowHeight", props.defaultRowHeight);
14975
- gridApi.refreshCells();
14976
- return item;
14977
- }
14978
- const updatedView = {
14979
- ...item,
14980
- table_config: customAndConfigSync(
14981
- item.table_config,
14982
- tableConfig
14983
- )
14984
- };
14985
- updateTableConfig(updatedView, gridApi, "smart-grid");
14986
- setTableConfig(updatedView.table_config);
14987
- return updatedView;
14988
- };
15059
+ const onSelect = useCallback4(
15060
+ ({ item }) => {
15061
+ if (!gridApi)
15062
+ return item;
15063
+ if (item.id === "default") {
15064
+ gridApi.autoSizeAllColumns();
15065
+ gridApi.resetColumnState();
15066
+ gridApi.setFilterModel(props.defaultViewFilters);
15067
+ gridApi.setGridOption("rowHeight", props.defaultRowHeight);
15068
+ gridApi.refreshCells();
15069
+ return item;
15070
+ }
15071
+ const updatedView = {
15072
+ ...item,
15073
+ table_config: customAndConfigSync(
15074
+ item.table_config,
15075
+ tableConfig
15076
+ )
15077
+ };
15078
+ updateTableConfig(updatedView, gridApi, "smart-grid");
15079
+ setTableConfig(updatedView.table_config);
15080
+ return updatedView;
15081
+ },
15082
+ [
15083
+ gridApi,
15084
+ props.defaultViewFilters,
15085
+ props.defaultRowHeight,
15086
+ tableConfig,
15087
+ setTableConfig
15088
+ ]
15089
+ );
15090
+ const stickyViewsKey = generateStickyViewsKey(
15091
+ props.domain,
15092
+ props.tableName,
15093
+ userId,
15094
+ projectId,
15095
+ companyId
15096
+ );
14989
15097
  return /* @__PURE__ */ React23.createElement(ToastAlertProvider, null, /* @__PURE__ */ React23.createElement(
14990
15098
  SavedViews,
14991
15099
  {
14992
15100
  onSelect,
14993
15101
  domain: props.domain,
14994
- userId: props.userId,
15102
+ userId,
14995
15103
  projectId,
14996
15104
  companyId,
14997
15105
  provider: "smart-grid",
14998
15106
  defaultView,
14999
15107
  tableName: props.tableName,
15000
15108
  tableConfig,
15001
- stickyViewsKey: props.stickyViewsKey,
15002
- enableSavedViews: props.enableSavedViews
15109
+ stickyViewsKey
15003
15110
  }
15004
15111
  ));
15005
15112
  };
15006
15113
 
15007
15114
  // src/SavedViews/components/SavedViews/DataTable/DataTableSavedViews.tsx
15008
15115
  import React24, {
15009
- forwardRef as forwardRef10,
15116
+ forwardRef as forwardRef11,
15010
15117
  useImperativeHandle,
15011
15118
  useState as useState6,
15012
- useCallback as useCallback4
15119
+ useCallback as useCallback5
15013
15120
  } from "react";
15014
15121
 
15015
15122
  // src/SavedViews/components/SavedViews/DataTable/DataTableDefaultSavedView.tsx
@@ -15083,58 +15190,63 @@ var useDefaultView2 = (props) => {
15083
15190
 
15084
15191
  // src/SavedViews/components/SavedViews/DataTable/DataTableSavedViews.tsx
15085
15192
  import { ToastAlertProvider as ToastAlertProvider2 } from "@procore/toast-alert";
15086
- var DataTableSavedViews = forwardRef10((props, ref) => {
15087
- const { tableApi, onTableConfigChange, projectId, companyId } = props;
15193
+ var generateStickyViewsKey2 = (domain, tableName, userId, projectId, companyId) => {
15194
+ return `savedView-${domain}-${tableName}-${companyId}-${projectId}-${userId}`;
15195
+ };
15196
+ var DataTableSavedViews = forwardRef11((props, ref) => {
15197
+ const { tableApi, userId, projectId, companyId } = props;
15088
15198
  const [internalTableConfig, setInternalTableConfig] = useState6(
15089
15199
  props.defaultViewConfig
15090
15200
  );
15091
15201
  useImperativeHandle(ref, () => ({
15092
15202
  setTableConfig: (newConfig) => {
15093
- handleConfigChange(newConfig);
15203
+ setInternalTableConfig(newConfig);
15094
15204
  }
15095
15205
  }));
15096
- const handleConfigChange = useCallback4(
15097
- (newConfig) => {
15098
- setInternalTableConfig(newConfig);
15099
- onTableConfigChange(newConfig);
15100
- },
15101
- [onTableConfigChange]
15102
- );
15103
15206
  const defaultView = useDefaultView2({
15104
15207
  defaultViewName: props.defaultViewName,
15105
15208
  receivedConfigFromTool: props.defaultViewConfig,
15106
15209
  domain: props.domain,
15107
15210
  columnDefinitions: props.columnDefinitions
15108
15211
  });
15109
- const onSelect = ({ item }) => {
15110
- const isDefaultView = item.id === "default";
15111
- const updatedView = isDefaultView ? defaultView : {
15112
- ...item,
15113
- table_config: customAndConfigSync(
15114
- item.table_config,
15115
- defaultView.table_config
15116
- )
15117
- };
15118
- updateTableConfig(updatedView, tableApi, "data-table", handleConfigChange);
15119
- return updatedView;
15120
- };
15212
+ const onSelect = useCallback5(
15213
+ ({ item }) => {
15214
+ const isDefaultView = item.id === "default";
15215
+ const updatedView = isDefaultView ? defaultView : {
15216
+ ...item,
15217
+ table_config: customAndConfigSync(
15218
+ item.table_config,
15219
+ defaultView.table_config
15220
+ )
15221
+ };
15222
+ updateTableConfig(updatedView, tableApi, "data-table");
15223
+ return updatedView;
15224
+ },
15225
+ [defaultView, tableApi]
15226
+ );
15121
15227
  if (!internalTableConfig) {
15122
15228
  return null;
15123
15229
  }
15230
+ const stickyViewsKey = generateStickyViewsKey2(
15231
+ props.domain,
15232
+ props.tableName,
15233
+ userId,
15234
+ projectId,
15235
+ companyId
15236
+ );
15124
15237
  return /* @__PURE__ */ React24.createElement(ToastAlertProvider2, null, /* @__PURE__ */ React24.createElement(
15125
15238
  SavedViews,
15126
15239
  {
15127
15240
  onSelect,
15128
15241
  domain: props.domain,
15129
- userId: props.userId,
15242
+ userId,
15130
15243
  projectId,
15131
15244
  companyId,
15132
15245
  provider: "data-table",
15133
15246
  defaultView,
15134
15247
  tableName: props.tableName,
15135
15248
  tableConfig: internalTableConfig,
15136
- stickyViewsKey: props.stickyViewsKey,
15137
- enableSavedViews: props.enableSavedViews
15249
+ stickyViewsKey
15138
15250
  }
15139
15251
  ));
15140
15252
  });