@overmap-ai/core 1.0.38-component-fields.4 → 1.0.38-component-fields.6

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.
@@ -5449,7 +5449,6 @@ class UserFormService extends BaseApiService {
5449
5449
  ...componentType && { component_type: componentType },
5450
5450
  ...ownerAttrs
5451
5451
  };
5452
- console.log(retForm);
5453
5452
  const { payloadWithoutImage, images } = await separateImageFromFields(offlineRevisionPayload);
5454
5453
  const retRevision = {
5455
5454
  ...payloadWithoutImage,
@@ -6240,19 +6239,19 @@ const OvermapProvider = (props) => {
6240
6239
  }
6241
6240
  return /* @__PURE__ */ jsx(OvermapContext.Provider, { value: null, children: ret });
6242
6241
  };
6243
- const description$2 = "_description_p31lm_1";
6244
- const floatingButtonContainer$2 = "_floatingButtonContainer_p31lm_5";
6245
- const FullScreenImageContainer$2 = "_FullScreenImageContainer_p31lm_12";
6246
- const TopBarContainer$2 = "_TopBarContainer_p31lm_22";
6247
- const fileName$2 = "_fileName_p31lm_30";
6248
- const longIconButton$2 = "_longIconButton_p31lm_35";
6249
- const previewImage$3 = "_previewImage_p31lm_41";
6250
- const FullScreenImage$2 = "_FullScreenImage_p31lm_12";
6251
- const tabsList = "_tabsList_p31lm_60";
6252
- const tabTrigger = "_tabTrigger_p31lm_68";
6253
- const patchfieldBorder = "_patchfieldBorder_p31lm_72";
6254
- const title = "_title_p31lm_72";
6255
- const error = "_error_p31lm_88";
6242
+ const description$2 = "_description_1w0fq_1";
6243
+ const floatingButtonContainer$2 = "_floatingButtonContainer_1w0fq_5";
6244
+ const FullScreenImageContainer$2 = "_FullScreenImageContainer_1w0fq_12";
6245
+ const TopBarContainer$2 = "_TopBarContainer_1w0fq_22";
6246
+ const fileName$2 = "_fileName_1w0fq_31";
6247
+ const longIconButton$2 = "_longIconButton_1w0fq_36";
6248
+ const previewImage$3 = "_previewImage_1w0fq_42";
6249
+ const FullScreenImage$2 = "_FullScreenImage_1w0fq_12";
6250
+ const tabsList = "_tabsList_1w0fq_61";
6251
+ const tabTrigger = "_tabTrigger_1w0fq_69";
6252
+ const patchfieldBorder = "_patchfieldBorder_1w0fq_73";
6253
+ const title = "_title_1w0fq_73";
6254
+ const error = "_error_1w0fq_89";
6256
6255
  const styles$7 = {
6257
6256
  description: description$2,
6258
6257
  floatingButtonContainer: floatingButtonContainer$2,
@@ -6366,14 +6365,14 @@ class BaseField extends BaseFormElement {
6366
6365
  }
6367
6366
  __publicField(BaseField, "fieldTypeName");
6368
6367
  __publicField(BaseField, "fieldTypeDescription");
6369
- const description$1 = "_description_1kceu_1";
6370
- const floatingButtonContainer$1 = "_floatingButtonContainer_1kceu_5";
6371
- const FullScreenImageContainer$1 = "_FullScreenImageContainer_1kceu_12";
6372
- const TopBarContainer$1 = "_TopBarContainer_1kceu_22";
6373
- const fileName$1 = "_fileName_1kceu_30";
6374
- const longIconButton$1 = "_longIconButton_1kceu_35";
6375
- const previewImage$2 = "_previewImage_1kceu_41";
6376
- const FullScreenImage$1 = "_FullScreenImage_1kceu_12";
6368
+ const description$1 = "_description_10o76_1";
6369
+ const floatingButtonContainer$1 = "_floatingButtonContainer_10o76_5";
6370
+ const FullScreenImageContainer$1 = "_FullScreenImageContainer_10o76_12";
6371
+ const TopBarContainer$1 = "_TopBarContainer_10o76_22";
6372
+ const fileName$1 = "_fileName_10o76_31";
6373
+ const longIconButton$1 = "_longIconButton_10o76_36";
6374
+ const previewImage$2 = "_previewImage_10o76_42";
6375
+ const FullScreenImage$1 = "_FullScreenImage_10o76_12";
6377
6376
  const styles$6 = {
6378
6377
  description: description$1,
6379
6378
  floatingButtonContainer: floatingButtonContainer$1,
@@ -10750,21 +10749,21 @@ const FieldActions = memo((props) => {
10750
10749
  ] });
10751
10750
  });
10752
10751
  FieldActions.displayName = "FieldActions";
