@fctc/widget-logic 4.9.1 → 4.9.3

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/hooks.js CHANGED
@@ -376,7 +376,6 @@ var useMenu = ({
376
376
  domain,
377
377
  defaultService
378
378
  }) => {
379
- const { env } = (0, provider_exports.useEnv)();
380
379
  const { useGetMenu: useGetMenu2 } = (0, provider_exports.useService)();
381
380
  const [action, callAction] = useCallAction();
382
381
  const [service, setService] = (0, import_react3.useState)("");
@@ -492,7 +491,10 @@ var useProfile = ({ service }) => {
492
491
  if (userInfoQuery.isLoading || !userInfoQuery.data) {
493
492
  return null;
494
493
  }
495
- return { ...userInfoQuery, context };
494
+ return {
495
+ ...userInfoQuery,
496
+ context
497
+ };
496
498
  };
497
499
 
498
500
  // src/hooks/core/use-user.ts
package/dist/hooks.mjs CHANGED
@@ -357,7 +357,6 @@ var useMenu = ({
357
357
  domain,
358
358
  defaultService
359
359
  }) => {
360
- const { env } = (0, provider_exports.useEnv)();
361
360
  const { useGetMenu: useGetMenu2 } = (0, provider_exports.useService)();
362
361
  const [action, callAction] = useCallAction();
363
362
  const [service, setService] = useState2("");
@@ -473,7 +472,10 @@ var useProfile = ({ service }) => {
473
472
  if (userInfoQuery.isLoading || !userInfoQuery.data) {
474
473
  return null;
475
474
  }
476
- return { ...userInfoQuery, context };
475
+ return {
476
+ ...userInfoQuery,
477
+ context
478
+ };
477
479
  };
478
480
 
479
481
  // src/hooks/core/use-user.ts
package/dist/index.js CHANGED
@@ -4448,7 +4448,6 @@ var useMenu = ({
4448
4448
  domain,
4449
4449
  defaultService
4450
4450
  }) => {
4451
- const { env } = (0, provider_exports.useEnv)();
4452
4451
  const { useGetMenu: useGetMenu2 } = (0, provider_exports.useService)();
4453
4452
  const [action, callAction] = useCallAction();
4454
4453
  const [service, setService] = (0, import_react3.useState)("");
@@ -4564,7 +4563,10 @@ var useProfile = ({ service }) => {
4564
4563
  if (userInfoQuery.isLoading || !userInfoQuery.data) {
4565
4564
  return null;
4566
4565
  }
4567
- return { ...userInfoQuery, context };
4566
+ return {
4567
+ ...userInfoQuery,
4568
+ context
4569
+ };
4568
4570
  };
4569
4571
 
4570
4572
  // src/hooks/core/use-user.ts
@@ -6249,7 +6251,11 @@ var binaryFieldController = (props) => {
6249
6251
  const [url, setUrl] = (0, import_react22.useState)(value || null);
6250
6252
  const [fileInfo, setFileInfo] = (0, import_react22.useState)(null);
6251
6253
  (0, import_react22.useEffect)(() => {
6252
- if (!value) return;
6254
+ if (!value) {
6255
+ setUrl(null);
6256
+ setFileInfo(null);
6257
+ return;
6258
+ }
6253
6259
  fetchFileMeta(value);
6254
6260
  }, [value]);
6255
6261
  const formatSize = (bytes) => {
@@ -6282,8 +6288,8 @@ var binaryFieldController = (props) => {
6282
6288
  const res = await mutateAsync({
6283
6289
  formData,
6284
6290
  service,
6285
- xNode,
6286
- path
6291
+ xNode
6292
+ // path: path,
6287
6293
  });
6288
6294
  const url2 = res?.url;
6289
6295
  methods?.setValue(name, url2, { shouldDirty: true });
package/dist/index.mjs CHANGED
@@ -4538,7 +4538,6 @@ var useMenu = ({
4538
4538
  domain,
4539
4539
  defaultService
4540
4540
  }) => {
4541
- const { env } = (0, provider_exports.useEnv)();
4542
4541
  const { useGetMenu: useGetMenu2 } = (0, provider_exports.useService)();
4543
4542
  const [action, callAction] = useCallAction();
4544
4543
  const [service, setService] = useState2("");
@@ -4654,7 +4653,10 @@ var useProfile = ({ service }) => {
4654
4653
  if (userInfoQuery.isLoading || !userInfoQuery.data) {
4655
4654
  return null;
4656
4655
  }
4657
- return { ...userInfoQuery, context };
4656
+ return {
4657
+ ...userInfoQuery,
4658
+ context
4659
+ };
4658
4660
  };
4659
4661
 
4660
4662
  // src/hooks/core/use-user.ts
@@ -6344,7 +6346,11 @@ var binaryFieldController = (props) => {
6344
6346
  const [url, setUrl] = useState12(value || null);
6345
6347
  const [fileInfo, setFileInfo] = useState12(null);
6346
6348
  useEffect13(() => {
6347
- if (!value) return;
6349
+ if (!value) {
6350
+ setUrl(null);
6351
+ setFileInfo(null);
6352
+ return;
6353
+ }
6348
6354
  fetchFileMeta(value);
6349
6355
  }, [value]);
6350
6356
  const formatSize = (bytes) => {
@@ -6377,8 +6383,8 @@ var binaryFieldController = (props) => {
6377
6383
  const res = await mutateAsync({
6378
6384
  formData,
6379
6385
  service,
6380
- xNode,
6381
- path
6386
+ xNode
6387
+ // path: path,
6382
6388
  });
6383
6389
  const url2 = res?.url;
6384
6390
  methods?.setValue(name, url2, { shouldDirty: true });
package/dist/widget.js CHANGED
@@ -5489,7 +5489,11 @@ var binaryFieldController = (props) => {
5489
5489
  const [url, setUrl] = (0, import_react22.useState)(value || null);
5490
5490
  const [fileInfo, setFileInfo] = (0, import_react22.useState)(null);
5491
5491
  (0, import_react22.useEffect)(() => {
5492
- if (!value) return;
5492
+ if (!value) {
5493
+ setUrl(null);
5494
+ setFileInfo(null);
5495
+ return;
5496
+ }
5493
5497
  fetchFileMeta(value);
5494
5498
  }, [value]);
5495
5499
  const formatSize = (bytes) => {
@@ -5522,8 +5526,8 @@ var binaryFieldController = (props) => {
5522
5526
  const res = await mutateAsync({
5523
5527
  formData,
5524
5528
  service,
5525
- xNode,
5526
- path
5529
+ xNode
5530
+ // path: path,
5527
5531
  });
5528
5532
  const url2 = res?.url;
5529
5533
  methods?.setValue(name, url2, { shouldDirty: true });
package/dist/widget.mjs CHANGED
@@ -5561,7 +5561,11 @@ var binaryFieldController = (props) => {
5561
5561
  const [url, setUrl] = useState12(value || null);
5562
5562
  const [fileInfo, setFileInfo] = useState12(null);
5563
5563
  useEffect13(() => {
5564
- if (!value) return;
5564
+ if (!value) {
5565
+ setUrl(null);
5566
+ setFileInfo(null);
5567
+ return;
5568
+ }
5565
5569
  fetchFileMeta(value);
5566
5570
  }, [value]);
5567
5571
  const formatSize = (bytes) => {
@@ -5594,8 +5598,8 @@ var binaryFieldController = (props) => {
5594
5598
  const res = await mutateAsync({
5595
5599
  formData,
5596
5600
  service,
5597
- xNode,
5598
- path
5601
+ xNode
5602
+ // path: path,
5599
5603
  });
5600
5604
  const url2 = res?.url;
5601
5605
  methods?.setValue(name, url2, { shouldDirty: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fctc/widget-logic",
3
- "version": "4.9.1",
3
+ "version": "4.9.3",
4
4
  "types": "dist/index.d.ts",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",