@resistdesign/voltra 3.0.0-alpha.33 → 3.0.0-alpha.34

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.
Files changed (40) hide show
  1. package/README.md +72 -2
  2. package/api/index.js +49 -36
  3. package/app/forms/Engine.d.ts +3 -0
  4. package/app/forms/UI.d.ts +7 -1
  5. package/app/forms/core/createAutoField.d.ts +11 -3
  6. package/app/forms/core/createFormRenderer.d.ts +3 -2
  7. package/app/forms/core/mergeSuites.d.ts +3 -2
  8. package/app/forms/core/resolveSuite.d.ts +2 -1
  9. package/app/forms/core/types.d.ts +20 -9
  10. package/app/forms/types.d.ts +34 -7
  11. package/app/index.js +21 -12
  12. package/app/utils/ApplicationState.d.ts +1 -1
  13. package/build/index.js +2 -2
  14. package/chunk-4PV5LPTT.js +1144 -0
  15. package/{chunk-FQMZMCXU.js → chunk-RUVFOXCR.js} +1 -1
  16. package/chunk-TJFTWPXQ.js +39 -0
  17. package/{chunk-LGM75I6P.js → chunk-WTD5BBJP.js} +223 -38
  18. package/common/Logging/Utils.d.ts +0 -9
  19. package/common/TypeParsing/TypeInfo.d.ts +20 -0
  20. package/common/TypeParsing/Validation.d.ts +152 -22
  21. package/common/index.js +6 -7
  22. package/iac/packs/auth.d.ts +10 -4
  23. package/iac-packs/index.d.ts +1 -0
  24. package/native/forms/UI.d.ts +8 -2
  25. package/native/forms/createNativeFormRenderer.d.ts +1 -1
  26. package/native/forms/index.d.ts +16 -0
  27. package/native/forms/suite.d.ts +1 -1
  28. package/native/index.js +71 -40
  29. package/native/testing/react-native.d.ts +33 -15
  30. package/native/utils/index.d.ts +13 -1
  31. package/package.json +1 -1
  32. package/web/forms/UI.d.ts +8 -2
  33. package/web/forms/createWebFormRenderer.d.ts +1 -1
  34. package/web/forms/suite.d.ts +1 -1
  35. package/web/index.js +234 -113
  36. package/web/utils/Route.d.ts +9 -3
  37. package/web/utils/index.d.ts +1 -0
  38. package/chunk-G5CLUK4Y.js +0 -621
  39. package/chunk-IWRHGGGH.js +0 -10
  40. package/chunk-WELZGQDJ.js +0 -456
package/app/index.js CHANGED
@@ -1,8 +1,8 @@
1
- export { createEasyLayout, getEasyLayoutTemplateDetails, getPascalCaseAreaName } from '../chunk-FQMZMCXU.js';
2
- export { Route, RouteContext, RouteContextConsumer, RouteContextProvider, RouteProvider, buildHistoryPath, buildQueryString, buildRoutePath, canUseBrowserHistory, computeTrackPixels, createBrowserRouteAdapter, createHistoryBackHandler, createManualRouteAdapter, createMemoryHistory, createNativeRouteAdapter, createRouteAdapterFromHistory, createUniversalAdapter, parseHistoryPath, useRouteContext } from '../chunk-G5CLUK4Y.js';
3
- export { AutoForm, AutoFormView, computeAreaBounds, createAutoField, createFormRenderer, getFieldKind, parseTemplate, resolveSuite, useFormEngine, validateAreas } from '../chunk-WELZGQDJ.js';
1
+ export { createEasyLayout, getEasyLayoutTemplateDetails, getPascalCaseAreaName } from '../chunk-RUVFOXCR.js';
2
+ export { computeTrackPixels } from '../chunk-TJFTWPXQ.js';
3
+ export { AutoForm, AutoFormView, Route, RouteContext, RouteContextConsumer, RouteContextProvider, RouteProvider, buildHistoryPath, buildQueryString, buildRoutePath, canUseBrowserHistory, computeAreaBounds, createAutoField, createBrowserRouteAdapter, createFormRenderer, createHistoryBackHandler, createManualRouteAdapter, createMemoryHistory, createNativeRouteAdapter, createRouteAdapterFromHistory, createUniversalAdapter, getFieldKind, parseHistoryPath, parseTemplate, resolveSuite, useFormEngine, useRouteContext, validateAreas } from '../chunk-4PV5LPTT.js';
4
4
  import '../chunk-7AMEFPPP.js';
5
- import '../chunk-IWRHGGGH.js';
5
+ import '../chunk-WTD5BBJP.js';
6
6
  import { mergeStringPaths, PATH_DELIMITER } from '../chunk-GYWRAW3Y.js';
7
7
  import '../chunk-I2KLQ2HA.js';
8
8
  import { createContext, useContext, useRef, useMemo, useCallback, useState, useEffect } from 'react';
@@ -38,6 +38,8 @@ var useApplicationStateValue = (identifier) => {
38
38
  } = useContext(ApplicationStateContext);
39
39
  const appStateRef = useRef(applicationState);
40
40
  appStateRef.current = applicationState;
