@geowiki/recodo 0.16.9-dev.19 → 0.16.9-dev.20

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.
package/dist/index.js CHANGED
@@ -5099,6 +5099,52 @@ var import_jsx_runtime35 = require("react/jsx-runtime");
5099
5099
  var MapWithNoSSR2 = (0, import_core62.dynamic)(() => Promise.resolve().then(() => (init_cluster_map(), cluster_map_exports)), {
5100
5100
  ssr: false
5101
5101
  });
5102
+ var CoverImageDropzone = ({ field, onFileSelected }) => {
5103
+ const coverImageDropzone = (0, import_react_dropzone5.useDropzone)({
5104
+ accept: {
5105
+ "image/jpeg": [".jpeg", ".png"]
5106
+ },
5107
+ maxFiles: 1,
5108
+ multiple: false,
5109
+ onDrop: (acceptedFiles) => {
5110
+ const selectedFile = acceptedFiles[0];
5111
+ onFileSelected(selectedFile);
5112
+ field.onChange(selectedFile);
5113
+ }
5114
+ });
5115
+ return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "mt-1 sm:mt-0 sm:col-span-2 pt-6", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "w-[70%] py-12 pb-14 flex justify-center px-6 border-2 border-grey-light border-dashed rounded-md", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { ...coverImageDropzone.getRootProps(), children: [
5116
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { ...coverImageDropzone.getInputProps({}) }),
5117
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "w-full text-center flex-col flex items-center", children: [
5118
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "w-16 h-16 bg-accent-primary flex items-center justify-center rounded-full", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5119
+ "svg",
5120
+ {
5121
+ width: "32",
5122
+ height: "32",
5123
+ viewBox: "0 0 32 32",
5124
+ fill: "none",
5125
+ xmlns: "http://www.w3.org/2000/svg",
5126
+ className: " fill-primary",
5127
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", { d: "M19.667 8V5L25.667 11H22.667C20.5603 11 19.667 10.1067 19.667 8ZM22.667 13C19.4403 13 17.667 11.2267 17.667 8V4H10.667C8.00033 4 6.66699 5.33333 6.66699 8V24C6.66699 26.6667 8.00033 28 10.667 28H22.667C25.3337 28 26.667 26.6667 26.667 24V13H22.667Z" })
5128
+ }
5129
+ ) }),
5130
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "pt-6 flex justify-center", children: [
5131
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "pr-1 text-lg font-normal", children: "Drop your files here or" }),
5132
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5133
+ "label",
5134
+ {
5135
+ htmlFor: "file-upload",
5136
+ className: "relative cursor-pointer rounded-md font-medium text-primary hover:text-primary-600 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-primary-500",
5137
+ children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "text-lg font-semibold", children: [
5138
+ " ",
5139
+ "browse"
5140
+ ] })
5141
+ }
5142
+ )
5143
+ ] }),
5144
+ /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm font-normal text-grey pt-2", children: "PNG, JPG, GIF up to 10MB. Landscape mode, recommended size 1920x1080px." })
5145
+ ] })
5146
+ ] }) }) });
5147
+ };
5102
5148
  var FarmerClusterCreate = () => {
5103
5149
  const [openSevedPopup, setOpenSevedPopup] = (0, import_react31.useState)(false);
5104
5150
  const [selectedFileUrl, setSelectedFileUrl] = (0, import_react31.useState)(null);
@@ -5470,54 +5516,16 @@ var FarmerClusterCreate = () => {
5470
5516
  {
5471
5517
  control,
5472
5518
  name: "coverImage",
5473
- render: ({ field }) => {
5474
- const coverImageDropzone = (0, import_react_dropzone5.useDropzone)({
5475
- accept: {
5476
- "image/jpeg": [".jpeg", ".png"]
5477
- },
5478
- maxFiles: 1,
5479
- multiple: false,
5480
- onDrop: (acceptedFiles) => {
5481
- let selectedFile2 = acceptedFiles[0];
5482
- setSelectedFile(selectedFile2);
5483
- let imgURL = URL.createObjectURL(selectedFile2);
5484
- setSelectedFileUrl(imgURL);
5485
- field.onChange(selectedFile2);
5519
+ render: ({ field }) => /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5520
+ CoverImageDropzone,
5521
+ {
5522
+ field,
5523
+ onFileSelected: (file) => {
5524
+ setSelectedFile(file);
5525
+ setSelectedFileUrl(URL.createObjectURL(file));
5486
5526
  }
5487
- });
5488
- return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "mt-1 sm:mt-0 sm:col-span-2 pt-6", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "w-[70%] py-12 pb-14 flex justify-center px-6 border-2 border-grey-light border-dashed rounded-md", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { ...coverImageDropzone.getRootProps(), children: [
5489
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("input", { ...coverImageDropzone.getInputProps({}) }),
5490
- /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "w-full text-center flex-col flex items-center", children: [
5491
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: "w-16 h-16 bg-accent-primary flex items-center justify-center rounded-full", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5492
- "svg",
5493
- {
5494
- width: "32",
5495
- height: "32",
5496
- viewBox: "0 0 32 32",
5497
- fill: "none",
5498
- xmlns: "http://www.w3.org/2000/svg",
5499
- className: " fill-primary",
5500
- children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("path", { d: "M19.667 8V5L25.667 11H22.667C20.5603 11 19.667 10.1067 19.667 8ZM22.667 13C19.4403 13 17.667 11.2267 17.667 8V4H10.667C8.00033 4 6.66699 5.33333 6.66699 8V24C6.66699 26.6667 8.00033 28 10.667 28H22.667C25.3337 28 26.667 26.6667 26.667 24V13H22.667Z" })
5501
- }
5502
- ) }),
5503
- /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: "pt-6 flex justify-center", children: [
5504
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "pr-1 text-lg font-normal", children: "Drop your files here or" }),
5505
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5506
- "label",
5507
- {
5508
- htmlFor: "file-upload",
5509
- className: "relative cursor-pointer rounded-md font-medium text-primary hover:text-primary-600 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-primary-500",
5510
- children: /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "text-lg font-semibold", children: [
5511
- " ",
5512
- "browse"
5513
- ] })
5514
- }
5515
- )
5516
- ] }),
5517
- /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", { className: "text-sm font-normal text-grey pt-2", children: "PNG, JPG, GIF up to 10MB. Landscape mode, recommended size 1920x1080px." })
5518
- ] })
5519
- ] }) }) });
5520
- }
5527
+ }
5528
+ )
5521
5529
  }
