@measured/puck 0.16.3-canary.af421c6 → 0.17.0-canary.229cbdd
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.css +52 -50
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +66 -34
- package/dist/index.mjs +73 -35
- package/dist/{resolve-all-data-BoWgijLi.d.mts → resolve-all-data-Bd3DnhYE.d.mts} +4 -1
- package/dist/{resolve-all-data-BoWgijLi.d.ts → resolve-all-data-Bd3DnhYE.d.ts} +4 -1
- package/dist/rsc.d.mts +2 -2
- package/dist/rsc.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.css
CHANGED
@@ -607,10 +607,10 @@ textarea._Input-input_3pq3z_47 {
|
|
607
607
|
}
|
608
608
|
|
609
609
|
/* css-module:/home/runner/work/puck/puck/packages/core/components/ExternalInput/styles.module.css/#css-module-data */
|
610
|
-
._ExternalInput-
|
610
|
+
._ExternalInput-actions_8wgzm_1 {
|
611
611
|
display: flex;
|
612
612
|
}
|
613
|
-
._ExternalInput-
|
613
|
+
._ExternalInput-button_8wgzm_5 {
|
614
614
|
display: flex;
|
615
615
|
gap: 8px;
|
616
616
|
align-items: center;
|
@@ -628,16 +628,16 @@ textarea._Input-input_3pq3z_47 {
|
|
628
628
|
overflow: hidden;
|
629
629
|
flex-grow: 1;
|
630
630
|
}
|
631
|
-
._ExternalInput--
|
631
|
+
._ExternalInput--dataSelected_8wgzm_24 ._ExternalInput-button_8wgzm_5 {
|
632
632
|
color: var(--puck-color-grey-03);
|
633
633
|
display: block;
|
634
634
|
border-top-right-radius: 0px;
|
635
635
|
border-bottom-right-radius: 0px;
|
636
636
|
}
|
637
|
-
._ExternalInput--
|
637
|
+
._ExternalInput--readOnly_8wgzm_31 ._ExternalInput-button_8wgzm_5 {
|
638
638
|
background-color: var(--puck-color-grey-11);
|
639
639
|
}
|
640
|
-
._ExternalInput-
|
640
|
+
._ExternalInput-detachButton_8wgzm_35 {
|
641
641
|
border: 1px solid var(--puck-color-grey-09);
|
642
642
|
border-top-right-radius: 4px;
|
643
643
|
border-bottom-right-radius: 4px;
|
@@ -652,28 +652,28 @@ textarea._Input-input_3pq3z_47 {
|
|
652
652
|
transition: background-color 50ms ease-in, color 50ms ease-in;
|
653
653
|
margin-left: -1px;
|
654
654
|
}
|
655
|
-
._ExternalInput-
|
656
|
-
._ExternalInput-
|
655
|
+
._ExternalInput-button_8wgzm_5:focus-visible,
|
656
|
+
._ExternalInput-detachButton_8wgzm_35:focus-visible {
|
657
657
|
outline: 2px solid var(--puck-color-azure-05);
|
658
658
|
outline-offset: 2px;
|
659
659
|
z-index: 1;
|
660
660
|
}
|
661
661
|
@media (hover: hover) and (pointer: fine) {
|
662
|
-
.
|
663
|
-
.
|
662
|
+
._ExternalInput_8wgzm_1:not(._ExternalInput--readOnly_8wgzm_31) ._ExternalInput-button_8wgzm_5:hover,
|
663
|
+
._ExternalInput_8wgzm_1:not(._ExternalInput--readOnly_8wgzm_31) ._ExternalInput-detachButton_8wgzm_35:hover {
|
664
664
|
background: var(--puck-color-azure-12);
|
665
665
|
transition: none;
|
666
666
|
}
|
667
|
-
.
|
667
|
+
._ExternalInput_8wgzm_1:not(._ExternalInput--readOnly_8wgzm_31) ._ExternalInput-detachButton_8wgzm_35:hover {
|
668
668
|
color: var(--puck-color-azure-04);
|
669
669
|
}
|
670
670
|
}
|
671
|
-
.
|
672
|
-
.
|
671
|
+
._ExternalInput_8wgzm_1:not(._ExternalInput--readOnly_8wgzm_31) ._ExternalInput-button_8wgzm_5:active,
|
672
|
+
._ExternalInput_8wgzm_1:not(._ExternalInput--readOnly_8wgzm_31) ._ExternalInput-detachButton_8wgzm_35:active {
|
673
673
|
background: var(--puck-color-azure-11);
|
674
674
|
transition: none;
|
675
675
|
}
|
676
|
-
.
|
676
|
+
._ExternalInputModal_8wgzm_79 {
|
677
677
|
color: var(--puck-color-black);
|
678
678
|
display: grid;
|
679
679
|
grid-template-rows: min-content minmax(128px, 100%) min-content;
|
@@ -682,35 +682,35 @@ textarea._Input-input_3pq3z_47 {
|
|
682
682
|
min-height: 50dvh;
|
683
683
|
max-height: 90dvh;
|
684
684
|
}
|
685
|
-
._ExternalInputModal-
|
685
|
+
._ExternalInputModal-grid_8wgzm_89 {
|
686
686
|
display: flex;
|
687
687
|
flex-direction: column;
|
688
688
|
}
|
689
689
|
@media (min-width: 458px) {
|
690
|
-
._ExternalInputModal-
|
690
|
+
._ExternalInputModal-grid_8wgzm_89 {
|
691
691
|
display: grid;
|
692
692
|
grid-template-columns: 100%;
|
693
693
|
}
|
694
|
-
._ExternalInputModal--
|
694
|
+
._ExternalInputModal--filtersToggled_8wgzm_100 ._ExternalInputModal-grid_8wgzm_89 {
|
695
695
|
grid-template-columns: 25% 75%;
|
696
696
|
}
|
697
697
|
}
|
698
|
-
._ExternalInputModal-
|
698
|
+
._ExternalInputModal-filters_8wgzm_105 {
|
699
699
|
border-bottom: 1px solid var(--puck-color-grey-09);
|
700
700
|
}
|
701
|
-
._ExternalInputModal--
|
701
|
+
._ExternalInputModal--filtersToggled_8wgzm_100 ._ExternalInputModal-filters_8wgzm_105 {
|
702
702
|
display: none;
|
703
703
|
}
|
704
704
|
@media (min-width: 458px) {
|
705
|
-
._ExternalInputModal-
|
705
|
+
._ExternalInputModal-filters_8wgzm_105 {
|
706
706
|
border-right: 1px solid var(--puck-color-grey-09);
|
707
707
|
display: none;
|
708
708
|
}
|
709
|
-
._ExternalInputModal--
|
709
|
+
._ExternalInputModal--filtersToggled_8wgzm_100 ._ExternalInputModal-filters_8wgzm_105 {
|
710
710
|
display: block;
|
711
711
|
}
|
712
712
|
}
|
713
|
-
._ExternalInputModal-
|
713
|
+
._ExternalInputModal-masthead_8wgzm_124 {
|
714
714
|
background-color: var(--puck-color-grey-12);
|
715
715
|
border-bottom: 1px solid var(--puck-color-grey-09);
|
716
716
|
display: flex;
|
@@ -718,13 +718,13 @@ textarea._Input-input_3pq3z_47 {
|
|
718
718
|
gap: 24px;
|
719
719
|
padding: 24px;
|
720
720
|
}
|
721
|
-
._ExternalInputModal-
|
721
|
+
._ExternalInputModal-tableWrapper_8wgzm_133 {
|
722
722
|
position: relative;
|
723
723
|
overflow-x: auto;
|
724
724
|
overflow-y: auto;
|
725
725
|
flex-grow: 1;
|
726
726
|
}
|
727
|
-
._ExternalInputModal-
|
727
|
+
._ExternalInputModal-table_8wgzm_133 {
|
728
728
|
border-collapse: unset;
|
729
729
|
border-spacing: 0px;
|
730
730
|
color: var(--puck-color-grey-02);
|
@@ -732,51 +732,51 @@ textarea._Input-input_3pq3z_47 {
|
|
732
732
|
z-index: 0;
|
733
733
|
min-width: 100%;
|
734
734
|
}
|
735
|
-
._ExternalInputModal-
|
735
|
+
._ExternalInputModal-thead_8wgzm_149 {
|
736
736
|
background-color: var(--puck-color-white);
|
737
737
|
position: sticky;
|
738
738
|
top: 0;
|
739
739
|
z-index: 1;
|
740
740
|
}
|
741
|
-
._ExternalInputModal-
|
741
|
+
._ExternalInputModal-th_8wgzm_149 {
|
742
742
|
border-bottom: 1px solid var(--puck-color-grey-09);
|
743
743
|
color: var(--puck-color-grey-04);
|
744
744
|
font-weight: 500;
|
745
745
|
font-size: 14px;
|
746
746
|
padding: 16px 24px;
|
747
747
|
}
|
748
|
-
._ExternalInputModal-
|
748
|
+
._ExternalInputModal-td_8wgzm_164 {
|
749
749
|
border-bottom: 1px solid var(--puck-color-grey-10);
|
750
750
|
padding: 16px 24px;
|
751
751
|
}
|
752
|
-
._ExternalInputModal-
|
752
|
+
._ExternalInputModal-tr_8wgzm_169 ._ExternalInputModal-td_8wgzm_164:first-of-type {
|
753
753
|
font-weight: 500;
|
754
754
|
width: 1%;
|
755
755
|
white-space: nowrap;
|
756
756
|
}
|
757
757
|
@media (hover: hover) and (pointer: fine) {
|
758
|
-
._ExternalInputModal-
|
758
|
+
._ExternalInputModal-tbody_8wgzm_176 ._ExternalInputModal-tr_8wgzm_169:hover {
|
759
759
|
background: var(--puck-color-azure-12);
|
760
760
|
color: var(--puck-color-azure-04);
|
761
761
|
cursor: pointer;
|
762
762
|
position: relative;
|
763
763
|
margin-left: -5px;
|
764
764
|
}
|
765
|
-
._ExternalInputModal-
|
765
|
+
._ExternalInputModal-tbody_8wgzm_176 ._ExternalInputModal-tr_8wgzm_169:hover ._ExternalInputModal-td_8wgzm_164:first-of-type {
|
766
766
|
border-left: 4px solid var(--puck-color-azure-04);
|
767
767
|
padding-left: 20px;
|
768
768
|
}
|
769
769
|
}
|
770
|
-
._ExternalInputModal-
|
770
|
+
._ExternalInputModal-tbody_8wgzm_176 ._ExternalInputModal-tr_8wgzm_169:last-of-type ._ExternalInputModal-td_8wgzm_164 {
|
771
771
|
border-bottom: none;
|
772
772
|
}
|
773
|
-
._ExternalInputModal-
|
773
|
+
._ExternalInputModal-tableWrapper_8wgzm_133 {
|
774
774
|
display: none;
|
775
775
|
}
|
776
|
-
._ExternalInputModal--
|
776
|
+
._ExternalInputModal--hasData_8wgzm_202 ._ExternalInputModal-tableWrapper_8wgzm_133 {
|
777
777
|
display: block;
|
778
778
|
}
|
779
|
-
._ExternalInputModal-
|
779
|
+
._ExternalInputModal-loadingBanner_8wgzm_206 {
|
780
780
|
display: none;
|
781
781
|
background-color: color-mix(in srgb, var(--puck-color-white) 90%, transparent);
|
782
782
|
padding: 64px;
|
@@ -788,21 +788,21 @@ textarea._Input-input_3pq3z_47 {
|
|
788
788
|
right: 0;
|
789
789
|
bottom: 0;
|
790
790
|
}
|
791
|
-
._ExternalInputModal--
|
791
|
+
._ExternalInputModal--isLoading_8wgzm_223 ._ExternalInputModal-loadingBanner_8wgzm_206 {
|
792
792
|
display: flex;
|
793
793
|
}
|
794
|
-
._ExternalInputModal-
|
794
|
+
._ExternalInputModal-searchForm_8wgzm_227 {
|
795
795
|
display: flex;
|
796
796
|
flex-wrap: wrap;
|
797
797
|
gap: 12px;
|
798
798
|
flex-grow: 1;
|
799
799
|
}
|
800
800
|
@media (min-width: 458px) {
|
801
|
-
._ExternalInputModal-
|
801
|
+
._ExternalInputModal-searchForm_8wgzm_227 {
|
802
802
|
flex-wrap: nowrap;
|
803
803
|
}
|
804
804
|
}
|
805
|
-
._ExternalInputModal-
|
805
|
+
._ExternalInputModal-search_8wgzm_227 {
|
806
806
|
display: flex;
|
807
807
|
background: var(--puck-color-white);
|
808
808
|
border-width: 1px;
|
@@ -812,18 +812,18 @@ textarea._Input-input_3pq3z_47 {
|
|
812
812
|
flex-grow: 1;
|
813
813
|
transition: border-color 50ms ease-in;
|
814
814
|
}
|
815
|
-
._ExternalInputModal-
|
815
|
+
._ExternalInputModal-search_8wgzm_227:focus-within {
|
816
816
|
border-color: var(--puck-color-grey-05);
|
817
817
|
outline: 2px solid var(--puck-color-azure-05);
|
818
818
|
transition: none;
|
819
819
|
}
|
820
820
|
@media (hover: hover) and (pointer: fine) {
|
821
|
-
._ExternalInputModal-
|
821
|
+
._ExternalInputModal-search_8wgzm_227:hover {
|
822
822
|
border-color: var(--puck-color-grey-05);
|
823
823
|
transition: none;
|
824
824
|
}
|
825
825
|
}
|
826
|
-
._ExternalInputModal-
|
826
|
+
._ExternalInputModal-searchIcon_8wgzm_264 {
|
827
827
|
align-items: center;
|
828
828
|
background: var(--puck-color-grey-12);
|
829
829
|
border-bottom-left-radius: 4px;
|
@@ -835,17 +835,17 @@ textarea._Input-input_3pq3z_47 {
|
|
835
835
|
padding: 12px 15px;
|
836
836
|
transition: color 50ms ease-in;
|
837
837
|
}
|
838
|
-
._ExternalInputModal-
|
838
|
+
._ExternalInputModal-search_8wgzm_227:focus-within ._ExternalInputModal-searchIcon_8wgzm_264 {
|
839
839
|
color: var(--puck-color-grey-04);
|
840
840
|
transition: none;
|
841
841
|
}
|
842
842
|
@media (hover: hover) and (pointer: fine) {
|
843
|
-
._ExternalInputModal-
|
843
|
+
._ExternalInputModal-search_8wgzm_227:hover ._ExternalInputModal-searchIcon_8wgzm_264 {
|
844
844
|
color: var(--puck-color-grey-04);
|
845
845
|
transition: none;
|
846
846
|
}
|
847
847
|
}
|
848
|
-
._ExternalInputModal-
|
848
|
+
._ExternalInputModal-searchIconText_8wgzm_289 {
|
849
849
|
clip: rect(0 0 0 0);
|
850
850
|
clip-path: inset(100%);
|
851
851
|
height: 1px;
|
@@ -854,7 +854,7 @@ textarea._Input-input_3pq3z_47 {
|
|
854
854
|
white-space: nowrap;
|
855
855
|
width: 1px;
|
856
856
|
}
|
857
|
-
._ExternalInputModal-
|
857
|
+
._ExternalInputModal-searchInput_8wgzm_299 {
|
858
858
|
border: none;
|
859
859
|
border-radius: 4px;
|
860
860
|
background: var(--puck-color-white);
|
@@ -863,30 +863,32 @@ textarea._Input-input_3pq3z_47 {
|
|
863
863
|
padding: 12px 15px;
|
864
864
|
width: 100%;
|
865
865
|
}
|
866
|
-
._ExternalInputModal-
|
866
|
+
._ExternalInputModal-searchInput_8wgzm_299:focus {
|
867
867
|
outline: 0;
|
868
868
|
}
|
869
|
-
._ExternalInputModal-
|
869
|
+
._ExternalInputModal-searchActions_8wgzm_313 {
|
870
870
|
display: flex;
|
871
871
|
gap: 8px;
|
872
872
|
height: 44px;
|
873
873
|
width: 100%;
|
874
874
|
}
|
875
875
|
@media (min-width: 458px) {
|
876
|
-
._ExternalInputModal-
|
876
|
+
._ExternalInputModal-searchActions_8wgzm_313 {
|
877
877
|
width: auto;
|
878
878
|
}
|
879
879
|
}
|
880
|
-
._ExternalInputModal-
|
880
|
+
._ExternalInputModal-searchActionIcon_8wgzm_326 {
|
881
881
|
align-self: center;
|
882
882
|
}
|
883
|
-
._ExternalInputModal-
|
883
|
+
._ExternalInputModal-footerContainer_8wgzm_330 {
|
884
884
|
background-color: var(--puck-color-grey-12);
|
885
885
|
border-top: 1px solid var(--puck-color-grey-09);
|
886
886
|
color: var(--puck-color-grey-04);
|
887
|
+
padding: 16px;
|
888
|
+
}
|
889
|
+
._ExternalInputModal-footer_8wgzm_330 {
|
887
890
|
font-weight: 500;
|
888
891
|
font-size: 14px;
|
889
|
-
padding: 16px;
|
890
892
|
text-align: right;
|
891
893
|
}
|
892
894
|
|
package/dist/index.d.mts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { F as FieldProps, a as Field, C as Config, D as Data, I as ItemSelector, P as PuckAction, b as DropZoneProps, U as UserGenerics, c as UiState, O as OnAction, d as Permissions, e as Plugin, f as Overrides, V as Viewports, g as IframeConfig, h as InitialHistory, i as DefaultComponentProps, j as DefaultRootFieldProps, H as History, A as AppState, E as ExtractPropsFromConfig, k as ExtractRootPropsFromConfig, l as ComponentDataMap } from './resolve-all-data-
|
2
|
-
export { L as Adaptor, J as ArrayField, r as ArrayState, a2 as AsFieldProps, B as BaseData, y as BaseField, t as ComponentConfig, w as ComponentData, x as Content, X as CustomField, $ as DefaultRootProps, _ as DefaultRootRenderProps, W as ExternalField, Q as ExternalFieldWithAdaptor, p as FieldRenderFunctions, Y as Fields, q as ItemWithId, M as MappedItem, N as NumberField, K as ObjectField, n as OverrideKey, s as PuckComponent, Z as PuckContext, G as RadioField, v as RootData, R as RootDataWithProps, u as RootDataWithoutProps, S as SelectField, T as TextField, z as TextareaField, m as Viewport, a3 as WithChildren, a0 as WithId, a1 as WithPuckProps, o as overrideKeys, a4 as resolveAllData } from './resolve-all-data-
|
1
|
+
import { F as FieldProps, a as Field, C as Config, D as Data, I as ItemSelector, P as PuckAction, b as DropZoneProps, U as UserGenerics, c as UiState, O as OnAction, d as Permissions, e as Plugin, f as Overrides, V as Viewports, g as IframeConfig, h as InitialHistory, i as DefaultComponentProps, j as DefaultRootFieldProps, H as History, A as AppState, E as ExtractPropsFromConfig, k as ExtractRootPropsFromConfig, l as ComponentDataMap } from './resolve-all-data-Bd3DnhYE.mjs';
|
2
|
+
export { L as Adaptor, J as ArrayField, r as ArrayState, a2 as AsFieldProps, B as BaseData, y as BaseField, t as ComponentConfig, w as ComponentData, x as Content, X as CustomField, $ as DefaultRootProps, _ as DefaultRootRenderProps, W as ExternalField, Q as ExternalFieldWithAdaptor, p as FieldRenderFunctions, Y as Fields, q as ItemWithId, M as MappedItem, N as NumberField, K as ObjectField, n as OverrideKey, s as PuckComponent, Z as PuckContext, G as RadioField, v as RootData, R as RootDataWithProps, u as RootDataWithoutProps, S as SelectField, T as TextField, z as TextareaField, m as Viewport, a3 as WithChildren, a0 as WithId, a1 as WithPuckProps, o as overrideKeys, a4 as resolveAllData } from './resolve-all-data-Bd3DnhYE.mjs';
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
4
4
|
import * as react from 'react';
|
5
5
|
import { ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
|
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import { F as FieldProps, a as Field, C as Config, D as Data, I as ItemSelector, P as PuckAction, b as DropZoneProps, U as UserGenerics, c as UiState, O as OnAction, d as Permissions, e as Plugin, f as Overrides, V as Viewports, g as IframeConfig, h as InitialHistory, i as DefaultComponentProps, j as DefaultRootFieldProps, H as History, A as AppState, E as ExtractPropsFromConfig, k as ExtractRootPropsFromConfig, l as ComponentDataMap } from './resolve-all-data-
|
2
|
-
export { L as Adaptor, J as ArrayField, r as ArrayState, a2 as AsFieldProps, B as BaseData, y as BaseField, t as ComponentConfig, w as ComponentData, x as Content, X as CustomField, $ as DefaultRootProps, _ as DefaultRootRenderProps, W as ExternalField, Q as ExternalFieldWithAdaptor, p as FieldRenderFunctions, Y as Fields, q as ItemWithId, M as MappedItem, N as NumberField, K as ObjectField, n as OverrideKey, s as PuckComponent, Z as PuckContext, G as RadioField, v as RootData, R as RootDataWithProps, u as RootDataWithoutProps, S as SelectField, T as TextField, z as TextareaField, m as Viewport, a3 as WithChildren, a0 as WithId, a1 as WithPuckProps, o as overrideKeys, a4 as resolveAllData } from './resolve-all-data-
|
1
|
+
import { F as FieldProps, a as Field, C as Config, D as Data, I as ItemSelector, P as PuckAction, b as DropZoneProps, U as UserGenerics, c as UiState, O as OnAction, d as Permissions, e as Plugin, f as Overrides, V as Viewports, g as IframeConfig, h as InitialHistory, i as DefaultComponentProps, j as DefaultRootFieldProps, H as History, A as AppState, E as ExtractPropsFromConfig, k as ExtractRootPropsFromConfig, l as ComponentDataMap } from './resolve-all-data-Bd3DnhYE.js';
|
2
|
+
export { L as Adaptor, J as ArrayField, r as ArrayState, a2 as AsFieldProps, B as BaseData, y as BaseField, t as ComponentConfig, w as ComponentData, x as Content, X as CustomField, $ as DefaultRootProps, _ as DefaultRootRenderProps, W as ExternalField, Q as ExternalFieldWithAdaptor, p as FieldRenderFunctions, Y as Fields, q as ItemWithId, M as MappedItem, N as NumberField, K as ObjectField, n as OverrideKey, s as PuckComponent, Z as PuckContext, G as RadioField, v as RootData, R as RootDataWithProps, u as RootDataWithoutProps, S as SelectField, T as TextField, z as TextareaField, m as Viewport, a3 as WithChildren, a0 as WithId, a1 as WithPuckProps, o as overrideKeys, a4 as resolveAllData } from './resolve-all-data-Bd3DnhYE.js';
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
4
4
|
import * as react from 'react';
|
5
5
|
import { ReactNode, SyntheticEvent, ReactElement, CSSProperties } from 'react';
|
package/dist/index.js
CHANGED
@@ -1485,32 +1485,60 @@ var ArrayField = ({
|
|
1485
1485
|
children: [
|
1486
1486
|
field.getItemSummary ? field.getItemSummary(data, i) : `Item #${_originalIndex}`,
|
1487
1487
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: getClassNameItem("rhs"), children: [
|
1488
|
-
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime9.
|
1489
|
-
|
1490
|
-
|
1491
|
-
|
1492
|
-
|
1493
|
-
|
1494
|
-
e
|
1495
|
-
|
1496
|
-
|
1497
|
-
|
1498
|
-
|
1499
|
-
|
1500
|
-
|
1501
|
-
|
1502
|
-
|
1503
|
-
|
1504
|
-
|
1505
|
-
|
1506
|
-
|
1507
|
-
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
|
1512
|
-
|
1513
|
-
|
1488
|
+
!readOnly && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: getClassNameItem("actions"), children: [
|
1489
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
1490
|
+
IconButton,
|
1491
|
+
{
|
1492
|
+
type: "button",
|
1493
|
+
disabled: !!addDisabled,
|
1494
|
+
onClick: (e) => {
|
1495
|
+
e.stopPropagation();
|
1496
|
+
const existingValue = [
|
1497
|
+
...value || []
|
1498
|
+
];
|
1499
|
+
existingValue.splice(
|
1500
|
+
i,
|
1501
|
+
0,
|
1502
|
+
existingValue[i]
|
1503
|
+
);
|
1504
|
+
onChange(
|
1505
|
+
existingValue,
|
1506
|
+
mapArrayStateToUi(
|
1507
|
+
regenerateArrayState(existingValue)
|
1508
|
+
)
|
1509
|
+
);
|
1510
|
+
},
|
1511
|
+
title: "Duplicate",
|
1512
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Copy, { size: 16 })
|
1513
|
+
}
|
1514
|
+
) }),
|
1515
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
1516
|
+
IconButton,
|
1517
|
+
{
|
1518
|
+
type: "button",
|
1519
|
+
disabled: field.min !== void 0 && field.min >= localState.arrayState.items.length,
|
1520
|
+
onClick: (e) => {
|
1521
|
+
e.stopPropagation();
|
1522
|
+
const existingValue = [
|
1523
|
+
...value || []
|
1524
|
+
];
|
1525
|
+
const existingItems = [
|
1526
|
+
...arrayState.items || []
|
1527
|
+
];
|
1528
|
+
existingValue.splice(i, 1);
|
1529
|
+
existingItems.splice(i, 1);
|
1530
|
+
onChange(
|
1531
|
+
existingValue,
|
1532
|
+
mapArrayStateToUi({
|
1533
|
+
items: existingItems
|
1534
|
+
})
|
1535
|
+
);
|
1536
|
+
},
|
1537
|
+
title: "Delete",
|
1538
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Trash, { size: 16 })
|
1539
|
+
}
|
1540
|
+
) })
|
1541
|
+
] }),
|
1514
1542
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(DragIcon, {}) })
|
1515
1543
|
] })
|
1516
1544
|
]
|
@@ -1607,7 +1635,7 @@ var DefaultField = ({
|
|
1607
1635
|
autoComplete: "off",
|
1608
1636
|
type: field.type,
|
1609
1637
|
name,
|
1610
|
-
value: typeof value === "undefined" ? "" : value,
|
1638
|
+
value: typeof value === "undefined" ? "" : value.toString(),
|
1611
1639
|
onChange: (e) => {
|
1612
1640
|
if (field.type === "number") {
|
1613
1641
|
onChange(Number(e.currentTarget.value));
|
@@ -1636,7 +1664,7 @@ var import_react10 = require("react");
|
|
1636
1664
|
|
1637
1665
|
// css-module:/home/runner/work/puck/puck/packages/core/components/ExternalInput/styles.module.css#css-module
|
1638
1666
|
init_react_import();
|
1639
|
-
var styles_module_default6 = { "ExternalInput-actions": "_ExternalInput-
|
1667
|
+
var styles_module_default6 = { "ExternalInput-actions": "_ExternalInput-actions_8wgzm_1", "ExternalInput-button": "_ExternalInput-button_8wgzm_5", "ExternalInput--dataSelected": "_ExternalInput--dataSelected_8wgzm_24", "ExternalInput--readOnly": "_ExternalInput--readOnly_8wgzm_31", "ExternalInput-detachButton": "_ExternalInput-detachButton_8wgzm_35", "ExternalInput": "_ExternalInput_8wgzm_1", "ExternalInputModal": "_ExternalInputModal_8wgzm_79", "ExternalInputModal-grid": "_ExternalInputModal-grid_8wgzm_89", "ExternalInputModal--filtersToggled": "_ExternalInputModal--filtersToggled_8wgzm_100", "ExternalInputModal-filters": "_ExternalInputModal-filters_8wgzm_105", "ExternalInputModal-masthead": "_ExternalInputModal-masthead_8wgzm_124", "ExternalInputModal-tableWrapper": "_ExternalInputModal-tableWrapper_8wgzm_133", "ExternalInputModal-table": "_ExternalInputModal-table_8wgzm_133", "ExternalInputModal-thead": "_ExternalInputModal-thead_8wgzm_149", "ExternalInputModal-th": "_ExternalInputModal-th_8wgzm_149", "ExternalInputModal-td": "_ExternalInputModal-td_8wgzm_164", "ExternalInputModal-tr": "_ExternalInputModal-tr_8wgzm_169", "ExternalInputModal-tbody": "_ExternalInputModal-tbody_8wgzm_176", "ExternalInputModal--hasData": "_ExternalInputModal--hasData_8wgzm_202", "ExternalInputModal-loadingBanner": "_ExternalInputModal-loadingBanner_8wgzm_206", "ExternalInputModal--isLoading": "_ExternalInputModal--isLoading_8wgzm_223", "ExternalInputModal-searchForm": "_ExternalInputModal-searchForm_8wgzm_227", "ExternalInputModal-search": "_ExternalInputModal-search_8wgzm_227", "ExternalInputModal-searchIcon": "_ExternalInputModal-searchIcon_8wgzm_264", "ExternalInputModal-searchIconText": "_ExternalInputModal-searchIconText_8wgzm_289", "ExternalInputModal-searchInput": "_ExternalInputModal-searchInput_8wgzm_299", "ExternalInputModal-searchActions": "_ExternalInputModal-searchActions_8wgzm_313", "ExternalInputModal-searchActionIcon": "_ExternalInputModal-searchActionIcon_8wgzm_326", "ExternalInputModal-footerContainer": "_ExternalInputModal-footerContainer_8wgzm_330", "ExternalInputModal-footer": "_ExternalInputModal-footer_8wgzm_330" };
|
1640
1668
|
|
1641
1669
|
// components/Modal/index.tsx
|
1642
1670
|
init_react_import();
|
@@ -1793,7 +1821,7 @@ var ExternalInput = ({
|
|
1793
1821
|
const validKeys = /* @__PURE__ */ new Set();
|
1794
1822
|
for (const item of mappedData) {
|
1795
1823
|
for (const key of Object.keys(item)) {
|
1796
|
-
if (typeof item[key] === "string" || typeof item[key] === "number") {
|
1824
|
+
if (typeof item[key] === "string" || typeof item[key] === "number" || (0, import_react10.isValidElement)(item[key])) {
|
1797
1825
|
validKeys.add(key);
|
1798
1826
|
}
|
1799
1827
|
}
|
@@ -1814,6 +1842,14 @@ var ExternalInput = ({
|
|
1814
1842
|
}),
|
1815
1843
|
[id, field]
|
1816
1844
|
);
|
1845
|
+
const Footer = (0, import_react10.useCallback)(
|
1846
|
+
(props) => field.renderFooter ? field.renderFooter(props) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: getClassNameModal("footer"), children: [
|
1847
|
+
props.items.length,
|
1848
|
+
" result",
|
1849
|
+
props.items.length === 1 ? "" : "s"
|
1850
|
+
] }),
|
1851
|
+
[field.renderFooter]
|
1852
|
+
);
|
1817
1853
|
(0, import_react10.useEffect)(() => {
|
1818
1854
|
search(searchQuery, filters);
|
1819
1855
|
}, []);
|
@@ -1953,11 +1989,7 @@ var ExternalInput = ({
|
|
1953
1989
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("loadingBanner"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Loader, { size: 24 }) })
|
1954
1990
|
] })
|
1955
1991
|
] }),
|
1956
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.
|
1957
|
-
mappedData.length,
|
1958
|
-
" result",
|
1959
|
-
mappedData.length === 1 ? "" : "s"
|
1960
|
-
] })
|
1992
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: getClassNameModal("footerContainer"), children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Footer, { items: mappedData }) })
|
1961
1993
|
]
|
1962
1994
|
}
|
1963
1995
|
) })
|
package/dist/index.mjs
CHANGED
@@ -1298,32 +1298,60 @@ var ArrayField = ({
|
|
1298
1298
|
children: [
|
1299
1299
|
field.getItemSummary ? field.getItemSummary(data, i) : `Item #${_originalIndex}`,
|
1300
1300
|
/* @__PURE__ */ jsxs4("div", { className: getClassNameItem("rhs"), children: [
|
1301
|
-
!readOnly && /* @__PURE__ */
|
1302
|
-
|
1303
|
-
|
1304
|
-
|
1305
|
-
|
1306
|
-
|
1307
|
-
e
|
1308
|
-
|
1309
|
-
|
1310
|
-
|
1311
|
-
|
1312
|
-
|
1313
|
-
|
1314
|
-
|
1315
|
-
|
1316
|
-
|
1317
|
-
|
1318
|
-
|
1319
|
-
|
1320
|
-
|
1321
|
-
|
1322
|
-
|
1323
|
-
|
1324
|
-
|
1325
|
-
|
1326
|
-
|
1301
|
+
!readOnly && /* @__PURE__ */ jsxs4("div", { className: getClassNameItem("actions"), children: [
|
1302
|
+
/* @__PURE__ */ jsx9("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ jsx9(
|
1303
|
+
IconButton,
|
1304
|
+
{
|
1305
|
+
type: "button",
|
1306
|
+
disabled: !!addDisabled,
|
1307
|
+
onClick: (e) => {
|
1308
|
+
e.stopPropagation();
|
1309
|
+
const existingValue = [
|
1310
|
+
...value || []
|
1311
|
+
];
|
1312
|
+
existingValue.splice(
|
1313
|
+
i,
|
1314
|
+
0,
|
1315
|
+
existingValue[i]
|
1316
|
+
);
|
1317
|
+
onChange(
|
1318
|
+
existingValue,
|
1319
|
+
mapArrayStateToUi(
|
1320
|
+
regenerateArrayState(existingValue)
|
1321
|
+
)
|
1322
|
+
);
|
1323
|
+
},
|
1324
|
+
title: "Duplicate",
|
1325
|
+
children: /* @__PURE__ */ jsx9(Copy, { size: 16 })
|
1326
|
+
}
|
1327
|
+
) }),
|
1328
|
+
/* @__PURE__ */ jsx9("div", { className: getClassNameItem("action"), children: /* @__PURE__ */ jsx9(
|
1329
|
+
IconButton,
|
1330
|
+
{
|
1331
|
+
type: "button",
|
1332
|
+
disabled: field.min !== void 0 && field.min >= localState.arrayState.items.length,
|
1333
|
+
onClick: (e) => {
|
1334
|
+
e.stopPropagation();
|
1335
|
+
const existingValue = [
|
1336
|
+
...value || []
|
1337
|
+
];
|
1338
|
+
const existingItems = [
|
1339
|
+
...arrayState.items || []
|
1340
|
+
];
|
1341
|
+
existingValue.splice(i, 1);
|
1342
|
+
existingItems.splice(i, 1);
|
1343
|
+
onChange(
|
1344
|
+
existingValue,
|
1345
|
+
mapArrayStateToUi({
|
1346
|
+
items: existingItems
|
1347
|
+
})
|
1348
|
+
);
|
1349
|
+
},
|
1350
|
+
title: "Delete",
|
1351
|
+
children: /* @__PURE__ */ jsx9(Trash, { size: 16 })
|
1352
|
+
}
|
1353
|
+
) })
|
1354
|
+
] }),
|
1327
1355
|
/* @__PURE__ */ jsx9("div", { children: /* @__PURE__ */ jsx9(DragIcon, {}) })
|
1328
1356
|
] })
|
1329
1357
|
]
|
@@ -1420,7 +1448,7 @@ var DefaultField = ({
|
|
1420
1448
|
autoComplete: "off",
|
1421
1449
|
type: field.type,
|
1422
1450
|
name,
|
1423
|
-
value: typeof value === "undefined" ? "" : value,
|
1451
|
+
value: typeof value === "undefined" ? "" : value.toString(),
|
1424
1452
|
onChange: (e) => {
|
1425
1453
|
if (field.type === "number") {
|
1426
1454
|
onChange(Number(e.currentTarget.value));
|
@@ -1445,11 +1473,17 @@ import { useEffect as useEffect8 } from "react";
|
|
1445
1473
|
|
1446
1474
|
// components/ExternalInput/index.tsx
|
1447
1475
|
init_react_import();
|
1448
|
-
import {
|
1476
|
+
import {
|
1477
|
+
useMemo,
|
1478
|
+
useEffect as useEffect7,
|
1479
|
+
useState as useState8,
|
1480
|
+
useCallback as useCallback4,
|
1481
|
+
isValidElement
|
1482
|
+
} from "react";
|
1449
1483
|
|
1450
1484
|
// css-module:/home/runner/work/puck/puck/packages/core/components/ExternalInput/styles.module.css#css-module
|
1451
1485
|
init_react_import();
|
1452
|
-
var styles_module_default6 = { "ExternalInput-actions": "_ExternalInput-
|
1486
|
+
var styles_module_default6 = { "ExternalInput-actions": "_ExternalInput-actions_8wgzm_1", "ExternalInput-button": "_ExternalInput-button_8wgzm_5", "ExternalInput--dataSelected": "_ExternalInput--dataSelected_8wgzm_24", "ExternalInput--readOnly": "_ExternalInput--readOnly_8wgzm_31", "ExternalInput-detachButton": "_ExternalInput-detachButton_8wgzm_35", "ExternalInput": "_ExternalInput_8wgzm_1", "ExternalInputModal": "_ExternalInputModal_8wgzm_79", "ExternalInputModal-grid": "_ExternalInputModal-grid_8wgzm_89", "ExternalInputModal--filtersToggled": "_ExternalInputModal--filtersToggled_8wgzm_100", "ExternalInputModal-filters": "_ExternalInputModal-filters_8wgzm_105", "ExternalInputModal-masthead": "_ExternalInputModal-masthead_8wgzm_124", "ExternalInputModal-tableWrapper": "_ExternalInputModal-tableWrapper_8wgzm_133", "ExternalInputModal-table": "_ExternalInputModal-table_8wgzm_133", "ExternalInputModal-thead": "_ExternalInputModal-thead_8wgzm_149", "ExternalInputModal-th": "_ExternalInputModal-th_8wgzm_149", "ExternalInputModal-td": "_ExternalInputModal-td_8wgzm_164", "ExternalInputModal-tr": "_ExternalInputModal-tr_8wgzm_169", "ExternalInputModal-tbody": "_ExternalInputModal-tbody_8wgzm_176", "ExternalInputModal--hasData": "_ExternalInputModal--hasData_8wgzm_202", "ExternalInputModal-loadingBanner": "_ExternalInputModal-loadingBanner_8wgzm_206", "ExternalInputModal--isLoading": "_ExternalInputModal--isLoading_8wgzm_223", "ExternalInputModal-searchForm": "_ExternalInputModal-searchForm_8wgzm_227", "ExternalInputModal-search": "_ExternalInputModal-search_8wgzm_227", "ExternalInputModal-searchIcon": "_ExternalInputModal-searchIcon_8wgzm_264", "ExternalInputModal-searchIconText": "_ExternalInputModal-searchIconText_8wgzm_289", "ExternalInputModal-searchInput": "_ExternalInputModal-searchInput_8wgzm_299", "ExternalInputModal-searchActions": "_ExternalInputModal-searchActions_8wgzm_313", "ExternalInputModal-searchActionIcon": "_ExternalInputModal-searchActionIcon_8wgzm_326", "ExternalInputModal-footerContainer": "_ExternalInputModal-footerContainer_8wgzm_330", "ExternalInputModal-footer": "_ExternalInputModal-footer_8wgzm_330" };
|
1453
1487
|
|
1454
1488
|
// components/Modal/index.tsx
|
1455
1489
|
init_react_import();
|
@@ -1606,7 +1640,7 @@ var ExternalInput = ({
|
|
1606
1640
|
const validKeys = /* @__PURE__ */ new Set();
|
1607
1641
|
for (const item of mappedData) {
|
1608
1642
|
for (const key of Object.keys(item)) {
|
1609
|
-
if (typeof item[key] === "string" || typeof item[key] === "number") {
|
1643
|
+
if (typeof item[key] === "string" || typeof item[key] === "number" || isValidElement(item[key])) {
|
1610
1644
|
validKeys.add(key);
|
1611
1645
|
}
|
1612
1646
|
}
|
@@ -1627,6 +1661,14 @@ var ExternalInput = ({
|
|
1627
1661
|
}),
|
1628
1662
|
[id, field]
|
1629
1663
|
);
|
1664
|
+
const Footer = useCallback4(
|
1665
|
+
(props) => field.renderFooter ? field.renderFooter(props) : /* @__PURE__ */ jsxs7("span", { className: getClassNameModal("footer"), children: [
|
1666
|
+
props.items.length,
|
1667
|
+
" result",
|
1668
|
+
props.items.length === 1 ? "" : "s"
|
1669
|
+
] }),
|
1670
|
+
[field.renderFooter]
|
1671
|
+
);
|
1630
1672
|
useEffect7(() => {
|
1631
1673
|
search(searchQuery, filters);
|
1632
1674
|
}, []);
|
@@ -1766,11 +1808,7 @@ var ExternalInput = ({
|
|
1766
1808
|
/* @__PURE__ */ jsx14("div", { className: getClassNameModal("loadingBanner"), children: /* @__PURE__ */ jsx14(Loader, { size: 24 }) })
|
1767
1809
|
] })
|
1768
1810
|
] }),
|
1769
|
-
/* @__PURE__ */
|
1770
|
-
mappedData.length,
|
1771
|
-
" result",
|
1772
|
-
mappedData.length === 1 ? "" : "s"
|
1773
|
-
] })
|
1811
|
+
/* @__PURE__ */ jsx14("div", { className: getClassNameModal("footerContainer"), children: /* @__PURE__ */ jsx14(Footer, { items: mappedData }) })
|
1774
1812
|
]
|
1775
1813
|
}
|
1776
1814
|
) })
|
@@ -91,9 +91,12 @@ type ExternalField<Props extends {
|
|
91
91
|
filters: Record<string, any>;
|
92
92
|
}) => Promise<any[] | null>;
|
93
93
|
mapProp?: (value: any) => Props;
|
94
|
-
mapRow?: (value: any) => Record<string, string | number>;
|
94
|
+
mapRow?: (value: any) => Record<string, string | number | ReactElement>;
|
95
95
|
getItemSummary?: (item: Props, index?: number) => string;
|
96
96
|
showSearch?: boolean;
|
97
|
+
renderFooter?: (props: {
|
98
|
+
items: any[];
|
99
|
+
}) => ReactElement;
|
97
100
|
initialQuery?: string;
|
98
101
|
filterFields?: Record<string, Field>;
|
99
102
|
initialFilters?: Record<string, any>;
|
@@ -91,9 +91,12 @@ type ExternalField<Props extends {
|
|
91
91
|
filters: Record<string, any>;
|
92
92
|
}) => Promise<any[] | null>;
|
93
93
|
mapProp?: (value: any) => Props;
|
94
|
-
mapRow?: (value: any) => Record<string, string | number>;
|
94
|
+
mapRow?: (value: any) => Record<string, string | number | ReactElement>;
|
95
95
|
getItemSummary?: (item: Props, index?: number) => string;
|
96
96
|
showSearch?: boolean;
|
97
|
+
renderFooter?: (props: {
|
98
|
+
items: any[];
|
99
|
+
}) => ReactElement;
|
97
100
|
initialQuery?: string;
|
98
101
|
filterFields?: Record<string, Field>;
|
99
102
|
initialFilters?: Record<string, any>;
|
package/dist/rsc.d.mts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
|
-
import { C as Config, D as Data } from './resolve-all-data-
|
3
|
-
export { a4 as resolveAllData } from './resolve-all-data-
|
2
|
+
import { C as Config, D as Data } from './resolve-all-data-Bd3DnhYE.mjs';
|
3
|
+
export { a4 as resolveAllData } from './resolve-all-data-Bd3DnhYE.mjs';
|
4
4
|
import 'react';
|
5
5
|
|
6
6
|
declare function Render<UserConfig extends Config = Config>({ config, data, }: {
|
package/dist/rsc.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
|
-
import { C as Config, D as Data } from './resolve-all-data-
|
3
|
-
export { a4 as resolveAllData } from './resolve-all-data-
|
2
|
+
import { C as Config, D as Data } from './resolve-all-data-Bd3DnhYE.js';
|
3
|
+
export { a4 as resolveAllData } from './resolve-all-data-Bd3DnhYE.js';
|
4
4
|
import 'react';
|
5
5
|
|
6
6
|
declare function Render<UserConfig extends Config = Config>({ config, data, }: {
|
package/package.json
CHANGED