@overmap-ai/core 1.0.51-hover-cards.0 → 1.0.51-qr-field.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,8 +5,8 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  (function(global2, factory) {
8
- typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react/jsx-runtime"), require("@overmap-ai/blocks"), require("dependency-graph"), require("@redux-offline/redux-offline"), require("@redux-offline/redux-offline/lib/defaults"), require("localforage"), require("redux-persist-migrate"), require("@reduxjs/toolkit"), require("superagent"), require("react-redux"), require("file-saver"), require("uuid"), require("color"), require("jwt-decode"), require("@redux-offline/redux-offline/lib/constants"), require("idb"), require("formik"), require("lodash.get"), require("linkify-react"), require("@hello-pangea/dnd"), require("xlsx"), require("react-pdf"), require("react-pdf/dist/Page/AnnotationLayer.css"), require("react-pdf/dist/Page/TextLayer.css"), require("react-dom"), require("react-sketch-canvas"), require("lodash.set"), require("lodash.clonedeep")) : typeof define === "function" && define.amd ? define(["exports", "react", "react/jsx-runtime", "@overmap-ai/blocks", "dependency-graph", "@redux-offline/redux-offline", "@redux-offline/redux-offline/lib/defaults", "localforage", "redux-persist-migrate", "@reduxjs/toolkit", "superagent", "react-redux", "file-saver", "uuid", "color", "jwt-decode", "@redux-offline/redux-offline/lib/constants", "idb", "formik", "lodash.get", "linkify-react", "@hello-pangea/dnd", "xlsx", "react-pdf", "react-pdf/dist/Page/AnnotationLayer.css", "react-pdf/dist/Page/TextLayer.css", "react-dom", "react-sketch-canvas", "lodash.set", "lodash.clonedeep"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2["overmap-core"] = {}, global2.React, global2.jsxRuntime, global2.blocks, global2.dependencyGraph, global2.reduxOffline, global2.offlineConfig, global2.localforage, global2.createMigration, global2.toolkit, global2.request, global2.reactRedux, global2.saveAs, global2.uuid, global2.ColorCls, global2.jwtDecode, global2.constants, global2.idb, global2.formik, global2.get, global2.Linkify, global2.dnd, global2.xlsx, global2.reactPdf, null, null, global2.ReactDOM, global2.reactSketchCanvas, global2.set, global2.cloneDeep));
9
- })(this, function(exports2, React, jsxRuntime, blocks, dependencyGraph, reduxOffline, offlineConfig, localforage, createMigration, toolkit, request, reactRedux, saveAs, uuid, ColorCls, jwtDecode, constants, idb, formik, get, Linkify, dnd, xlsx, reactPdf, AnnotationLayer_css, TextLayer_css, ReactDOM, reactSketchCanvas, set, cloneDeep) {
8
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("react/jsx-runtime"), require("@overmap-ai/blocks"), require("dependency-graph"), require("@redux-offline/redux-offline"), require("@redux-offline/redux-offline/lib/defaults"), require("localforage"), require("redux-persist-migrate"), require("@reduxjs/toolkit"), require("superagent"), require("react-redux"), require("file-saver"), require("uuid"), require("color"), require("jwt-decode"), require("@redux-offline/redux-offline/lib/constants"), require("idb"), require("formik"), require("lodash.get"), require("linkify-react"), require("@hello-pangea/dnd"), require("qr-scanner"), require("xlsx"), require("react-pdf"), require("react-pdf/dist/Page/AnnotationLayer.css"), require("react-pdf/dist/Page/TextLayer.css"), require("react-dom"), require("react-sketch-canvas"), require("lodash.set"), require("lodash.clonedeep")) : typeof define === "function" && define.amd ? define(["exports", "react", "react/jsx-runtime", "@overmap-ai/blocks", "dependency-graph", "@redux-offline/redux-offline", "@redux-offline/redux-offline/lib/defaults", "localforage", "redux-persist-migrate", "@reduxjs/toolkit", "superagent", "react-redux", "file-saver", "uuid", "color", "jwt-decode", "@redux-offline/redux-offline/lib/constants", "idb", "formik", "lodash.get", "linkify-react", "@hello-pangea/dnd", "qr-scanner", "xlsx", "react-pdf", "react-pdf/dist/Page/AnnotationLayer.css", "react-pdf/dist/Page/TextLayer.css", "react-dom", "react-sketch-canvas", "lodash.set", "lodash.clonedeep"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2["overmap-core"] = {}, global2.React, global2.jsxRuntime, global2.blocks, global2.dependencyGraph, global2.reduxOffline, global2.offlineConfig, global2.localforage, global2.createMigration, global2.toolkit, global2.request, global2.reactRedux, global2.saveAs, global2.uuid, global2.ColorCls, global2.jwtDecode, global2.constants, global2.idb, global2.formik, global2.get, global2.Linkify, global2.dnd, global2.QrScannerAPI, global2.xlsx, global2.reactPdf, null, null, global2.ReactDOM, global2.reactSketchCanvas, global2.set, global2.cloneDeep));
9
+ })(this, function(exports2, React, jsxRuntime, blocks, dependencyGraph, reduxOffline, offlineConfig, localforage, createMigration, toolkit, request, reactRedux, saveAs, uuid, ColorCls, jwtDecode, constants, idb, formik, get, Linkify, dnd, QrScannerAPI, xlsx, reactPdf, AnnotationLayer_css, TextLayer_css, ReactDOM, reactSketchCanvas, set, cloneDeep) {
10
10
  var _a;
11
11
  "use strict";
12
12
  function _interopNamespaceDefault(e) {
@@ -1563,9 +1563,6 @@ var __publicField = (obj, key, value) => {
1563
1563
  hiddenCategoryCount++;
1564
1564
  return hiddenCategoryCount;
1565
1565
  };
1566
- const selectIssueCountOfCategory = (categoryId) => (state) => {
1567
- return Object.values(state.issueReducer.issues).filter((issue) => issue.category === categoryId).length;
1568
- };
1569
1566
  const categoryReducer = categorySlice.reducer;
1570
1567
  function setAttachments(state, action) {
1571
1568
  state.attachments = {};
@@ -8225,7 +8222,7 @@ var __publicField = (obj, key, value) => {
8225
8222
  const patchfieldBorder = "_patchfieldBorder_1w0fq_73";
8226
8223
  const title = "_title_1w0fq_73";
8227
8224
  const error = "_error_1w0fq_89";
8228
- const styles$c = {
8225
+ const styles$d = {
8229
8226
  description: description$2,
8230
8227
  floatingButtonContainer: floatingButtonContainer$2,
8231
8228
  FullScreenImageContainer: FullScreenImageContainer$2,
@@ -8346,7 +8343,7 @@ var __publicField = (obj, key, value) => {
8346
8343
  const longIconButton$1 = "_longIconButton_10o76_36";
8347
8344
  const previewImage$1 = "_previewImage_10o76_42";
8348
8345
  const FullScreenImage$1 = "_FullScreenImage_10o76_12";
8349
- const styles$b = {
8346
+ const styles$c = {
8350
8347
  description: description$1,
8351
8348
  floatingButtonContainer: floatingButtonContainer$1,
8352
8349
  FullScreenImageContainer: FullScreenImageContainer$1,
@@ -8370,7 +8367,7 @@ var __publicField = (obj, key, value) => {
8370
8367
  /* @__PURE__ */ jsxRuntime.jsx(
8371
8368
  "button",
8372
8369
  {
8373
- className: styles$b.FullScreenImageContainer,
8370
+ className: styles$c.FullScreenImageContainer,
8374
8371
  type: "button",
8375
8372
  onClick: () => {
8376
8373
  setShowPreview(false);
@@ -8378,7 +8375,7 @@ var __publicField = (obj, key, value) => {
8378
8375
  children: /* @__PURE__ */ jsxRuntime.jsx(
8379
8376
  "img",
8380
8377
  {
8381
- className: styles$b.FullScreenImage,
8378
+ className: styles$c.FullScreenImage,
8382
8379
  src: url,
8383
8380
  alt: name,
8384
8381
  onClick: (e) => {
@@ -8388,11 +8385,11 @@ var __publicField = (obj, key, value) => {
8388
8385
  )
8389
8386
  }
8390
8387
  ),
8391
- /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { className: styles$b.TopBarContainer, align: "center", children: [
8388
+ /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { className: styles$c.TopBarContainer, align: "center", children: [
8392
8389
  /* @__PURE__ */ jsxRuntime.jsx(
8393
8390
  blocks.IconButton,
8394
8391
  {
8395
- className: styles$b.longIconButton,
8392
+ className: styles$c.longIconButton,
8396
8393
  variant: "soft",
8397
8394
  "aria-label": "Exit preview",
8398
8395
  onClick: () => {
@@ -8401,11 +8398,11 @@ var __publicField = (obj, key, value) => {
8401
8398
  children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiArrowLeftLine" })
8402
8399
  }
8403
8400
  ),
8404
- /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { className: styles$b.fileName, children: name }),
8401
+ /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { className: styles$c.fileName, children: name }),
8405
8402
  /* @__PURE__ */ jsxRuntime.jsx(
8406
8403
  blocks.IconButton,
8407
8404
  {
8408
- className: styles$b.longIconButton,
8405
+ className: styles$c.longIconButton,
8409
8406
  variant: "soft",
8410
8407
  "aria-label": `Download ${name}`,
8411
8408
  onClick: handleDownload,
@@ -8433,7 +8430,7 @@ var __publicField = (obj, key, value) => {
8433
8430
  /* @__PURE__ */ jsxRuntime.jsx(
8434
8431
  "img",
8435
8432
  {
8436
- className: styles$b.previewImage,
8433
+ className: styles$c.previewImage,
8437
8434
  src: resolvedImageURL,
8438
8435
  alt: resolvedImage.name,
8439
8436
  onClick: () => {
@@ -8461,7 +8458,7 @@ var __publicField = (obj, key, value) => {
8461
8458
  const { helpText, children, severity } = props;
8462
8459
  return /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { direction: "column", gap: "1", children: [
8463
8460
  children,
8464
- /* @__PURE__ */ jsxRuntime.jsx(blocks.Flex, { direction: "column", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { size: "1", severity, className: styles$b.description, children: helpText }) })
8461
+ /* @__PURE__ */ jsxRuntime.jsx(blocks.Flex, { direction: "column", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { size: "1", severity, className: styles$c.description, children: helpText }) })
8465
8462
  ] });
8466
8463
  };
8467
8464
  const InputWithLabelAndHelpText = (props) => {
@@ -8695,6 +8692,9 @@ var __publicField = (obj, key, value) => {
8695
8692
  function RiCalendarLine(props) {
8696
8693
  return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M9 1V3H15V1H17V3H21C21.5523 3 22 3.44772 22 4V20C22 20.5523 21.5523 21 21 21H3C2.44772 21 2 20.5523 2 20V4C2 3.44772 2.44772 3 3 3H7V1H9ZM20 11H4V19H20V11ZM7 5H4V9H20V5H17V7H15V5H9V7H7V5Z" }, "child": [] }] })(props);
8697
8694
  }
8695
+ function RiQrCodeLine(props) {
8696
+ return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M16 17V16H13V13H16V15H18V17H17V19H15V21H13V18H15V17H16ZM21 21H17V19H19V17H21V21ZM3 3H11V11H3V3ZM5 5V9H9V5H5ZM13 3H21V11H13V3ZM15 5V9H19V5H15ZM3 13H11V21H3V13ZM5 15V19H9V15H5ZM18 13H21V15H18V13ZM6 6H8V8H6V6ZM6 16H8V18H6V16ZM16 6H18V8H16V6Z" }, "child": [] }] })(props);
8697
+ }
8698
8698
  function RiFileCopyLine(props) {
8699
8699
  return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "fill": "currentColor" }, "child": [{ "tag": "path", "attr": { "d": "M6.9998 6V3C6.9998 2.44772 7.44752 2 7.9998 2H19.9998C20.5521 2 20.9998 2.44772 20.9998 3V17C20.9998 17.5523 20.5521 18 19.9998 18H16.9998V20.9991C16.9998 21.5519 16.5499 22 15.993 22H4.00666C3.45059 22 3 21.5554 3 20.9991L3.0026 7.00087C3.0027 6.44811 3.45264 6 4.00942 6H6.9998ZM5.00242 8L5.00019 20H14.9998V8H5.00242ZM8.9998 6H16.9998V16H18.9998V4H8.9998V6Z" }, "child": [] }] })(props);
8700
8700
  }
@@ -9598,9 +9598,9 @@ var __publicField = (obj, key, value) => {
9598
9598
  return React__namespace.createElement("div", { ...insetProps, ref: forwardedRef, className: classNames("rt-Inset", className, withBreakpoints(side, "rt-r-side"), withBreakpoints(clip, "rt-r-clip"), withBreakpoints(p, "rt-r-p"), withBreakpoints(px, "rt-r-px"), withBreakpoints(py, "rt-r-py"), withBreakpoints(pt, "rt-r-pt"), withBreakpoints(pr, "rt-r-pr"), withBreakpoints(pb, "rt-r-pb"), withBreakpoints(pl, "rt-r-pl"), withMarginProps(marginProps)) });
9599
9599
  });
9600
9600
  Inset.displayName = "Inset";
9601
- const sizes$7 = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
9601
+ const sizes$8 = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
9602
9602
  const headingPropDefs = {
9603
- size: { type: "enum", values: sizes$7, default: "6", responsive: true },
9603
+ size: { type: "enum", values: sizes$8, default: "6", responsive: true },
9604
9604
  weight: { ...weightProp, default: "bold" },
9605
9605
  align: alignProp,
9606
9606
  trim: trimProp,
@@ -9613,9 +9613,9 @@ var __publicField = (obj, key, value) => {
9613
9613
  return React__namespace.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, { "data-accent-color": color, ...headingProps, ref: forwardedRef, className: classNames("rt-Heading", className, withBreakpoints(size, "rt-r-size"), withBreakpoints(weight, "rt-r-weight"), withBreakpoints(align, "rt-r-ta"), withBreakpoints(trim, "rt-r-lt"), { "rt-high-contrast": highContrast }, withMarginProps(marginProps)) }, asChild ? children : React__namespace.createElement(Tag, null, children));
9614
9614
  });
9615
9615
  Heading.displayName = "Heading";
9616
- const sizes$6 = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
9616
+ const sizes$7 = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
9617
9617
  const textPropDefs = {
9618
- size: { type: "enum", values: sizes$6, default: void 0, responsive: true },
9618
+ size: { type: "enum", values: sizes$7, default: void 0, responsive: true },
9619
9619
  weight: weightProp,
9620
9620
  align: alignProp,
9621
9621
  trim: trimProp,
@@ -9628,6 +9628,21 @@ var __publicField = (obj, key, value) => {
9628
9628
  return React__namespace.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, { "data-accent-color": color, ...textProps, ref: forwardedRef, className: classNames("rt-Text", className, withBreakpoints(size, "rt-r-size"), withBreakpoints(weight, "rt-r-weight"), withBreakpoints(align, "rt-r-ta"), withBreakpoints(trim, "rt-r-lt"), { "rt-high-contrast": highContrast }, withMarginProps(marginProps)) }, asChild ? children : React__namespace.createElement(Tag, null, children));
9629
9629
  });
9630
9630
  Text.displayName = "Text";
9631
+ const sizes$6 = ["1", "2", "3", "4", "5", "6", "7", "8", "9"];
9632
+ const variants$4 = ["solid", "soft", "outline", "ghost"];
9633
+ const codePropDefs = {
9634
+ size: { type: "enum", values: sizes$6, default: void 0, responsive: true },
9635
+ variant: { type: "enum", values: variants$4, default: "soft" },
9636
+ weight: weightProp,
9637
+ color: colorProp,
9638
+ highContrast: highContrastProp
9639
+ };
9640
+ const Code = React__namespace.forwardRef((props, forwardedRef) => {
9641
+ const { rest: marginRest, ...marginProps } = extractMarginProps(props);
9642
+ const { className, size = codePropDefs.size.default, variant = codePropDefs.variant.default, weight = codePropDefs.weight.default, color = codePropDefs.color.default, highContrast = codePropDefs.highContrast.default, ...codeProps } = marginRest;
9643
+ return React__namespace.createElement("code", { "data-accent-color": color, ...codeProps, ref: forwardedRef, className: classNames("rt-Code", className, withBreakpoints(size, "rt-r-size"), `rt-variant-${variant}`, withBreakpoints(weight, "rt-r-weight"), { "rt-high-contrast": highContrast }, withMarginProps(marginProps)) });
9644
+ });
9645
+ Code.displayName = "Code";
9631
9646
  const Em = React__namespace.forwardRef((props, forwardedRef) => React__namespace.createElement("em", { ...props, ref: forwardedRef, className: classNames("rt-Em", props.className) }));
9632
9647
  Em.displayName = "Em";
9633
9648
  const Strong = React__namespace.forwardRef((props, forwardedRef) => React__namespace.createElement("strong", { ...props, ref: forwardedRef, className: classNames("rt-Strong", props.className) }));
@@ -12018,7 +12033,7 @@ var __publicField = (obj, key, value) => {
12018
12033
  });
12019
12034
  const clickableLinkContainer = "_clickableLinkContainer_1ace7_1";
12020
12035
  const TextFieldInputCopy = "_TextFieldInputCopy_1ace7_5";
12021
- const styles$a = {
12036
+ const styles$b = {
12022
12037
  clickableLinkContainer,
12023
12038
  TextFieldInputCopy
12024
12039
  };
@@ -12047,13 +12062,13 @@ var __publicField = (obj, key, value) => {
12047
12062
  placeholder: field.placeholder,
12048
12063
  color
12049
12064
  }
12050
- ) : /* @__PURE__ */ jsxRuntime.jsxs(TextField$1.Root, { className: styles$a.clickableLinkContainer, children: [
12065
+ ) : /* @__PURE__ */ jsxRuntime.jsxs(TextField$1.Root, { className: styles$b.clickableLinkContainer, children: [
12051
12066
  /* @__PURE__ */ jsxRuntime.jsx(
12052
12067
  "div",
12053
12068
  {
12054
12069
  className: classNames$1(
12055
12070
  "rt-TextFieldInput rt-r-size-2 rt-variant-surface",
12056
- styles$a.TextFieldInputCopy
12071
+ styles$b.TextFieldInputCopy
12057
12072
  ),
12058
12073
  children: /* @__PURE__ */ jsxRuntime.jsx(
12059
12074
  Linkify,
@@ -12745,6 +12760,158 @@ var __publicField = (obj, key, value) => {
12745
12760
  __publicField(_MultiSelectField, "fieldTypeDescription", "Allows the user to select a multiple options from a list of options.");
12746
12761
  __publicField(_MultiSelectField, "Icon", RiCheckboxLine);
12747
12762
  let MultiSelectField = _MultiSelectField;
12763
+ const QrScannerWrapper = "_QrScannerWrapper_1puz3_1";
12764
+ const styles$a = {
12765
+ QrScannerWrapper
12766
+ };
12767
+ const QrInput = React.memo((props) => {
12768
+ const [{ inputId, labelId, label, helpText, size, severity, showInputOnly, field, fieldProps }, rest] = useFormikInput(props);
12769
+ const [showQrScanner, setShowQrScanner] = React.useState(false);
12770
+ const value = fieldProps.value;
12771
+ const handleQrScan = React.useCallback(
12772
+ (data) => {
12773
+ fieldProps.onChange({ target: { value: data } });
12774
+ setShowQrScanner(false);
12775
+ },
12776
+ [fieldProps]
12777
+ );
12778
+ const handleClearScanResult = React.useCallback(() => {
12779
+ fieldProps.onChange({ target: { value: "" } });
12780
+ }, [fieldProps]);
12781
+ const handleScanButtonClicked = React.useCallback(() => {
12782
+ setShowQrScanner(true);
12783
+ }, []);
12784
+ const handleQrScannerClose = React.useCallback(() => {
12785
+ setShowQrScanner(false);
12786
+ }, []);
12787
+ return /* @__PURE__ */ jsxRuntime.jsx(InputWithLabelAndHelpText, { helpText, severity, children: /* @__PURE__ */ jsxRuntime.jsxs(
12788
+ InputWithLabel,
12789
+ {
12790
+ size,
12791
+ severity,
12792
+ inputId,
12793
+ labelId,
12794
+ label: showInputOnly ? label : "",
12795
+ image: showInputOnly ? void 0 : field.image,
12796
+ flexProps: { direction: "column", justify: "start", align: "start", gap: "1" },
12797
+ children: [
12798
+ /* @__PURE__ */ jsxRuntime.jsx(
12799
+ blocks.Overlay,
12800
+ {
12801
+ open: showQrScanner,
12802
+ content: () => /* @__PURE__ */ jsxRuntime.jsx(QrScanner, { onQrScan: handleQrScan, onClose: handleQrScannerClose }),
12803
+ onOpenChange: setShowQrScanner
12804
+ }
12805
+ ),
12806
+ /* @__PURE__ */ jsxRuntime.jsxs(Flex, { width: "max-content", gap: "1", align: "center", children: [
12807
+ /* @__PURE__ */ jsxRuntime.jsxs(blocks.Button, { ...rest, variant: "soft", onClick: handleScanButtonClicked, children: [
12808
+ /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiQrCodeLine" }),
12809
+ "Scan"
12810
+ ] }),
12811
+ value && /* @__PURE__ */ jsxRuntime.jsx(Text, { color: "jade", size: "1", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiCheckLine", style: { verticalAlign: "bottom" } }) })
12812
+ ] }),
12813
+ value && /* @__PURE__ */ jsxRuntime.jsx(Card, { children: /* @__PURE__ */ jsxRuntime.jsxs(Flex, { width: "max-content", gap: "2", align: "center", children: [
12814
+ /* @__PURE__ */ jsxRuntime.jsx(Code, { color: "gray", highContrast: true, children: value }),
12815
+ /* @__PURE__ */ jsxRuntime.jsx(
12816
+ blocks.IconButton,
12817
+ {
12818
+ severity: "info",
12819
+ variant: "ghost",
12820
+ "aria-label": "delete",
12821
+ size: "small",
12822
+ onClick: handleClearScanResult,
12823
+ children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiCloseLine" })
12824
+ }
12825
+ )
12826
+ ] }) })
12827
+ ]
12828
+ }
12829
+ ) });
12830
+ });
12831
+ QrInput.displayName = "QrInput";
12832
+ const QrScanner = React.memo((props) => {
12833
+ const { onQrScan, onClose } = props;
12834
+ const videoRef = React.useRef(null);
12835
+ const [isScannerLoading, setIsScannerLoading] = React.useState(false);
12836
+ React.useEffect(() => {
12837
+ if (!videoRef.current)
12838
+ return;
12839
+ const qrScanner = new QrScannerAPI(
12840
+ videoRef.current,
12841
+ (result) => {
12842
+ const data = result.data;
12843
+ onQrScan(data);
12844
+ qrScanner.destroy();
12845
+ },
12846
+ {
12847
+ highlightCodeOutline: true,
12848
+ highlightScanRegion: true,
12849
+ maxScansPerSecond: 1
12850
+ }
12851
+ );
12852
+ setIsScannerLoading(true);
12853
+ qrScanner.start().then(() => {
12854
+ setIsScannerLoading(false);
12855
+ }).catch(() => {
12856
+ setIsScannerLoading(false);
12857
+ });
12858
+ }, [onQrScan]);
12859
+ return /* @__PURE__ */ jsxRuntime.jsxs(
12860
+ Flex,
12861
+ {
12862
+ className: styles$a.QrScannerWrapper,
12863
+ width: "100%",
12864
+ height: "100%",
12865
+ direction: "column",
12866
+ gap: "2",
12867
+ justify: "center",
12868
+ position: "relative",
12869
+ children: [
12870
+ /* @__PURE__ */ jsxRuntime.jsx(Flex, { width: "100%", position: "absolute", top: "0", p: "2", children: /* @__PURE__ */ jsxRuntime.jsx(blocks.IconButton, { "aria-label": "close", variant: "soft", severity: "info", highContrast: true, onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiCloseLine" }) }) }),
12871
+ /* @__PURE__ */ jsxRuntime.jsxs(Box, { style: { maxWidth: "100%", maxHeight: "100%" }, position: "relative", children: [
12872
+ /* @__PURE__ */ jsxRuntime.jsx("video", { ref: videoRef, style: { width: "100%", height: "100%" } }),
12873
+ isScannerLoading && /* @__PURE__ */ jsxRuntime.jsx(
12874
+ Flex,
12875
+ {
12876
+ position: "absolute",
12877
+ inset: "0",
12878
+ style: { background: "var(--color-background)" },
12879
+ justify: "center",
12880
+ align: "center",
12881
+ children: /* @__PURE__ */ jsxRuntime.jsx(blocks.Spinner, {})
12882
+ }
12883
+ )
12884
+ ] })
12885
+ ]
12886
+ }
12887
+ );
12888
+ });
12889
+ QrScanner.displayName = "QrScanner";
12890
+ const emptyQrField = {
12891
+ ...emptyBaseField,
12892
+ type: "qr"
12893
+ };
12894
+ const _QrField = class _QrField extends BaseField {
12895
+ constructor(options) {
12896
+ super({ ...options, type: "qr" });
12897
+ __publicField(this, "onlyValidateAfterTouched", false);
12898
+ }
12899
+ serialize() {
12900
+ return super._serialize();
12901
+ }
12902
+ static deserialize(data) {
12903
+ if (data.type !== "qr")
12904
+ throw new Error("Type mismatch.");
12905
+ return new _QrField(data);
12906
+ }
12907
+ getInput(props) {
12908
+ return /* @__PURE__ */ jsxRuntime.jsx(QrInput, { ...props, field: this });
12909
+ }
12910
+ };
12911
+ __publicField(_QrField, "fieldTypeName", "QR");
12912
+ __publicField(_QrField, "fieldTypeDescription", "Used for scanning/reading QR codes.");
12913
+ __publicField(_QrField, "Icon", RiQrCodeLine);
12914
+ let QrField = _QrField;
12748
12915
  const FieldInputCloner = React.memo((props) => {
12749
12916
  const { field, ...rest } = props;
12750
12917
  const [{ value: identifier }] = formik.useField(field.options.clonedFieldIdentifier);
@@ -14002,6 +14169,7 @@ var __publicField = (obj, key, value) => {
14002
14169
  text: TextField,
14003
14170
  custom: CustomField,
14004
14171
  upload: UploadField,
14172
+ qr: QrField,
14005
14173
  // TODO: Underscore
14006
14174
  "multi-string": MultiStringField,
14007
14175
  "multi-select": MultiSelectField
@@ -14015,6 +14183,7 @@ var __publicField = (obj, key, value) => {
14015
14183
  text: emptyTextField,
14016
14184
  custom: emptyCustomField,
14017
14185
  upload: emptyUploadField,
14186
+ qr: emptyQrField,
14018
14187
  // TODO: Underscore
14019
14188
  "multi-string": emptyMultiStringField,
14020
14189
  "multi-select": emptyMultiSelectField
@@ -14102,7 +14271,7 @@ var __publicField = (obj, key, value) => {
14102
14271
  return /* @__PURE__ */ jsxRuntime.jsx(Card, { children: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { direction: "column", gap: "3", children: [
14103
14272
  /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { direction: "column", children: [
14104
14273
  /* @__PURE__ */ jsxRuntime.jsx(Heading, { as: "h3", size: "3", children: label }),
14105
- /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { className: styles$b.description, children: description2 })
14274
+ /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { className: styles$c.description, children: description2 })
14106
14275
  ] }),
14107
14276
  inputs
14108
14277
  ] }) });
@@ -14345,7 +14514,7 @@ var __publicField = (obj, key, value) => {
14345
14514
  [schema.title]
14346
14515
  );
14347
14516
  const Description = React.useMemo(
14348
- () => typeof schema.description === "string" ? /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { className: styles$b.description, children: schema.description }) : schema.description,
14517
+ () => typeof schema.description === "string" ? /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { className: styles$c.description, children: schema.description }) : schema.description,
14349
14518
  [schema.description]
14350
14519
  );
14351
14520
  const inputs = useFieldInputs(schema.fields, { formId: formId2, disabled: readonly });
@@ -14361,7 +14530,7 @@ var __publicField = (obj, key, value) => {
14361
14530
  !hideDescription && Description
14362
14531
  ] }) }),
14363
14532
  inputs,
14364
- !readonly && /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { className: styles$b.floatingButtonContainer, align: "center", justify: "end", gap: "2", children: [
14533
+ !readonly && /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { className: styles$c.floatingButtonContainer, align: "center", justify: "end", gap: "2", children: [
14365
14534
  cancelText && /* @__PURE__ */ jsxRuntime.jsx(blocks.Button, { severity: "info", ...buttonProps, type: "button", onClick: onCancel, children: cancelText }),
14366
14535
  /* @__PURE__ */ jsxRuntime.jsx(blocks.Button, { ...buttonProps, type: "submit", disabled: !formik$1.isValid, children: submitText })
14367
14536
  ] })
@@ -15709,12 +15878,12 @@ var __publicField = (obj, key, value) => {
15709
15878
  });
15710
15879
  const previewSchema = React.useMemo(() => formRevisionToSchema(formik$1.values), [formik$1.values]);
15711
15880
  return /* @__PURE__ */ jsxRuntime.jsx(Tabs.Root, { ref, defaultValue: "edit", children: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { direction: "column", gap: "2", children: [
15712
- showTabs && /* @__PURE__ */ jsxRuntime.jsxs(Tabs.List, { className: classNames$1(styles$c.tabsList, tabsListClassName), children: [
15713
- /* @__PURE__ */ jsxRuntime.jsx(Tabs.Trigger, { className: styles$c.tabTrigger, value: "edit", children: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { align: "center", gap: "2", children: [
15881
+ showTabs && /* @__PURE__ */ jsxRuntime.jsxs(Tabs.List, { className: classNames$1(styles$d.tabsList, tabsListClassName), children: [
15882
+ /* @__PURE__ */ jsxRuntime.jsx(Tabs.Trigger, { className: styles$d.tabTrigger, value: "edit", children: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { align: "center", gap: "2", children: [
15714
15883
  /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiPencilLine" }),
15715
15884
  "Edit"
15716
15885
  ] }) }),
15717
- /* @__PURE__ */ jsxRuntime.jsx(Tabs.Trigger, { className: styles$c.tabTrigger, value: "preview", children: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { align: "center", gap: "2", children: [
15886
+ /* @__PURE__ */ jsxRuntime.jsx(Tabs.Trigger, { className: styles$d.tabTrigger, value: "preview", children: /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { align: "center", gap: "2", children: [
15718
15887
  /* @__PURE__ */ jsxRuntime.jsx(blocks.RiIcon, { icon: "RiEyeLine" }),
15719
15888
  "Preview"
15720
15889
  ] }) })
@@ -15738,8 +15907,8 @@ var __publicField = (obj, key, value) => {
15738
15907
  render: ({ setValue, value, meta }) => /* @__PURE__ */ jsxRuntime.jsx(InputWithHelpText, { severity: "danger", helpText: meta.error ?? null, children: /* @__PURE__ */ jsxRuntime.jsx(
15739
15908
  blocks.Input,
15740
15909
  {
15741
- className: classNames$1(styles$c.title, {
15742
- [styles$c.error]: meta.error
15910
+ className: classNames$1(styles$d.title, {
15911
+ [styles$d.error]: meta.error
15743
15912
  }),
15744
15913
  placeholder: "Form title",
15745
15914
  value,
@@ -15761,7 +15930,7 @@ var __publicField = (obj, key, value) => {
15761
15930
  render: ({ setValue, value }) => /* @__PURE__ */ jsxRuntime.jsx(
15762
15931
  blocks.TextArea,
15763
15932
  {
15764
- className: styles$c.description,
15933
+ className: styles$d.description,
15765
15934
  placeholder: "Explain the purpose of this form",
15766
15935
  value,
15767
15936
  onChange: (event) => {
@@ -15779,7 +15948,7 @@ var __publicField = (obj, key, value) => {
15779
15948
  /* @__PURE__ */ jsxRuntime.jsx(FieldsEditor, { fieldsOnly }),
15780
15949
  /* @__PURE__ */ jsxRuntime.jsx(blocks.Text, { severity: "danger", size: "1", children: typeof formik$1.errors.fields === "string" && formik$1.errors.fields })
15781
15950
  ] }),
15782
- /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { className: styles$c.floatingButtonContainer, align: "center", justify: "end", gap: "2", children: [
15951
+ /* @__PURE__ */ jsxRuntime.jsxs(blocks.Flex, { className: styles$d.floatingButtonContainer, align: "center", justify: "end", gap: "2", children: [
15783
15952
  onCancel && /* @__PURE__ */ jsxRuntime.jsx(blocks.Button, { type: "button", variant: "solid", severity: "info", onClick: onCancel, children: "Cancel" }),
15784
15953
  /* @__PURE__ */ jsxRuntime.jsx(blocks.Button, { type: "submit", children: "Save form" })
15785
15954
  ] })
@@ -15814,6 +15983,9 @@ var __publicField = (obj, key, value) => {
15814
15983
  NumberInput,
15815
15984
  PatchField,
15816
15985
  PatchFormProvider,
15986
+ QrField,
15987
+ QrInput,
15988
+ QrScanner,
15817
15989
  SelectField,
15818
15990
  SelectInput,
15819
15991
  StringField,
@@ -15828,6 +16000,7 @@ var __publicField = (obj, key, value) => {
15828
16000
  emptyMultiSelectField,
15829
16001
  emptyMultiStringField,
15830
16002
  emptyNumberField,
16003
+ emptyQrField,
15831
16004
  emptySelectField,
15832
16005
  emptyStringField,
15833
16006
  emptyTextField,
@@ -15917,6 +16090,9 @@ var __publicField = (obj, key, value) => {
15917
16090
  exports2.ProjectFileService = ProjectFileService;
15918
16091
  exports2.ProjectService = ProjectService;
15919
16092
  exports2.ProjectType = ProjectType;
16093
+ exports2.QrField = QrField;
16094
+ exports2.QrInput = QrInput;
16095
+ exports2.QrScanner = QrScanner;
15920
16096
  exports2.SDKContext = SDKContext;
15921
16097
  exports2.SDKProvider = SDKProvider;
15922
16098
  exports2.SUPPORTED_IMAGE_FILE_TYPES = SUPPORTED_IMAGE_FILE_TYPES;
@@ -16040,6 +16216,7 @@ var __publicField = (obj, key, value) => {
16040
16216
  exports2.emptyMultiSelectField = emptyMultiSelectField;
16041
16217
  exports2.emptyMultiStringField = emptyMultiStringField;
16042
16218
  exports2.emptyNumberField = emptyNumberField;
16219
+ exports2.emptyQrField = emptyQrField;
16043
16220
  exports2.emptySelectField = emptySelectField;
16044
16221
  exports2.emptyStringField = emptyStringField;
16045
16222
  exports2.emptyTextField = emptyTextField;
@@ -16264,7 +16441,6 @@ var __publicField = (obj, key, value) => {
16264
16441
  exports2.selectIssueAttachment = selectIssueAttachment;
16265
16442
  exports2.selectIssueAttachmentMapping = selectIssueAttachmentMapping;
16266
16443
  exports2.selectIssueAttachments = selectIssueAttachments;
16267
- exports2.selectIssueCountOfCategory = selectIssueCountOfCategory;
16268
16444
  exports2.selectIssueMapping = selectIssueMapping;
16269
16445
  exports2.selectIssueUpdateMapping = selectIssueUpdateMapping;
16270
16446
  exports2.selectIssueUpdatesOfIssue = selectIssueUpdatesOfIssue;