10753
- const description = "_description_o5qyx_1";
10754
- const floatingButtonContainer = "_floatingButtonContainer_o5qyx_5";
10755
- const FullScreenImageContainer = "_FullScreenImageContainer_o5qyx_12";
10756
- const TopBarContainer = "_TopBarContainer_o5qyx_22";
10757
- const fileName = "_fileName_o5qyx_30";
10758
- const longIconButton = "_longIconButton_o5qyx_35";
10759
- const previewImage = "_previewImage_o5qyx_41";
10760
- const FullScreenImage = "_FullScreenImage_o5qyx_12";
10761
- const popoverInputsContainer = "_popoverInputsContainer_o5qyx_60";
10762
- const imageContainer = "_imageContainer_o5qyx_64";
10763
- const deleteImageButton = "_deleteImageButton_o5qyx_69";
10764
- const typeBadge = "_typeBadge_o5qyx_80";
10765
- const previewInput = "_previewInput_o5qyx_85";
10766
- const directInput = "_directInput_o5qyx_89";
10767
- const grow = "_grow_o5qyx_94";
10752
+ const description = "_description_6795p_1";
10753
+ const floatingButtonContainer = "_floatingButtonContainer_6795p_5";
10754
+ const FullScreenImageContainer = "_FullScreenImageContainer_6795p_12";
10755
+ const TopBarContainer = "_TopBarContainer_6795p_22";
10756
+ const fileName = "_fileName_6795p_31";
10757
+ const longIconButton = "_longIconButton_6795p_36";
10758
+ const previewImage = "_previewImage_6795p_42";
10759
+ const FullScreenImage = "_FullScreenImage_6795p_12";
10760
+ const popoverInputsContainer = "_popoverInputsContainer_6795p_61";
10761
+ const imageContainer = "_imageContainer_6795p_65";
10762
+ const deleteImageButton = "_deleteImageButton_6795p_70";
10763
+ const typeBadge = "_typeBadge_6795p_81";
10764
+ const previewInput = "_previewInput_6795p_86";
10765
+ const directInput = "_directInput_6795p_90";
10766
+ const grow = "_grow_6795p_95";
10768
10767
  const styles = {
10769
10768
  description,
10770
10769
  floatingButtonContainer,
@@ -10846,19 +10845,24 @@ const FieldBuilder = memo((props) => {
10846
10845
  const { parentPath, index: index2, initial, conditionalSourceFields } = props;
10847
10846
  const { values, setFieldValue, errors } = useFormikContext();
10848
10847
  const fieldTypeItems = useFieldTypeItems();
10848
+ const containerRef = useRef(null);
10849
10849
  const RADIX_SM_MIN_WIDTH = 576;
10850
- const [isLargeScreen, setIsLargeScreen] = useState(
10851
- window.matchMedia(`(min-width: ${RADIX_SM_MIN_WIDTH}px)`).matches
10850
+ const [isLargeContainer, setIsLargeContainer] = useState(
10851
+ containerRef.current && containerRef.current.getBoundingClientRect().width >= RADIX_SM_MIN_WIDTH
10852
10852
  );
10853
10853
  useEffect(() => {
10854
- const mediaQuery = window.matchMedia(`(min-width: ${RADIX_SM_MIN_WIDTH}px)`);
10855
- const handleMediaQueryChange = (event) => {
10856
- setIsLargeScreen(event.matches);
10857
- };
10858
- mediaQuery.addEventListener("change", handleMediaQueryChange);
10859
- return () => {
10860
- mediaQuery.removeEventListener("change", handleMediaQueryChange);
10861
- };
10854
+ const container = containerRef.current;
10855
+ if (container) {
10856
+ const observer = new ResizeObserver((entries) => {
10857
+ if (entries[0]) {
10858
+ setIsLargeContainer(entries[0].contentRect.width >= RADIX_SM_MIN_WIDTH);
10859
+ }
10860
+ });
10861
+ observer.observe(container);
10862
+ return () => {
10863
+ observer.disconnect();
10864
+ };
10865
+ }
10862
10866
  }, []);
10863
10867
  const [resolvedImage, setResolvedImage] = useState(void 0);
10864
10868
  const [showImagePreview, setShowImagePreview] = useState(false);
@@ -10935,7 +10939,7 @@ const FieldBuilder = memo((props) => {
10935
10939
  const fieldObject = fieldCls.getFieldCreationSchema(
10936
10940
  `${parentPath}.${index2}`
10937
10941
  );
10938
- if (isLargeScreen) {
10942
+ if (isLargeContainer) {
10939
10943
  directlyShownFields2 = [
10940
10944
  ...directlyShownFields2,
10941
10945
  ...fieldObject.filter((field) => field.showDirectly).map((field) => field.field)
@@ -10949,7 +10953,7 @@ const FieldBuilder = memo((props) => {
10949
10953
  }
10950
10954
  }
10951
10955
  return [directlyShownFields2, popoverFields2];
10952
- }, [fieldCls, conditionalSourceFields, parentPath, index2, isLargeScreen]);
10956
+ }, [fieldCls, conditionalSourceFields, parentPath, index2, isLargeContainer]);
10953
10957
  const directlyShownInputs = useFieldInputs(directlyShownFields, {
10954
10958
  formId,
10955
10959
  disabled: false,
@@ -10969,7 +10973,7 @@ const FieldBuilder = memo((props) => {
10969
10973
  });
10970
10974
  const deserializedField = useMemo(() => deserialize(initial), [initial]);
10971
10975
  const previewInput2 = useFieldInput(deserializedField, { formId, disabled: true, showInputOnly: true });
10972
- return /* @__PURE__ */ jsxs(Flex, { align: "center", grow: "1", children: [
10976
+ return /* @__PURE__ */ jsxs(Flex, { ref: containerRef, align: "center", grow: "1", children: [
10973
10977
  /* @__PURE__ */ jsxs(Flex, { direction: "column", width: "100%", children: [
10974
10978
  fieldCls === FieldSection && /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: "1", children: [
10975
10979
  directlyShownFields.length > 0 && directlyShownInputs,