41
+ const modificationStateRef = useRef(modificationState);
42
+ modificationStateRef.current = modificationState;
41
43
  const modified = useMemo(
42
44
  () => getApplicationStateModified(identifier, modificationState),
43
45
  [identifier, modificationState]
@@ -49,7 +51,11 @@ var useApplicationStateValue = (identifier) => {
49
51
  const setModified = useCallback(
50
52
  (isModified) => {
51
53
  setModificationState(
52
- setApplicationStateModified(identifier, isModified, modificationState)
54
+ setApplicationStateModified(
55
+ identifier,
56
+ isModified,
57
+ modificationStateRef.current
58
+ )
53
59
  );
54
60
  },
55
61
  [identifier, setModificationState]
@@ -130,6 +136,8 @@ var ApplicationStateProvider = ({
130
136
 
131
137
  // src/app/utils/Service.ts
132
138
  var getFullUrl = (protocol, domain, basePath = "", path = "", port) => {
139
+ const normalizedProtocol = protocol.endsWith(":") ? protocol.slice(0, -1) : protocol;
140
+ const normalizedDomain = domain.replace(/\/+$/, "");
133
141
  const portString = !!port ? `:${port}` : "";
134
142
  const fullPath = mergeStringPaths(
135
143
  basePath,
@@ -139,7 +147,8 @@ var getFullUrl = (protocol, domain, basePath = "", path = "", port) => {
139
147
  false,
140
148
  false
141
149
  );
142
- return `${protocol}://${domain}${portString}${fullPath}`;
150
+ const normalizedPath = fullPath ? fullPath.startsWith(PATH_DELIMITER) ? fullPath : `${PATH_DELIMITER}${fullPath}` : "";
151
+ return `${normalizedProtocol}://${normalizedDomain}${portString}${normalizedPath}`;
143
152
  };
144
153
  var sendServiceRequest = async (config, path = "", args = []) => {
145
154
  const { protocol, domain, port, basePath = "", authorization = "" } = config;
@@ -229,7 +238,7 @@ var useApplicationStateLoader = (config) => {
229
238
  var getKeyValueWithoutError = (obj, key) => {
230
239
  try {
231
240
  return obj[key];
232
- } catch (e) {
241
+ } catch (_error) {
233
242
  return void 0;
234
243
  }
235
244
  };
@@ -240,7 +249,8 @@ var useController = (parentValue, key, onParentValueChange, isArrayIndex = false
240
249
  try {
241
250
  setValue(value2);
242
251
  if (isArrayIndex) {
243
- const newArray = [...parentValue];
252
+ const baseArray = Array.isArray(parentValue) ? parentValue : [];
253
+ const newArray = [...baseArray];
244
254
  newArray[key] = value2;
245
255
  onParentValueChange(newArray);
246
256
  } else {
@@ -249,7 +259,7 @@ var useController = (parentValue, key, onParentValueChange, isArrayIndex = false
249
259
  [key]: value2
250
260
  });
251
261
  }
252
- } catch (e) {
262
+ } catch (_error) {
253
263
  }
254
264
  },
255
265
  [parentValue, key, onParentValueChange, isArrayIndex]
@@ -257,7 +267,7 @@ var useController = (parentValue, key, onParentValueChange, isArrayIndex = false
257
267
  useEffect(() => {
258
268
  try {
259
269
  setValue(getKeyValueWithoutError(parentValue, key));
260
- } catch (e) {
270
+ } catch (_error) {
261
271
  setValue(void 0);
262
272
  }
263
273
  }, [parentValue, key]);
@@ -378,8 +388,7 @@ var useTypeInfoORMAPI = (typeInfoORMAPI) => {
378
388
  );
379
389
  const api = useMemo(() => {
380
390
  const apiBase = {};
381
- for (const aM in typeInfoORMAPI) {
382
- const methodName = aM;
391
+ for (const methodName of Object.keys(typeInfoORMAPI)) {
383
392
  apiBase[methodName] = requestHandlerFactory(
384
393
  typeInfoORMAPI,
385
394
  methodName,
@@ -60,7 +60,7 @@ export declare const getApplicationStateValue: (identifier: ApplicationStateIden
60
60
  * @param modificationState - The current modification map.
61
61
  * @returns A new modification map with the updated flag.
62
62
  * */
63
- export declare const setApplicationStateModified: (identifier: ApplicationStateIdentifier, value: boolean, modificationState: ApplicationState) => ApplicationStateModificationState;
63
+ export declare const setApplicationStateModified: (identifier: ApplicationStateIdentifier, value: boolean, modificationState: ApplicationStateModificationState) => ApplicationStateModificationState;
64
64
  /**
65
65
  * Set the stored value for an identifier.
66
66
  *
package/build/index.js CHANGED
@@ -394,7 +394,7 @@ var getTypeInfoFromPickOmitFieldFilters = (typeNameStr, typeRef, typeMap) => {
394
394
  (fieldSet) => fieldSet.filter(
395
395
  (field) => picking ? omitFieldNames.includes(field) : !omitFieldNames.includes(field)
396
396
  )
397
- ) : void 0;
397
+ ).filter((fieldSet) => fieldSet.length > 0) : void 0;
398
398
  typeInfo = {
399
399
  ...typeInfoOther,
400
400
  fields: cleanTypeInfoFields,
@@ -438,7 +438,7 @@ var getTypeInfoFromExcludeFieldFilter = (_typeNameStr, typeRef, typeMap) => {
438
438
  );
439
439
  const cleanUnionFieldSets = existingUnionFieldSets ? existingUnionFieldSets.map(
440
440
  (fieldSet) => fieldSet.filter((field) => !excludeFieldNames.includes(field))
441
- ) : void 0;
441
+ ).filter((fieldSet) => fieldSet.length > 0) : void 0;
442
442
  typeInfo = {
443
443
  ...baseTypeInfo,
444
444
  fields: cleanTypeInfoFields,