@inseefr/lunatic 3.0.0-rc.13 → 3.0.0-rc.15

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 (82) hide show
  1. package/lib/main.css +0 -2
  2. package/lib/main.css.map +1 -1
  3. package/lib/package.json +3 -3
  4. package/lib/src/components/Loop/Loop.d.ts +1 -1
  5. package/lib/src/components/LunaticComponents.d.ts +5 -4
  6. package/lib/src/components/LunaticComponents.js.map +1 -1
  7. package/lib/src/components/PairwiseLinks/PairwiseLinks.js +31 -5
  8. package/lib/src/components/PairwiseLinks/PairwiseLinks.js.map +1 -1
  9. package/lib/src/components/Radio/Radio.d.ts +1 -0
  10. package/lib/src/components/RosterForLoop/RosterForLoop.spec.js.map +1 -1
  11. package/lib/src/components/Sequence/Sequence.d.ts +3 -1
  12. package/lib/src/components/Subsequence/Subsequence.d.ts +3 -1
  13. package/lib/src/components/Suggester/CustomSuggester.d.ts +9 -8
  14. package/lib/src/components/Suggester/CustomSuggester.js +4 -31
  15. package/lib/src/components/Suggester/CustomSuggester.js.map +1 -1
  16. package/lib/src/components/Suggester/Suggester.d.ts +1 -1
  17. package/lib/src/components/Suggester/Suggester.js +57 -35
  18. package/lib/src/components/Suggester/Suggester.js.map +1 -1
  19. package/lib/src/components/Suggester/SuggesterNotification.d.ts +5 -6
  20. package/lib/src/components/Suggester/SuggesterNotification.js +5 -10
  21. package/lib/src/components/Suggester/SuggesterNotification.js.map +1 -1
  22. package/lib/src/components/Suggester/useSuggestions.d.ts +20 -0
  23. package/lib/src/components/Suggester/useSuggestions.js +86 -0
  24. package/lib/src/components/Suggester/useSuggestions.js.map +1 -0
  25. package/lib/src/components/Switch/Switch.d.ts +1 -0
  26. package/lib/src/components/library.d.ts +15 -5
  27. package/lib/src/components/shared/Combobox/Combobox.d.ts +2 -0
  28. package/lib/src/components/shared/Combobox/Combobox.js +5 -6
  29. package/lib/src/components/shared/Combobox/Combobox.js.map +1 -1
  30. package/lib/src/components/shared/Combobox/ComboboxType.d.ts +1 -0
  31. package/lib/src/components/shared/Combobox/Panel/ComboboxOption.js +4 -0
  32. package/lib/src/components/shared/Combobox/Panel/ComboboxOption.js.map +1 -1
  33. package/lib/src/components/shared/Combobox/Panel/ComboboxPanel.d.ts +1 -1
  34. package/lib/src/components/shared/Combobox/Panel/ComboboxPanel.js +15 -1
  35. package/lib/src/components/shared/Combobox/Panel/ComboboxPanel.js.map +1 -1
  36. package/lib/src/components/shared/Combobox/Selection/ComboboxLabelSelection.js +6 -0
  37. package/lib/src/components/shared/Combobox/Selection/ComboboxLabelSelection.js.map +1 -1
  38. package/lib/src/components/type.d.ts +41 -11
  39. package/lib/src/components/type.js.map +1 -1
  40. package/lib/src/hooks/use-track-changes.js +1 -1
  41. package/lib/src/hooks/use-track-changes.js.map +1 -1
  42. package/lib/src/hooks/useDebounce.d.ts +4 -0
  43. package/lib/src/hooks/useDebounce.js +23 -0
  44. package/lib/src/hooks/useDebounce.js.map +1 -0
  45. package/lib/src/hooks/useDocumentEvent.js +1 -1
  46. package/lib/src/hooks/useDocumentEvent.js.map +1 -1
  47. package/lib/src/hooks/{use-ref-sync.js → useRefSync.js} +1 -1
  48. package/lib/src/hooks/useRefSync.js.map +1 -0
  49. package/lib/src/hooks/useSuggesterInfo.d.ts +1 -1
  50. package/lib/src/i18n/dictionary.d.ts +16 -0
  51. package/lib/src/i18n/dictionary.js +16 -0
  52. package/lib/src/i18n/dictionary.js.map +1 -1
  53. package/lib/src/i18n/index.d.ts +1 -1
  54. package/lib/src/use-lunatic/commons/fill-components/fill-component-expressions.js +3 -0
  55. package/lib/src/use-lunatic/commons/fill-components/fill-component-expressions.js.map +1 -1
  56. package/lib/src/use-lunatic/commons/fill-components/fill-component-required.d.ts +71 -66
  57. package/lib/src/use-lunatic/commons/fill-components/fill-from-state.d.ts +68 -63
  58. package/lib/src/use-lunatic/commons/fill-components/fill-iterations.d.ts +16 -16
  59. package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.d.ts +70 -60
  60. package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.js +16 -0
  61. package/lib/src/use-lunatic/commons/fill-components/fill-specific-expression.js.map +1 -1
  62. package/lib/src/use-lunatic/commons/use-components-from-state.d.ts +2 -1
  63. package/lib/src/use-lunatic/commons/use-components-from-state.js.map +1 -1
  64. package/lib/src/use-lunatic/hooks/use-page-has-response.d.ts +2 -2
  65. package/lib/src/use-lunatic/hooks/use-page-has-response.js +6 -3
  66. package/lib/src/use-lunatic/hooks/use-page-has-response.js.map +1 -1
  67. package/lib/src/use-lunatic/replace-component-sequence.d.ts +3 -3
  68. package/lib/src/use-lunatic/type-source.d.ts +7 -2
  69. package/lib/src/use-lunatic/use-lunatic.d.ts +4 -486
  70. package/lib/src/use-lunatic/use-lunatic.js +2 -2
  71. package/lib/src/use-lunatic/use-lunatic.js.map +1 -1
  72. package/lib/src/use-lunatic/use-lunatic.test.js +2 -2
  73. package/lib/src/use-lunatic/use-lunatic.test.js.map +1 -1
  74. package/lib/src/utils/function.d.ts +1 -0
  75. package/lib/src/utils/function.js +18 -0
  76. package/lib/src/utils/function.js.map +1 -1
  77. package/package.json +3 -3
  78. package/lib/src/components/Suggester/SuggesterStatus.d.ts +0 -23
  79. package/lib/src/components/Suggester/SuggesterStatus.js +0 -24
  80. package/lib/src/components/Suggester/SuggesterStatus.js.map +0 -1
  81. package/lib/src/hooks/use-ref-sync.js.map +0 -1
  82. /package/lib/src/hooks/{use-ref-sync.d.ts → useRefSync.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inseefr/lunatic",
3
- "version": "3.0.0-rc.13",
3
+ "version": "3.0.0-rc.15",
4
4
  "workersVersion": "0.3.0",
5
5
  "description": "Library of questionnaire components",
6
6
  "repository": {
@@ -46,7 +46,7 @@
46
46
  "test:e2e:codegen": "playwright codegen http://localhost:9999/iframe.html?viewMode=story&id=",
47
47
  "test:storybook": "test-storybook --url http://localhost:9999 --maxWorkers=4 --no-cache",
48
48
  "test-watch": "vitest",
49
- "check": "tsc",
49
+ "check": "tsc --noEmit",
50
50
  "lint": "eslint ./src",
51
51
  "lint:check": "eslint . --ext .ts,.tsx",
52
52
  "_format": "prettier **/*.{ts,tsx,json}",
@@ -56,7 +56,7 @@
56
56
  "build-workers": "node ./scripts/build/build-workers.js",
57
57
  "prepare-workers": "npm run build-workers && node ./scripts/build/add-workers-to-public.js",
58
58
  "postinstall": "node ./scripts/build/add-workers-to-public.js",
59
- "build": "tsc --project tsconfig.prod.json && sass ./src/css/main.scss ./lib/main.css && cp -R ./src/css/icons ./lib/icons && npm run build-workers",
59
+ "build": "tsc && sass ./src/css/main.scss ./lib/main.css && cp -R ./src/css/icons ./lib/icons && npm run build-workers",
60
60
  "storybook": "npm run prepare-workers && storybook dev -p 9999 --no-open",
61
61
  "build-storybook": "npm run prepare-workers && storybook build"
62
62
  },
@@ -1,23 +0,0 @@
1
- import { type PropsWithChildren, type ReactNode } from 'react';
2
- import { SuggesterStatus as SuggesterStatusEnum } from '../../use-lunatic/use-suggesters';
3
- export declare const STATUS: {
4
- unused: number;
5
- idle: number;
6
- pending: number;
7
- success: number;
8
- unknown: number;
9
- error: number;
10
- };
11
- type Props = PropsWithChildren<{
12
- getSuggesterStatus: (s: string) => {
13
- status: SuggesterStatusEnum;
14
- };
15
- storeName: string;
16
- label?: ReactNode;
17
- description?: ReactNode;
18
- }>;
19
- /**
20
- * Check the status of suggester status and shows a warning / error
21
- */
22
- export declare function SuggesterStatus({ children, storeName, getSuggesterStatus, label, description, }: Props): import("react/jsx-runtime").JSX.Element;
23
- export {};
@@ -1,24 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import {} from 'react';
3
- import { SuggesterStatus as SuggesterStatusEnum } from '../../use-lunatic/use-suggesters';
4
- import { Label } from '../shared/Label/Label';
5
- import { SuggesterNotification } from './SuggesterNotification';
6
- export const STATUS = {
7
- unused: 0,
8
- idle: 1,
9
- pending: 2,
10
- success: 3,
11
- unknown: 4,
12
- error: 5,
13
- };
14
- /**
15
- * Check the status of suggester status and shows a warning / error
16
- */
17
- export function SuggesterStatus({ children, storeName, getSuggesterStatus, label, description, }) {
18
- const { status } = getSuggesterStatus(storeName);
19
- if (status === SuggesterStatusEnum.unused) {
20
- return (_jsxs(_Fragment, { children: [_jsx(Label, { description: description, children: label }), children] }));
21
- }
22
- return (_jsx(SuggesterNotification, { status: status, storeName: storeName, label: label, description: description, children: children }));
23
- }
24
- //# sourceMappingURL=SuggesterStatus.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SuggesterStatus.js","sourceRoot":"","sources":["../../../../src/components/Suggester/SuggesterStatus.tsx"],"names":[],"mappings":";AAAA,OAAO,EAA0C,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC1F,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,CAAC,MAAM,MAAM,GAAG;IACrB,MAAM,EAAE,CAAC;IACT,IAAI,EAAE,CAAC;IACP,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,CAAC;CACR,CAAC;AASF;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,EAC/B,QAAQ,EACR,SAAS,EACT,kBAAkB,EAClB,KAAK,EACL,WAAW,GACJ;IACP,MAAM,EAAE,MAAM,EAAE,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAEjD,IAAI,MAAM,KAAK,mBAAmB,CAAC,MAAM,EAAE,CAAC;QAC3C,OAAO,CACN,8BACC,KAAC,KAAK,IAAC,WAAW,EAAE,WAAW,YAAG,KAAK,GAAS,EAC/C,QAAQ,IACP,CACH,CAAC;IACH,CAAC;IACD,OAAO,CACN,KAAC,qBAAqB,IACrB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,YAEvB,QAAQ,GACc,CACxB,CAAC;AACH,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-ref-sync.js","sourceRoot":"","sources":["../../../src/hooks/use-ref-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE/B;;GAEG;AACH,MAAM,UAAU,UAAU,CAAI,KAAQ;IACrC,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1B,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC;IACpB,OAAO,GAAG,CAAC;AACZ,CAAC"}