@carlonicora/nextjs-jsonapi 1.123.1 → 1.124.0
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/{BlockNoteEditor-4UBKHQHZ.mjs → BlockNoteEditor-JSY65RSG.mjs} +2 -2
- package/dist/{BlockNoteEditor-JWE5R6TH.js → BlockNoteEditor-PFA6IAEL.js} +9 -9
- package/dist/{BlockNoteEditor-JWE5R6TH.js.map → BlockNoteEditor-PFA6IAEL.js.map} +1 -1
- package/dist/billing/index.js +299 -299
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-NHTN4LWQ.js → chunk-LJLXNH2Z.js} +851 -596
- package/dist/chunk-LJLXNH2Z.js.map +1 -0
- package/dist/{chunk-WDWU5VJ5.mjs → chunk-RSIVJ3VJ.mjs} +3136 -2881
- package/dist/chunk-RSIVJ3VJ.mjs.map +1 -0
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/components/index.d.mts +179 -123
- package/dist/components/index.d.ts +179 -123
- package/dist/components/index.js +12 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +11 -1
- package/dist/contexts/index.js +2 -2
- package/dist/contexts/index.mjs +1 -1
- package/dist/features/help/index.js +30 -30
- package/dist/features/help/index.mjs +1 -1
- package/package.json +1 -1
- package/src/components/forms/EntityMultiSelector.tsx +15 -3
- package/src/components/forms/EntitySelector.tsx +256 -0
- package/src/components/forms/FormLayout.tsx +58 -0
- package/src/components/forms/index.ts +10 -8
- package/src/components/forms/useEditorDialog.ts +21 -4
- package/src/components/tables/ContentTableSearch.tsx +2 -0
- package/dist/chunk-NHTN4LWQ.js.map +0 -1
- package/dist/chunk-WDWU5VJ5.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-4UBKHQHZ.mjs.map → BlockNoteEditor-JSY65RSG.mjs.map} +0 -0
|
@@ -1,22 +1,24 @@
|
|
|
1
|
+
export { FormFeatures } from "../../features/feature/components/forms/FormFeatures";
|
|
1
2
|
export * from "./CommonAssociationForm";
|
|
2
|
-
export * from "./EntityMultiSelector";
|
|
3
3
|
export * from "./CommonDeleter";
|
|
4
4
|
export * from "./CommonEditorButtons";
|
|
5
|
-
export * from "./CommonEditorHeader";
|
|
6
5
|
export * from "./CommonEditorDiscardDialog";
|
|
6
|
+
export * from "./CommonEditorHeader";
|
|
7
7
|
export * from "./CommonEditorTrigger";
|
|
8
|
-
export * from "./
|
|
9
|
-
export * from "./EditorSheet";
|
|
8
|
+
export * from "./CurrencyInput";
|
|
10
9
|
export * from "./DatePickerPopover";
|
|
11
10
|
export * from "./DateRangeSelector";
|
|
11
|
+
export * from "./EditorSheet";
|
|
12
|
+
export * from "./EntityMultiSelector";
|
|
13
|
+
export { default as EntitySelector } from "./EntitySelector";
|
|
12
14
|
export * from "./FileUploader";
|
|
13
|
-
export * from "./CurrencyInput";
|
|
14
|
-
export * from "./FormCheckbox";
|
|
15
15
|
export * from "./FormBlockNote";
|
|
16
|
-
export * from "./
|
|
16
|
+
export * from "./FormCheckbox";
|
|
17
17
|
export * from "./FormDate";
|
|
18
18
|
export * from "./FormDateTime";
|
|
19
|
+
export * from "./FormFieldWrapper";
|
|
19
20
|
export * from "./FormInput";
|
|
21
|
+
export * from "./FormLayout";
|
|
20
22
|
export * from "./FormPassword";
|
|
21
23
|
export * from "./FormPlaceAutocomplete";
|
|
22
24
|
export * from "./FormSelect";
|
|
@@ -26,4 +28,4 @@ export * from "./FormTextarea";
|
|
|
26
28
|
export * from "./GdprConsentCheckbox";
|
|
27
29
|
export * from "./MultiFileUploader";
|
|
28
30
|
export * from "./PasswordInput";
|
|
29
|
-
export
|
|
31
|
+
export * from "./useEditorDialog";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
|
-
import { useCallback, useEffect, useState } from "react";
|
|
3
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
4
|
|
|
5
5
|
type UseEditorDialogOptions = {
|
|
6
6
|
dialogOpen?: boolean;
|
|
@@ -24,15 +24,32 @@ export function useEditorDialog(isFormDirty: () => boolean, options?: UseEditorD
|
|
|
24
24
|
const [open, setOpen] = useState<boolean>(false);
|
|
25
25
|
const [showDiscardConfirm, setShowDiscardConfirm] = useState<boolean>(false);
|
|
26
26
|
|
|
27
|
-
//
|
|
27
|
+
// Marks that the pending `open` change originated FROM the dialogOpen prop
|
|
28
|
+
// (the sync effect below), so the notify effect must not echo it back to the
|
|
29
|
+
// parent. Without this guard the two effects form an unguarded two-way
|
|
30
|
+
// binding: on mount `open` (false) and `dialogOpen` (true) disagree, so one
|
|
31
|
+
// effect pushes open→parent while the other pulls parent→open, and they chase
|
|
32
|
+
// each other every render → "Maximum update depth exceeded".
|
|
33
|
+
const syncingFromProp = useRef(false);
|
|
34
|
+
|
|
35
|
+
// Sync open state from external dialogOpen prop.
|
|
36
|
+
// `open` is intentionally NOT a dependency: this effect must run only when the
|
|
37
|
+
// prop changes. Adding `open` would re-fire on internal closes and immediately
|
|
38
|
+
// re-open the dialog (dialogOpen still true while open just went false).
|
|
28
39
|
useEffect(() => {
|
|
29
|
-
if (options?.dialogOpen !== undefined) {
|
|
40
|
+
if (options?.dialogOpen !== undefined && options.dialogOpen !== open) {
|
|
41
|
+
syncingFromProp.current = true;
|
|
30
42
|
setOpen(options.dialogOpen);
|
|
31
43
|
}
|
|
32
44
|
}, [options?.dialogOpen]);
|
|
33
45
|
|
|
34
|
-
// Notify parent when open state changes
|
|
46
|
+
// Notify parent when open state changes — but skip the echo when this change
|
|
47
|
+
// was driven by the dialogOpen prop above (otherwise it ping-pongs).
|
|
35
48
|
useEffect(() => {
|
|
49
|
+
if (syncingFromProp.current) {
|
|
50
|
+
syncingFromProp.current = false;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
36
53
|
if (typeof options?.onDialogOpenChange === "function") {
|
|
37
54
|
options.onDialogOpenChange(open);
|
|
38
55
|
}
|
|
@@ -69,6 +69,7 @@ export function ContentTableSearch({ data }: ContentTableSearchProps) {
|
|
|
69
69
|
}`}
|
|
70
70
|
>
|
|
71
71
|
<Search
|
|
72
|
+
data-testid="content-table-search-trigger"
|
|
72
73
|
className={`absolute top-1 left-1 h-4 w-4 transition-colors ${
|
|
73
74
|
isExpanded ? "text-muted-foreground" : "text-muted-foreground hover:text-foreground cursor-pointer"
|
|
74
75
|
}`}
|
|
@@ -76,6 +77,7 @@ export function ContentTableSearch({ data }: ContentTableSearchProps) {
|
|
|
76
77
|
/>
|
|
77
78
|
{isExpanded && (
|
|
78
79
|
<Input
|
|
80
|
+
data-testid="content-table-search-input"
|
|
79
81
|
ref={inputRef}
|
|
80
82
|
onKeyDown={(e) => {
|
|
81
83
|
if (e.key === "Escape") {
|