@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
  var _a, _b;
11205
11222
  if (!props.item) {
@@ -11228,11 +11245,12 @@ var SavedViewCollectionMenuItem = (props) => {
11228
11245
  const copyShareLink = async (event) => {
11229
11246
  event.stopPropagation();
11230
11247
  try {
11231
- const currentUrl = new URL(window.location.href);
11232
- await navigator.clipboard.writeText(currentUrl.toString());
11248
+ const { origin, pathname } = window.location;
11249
+ const shareUrl = new URL(`${origin}${pathname}`);
11250
+ shareUrl.searchParams.set("saved-view", props.item.share_token);
11251
+ await navigator.clipboard.writeText(shareUrl.toString());
11233
11252
  showToast.success(i18n.t("savedViews.actions.linkCopied"));
11234
11253
  } catch (error) {
11235
- console.error("Failed to copy link:", error);
11236
11254
  showToast.error(i18n.t("savedViews.errors.copyFailed"));
11237
11255
  }
11238
11256
  };
@@ -11246,7 +11264,7 @@ var SavedViewCollectionMenuItem = (props) => {
11246
11264
  label: i18n.t("savedViews.actions.delete")
11247
11265
  }
11248
11266
  ];
11249
- return /* @__PURE__ */ React14.createElement(
11267
+ return /* @__PURE__ */ React15.createElement(
11250
11268
  Container2,
11251
11269
  {
11252
11270
  "aria-selected": Boolean(props.selected),
@@ -11257,7 +11275,7 @@ var SavedViewCollectionMenuItem = (props) => {
11257
11275
  }),
11258
11276
  "data-testid": "saved-view-collection-menu-item"
11259
11277
  },
11260
- /* @__PURE__ */ React14.createElement(
11278
+ /* @__PURE__ */ React15.createElement(
11261
11279
  "span",
11262
11280
  {
11263
11281
  "data-testid": "saved-view-display-name",
@@ -11265,7 +11283,7 @@ var SavedViewCollectionMenuItem = (props) => {
11265
11283
  },
11266
11284
  props.item.name
11267
11285
  ),
11268
- /* @__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(
11286
+ /* @__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(
11269
11287
  Button2,
11270
11288
  {
11271
11289
  onClick: updateItem,
@@ -11276,7 +11294,7 @@ var SavedViewCollectionMenuItem = (props) => {
11276
11294
  loading: props.isUpdateProcessing
11277
11295
  },
11278
11296
  i18n.t("savedViews.actions.update")
11279
- )), props.item.id !== "default" && props.selected && !props.canUpdate && props.item.id !== "temporary" && /* @__PURE__ */ React14.createElement("div", null, /* @__PURE__ */ React14.createElement(
11297
+ )), props.item.id !== "default" && props.selected && !props.canUpdate && props.item.id !== "temporary" && /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement(
11280
11298
  Button2,
11281
11299
  {
11282
11300
  onClick: copyShareLink,
@@ -11285,8 +11303,23 @@ var SavedViewCollectionMenuItem = (props) => {
11285
11303
  "aria-label": i18n.t("savedViews.actions.copyShareLink"),
11286
11304
  "data-testid": "copy-share-link-button"
11287
11305
  },
11288
- /* @__PURE__ */ React14.createElement(Link_default, { size: "sm" })
11289
- ))), /* @__PURE__ */ React14.createElement(Box, null, props.item.id !== "default" && props.canEditOrDelete && /* @__PURE__ */ React14.createElement("div", { onClick: (e2) => e2.stopPropagation() }, /* @__PURE__ */ React14.createElement(
11306
+ /* @__PURE__ */ React15.createElement(Link_default, { size: "sm" })
11307
+ )), props.item.id === "temporary" && /* @__PURE__ */ React15.createElement("div", null, /* @__PURE__ */ React15.createElement(
11308
+ Button2,
11309
+ {
11310
+ onClick: (e2) => {
11311
+ var _a;
11312
+ e2.stopPropagation();
11313
+ (_a = props.onClearTemporary) == null ? void 0 : _a.call(props);
11314
+ },
11315
+ variant: "tertiary",
11316
+ size: "sm",
11317
+ "aria-label": i18n.t("savedViews.actions.clearTemporary"),
11318
+ title: i18n.t("savedViews.actions.clearTemporary"),
11319
+ "data-testid": "clear-temporary-view-button"
11320
+ },
11321
+ /* @__PURE__ */ React15.createElement(Clear_default, { size: "sm" })
11322
+ ))), /* @__PURE__ */ React15.createElement(Box, null, props.item.id !== "default" && props.canEditOrDelete && /* @__PURE__ */ React15.createElement("div", { onClick: (e2) => e2.stopPropagation() }, /* @__PURE__ */ React15.createElement(
11290
11323
  DropdownFlyout,
11291
11324
  {
11292
11325
  "data-testid": "saved-view-overflow-button",
@@ -11319,9 +11352,9 @@ import {
11319
11352
  useI18nContext as useI18nContext5
11320
11353
  } from "@procore/core-react";
11321
11354
  import { useToastAlertContext as useToastAlertContext2 } from "@procore/toast-alert";
11322
- import React16 from "react";
11355
+ import React17 from "react";
11323
11356
 
11324
- // ../../node_modules/@procore/core-http/dist/modern/index.js
11357
+ // node_modules/@procore/core-http/dist/modern/index.js
11325
11358
  function getCSRFToken() {
11326
11359
  const token = document.cookie.match("(^|;)\\s*csrf_token\\s*=\\s*([^;]+)");
11327
11360
  return token ? decodeURIComponent(token.pop() || "") : "";
@@ -11378,7 +11411,7 @@ var useApiRequest = (props, method, mutationKey) => {
11378
11411
  mutationFn: async (savedView) => {
11379
11412
  let url = "";
11380
11413
  if (method === "DELETE" || method === "PUT") {
11381
- url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/${savedView.id}?permissions_domain=${domain}`;
11414
+ url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/${savedView.share_token}?permissions_domain=${domain}`;
11382
11415
  } else {
11383
11416
  url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views?table_name=${tableName}&permissions_domain=${domain}`;
11384
11417
  }
@@ -11407,7 +11440,9 @@ var useApiRequest = (props, method, mutationKey) => {
11407
11440
  domain,
11408
11441
  tableName
11409
11442
  ]);
11410
- const oldView = oldData == null ? void 0 : oldData.find((item) => item.id === savedView.id);
11443
+ const oldView = oldData == null ? void 0 : oldData.find(
11444
+ (item) => item.share_token === savedView.share_token
11445
+ );
11411
11446
  if ((oldView == null ? void 0 : oldView.name) !== savedView.name) {
11412
11447
  queryClient2.invalidateQueries({
11413
11448
  queryKey: ["savedViews", domain, tableName]
@@ -11421,7 +11456,7 @@ var useApiRequest = (props, method, mutationKey) => {
11421
11456
  if (!oldData)
11422
11457
  return [savedView];
11423
11458
  return oldData.map(
11424
- (item) => item.id === savedView.id ? savedView : item
11459
+ (item) => item.share_token === savedView.share_token ? savedView : item
11425
11460
  );
11426
11461
  }
11427
11462
  );
@@ -11438,7 +11473,6 @@ var useSavedViewsQuery = (props) => {
11438
11473
  const { projectId, companyId, domain, tableName } = props;
11439
11474
  const url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views?table_name=${tableName}&permissions_domain=${domain}`;
11440
11475
  return useQuery({
11441
- enabled: props.enableSavedViews,
11442
11476
  queryKey: ["savedViews", domain, tableName],
11443
11477
  queryFn: async () => {
11444
11478
  const getUrl2 = `${url}&per_page=${PAGE_SIZE}`;
@@ -11451,7 +11485,6 @@ var useSavedViewsPermissions = (props) => {
11451
11485
  const { projectId, companyId, domain } = props;
11452
11486
  const url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/permissions?permissions_domain=${domain}`;
11453
11487
  return useQuery({
11454
- enabled: props.enableSavedViews,
11455
11488
  queryKey: ["savedViewsConfig", domain],
11456
11489
  queryFn: async () => {
11457
11490
  const response = await requestJSON(url);
@@ -11474,13 +11507,13 @@ var useDeleteSavedView = (props) => useApiRequest(props, "DELETE", [
11474
11507
  props.domain,
11475
11508
  props.tableName
11476
11509
  ]);
11477
- var useFetchSavedViewById = (savedViewId, queryInput, enabled = true) => {
11510
+ var useFetchSavedViewById = (savedViewToken, queryInput, enabled = true) => {
11478
11511
  const { projectId, companyId } = queryInput;
11479
11512
  return useQuery({
11480
- enabled: enabled && Boolean(savedViewId),
11481
- queryKey: ["savedView", savedViewId],
11513
+ enabled: enabled && Boolean(savedViewToken),
11514
+ queryKey: ["savedView", savedViewToken],
11482
11515
  queryFn: async () => {
11483
- const url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/${savedViewId}`;
11516
+ const url = `/rest/v2.0/companies/${companyId}/projects/${projectId}/saved_views/${savedViewToken}`;
11484
11517
  const response = await requestJSON(url);
11485
11518
  return response.data;
11486
11519
  }
@@ -11559,7 +11592,7 @@ var getColumnIdentifier = (col) => {
11559
11592
  }
11560
11593
  return "";
11561
11594
  };
11562
- var updateTableConfig = (view, tableApi, provider, onTableConfigChange) => {
11595
+ var updateTableConfig = (view, tableApi, provider) => {
11563
11596
  if (provider === "smart-grid") {
11564
11597
  setSmartGridConfig(
11565
11598
  tableApi,
@@ -11574,9 +11607,6 @@ var updateTableConfig = (view, tableApi, provider, onTableConfigChange) => {
11574
11607
  dataTableApi == null ? void 0 : dataTableApi.setRowHeight(rowHeight);
11575
11608
  }
11576
11609
  dataTableApi == null ? void 0 : dataTableApi.setTableConfiguration(tableConfig);
11577
- if (onTableConfigChange) {
11578
- onTableConfigChange(tableConfig);
11579
- }
11580
11610
  }
11581
11611
  }
11582
11612
  };
@@ -11696,15 +11726,15 @@ import {
11696
11726
  Typography,
11697
11727
  useI18nContext as useI18nContext4
11698
11728
  } from "@procore/core-react";
11699
- import React15 from "react";
11729
+ import React16 from "react";
11700
11730
  var groupIcon = (group) => {
11701
11731
  switch (group) {
11702
11732
  case "personal":
11703
- return /* @__PURE__ */ React15.createElement(Person_default, null);
11733
+ return /* @__PURE__ */ React16.createElement(Person_default, null);
11704
11734
  case "project":
11705
- return /* @__PURE__ */ React15.createElement(Excavator_default, null);
11735
+ return /* @__PURE__ */ React16.createElement(Excavator_default, null);
11706
11736
  case "company":
11707
- return /* @__PURE__ */ React15.createElement(Building_default, null);
11737
+ return /* @__PURE__ */ React16.createElement(Building_default, null);
11708
11738
  }
11709
11739
  };
11710
11740
  var Header = styled_components_esm_default(Flex2)`
@@ -11715,7 +11745,7 @@ var Header = styled_components_esm_default(Flex2)`
11715
11745
  `;
11716
11746
  var ViewLevelHeader = ({ expanded, toggleGroup, group }) => {
11717
11747
  const I18n = useI18nContext4();
11718
- return /* @__PURE__ */ React15.createElement(
11748
+ return /* @__PURE__ */ React16.createElement(
11719
11749
  Header,
11720
11750
  {
11721
11751
  alignItems: "center",
@@ -11724,9 +11754,9 @@ var ViewLevelHeader = ({ expanded, toggleGroup, group }) => {
11724
11754
  style: { cursor: "pointer" },
11725
11755
  onClick: () => toggleGroup(group)
11726
11756
  },
11727
- expanded ? /* @__PURE__ */ React15.createElement(ChevronDown_default, { size: "sm" }) : /* @__PURE__ */ React15.createElement(ChevronRight_default, { size: "sm" }),
11757
+ expanded ? /* @__PURE__ */ React16.createElement(ChevronDown_default, { size: "sm" }) : /* @__PURE__ */ React16.createElement(ChevronRight_default, { size: "sm" }),
11728
11758
  groupIcon(group),
11729
- /* @__PURE__ */ React15.createElement(Typography, { weight: "semibold" }, I18n.t(`savedViews.viewLevel.${group}`))
11759
+ /* @__PURE__ */ React16.createElement(Typography, { weight: "semibold" }, I18n.t(`savedViews.viewLevel.${group}`))
11730
11760
  );
11731
11761
  };
11732
11762
  var ViewLevelHeader_default = ViewLevelHeader;
@@ -11761,21 +11791,20 @@ var Panel2 = styled_components_esm_default(DetailPage.Card)`
11761
11791
  box-shadow: none;
11762
11792
  `;
11763
11793
  var PanelContent = (props) => {
11764
- var _a, _b;
11794
+ var _a, _b, _c;
11765
11795
  const { showToast } = useToastAlertContext2();
11766
11796
  const I18n = useI18nContext5();
11767
11797
  const { mutate: updateSavedView, isPending: isUpdateLoading } = useUpdateSavedView(props.queryInput);
11768
- const { data: savedViewsFromQuery, error: savedViewsError } = useSavedViewsQuery(props.queryInput);
11769
- const savedViews = props.savedViews ?? savedViewsFromQuery;
11770
- const errorToastRef = React16.useRef(null);
11771
- React16.useEffect(() => {
11798
+ const { error: savedViewsError } = useSavedViewsQuery(props.queryInput);
11799
+ const errorToastRef = React17.useRef(null);
11800
+ React17.useEffect(() => {
11772
11801
  if (savedViewsError && savedViewsError !== errorToastRef.current) {
11773
11802
  showToast.error(I18n.t("savedViews.errors.fetch"));
11774
11803
  errorToastRef.current = savedViewsError;
11775
11804
  }
11776
11805
  }, [savedViewsError, showToast, I18n]);
11777
11806
  const { data: permissions } = useSavedViewsPermissions(props.queryInput);
11778
- const selectedRowRef = useScrollToRef(savedViews);
11807
+ const selectedRowRef = useScrollToRef(props.savedViews);
11779
11808
  const onUpdate = (data) => {
11780
11809
  const newSavedView = {
11781
11810
  ...data,
@@ -11785,8 +11814,7 @@ var PanelContent = (props) => {
11785
11814
  updateSavedView(newSavedView, {
11786
11815
  onSuccess: () => {
11787
11816
  showToast.success(I18n.t("savedViews.update.success"));
11788
- props.updateLocalStorage(newSavedView);
11789
- props.setSelectedSavedView(newSavedView);
11817
+ props.onSelect({ item: newSavedView });
11790
11818
  },
11791
11819
  onError: () => {
11792
11820
  showToast.error(I18n.t("savedViews.errors.update"));
@@ -11796,29 +11824,32 @@ var PanelContent = (props) => {
11796
11824
  const { groups, toggleGroup } = useGroups();
11797
11825
  const isDefaultSelected = ((_a = props.selectedSavedView) == null ? void 0 : _a.id) === "default";
11798
11826
  const isTemporarySelected = ((_b = props.selectedSavedView) == null ? void 0 : _b.id) === "temporary";
11799
- const temporaryView = savedViews == null ? void 0 : savedViews.find((view) => view.id === "temporary");
11800
- return /* @__PURE__ */ React16.createElement(Panel2, { "data-testid": "inner-panel" }, /* @__PURE__ */ React16.createElement(Flex3, { direction: "column", style: { height: "100%", width: "100%" } }, temporaryView && /* @__PURE__ */ React16.createElement(
11827
+ const temporaryView = (_c = props.savedViews) == null ? void 0 : _c.find(
11828
+ (view) => view.id === "temporary"
11829
+ );
11830
+ return /* @__PURE__ */ React17.createElement(Panel2, { "data-testid": "inner-panel" }, /* @__PURE__ */ React17.createElement(Flex3, { direction: "column", style: { height: "100%", width: "100%" } }, temporaryView && /* @__PURE__ */ React17.createElement(
11801
11831
  Row,
11802
11832
  {
11803
11833
  selected: isTemporarySelected,
11804
11834
  onClick: () => props.onSelect({ item: temporaryView }),
11805
11835
  ref: isTemporarySelected ? selectedRowRef : null
11806
11836
  },
11807
- /* @__PURE__ */ React16.createElement(
11837
+ /* @__PURE__ */ React17.createElement(
11808
11838
  SavedViewCollectionMenuItem,
11809
11839
  {
11810
11840
  item: temporaryView,
11811
- selected: isTemporarySelected
11841
+ selected: isTemporarySelected,
11842
+ onClearTemporary: props.onClearTemporary
11812
11843
  }
11813
11844
  )
11814
- ), /* @__PURE__ */ React16.createElement(
11845
+ ), /* @__PURE__ */ React17.createElement(
11815
11846
  Row,
11816
11847
  {
11817
11848
  selected: isDefaultSelected,
11818
11849
  onClick: () => props.onSelect({ item: props.defaultView }),
11819
11850
  ref: isDefaultSelected ? selectedRowRef : null
11820
11851
  },
11821
- /* @__PURE__ */ React16.createElement(
11852
+ /* @__PURE__ */ React17.createElement(
11822
11853
  SavedViewCollectionMenuItem,
11823
11854
  {
11824
11855
  item: props.defaultView,
@@ -11827,10 +11858,10 @@ var PanelContent = (props) => {
11827
11858
  )
11828
11859
  ), VIEW_LEVELS.map((level) => {
11829
11860
  const isExpanded = groups[level];
11830
- const views = isExpanded && savedViews ? savedViews.filter(
11861
+ const views = isExpanded && props.savedViews ? props.savedViews.filter(
11831
11862
  (view) => view.view_level === level && view.id !== "temporary"
11832
11863
  ) : [];
11833
- return /* @__PURE__ */ React16.createElement(React16.Fragment, { key: level }, /* @__PURE__ */ React16.createElement(
11864
+ return /* @__PURE__ */ React17.createElement(React17.Fragment, { key: level }, /* @__PURE__ */ React17.createElement(
11834
11865
  ViewLevelHeader_default,
11835
11866
  {
11836
11867
  group: level,
@@ -11847,7 +11878,7 @@ var PanelContent = (props) => {
11847
11878
  props.provider
11848
11879
  );
11849
11880
  const canEditOrDelete = isSelected && hasPermissionForViewLevel(view.view_level, permissions);
11850
- return /* @__PURE__ */ React16.createElement(
11881
+ return /* @__PURE__ */ React17.createElement(
11851
11882
  Row,
11852
11883
  {
11853
11884
  key: view.id,
@@ -11858,7 +11889,7 @@ var PanelContent = (props) => {
11858
11889
  },
11859
11890
  ref: isSelected ? selectedRowRef : null
11860
11891
  },
11861
- /* @__PURE__ */ React16.createElement(
11892
+ /* @__PURE__ */ React17.createElement(
11862
11893
  SavedViewCollectionMenuItem,
11863
11894
  {
11864
11895
  item: view,
@@ -11879,7 +11910,7 @@ var PanelContent = (props) => {
11879
11910
  };
11880
11911
 
11881
11912
  // src/SavedViews/components/SavedViews/SmartGrid/SmartGridSavedViews.tsx
11882
- import React23 from "react";
11913
+ import React23, { useCallback as useCallback4 } from "react";
11883
11914
 
11884
11915
  // src/SavedViews/components/SavedViews/SmartGrid/SmartGridDefaultSavedView.tsx
11885
11916
  import { useI18nContext as useI18nContext6 } from "@procore/core-react";
@@ -11942,12 +11973,12 @@ var useSmartGridConfig = (gridApi) => {
11942
11973
  import {
11943
11974
  Box as Box2,
11944
11975
  Button as Button6,
11945
- Flex as Flex5,
11976
+ Flex as Flex6,
11946
11977
  Panel as Panel3,
11947
11978
  Tooltip,
11948
11979
  useI18nContext as useI18nContext11
11949
11980
  } from "@procore/core-react";
11950
- import React22 from "react";
11981
+ import React22, { useState as useState5, useEffect as useEffect4, useCallback as useCallback3 } from "react";
11951
11982
  import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
11952
11983
 
11953
11984
  // src/SavedViews/components/SavedViewsModals/SavedViewsDeleteConfirmationModalShared.tsx
@@ -11958,14 +11989,14 @@ import {
11958
11989
  P as P2,
11959
11990
  useI18nContext as useI18nContext7
11960
11991
  } from "@procore/core-react";
11961
- import React17 from "react";
11992
+ import React18 from "react";
11962
11993
  var SavedViewsDeleteConfirmationModalShared = ({
11963
11994
  onCancel,
11964
11995
  onDelete,
11965
11996
  open
11966
11997
  }) => {
11967
11998
  const i18n = useI18nContext7();
11968
- return /* @__PURE__ */ React17.createElement(
11999
+ return /* @__PURE__ */ React18.createElement(
11969
12000
  ConfirmModal,
11970
12001
  {
11971
12002
  "data-testid": "delete-confirmation-modal",
@@ -11975,13 +12006,13 @@ var SavedViewsDeleteConfirmationModalShared = ({
11975
12006
  onClose: onCancel,
11976
12007
  style: { overflowWrap: "anywhere" }
11977
12008
  },
11978
- /* @__PURE__ */ React17.createElement(Modal.Body, null, /* @__PURE__ */ React17.createElement(P2, null, i18n.t("savedViews.modal.delete.description"))),
11979
- /* @__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"))))
12009
+ /* @__PURE__ */ React18.createElement(Modal.Body, null, /* @__PURE__ */ React18.createElement(P2, null, i18n.t("savedViews.modal.delete.description"))),
12010
+ /* @__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"))))
11980
12011
  );
11981
12012
  };
11982
12013
 
11983
12014
  // src/SavedViews/components/SavedViewsModals/SavedViewsFormModal.tsx
11984
- import React19 from "react";
12015
+ import React20 from "react";
11985
12016
 
11986
12017
  // src/SavedViews/components/SavedViewsModals/SavedViewsCreateUpdateModalBase.tsx
11987
12018
  import {
@@ -11997,7 +12028,7 @@ import {
11997
12028
  Typography as Typography2,
11998
12029
  useI18nContext as useI18nContext8
11999
12030
  } from "@procore/core-react";
12000
- import * as React18 from "react";
12031
+ import * as React19 from "react";
12001
12032
 
12002
12033
  // ../../node_modules/yup/index.esm.js
12003
12034
  var import_property_expr = __toESM(require_property_expr());
@@ -14340,7 +14371,6 @@ var SavedViewsCreateUpdateModalBase = ({
14340
14371
  tableName,
14341
14372
  defaultView,
14342
14373
  selectedSavedView,
14343
- setSelectedSavedView,
14344
14374
  setOpenEditCreateModal,
14345
14375
  onSelect
14346
14376
  }) => {
@@ -14378,8 +14408,8 @@ var SavedViewsCreateUpdateModalBase = ({
14378
14408
  };
14379
14409
  updateSavedView(body, {
14380
14410
  onSuccess: (updatedSavedView) => {
14411
+ onSelect(updatedSavedView);
14381
14412
  setOpenEditCreateModal(false);
14382
- setSelectedSavedView(updatedSavedView);
14383
14413
  }
14384
14414
  });
14385
14415
  } else {
@@ -14398,7 +14428,7 @@ var SavedViewsCreateUpdateModalBase = ({
14398
14428
  }
14399
14429
  };
14400
14430
  const viewLevelOptions = getViewLevelOptions(permissions, I18n);
14401
- return /* @__PURE__ */ React18.createElement(
14431
+ return /* @__PURE__ */ React19.createElement(
14402
14432
  Modal2,
14403
14433
  {
14404
14434
  "aria-label": I18n.t("savedViews.ariaLabels.modal"),
@@ -14407,14 +14437,14 @@ var SavedViewsCreateUpdateModalBase = ({
14407
14437
  style: { width: "540px" },
14408
14438
  "data-testid": "create-update-modal"
14409
14439
  },
14410
- /* @__PURE__ */ React18.createElement(ScrollContainer, null, /* @__PURE__ */ React18.createElement(
14440
+ /* @__PURE__ */ React19.createElement(ScrollContainer, null, /* @__PURE__ */ React19.createElement(
14411
14441
  Modal2.Header,
14412
14442
  {
14413
14443
  onClose,
14414
14444
  style: { borderBottom: `1px solid ${colors3.gray85}` }
14415
14445
  },
14416
- /* @__PURE__ */ React18.createElement(H2, null, header)
14417
- ), /* @__PURE__ */ React18.createElement(
14446
+ /* @__PURE__ */ React19.createElement(H2, null, header)
14447
+ ), /* @__PURE__ */ React19.createElement(
14418
14448
  Form,
14419
14449
  {
14420
14450
  initialValues: {
@@ -14440,13 +14470,13 @@ var SavedViewsCreateUpdateModalBase = ({
14440
14470
  onReset: onCancel,
14441
14471
  validateOnChange: true
14442
14472
  },
14443
- /* @__PURE__ */ React18.createElement(Form.Form, { name: header }, /* @__PURE__ */ React18.createElement(
14473
+ /* @__PURE__ */ React19.createElement(Form.Form, { name: header }, /* @__PURE__ */ React19.createElement(
14444
14474
  Modal2.Body,
14445
14475
  {
14446
14476
  style: { paddingTop: 0, paddingBottom: 0, marginTop: spacing3.lg }
14447
14477
  },
14448
- 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 == null ? void 0 : errors.form) || I18n.t(`savedViews.modal.errors.description.${mode}`)))),
14449
- /* @__PURE__ */ React18.createElement(Form.Row, null, /* @__PURE__ */ React18.createElement(
14478
+ 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 == null ? void 0 : errors.form) || I18n.t(`savedViews.modal.errors.description.${mode}`)))),
14479
+ /* @__PURE__ */ React19.createElement(Form.Row, null, /* @__PURE__ */ React19.createElement(
14450
14480
  Form.Text,
14451
14481
  {
14452
14482
  name: "name",
@@ -14457,12 +14487,12 @@ var SavedViewsCreateUpdateModalBase = ({
14457
14487
  onChange: () => resetMutations()
14458
14488
  }
14459
14489
  )),
14460
- /* @__PURE__ */ React18.createElement(
14490
+ /* @__PURE__ */ React19.createElement(
14461
14491
  Form.Row,
14462
14492
  {
14463
14493
  style: { marginTop: (errors == null ? void 0 : errors.name) ? spacing3.xl : spacing3.none }
14464
14494
  },
14465
- /* @__PURE__ */ React18.createElement(
14495
+ /* @__PURE__ */ React19.createElement(
14466
14496
  Form.TextArea,
14467
14497
  {
14468
14498
  name: "description",
@@ -14473,7 +14503,7 @@ var SavedViewsCreateUpdateModalBase = ({
14473
14503
  }
14474
14504
  )
14475
14505
  ),
14476
- viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */ React18.createElement(Form.Row, null, /* @__PURE__ */ React18.createElement(
14506
+ viewLevelOptions.length > 1 && mode === "create" /* CREATE */ ? /* @__PURE__ */ React19.createElement(Form.Row, null, /* @__PURE__ */ React19.createElement(
14477
14507
  Form.Select,
14478
14508
  {
14479
14509
  name: "view_level",
@@ -14483,8 +14513,8 @@ var SavedViewsCreateUpdateModalBase = ({
14483
14513
  onSearch: false,
14484
14514
  onClear: false
14485
14515
  }
14486
- )) : /* @__PURE__ */ React18.createElement(React18.Fragment, null)
14487
- ), /* @__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(
14516
+ )) : /* @__PURE__ */ React19.createElement(React19.Fragment, null)
14517
+ ), /* @__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(
14488
14518
  Button4,
14489
14519
  {
14490
14520
  "data-testid": "create-update-modal-button",
@@ -14509,13 +14539,12 @@ var SavedViewsFormModal = ({
14509
14539
  tableName,
14510
14540
  queryInput,
14511
14541
  selectedSavedView,
14512
- setSelectedSavedView,
14513
14542
  setOpenEditCreateModal,
14514
14543
  onSelect,
14515
14544
  defaultView
14516
14545
  }) => {
14517
14546
  const i18n = useI18nContext9();
14518
- return /* @__PURE__ */ React19.createElement(
14547
+ return /* @__PURE__ */ React20.createElement(
14519
14548
  SavedViewsCreateUpdateModalBase,
14520
14549
  {
14521
14550
  open,
@@ -14528,7 +14557,6 @@ var SavedViewsFormModal = ({
14528
14557
  tableConfig,
14529
14558
  tableName,
14530
14559
  selectedSavedView,
14531
- setSelectedSavedView,
14532
14560
  setOpenEditCreateModal,
14533
14561
  onSelect,
14534
14562
  defaultView
@@ -14536,274 +14564,301 @@ var SavedViewsFormModal = ({
14536
14564
  );
14537
14565
  };
14538
14566
 
14539
- // src/SavedViews/components/SavedViewsModals/CopyViewConfirmationModal.tsx
14540
- import { Button as Button5, Modal as Modal3, P as P3, useI18nContext as useI18nContext10 } from "@procore/core-react";
14541
- import React20 from "react";
14542
- var CreateViewConfirmationModal = ({ open, savedViewName, onClose, onViewTemporarily, onCreateView }) => {
14543
- const i18n = useI18nContext10();
14544
- const handleViewTemporarily = () => {
14545
- onViewTemporarily == null ? void 0 : onViewTemporarily();
14567
+ // src/SavedViews/components/SavedViewsModals/SharedViewFormModal.tsx
14568
+ import {
14569
+ Banner as Banner2,
14570
+ Button as Button5,
14571
+ colors as colors4,
14572
+ ErrorBanner as ErrorBanner2,
14573
+ Flex as Flex5,
14574
+ Form as Form2,
14575
+ Modal as Modal3,
14576
+ P as P3,
14577
+ spacing as spacing4,
14578
+ Typography as Typography3,
14579
+ useI18nContext as useI18nContext10
14580
+ } from "@procore/core-react";
14581
+ import * as React21 from "react";
14582
+ var SharedViewFormModal = ({
14583
+ open,
14584
+ fetchedView,
14585
+ onClose,
14586
+ onCreateTemporaryView,
14587
+ onCreateView,
14588
+ createError,
14589
+ isCreating,
14590
+ resetCreateError
14591
+ }) => {
14592
+ const I18n = useI18nContext10();
14593
+ const NAME_MAX_LENGTH = 150;
14594
+ const errors = extractMessage(createError, I18n);
14595
+ const handleNameChange = () => {
14596
+ if (resetCreateError) {
14597
+ resetCreateError();
14598
+ }
14546
14599
  };
14547
- const handleCreateView = () => {
14548
- onCreateView == null ? void 0 : onCreateView();
14600
+ const handleOnSubmit = (data) => {
14601
+ onCreateView(data.name, data.description);
14549
14602
  };
14550
- return /* @__PURE__ */ React20.createElement(
14603
+ return /* @__PURE__ */ React21.createElement(
14551
14604
  Modal3,
14552
14605
  {
14553
- "data-testid": "create-view-confirmation-modal",
14606
+ "data-testid": "shared-view-form-modal",
14554
14607
  open,
14555
- onClickOverlay: onClose
14556
- },
14557
- /* @__PURE__ */ React20.createElement(Modal3.Header, { onClose }, i18n.t("savedViews.modal.copyConfirmation.headline", {
14558
- savedViewName
14559
- })),
14560
- /* @__PURE__ */ React20.createElement(Modal3.Body, null, /* @__PURE__ */ React20.createElement(P3, null, i18n.t("savedViews.modal.copyConfirmation.description"))),
14561
- /* @__PURE__ */ React20.createElement(Modal3.Footer, null, /* @__PURE__ */ React20.createElement(Modal3.FooterButtons, null, /* @__PURE__ */ React20.createElement(
14562
- Button5,
14608
+ onClickOverlay: onClose,
14609
+ style: { width: "540px" }
14610
+ },
14611
+ /* @__PURE__ */ React21.createElement(
14612
+ Modal3.Header,
14563
14613
  {
14564
- variant: "secondary",
14565
- onClick: handleViewTemporarily,
14566
- "data-testid": "view-temporarily-button"
14614
+ onClose,
14615
+ style: {
14616
+ paddingTop: spacing4.lg,
14617
+ paddingBottom: spacing4.xs,
14618
+ paddingLeft: spacing4.xl,
14619
+ paddingRight: spacing4.xl
14620
+ }
14621
+ },
14622
+ I18n.t("savedViews.modal.create.title")
14623
+ ),
14624
+ /* @__PURE__ */ React21.createElement(
14625
+ P3,
14626
+ {
14627
+ style: {
14628
+ paddingLeft: spacing4.xl,
14629
+ paddingRight: spacing4.xl,
14630
+ paddingBottom: spacing4.lg,
14631
+ paddingTop: spacing4.none,
14632
+ margin: 0,
14633
+ color: colors4.gray45,
14634
+ whiteSpace: "pre-line"
14635
+ }
14567
14636
  },
14568
- i18n.t("savedViews.actions.viewTemporarily")
14569
- ), /* @__PURE__ */ React20.createElement(
14570
- Button5,
14637
+ I18n.t("savedViews.modal.copyConfirmation.description")
14638
+ ),
14639
+ /* @__PURE__ */ React21.createElement(
14640
+ Form2,
14571
14641
  {
14572
- variant: "primary",
14573
- onClick: handleCreateView,
14574
- "data-testid": "create-view-button"
14642
+ initialValues: {
14643
+ name: fetchedView.name,
14644
+ description: fetchedView.description ?? ""
14645
+ },
14646
+ view: "create",
14647
+ validationSchema: create$3().shape({
14648
+ name: create$6().trim().max(
14649
+ NAME_MAX_LENGTH,
14650
+ I18n.t("savedViews.modal.errors.maxLengthName", {
14651
+ maxLength: NAME_MAX_LENGTH
14652
+ })
14653
+ ).required(I18n.t("savedViews.modal.errors.required"))
14654
+ }),
14655
+ onSubmit: handleOnSubmit,
14656
+ validateOnChange: true
14575
14657
  },
14576
- i18n.t("savedViews.actions.createView")
14577
- )))
14658
+ /* @__PURE__ */ React21.createElement(Form2.Form, { name: "share-view-form" }, /* @__PURE__ */ React21.createElement(
14659
+ Modal3.Body,
14660
+ {
14661
+ style: {
14662
+ paddingTop: spacing4.lg,
14663
+ paddingBottom: 0,
14664
+ borderTop: `1px solid ${colors4.gray85}`
14665
+ }
14666
+ },
14667
+ 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", {
14668
+ mode: "create"
14669
+ })), /* @__PURE__ */ React21.createElement(Banner2.Body, null, (errors == null ? void 0 : errors.form) || I18n.t("savedViews.modal.errors.description.create")))),
14670
+ /* @__PURE__ */ React21.createElement(Form2.Row, null, /* @__PURE__ */ React21.createElement(
14671
+ Form2.Text,
14672
+ {
14673
+ name: "name",
14674
+ error: errors == null ? void 0 : errors.name,
14675
+ placeholder: I18n.t("savedViews.modal.fields.name"),
14676
+ label: I18n.t("savedViews.modal.fields.name"),
14677
+ colWidth: 12,
14678
+ onChange: handleNameChange
14679
+ }
14680
+ )),
14681
+ /* @__PURE__ */ React21.createElement(
14682
+ Form2.Row,
14683
+ {
14684
+ style: { marginTop: (errors == null ? void 0 : errors.name) ? spacing4.xl : spacing4.none }
14685
+ },
14686
+ /* @__PURE__ */ React21.createElement(
14687
+ Form2.TextArea,
14688
+ {
14689
+ name: "description",
14690
+ placeholder: I18n.t("savedViews.modal.fields.description"),
14691
+ label: I18n.t("savedViews.modal.fields.description"),
14692
+ colWidth: 12,
14693
+ resize: "vertical"
14694
+ }
14695
+ )
14696
+ )
14697
+ ), /* @__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(
14698
+ Button5,
14699
+ {
14700
+ variant: "secondary",
14701
+ onClick: onCreateTemporaryView,
14702
+ "data-testid": "view-temporarily-button",
14703
+ disabled: isCreating
14704
+ },
14705
+ I18n.t("savedViews.actions.viewTemporarily")
14706
+ ), /* @__PURE__ */ React21.createElement(
14707
+ Button5,
14708
+ {
14709
+ type: "submit",
14710
+ variant: "primary",
14711
+ "data-testid": "create-view-button",
14712
+ disabled: isCreating,
14713
+ loading: isCreating
14714
+ },
14715
+ I18n.t("savedViews.actions.create")
14716
+ )))))
14717
+ )
14578
14718
  );
14579
14719
  };
14580
14720
 
14581
14721
  // src/utils/Hooks/useViewSelection.ts
14582
- import { useState as useState4, useCallback as useCallback2 } from "react";
14583
-
14584
- // src/utils/Hooks/useUrlSync.ts
14585
- import { useEffect as useEffect3 } from "react";
14722
+ import { useState as useState4, useCallback as useCallback2, useEffect as useEffect3 } from "react";
14586
14723
  import { useSearchParams } from "react-router-dom";
14587
- var useUrlSync = (selectedView, availableViews, defaultView, onViewFound, onViewNotFound) => {
14588
- const [searchParams, setSearchParams] = useSearchParams();
14589
- const applySavedViewFromUrl = (savedViewId) => {
14590
- if (savedViewId === "default") {
14591
- if (defaultView.id !== (selectedView == null ? void 0 : selectedView.id)) {
14592
- onViewFound(defaultView);
14593
- }
14594
- return;
14595
- }
14596
- const viewInUserViews = availableViews.find((v2) => v2.id === savedViewId);
14597
- if (viewInUserViews) {
14598
- if (viewInUserViews.id !== (selectedView == null ? void 0 : selectedView.id)) {
14599
- onViewFound(viewInUserViews);
14600
- }
14601
- } else {
14602
- onViewNotFound(savedViewId);
14603
- }
14604
- };
14605
- const applyListView = (viewParam) => {
14606
- if (viewParam === "list" && defaultView.id !== (selectedView == null ? void 0 : selectedView.id)) {
14607
- onViewFound(defaultView);
14608
- }
14609
- };
14610
- useEffect3(() => {
14611
- if (!availableViews.length)
14612
- return;
14613
- const savedViewId = searchParams.get("saved-view");
14614
- const viewParamFromConsumer = searchParams.get("view");
14615
- if (savedViewId) {
14616
- applySavedViewFromUrl(savedViewId);
14617
- return;
14618
- }
14619
- if (viewParamFromConsumer) {
14620
- applyListView(viewParamFromConsumer);
14724
+
14725
+ // src/utils/viewStorage.ts
14726
+ var ViewStorage = {
14727
+ save(key, view) {
14728
+ localStorage.setItem(key, JSON.stringify(view));
14729
+ },
14730
+ load(key) {
14731
+ try {
14732
+ const stored = localStorage.getItem(key);
14733
+ return stored ? JSON.parse(stored) : null;
14734
+ } catch (e2) {
14735
+ return null;
14621
14736
  }
14622
- }, [
14623
- searchParams,
14624
- availableViews,
14625
- defaultView,
14626
- selectedView,
14627
- onViewFound,
14628
- onViewNotFound
14629
- ]);
14630
- const updateUrl = (view) => {
14631
- setSearchParams(
14632
- (currentParams) => {
14633
- const updatedParams = new URLSearchParams(currentParams);
14634
- if (view.id === "default") {
14635
- updatedParams.delete("saved-view");
14636
- } else {
14637
- updatedParams.set("saved-view", view.id);
14638
- }
14639
- return updatedParams;
14640
- },
14641
- { replace: true }
14642
- );
14643
- };
14644
- return { updateUrl };
14737
+ },
14738
+ remove(key) {
14739
+ localStorage.removeItem(key);
14740
+ }
14645
14741
  };
14646
14742
 
14647
14743
  // src/utils/Hooks/useViewSelection.ts
14648
- var useViewSelection = (config, savedViews, openCrossUserModal) => {
14744
+ var getUpdatedSearchParams = (currentParams, view) => {
14745
+ const updatedParams = new URLSearchParams(currentParams);
14746
+ if (view.id === "default") {
14747
+ updatedParams.delete("saved-view");
14748
+ } else if (view.id === "temporary") {
14749
+ updatedParams.set("saved-view", "temporary");
14750
+ } else {
14751
+ updatedParams.set("saved-view", view.share_token);
14752
+ }
14753
+ return updatedParams;
14754
+ };
14755
+ var checkIsViewSelected = (selectedView, viewId) => {
14756
+ return (selectedView == null ? void 0 : selectedView.share_token) === viewId || (selectedView == null ? void 0 : selectedView.id) === viewId;
14757
+ };
14758
+ var useViewSelection = (config, savedViews, openSharedViewModal) => {
14759
+ const storageKey = `${config.domain}_${config.tableName}_${config.stickyViewsKey}_${config.projectId}_${config.userId}`;
14760
+ const temporaryStorageKey = `${storageKey}_temporary`;
14761
+ const [searchParams, setSearchParams] = useSearchParams();
14649
14762
  const [selectedSavedView, setSelectedSavedView] = useState4(() => {
14650
- try {
14651
- const savedView = JSON.parse(
14652
- localStorage.getItem(
14653
- `${config.domain}_${config.tableName}_${config.stickyViewsKey}_${config.projectId}_${config.userId}`
14654
- )
14655
- );
14656
- return savedView || config.defaultView;
14657
- } catch (e2) {
14658
- return config.defaultView;
14659
- }
14763
+ const stored = ViewStorage.load(storageKey);
14764
+ return stored ?? config.defaultView;
14765
+ });
14766
+ const [temporaryView, setTemporaryView] = useState4(() => {
14767
+ return ViewStorage.load(temporaryStorageKey);
14660
14768
  });
14661
- const [temporaryView, setTemporaryView] = useState4(null);
14662
- const createTemporaryView = useCallback2((fetchedView) => {
14663
- const tempView = {
14664
- ...fetchedView,
14665
- id: "temporary",
14666
- name: "Temporary View"
14667
- };
14668
- setTemporaryView(tempView);
14669
- return tempView;
14670
- }, []);
14671
- const clearTemporaryView = useCallback2(() => setTemporaryView(null), []);
14672
14769
  const updateLocalStorage = useCallback2(
14673
14770
  (view) => {
14674
14771
  if (config.stickyViewsKey) {
14675
- localStorage.setItem(
14676
- `${config.domain}_${config.tableName}_${config.stickyViewsKey}_${config.projectId}_${config.userId}`,
14677
- JSON.stringify(view)
14678
- );
14772
+ ViewStorage.save(storageKey, view);
14679
14773
  }
14680
14774
  },
14681
- [
14682
- config.domain,
14683
- config.tableName,
14684
- config.stickyViewsKey,
14685
- config.projectId,
14686
- config.userId
14687
- ]
14775
+ [config.stickyViewsKey, storageKey]
14688
14776
  );
14689
- const allViews = temporaryView ? [...savedViews ?? [], temporaryView] : savedViews ?? [];
14690
- const onUrlViewFound = (foundView) => {
14691
- selectView(foundView);
14692
- };
14693
- const onUrlViewNotFound = (viewId) => {
14694
- if (viewId === (selectedSavedView == null ? void 0 : selectedSavedView.id)) {
14695
- return;
14696
- }
14697
- openCrossUserModal(viewId);
14698
- };
14699
- const { updateUrl } = useUrlSync(
14700
- selectedSavedView,
14701
- allViews,
14702
- config.defaultView,
14703
- onUrlViewFound,
14704
- onUrlViewNotFound
14777
+ const updateUrlForView = useCallback2(
14778
+ (view) => {
14779
+ setSearchParams(
14780
+ (currentParams) => getUpdatedSearchParams(currentParams, view),
14781
+ { replace: true }
14782
+ );
14783
+ },
14784
+ [setSearchParams]
14705
14785
  );
14786
+ const baseViews = savedViews ?? [];
14787
+ const allViews = temporaryView ? [...baseViews, temporaryView] : baseViews;
14706
14788
  const selectView = useCallback2(
14707
14789
  (view) => {
14708
- if (view.id !== "temporary" && temporaryView) {
14709
- clearTemporaryView();
14710
- }
14711
14790
  const viewToSelect = config.onSelect({ item: view });
14712
14791
  setSelectedSavedView(viewToSelect);
14713
14792
  updateLocalStorage(viewToSelect);
14714
- updateUrl(viewToSelect);
14793
+ updateUrlForView(viewToSelect);
14715
14794
  return viewToSelect;
14716
14795
  },
14717
- [config, temporaryView, clearTemporaryView, updateLocalStorage, updateUrl]
14796
+ [config, updateLocalStorage, updateUrlForView]
14718
14797
  );
14719
- return {
14720
- selectedView: selectedSavedView,
14721
- selectView,
14722
- updateLocalStorage,
14723
- temporaryView,
14724
- createTemporaryView
14725
- };
14726
- };
14727
-
14728
- // src/utils/Hooks/useCrossUserSharing.ts
14729
- import React21 from "react";
14730
- var useCrossUserSharing = (queryInput, viewId, selectedSavedView, defaultView, actions, tableName) => {
14731
- const { data: fetchedView, isError: fetchError } = useFetchSavedViewById(
14732
- viewId,
14733
- queryInput,
14734
- Boolean(viewId)
14735
- );
14736
- const { mutate: createSavedView } = useCreateSavedView(queryInput);
14737
- React21.useEffect(() => {
14738
- if (fetchError && viewId) {
14739
- actions.selectView(selectedSavedView ?? defaultView);
14740
- actions.closeModal();
14741
- }
14742
- }, [fetchError, viewId, actions, selectedSavedView, defaultView]);
14743
- const viewSharedViewTemporarily = () => {
14744
- if (fetchedView) {
14745
- const tempView = actions.createTemporaryView(fetchedView);
14746
- actions.selectView(tempView);
14747
- actions.closeModal();
14748
- }
14749
- };
14750
- const createPersonalCopyOfSharedView = () => {
14751
- if (fetchedView) {
14752
- const viewToCreate = {
14753
- name: fetchedView.name,
14754
- description: fetchedView.description,
14755
- table_name: tableName,
14756
- table_config: fetchedView.table_config,
14757
- view_level: "personal"
14798
+ const createTemporaryView = useCallback2(
14799
+ (fetchedView) => {
14800
+ const tempView = {
14801
+ ...fetchedView,
14802
+ id: "temporary",
14803
+ name: "Temporary View"
14758
14804
  };
14759
- createSavedView(viewToCreate, {
14760
- onSuccess: (newView) => {
14761
- actions.selectView(newView);
14762
- actions.closeModal();
14763
- }
14764
- });
14765
- }
14766
- };
14767
- const selectCurrentViewAndCloseModal = () => {
14768
- actions.selectView(selectedSavedView ?? defaultView);
14769
- actions.closeModal();
14770
- };
14771
- return {
14772
- fetchedView,
14773
- viewSharedViewTemporarily,
14774
- createPersonalCopyOfSharedView,
14775
- selectCurrentViewAndCloseModal
14776
- };
14777
- };
14778
-
14779
- // src/utils/Hooks/useModalState.ts
14780
- import { useState as useState5, useCallback as useCallback3 } from "react";
14781
- var useModalState = () => {
14782
- const [activeModal, setActiveModal] = useState5(null);
14783
- const [modalData, setModalData] = useState5(null);
14784
- const openModal = useCallback3(
14785
- (type, data) => {
14786
- setActiveModal(type);
14787
- setModalData(data ?? null);
14805
+ ViewStorage.save(temporaryStorageKey, tempView);
14806
+ setTemporaryView(tempView);
14807
+ selectView(tempView);
14808
+ return tempView;
14788
14809
  },
14789
- []
14810
+ [temporaryStorageKey, selectView]
14790
14811
  );
14791
- const closeModal = useCallback3(() => {
14792
- setActiveModal(null);
14793
- setModalData(null);
14794
- }, []);
14795
- const isModalOpen = useCallback3(
14796
- (type) => {
14797
- return activeModal === type;
14812
+ const clearTemporaryView = useCallback2(() => {
14813
+ ViewStorage.remove(temporaryStorageKey);
14814
+ setTemporaryView(null);
14815
+ selectView(config.defaultView);
14816
+ }, [temporaryStorageKey, config.defaultView, selectView]);
14817
+ const isViewAlreadySelected = useCallback2(
14818
+ (viewId) => checkIsViewSelected(selectedSavedView, viewId),
14819
+ [selectedSavedView]
14820
+ );
14821
+ const handleSavedViewFromUrl = useCallback2(
14822
+ (viewId) => {
14823
+ if (isViewAlreadySelected(viewId)) {
14824
+ return;
14825
+ }
14826
+ openSharedViewModal(viewId);
14798
14827
  },
14799
- [activeModal]
14828
+ [isViewAlreadySelected, openSharedViewModal]
14800
14829
  );
14830
+ const handleListViewFromUrl = useCallback2(() => {
14831
+ if (config.defaultView.id !== (selectedSavedView == null ? void 0 : selectedSavedView.id)) {
14832
+ selectView(config.defaultView);
14833
+ }
14834
+ }, [config.defaultView, selectedSavedView, selectView]);
14835
+ useEffect3(() => {
14836
+ if (!allViews.length)
14837
+ return;
14838
+ const savedViewId = searchParams.get("saved-view");
14839
+ const viewParamFromConsumer = searchParams.get("view");
14840
+ if (savedViewId) {
14841
+ handleSavedViewFromUrl(savedViewId);
14842
+ return;
14843
+ }
14844
+ if (viewParamFromConsumer === "list") {
14845
+ handleListViewFromUrl();
14846
+ }
14847
+ }, [
14848
+ searchParams,
14849
+ savedViews,
14850
+ temporaryView,
14851
+ handleSavedViewFromUrl,
14852
+ handleListViewFromUrl,
14853
+ allViews.length
14854
+ ]);
14801
14855
  return {
14802
- openModal,
14803
- closeModal,
14804
- isModalOpen,
14805
- modalData,
14806
- activeModal
14856
+ selectedView: selectedSavedView,
14857
+ selectView,
14858
+ temporaryView,
14859
+ createTemporaryView,
14860
+ clearTemporaryView,
14861
+ allViews
14807
14862
  };
14808
14863
  };
14809
14864
 
@@ -14823,16 +14878,26 @@ var SavedViewsContent = (props) => {
14823
14878
  };
14824
14879
  const { data: savedViews } = useSavedViewsQuery(queryInput);
14825
14880
  const { mutate: deleteSavedView } = useDeleteSavedView(queryInput);
14826
- const { openModal, closeModal, isModalOpen, modalData, activeModal } = useModalState();
14827
- const openCrossUserModal = (viewId) => {
14828
- openModal("crossUser" /* CROSS_USER */, { viewId });
14881
+ const [activeModal, setActiveModal] = useState5(null);
14882
+ const [modalData, setModalData] = useState5(null);
14883
+ const openModal = (type, data) => {
14884
+ setActiveModal(type);
14885
+ setModalData(data ?? null);
14886
+ };
14887
+ const closeModal = useCallback3(() => {
14888
+ setActiveModal(null);
14889
+ setModalData(null);
14890
+ }, []);
14891
+ const isModalOpen = (type) => activeModal === type;
14892
+ const openSharedViewModal = (viewId) => {
14893
+ openModal("sharedView" /* SHARED_VIEW */, { viewId });
14829
14894
  };
14830
14895
  const {
14831
14896
  selectedView,
14832
14897
  selectView,
14833
- updateLocalStorage,
14834
- temporaryView,
14835
- createTemporaryView
14898
+ createTemporaryView,
14899
+ clearTemporaryView,
14900
+ allViews
14836
14901
  } = useViewSelection(
14837
14902
  {
14838
14903
  domain: props.domain,
@@ -14844,25 +14909,54 @@ var SavedViewsContent = (props) => {
14844
14909
  onSelect: props.onSelect
14845
14910
  },
14846
14911
  savedViews,
14847
- openCrossUserModal
14912
+ openSharedViewModal
14848
14913
  );
14849
- const {
14850
- fetchedView,
14851
- viewSharedViewTemporarily,
14852
- createPersonalCopyOfSharedView,
14853
- selectCurrentViewAndCloseModal
14854
- } = useCrossUserSharing(
14855
- queryInput,
14914
+ const { data: fetchedView, isError: fetchError } = useFetchSavedViewById(
14856
14915
  (modalData == null ? void 0 : modalData.viewId) ?? null,
14857
- selectedView,
14858
- props.defaultView,
14859
- {
14860
- selectView,
14861
- createTemporaryView,
14862
- closeModal
14863
- },
14864
- props.tableName
14916
+ queryInput,
14917
+ Boolean(modalData == null ? void 0 : modalData.viewId)
14865
14918
  );
14919
+ const {
14920
+ mutate: createSavedView,
14921
+ isPending: isCreating,
14922
+ error: createError,
14923
+ reset: resetCreateError
14924
+ } = useCreateSavedView(queryInput);
14925
+ useEffect4(() => {
14926
+ if (fetchError) {
14927
+ selectView(selectedView ?? props.defaultView);
14928
+ closeModal();
14929
+ }
14930
+ }, [fetchError, selectedView, props.defaultView, selectView, closeModal]);
14931
+ const viewSharedViewTemporarily = () => {
14932
+ if (fetchedView) {
14933
+ createTemporaryView(fetchedView);
14934
+ closeModal();
14935
+ }
14936
+ };
14937
+ const createPersonalCopyOfSharedView = (name, description) => {
14938
+ if (fetchedView) {
14939
+ const viewToCreate = {
14940
+ id: "",
14941
+ name,
14942
+ description,
14943
+ table_name: props.tableName,
14944
+ table_config: fetchedView.table_config,
14945
+ view_level: "personal",
14946
+ share_token: ""
14947
+ };
14948
+ createSavedView(viewToCreate, {
14949
+ onSuccess: (newView) => {
14950
+ selectView(newView);
14951
+ closeModal();
14952
+ }
14953
+ });
14954
+ }
14955
+ };
14956
+ const selectCurrentViewAndCloseModal = () => {
14957
+ selectView(selectedView ?? props.defaultView);
14958
+ closeModal();
14959
+ };
14866
14960
  const deleteSelectedView = () => {
14867
14961
  if (selectedView) {
14868
14962
  deleteSavedView(selectedView, {
@@ -14875,18 +14969,13 @@ var SavedViewsContent = (props) => {
14875
14969
  closeModal();
14876
14970
  };
14877
14971
  const i18n = useI18nContext11();
14878
- const selectSavedViewFromList = ({ item }) => selectView(item);
14879
- const setSelectedSavedView = (view) => {
14880
- selectView(view);
14881
- };
14882
- const allViews = temporaryView ? [...savedViews ?? [], temporaryView] : savedViews ?? [];
14883
14972
  return /* @__PURE__ */ React22.createElement(StyledPanel, { provider: props.provider }, /* @__PURE__ */ React22.createElement(
14884
14973
  ExpandedPanel,
14885
14974
  {
14886
14975
  "data-testid": "saved-view-expanded-panel",
14887
14976
  provider: props.provider
14888
14977
  },
14889
- /* @__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(
14978
+ /* @__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(
14890
14979
  Tooltip,
14891
14980
  {
14892
14981
  overlay: i18n.t("savedViews.actions.create"),
@@ -14907,11 +14996,9 @@ var SavedViewsContent = (props) => {
14907
14996
  /* @__PURE__ */ React22.createElement(Panel3.Body, { style: { display: "flex", flexFlow: "column" } }, /* @__PURE__ */ React22.createElement(
14908
14997
  PanelContent,
14909
14998
  {
14910
- onSelect: selectSavedViewFromList,
14999
+ onSelect: ({ item }) => selectView(item),
14911
15000
  openModal,
14912
15001
  onDelete: () => openModal("delete" /* DELETE */),
14913
- updateLocalStorage,
14914
- setSelectedSavedView,
14915
15002
  queryInput,
14916
15003
  selectedSavedView: selectedView,
14917
15004
  tableConfig: props.tableConfig,
@@ -14919,7 +15006,8 @@ var SavedViewsContent = (props) => {
14919
15006
  stickyViewsKey: props.stickyViewsKey,
14920
15007
  savedViews: allViews,
14921
15008
  provider: props.provider,
14922
- userId: props.userId
15009
+ userId: props.userId,
15010
+ onClearTemporary: clearTemporaryView
14923
15011
  }
14924
15012
  ))
14925
15013
  ), (isModalOpen("create" /* CREATE */) || isModalOpen("update" /* UPDATE */)) && /* @__PURE__ */ React22.createElement(
@@ -14932,7 +15020,6 @@ var SavedViewsContent = (props) => {
14932
15020
  tableConfig: props.tableConfig,
14933
15021
  tableName: props.tableName,
14934
15022
  selectedSavedView: selectedView,
14935
- setSelectedSavedView,
14936
15023
  onSelect: selectView,
14937
15024
  setOpenEditCreateModal: closeModal,
14938
15025
  defaultView: props.defaultView
@@ -14944,14 +15031,17 @@ var SavedViewsContent = (props) => {
14944
15031
  onDelete: confirmDeleteAndCloseModal,
14945
15032
  onCancel: closeModal
14946
15033
  }
14947
- ), fetchedView && isModalOpen("crossUser" /* CROSS_USER */) && /* @__PURE__ */ React22.createElement(
14948
- CreateViewConfirmationModal,
15034
+ ), fetchedView && isModalOpen("sharedView" /* SHARED_VIEW */) && /* @__PURE__ */ React22.createElement(
15035
+ SharedViewFormModal,
14949
15036
  {
14950
15037
  open: true,
14951
- savedViewName: fetchedView.name,
15038
+ fetchedView,
14952
15039
  onClose: selectCurrentViewAndCloseModal,
14953
- onViewTemporarily: viewSharedViewTemporarily,
14954
- onCreateView: createPersonalCopyOfSharedView
15040
+ onCreateTemporaryView: viewSharedViewTemporarily,
15041
+ onCreateView: createPersonalCopyOfSharedView,
15042
+ createError,
15043
+ isCreating,
15044
+ resetCreateError
14955
15045
  }
14956
15046
  ));
14957
15047
  };
@@ -14961,59 +15051,77 @@ var SavedViews = (props) => {
14961
15051
 
14962
15052
  // src/SavedViews/components/SavedViews/SmartGrid/SmartGridSavedViews.tsx
14963
15053
  import { ToastAlertProvider } from "@procore/toast-alert";
15054
+ var generateStickyViewsKey = (domain, tableName, userId, projectId, companyId) => {
15055
+ return `savedView-${domain}-${tableName}-${companyId}-${projectId}-${userId}`;
15056
+ };
14964
15057
  var SmartGridSavedViews = (props) => {
14965
- const { gridApi, projectId, companyId } = props;
15058
+ const { gridApi, userId, projectId, companyId } = props;
14966
15059
  const { config: tableConfig, setConfig: setTableConfig } = useSmartGridConfig(gridApi);
14967
15060
  const defaultView = useDefaultView({
14968
15061
  defaultViewName: props.defaultViewName,
14969
15062
  domain: props.domain
14970
15063
  });
14971
- const onSelect = ({ item }) => {
14972
- if (!gridApi)
14973
- return item;
14974
- if (item.id === "default") {
14975
- gridApi.autoSizeAllColumns();
14976
- gridApi.resetColumnState();
14977
- gridApi.setFilterModel(props.defaultViewFilters);
14978
- gridApi.setGridOption("rowHeight", props.defaultRowHeight);
14979
- gridApi.refreshCells();
14980
- return item;
14981
- }
14982
- const updatedView = {
14983
- ...item,
14984
- table_config: customAndConfigSync(
14985
- item.table_config,
14986
- tableConfig
14987
- )
14988
- };
14989
- updateTableConfig(updatedView, gridApi, "smart-grid");
14990
- setTableConfig(updatedView.table_config);
14991
- return updatedView;
14992
- };
15064
+ const onSelect = useCallback4(
15065
+ ({ item }) => {
15066
+ if (!gridApi)
15067
+ return item;
15068
+ if (item.id === "default") {
15069
+ gridApi.autoSizeAllColumns();
15070
+ gridApi.resetColumnState();
15071
+ gridApi.setFilterModel(props.defaultViewFilters);
15072
+ gridApi.setGridOption("rowHeight", props.defaultRowHeight);
15073
+ gridApi.refreshCells();
15074
+ return item;
15075
+ }
15076
+ const updatedView = {
15077
+ ...item,
15078
+ table_config: customAndConfigSync(
15079
+ item.table_config,
15080
+ tableConfig
15081
+ )
15082
+ };
15083
+ updateTableConfig(updatedView, gridApi, "smart-grid");
15084
+ setTableConfig(updatedView.table_config);
15085
+ return updatedView;
15086
+ },
15087
+ [
15088
+ gridApi,
15089
+ props.defaultViewFilters,
15090
+ props.defaultRowHeight,
15091
+ tableConfig,
15092
+ setTableConfig
15093
+ ]
15094
+ );
15095
+ const stickyViewsKey = generateStickyViewsKey(
15096
+ props.domain,
15097
+ props.tableName,
15098
+ userId,
15099
+ projectId,
15100
+ companyId
15101
+ );
14993
15102
  return /* @__PURE__ */ React23.createElement(ToastAlertProvider, null, /* @__PURE__ */ React23.createElement(
14994
15103
  SavedViews,
14995
15104
  {
14996
15105
  onSelect,
14997
15106
  domain: props.domain,
14998
- userId: props.userId,
15107
+ userId,
14999
15108
  projectId,
15000
15109
  companyId,
15001
15110
  provider: "smart-grid",
15002
15111
  defaultView,
15003
15112
  tableName: props.tableName,
15004
15113
  tableConfig,
15005
- stickyViewsKey: props.stickyViewsKey,
15006
- enableSavedViews: props.enableSavedViews
15114
+ stickyViewsKey
15007
15115
  }
15008
15116
  ));
15009
15117
  };
15010
15118
 
15011
15119
  // src/SavedViews/components/SavedViews/DataTable/DataTableSavedViews.tsx
15012
15120
  import React24, {
15013
- forwardRef as forwardRef10,
15121
+ forwardRef as forwardRef11,
15014
15122
  useImperativeHandle,
15015
15123
  useState as useState6,
15016
- useCallback as useCallback4
15124
+ useCallback as useCallback5
15017
15125
  } from "react";
15018
15126
 
15019
15127
  // src/SavedViews/components/SavedViews/DataTable/DataTableDefaultSavedView.tsx
@@ -15088,58 +15196,63 @@ var useDefaultView2 = (props) => {
15088
15196
 
15089
15197
  // src/SavedViews/components/SavedViews/DataTable/DataTableSavedViews.tsx
15090
15198
  import { ToastAlertProvider as ToastAlertProvider2 } from "@procore/toast-alert";
15091
- var DataTableSavedViews = forwardRef10((props, ref) => {
15092
- const { tableApi, onTableConfigChange, projectId, companyId } = props;
15199
+ var generateStickyViewsKey2 = (domain, tableName, userId, projectId, companyId) => {
15200
+ return `savedView-${domain}-${tableName}-${companyId}-${projectId}-${userId}`;
15201
+ };
15202
+ var DataTableSavedViews = forwardRef11((props, ref) => {
15203
+ const { tableApi, userId, projectId, companyId } = props;
15093
15204
  const [internalTableConfig, setInternalTableConfig] = useState6(
15094
15205
  props.defaultViewConfig
15095
15206
  );
15096
15207
  useImperativeHandle(ref, () => ({
15097
15208
  setTableConfig: (newConfig) => {
15098
- handleConfigChange(newConfig);
15209
+ setInternalTableConfig(newConfig);
15099
15210
  }
15100
15211
  }));
15101
- const handleConfigChange = useCallback4(
15102
- (newConfig) => {
15103
- setInternalTableConfig(newConfig);
15104
- onTableConfigChange(newConfig);
15105
- },
15106
- [onTableConfigChange]
15107
- );
15108
15212
  const defaultView = useDefaultView2({
15109
15213
  defaultViewName: props.defaultViewName,
15110
15214
  receivedConfigFromTool: props.defaultViewConfig,
15111
15215
  domain: props.domain,
15112
15216
  columnDefinitions: props.columnDefinitions
15113
15217
  });
15114
- const onSelect = ({ item }) => {
15115
- const isDefaultView = item.id === "default";
15116
- const updatedView = isDefaultView ? defaultView : {
15117
- ...item,
15118
- table_config: customAndConfigSync(
15119
- item.table_config,
15120
- defaultView.table_config
15121
- )
15122
- };
15123
- updateTableConfig(updatedView, tableApi, "data-table", handleConfigChange);
15124
- return updatedView;
15125
- };
15218
+ const onSelect = useCallback5(
15219
+ ({ item }) => {
15220
+ const isDefaultView = item.id === "default";
15221
+ const updatedView = isDefaultView ? defaultView : {
15222
+ ...item,
15223
+ table_config: customAndConfigSync(
15224
+ item.table_config,
15225
+ defaultView.table_config
15226
+ )
15227
+ };
15228
+ updateTableConfig(updatedView, tableApi, "data-table");
15229
+ return updatedView;
15230
+ },
15231
+ [defaultView, tableApi]
15232
+ );
15126
15233
  if (!internalTableConfig) {
15127
15234
  return null;
15128
15235
  }
15236
+ const stickyViewsKey = generateStickyViewsKey2(
15237
+ props.domain,
15238
+ props.tableName,
15239
+ userId,
15240
+ projectId,
15241
+ companyId
15242
+ );
15129
15243
  return /* @__PURE__ */ React24.createElement(ToastAlertProvider2, null, /* @__PURE__ */ React24.createElement(
15130
15244
  SavedViews,
15131
15245
  {
15132
15246
  onSelect,
15133
15247
  domain: props.domain,
15134
- userId: props.userId,
15248
+ userId,
15135
15249
  projectId,
15136
15250
  companyId,
15137
15251
  provider: "data-table",
15138
15252
  defaultView,
15139
15253
  tableName: props.tableName,
15140
15254
  tableConfig: internalTableConfig,
15141
- stickyViewsKey: props.stickyViewsKey,
15142
- enableSavedViews: props.enableSavedViews
15255
+ stickyViewsKey
15143
15256
  }
15144
15257
  ));
15145
15258
  });