5522
5530
  ),
5523
5531
  errors.coverImage && typeof errors.coverImage.message === "string" && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "text-red-500", children: errors.coverImage.message }),
package/dist/index.mjs CHANGED
@@ -5049,6 +5049,52 @@ import { jsx as jsx33, jsxs as jsxs26 } from "react/jsx-runtime";
5049
5049
  var MapWithNoSSR2 = dynamic4(() => import("./cluster-map-D24GOWM4.mjs"), {
5050
5050
  ssr: false
5051
5051
  });
5052
+ var CoverImageDropzone = ({ field, onFileSelected }) => {
5053
+ const coverImageDropzone = useDropzone5({
5054
+ accept: {
5055
+ "image/jpeg": [".jpeg", ".png"]
5056
+ },
5057
+ maxFiles: 1,
5058
+ multiple: false,
5059
+ onDrop: (acceptedFiles) => {
5060
+ const selectedFile = acceptedFiles[0];
5061
+ onFileSelected(selectedFile);
5062
+ field.onChange(selectedFile);
5063
+ }
5064
+ });
5065
+ return /* @__PURE__ */ jsx33("div", { className: "mt-1 sm:mt-0 sm:col-span-2 pt-6", children: /* @__PURE__ */ jsx33("div", { className: "w-[70%] py-12 pb-14 flex justify-center px-6 border-2 border-grey-light border-dashed rounded-md", children: /* @__PURE__ */ jsxs26("div", { ...coverImageDropzone.getRootProps(), children: [
5066
+ /* @__PURE__ */ jsx33("input", { ...coverImageDropzone.getInputProps({}) }),
5067
+ /* @__PURE__ */ jsxs26("div", { className: "w-full text-center flex-col flex items-center", children: [
5068
+ /* @__PURE__ */ jsx33("div", { className: "w-16 h-16 bg-accent-primary flex items-center justify-center rounded-full", children: /* @__PURE__ */ jsx33(
5069
+ "svg",
5070
+ {
5071
+ width: "32",
5072
+ height: "32",
5073
+ viewBox: "0 0 32 32",
5074
+ fill: "none",
5075
+ xmlns: "http://www.w3.org/2000/svg",
5076
+ className: " fill-primary",
5077
+ children: /* @__PURE__ */ jsx33("path", { d: "M19.667 8V5L25.667 11H22.667C20.5603 11 19.667 10.1067 19.667 8ZM22.667 13C19.4403 13 17.667 11.2267 17.667 8V4H10.667C8.00033 4 6.66699 5.33333 6.66699 8V24C6.66699 26.6667 8.00033 28 10.667 28H22.667C25.3337 28 26.667 26.6667 26.667 24V13H22.667Z" })
5078
+ }
5079
+ ) }),
5080
+ /* @__PURE__ */ jsxs26("div", { className: "pt-6 flex justify-center", children: [
5081
+ /* @__PURE__ */ jsx33("p", { className: "pr-1 text-lg font-normal", children: "Drop your files here or" }),
5082
+ /* @__PURE__ */ jsx33(
5083
+ "label",
5084
+ {
5085
+ htmlFor: "file-upload",
5086
+ className: "relative cursor-pointer rounded-md font-medium text-primary hover:text-primary-600 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-primary-500",
5087
+ children: /* @__PURE__ */ jsxs26("span", { className: "text-lg font-semibold", children: [
5088
+ " ",
5089
+ "browse"
5090
+ ] })
5091
+ }
5092
+ )
5093
+ ] }),
5094
+ /* @__PURE__ */ jsx33("p", { className: "text-sm font-normal text-grey pt-2", children: "PNG, JPG, GIF up to 10MB. Landscape mode, recommended size 1920x1080px." })
5095
+ ] })
5096
+ ] }) }) });
5097
+ };
5052
5098
  var FarmerClusterCreate = () => {
5053
5099
  const [openSevedPopup, setOpenSevedPopup] = useState17(false);
5054
5100
  const [selectedFileUrl, setSelectedFileUrl] = useState17(null);
@@ -5420,54 +5466,16 @@ var FarmerClusterCreate = () => {
5420
5466
  {
5421
5467
  control,
5422
5468
  name: "coverImage",
5423
- render: ({ field }) => {
5424
- const coverImageDropzone = useDropzone5({
5425
- accept: {
5426
- "image/jpeg": [".jpeg", ".png"]
5427
- },
5428
- maxFiles: 1,
5429
- multiple: false,
5430
- onDrop: (acceptedFiles) => {
5431
- let selectedFile2 = acceptedFiles[0];
5432
- setSelectedFile(selectedFile2);
5433
- let imgURL = URL.createObjectURL(selectedFile2);
5434
- setSelectedFileUrl(imgURL);
5435
- field.onChange(selectedFile2);
5469
+ render: ({ field }) => /* @__PURE__ */ jsx33(
5470
+ CoverImageDropzone,
5471
+ {
5472
+ field,
5473
+ onFileSelected: (file) => {
5474
+ setSelectedFile(file);
5475
+ setSelectedFileUrl(URL.createObjectURL(file));
5436
5476
  }
5437
- });
5438
- return /* @__PURE__ */ jsx33("div", { className: "mt-1 sm:mt-0 sm:col-span-2 pt-6", children: /* @__PURE__ */ jsx33("div", { className: "w-[70%] py-12 pb-14 flex justify-center px-6 border-2 border-grey-light border-dashed rounded-md", children: /* @__PURE__ */ jsxs26("div", { ...coverImageDropzone.getRootProps(), children: [
5439
- /* @__PURE__ */ jsx33("input", { ...coverImageDropzone.getInputProps({}) }),
5440
- /* @__PURE__ */ jsxs26("div", { className: "w-full text-center flex-col flex items-center", children: [
5441
- /* @__PURE__ */ jsx33("div", { className: "w-16 h-16 bg-accent-primary flex items-center justify-center rounded-full", children: /* @__PURE__ */ jsx33(
5442
- "svg",
5443
- {
5444
- width: "32",
5445
- height: "32",
5446
- viewBox: "0 0 32 32",
5447
- fill: "none",
5448
- xmlns: "http://www.w3.org/2000/svg",
5449
- className: " fill-primary",
5450
- children: /* @__PURE__ */ jsx33("path", { d: "M19.667 8V5L25.667 11H22.667C20.5603 11 19.667 10.1067 19.667 8ZM22.667 13C19.4403 13 17.667 11.2267 17.667 8V4H10.667C8.00033 4 6.66699 5.33333 6.66699 8V24C6.66699 26.6667 8.00033 28 10.667 28H22.667C25.3337 28 26.667 26.6667 26.667 24V13H22.667Z" })
5451
- }
5452
- ) }),
5453
- /* @__PURE__ */ jsxs26("div", { className: "pt-6 flex justify-center", children: [
5454
- /* @__PURE__ */ jsx33("p", { className: "pr-1 text-lg font-normal", children: "Drop your files here or" }),
5455
- /* @__PURE__ */ jsx33(
5456
- "label",
5457
- {
5458
- htmlFor: "file-upload",
5459
- className: "relative cursor-pointer rounded-md font-medium text-primary hover:text-primary-600 focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:ring-primary-500",
5460
- children: /* @__PURE__ */ jsxs26("span", { className: "text-lg font-semibold", children: [
5461
- " ",
5462
- "browse"
5463
- ] })
5464
- }
5465
- )
5466
- ] }),
5467
- /* @__PURE__ */ jsx33("p", { className: "text-sm font-normal text-grey pt-2", children: "PNG, JPG, GIF up to 10MB. Landscape mode, recommended size 1920x1080px." })
5468
- ] })
5469
- ] }) }) });
5470
- }
5477
+ }
5478
+ )
5471
5479
  }
5472
5480
  ),
5473
5481
  errors.coverImage && typeof errors.coverImage.message === "string" && /* @__PURE__ */ jsx33("span", { className: "text-red-500", children: errors.coverImage.message }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geowiki/recodo",
3
- "version": "0.16.9-dev.19",
3
+ "version": "0.16.9-dev.20",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [
@@ -34,11 +34,11 @@
34
34
  "uuid": "^9.0.0",
35
35
  "zod": "^3.23.8",
36
36
  "class-variance-authority": "^0.6.0",
37
- "@geowiki/api-proxy": "0.16.9-dev.19",
38
- "@geowiki/cms-proxy": "0.16.9-dev.19",
39
- "@geowiki/core": "0.16.9-dev.19",
40
- "@geowiki/map": "0.16.9-dev.19",
41
- "@geowiki/ui": "0.16.9-dev.19"
37
+ "@geowiki/api-proxy": "0.16.9-dev.20",
38
+ "@geowiki/cms-proxy": "0.16.9-dev.20",
39
+ "@geowiki/core": "0.16.9-dev.20",
40
+ "@geowiki/map": "0.16.9-dev.20",
41
+ "@geowiki/ui": "0.16.9-dev.20"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "@tanstack/react-query": "^5.22.2",