@measured/puck-plugin-heading-analyzer 0.13.2-canary.8d7db7b → 0.14.0-canary.03dd90b

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -31,4 +31,4 @@ export function Page() {
31
31
 
32
32
  ## License
33
33
 
34
- MIT © [Measured Co.](https://github.com/measuredco)
34
+ MIT © [Measured Corporation Ltd](https://measured.co)
package/dist/index.css CHANGED
@@ -1,60 +1,76 @@
1
1
  /* css-module:/home/runner/work/puck/puck/packages/core/components/SidebarSection/styles.module.css/#css-module-data */
2
- ._SidebarSection_170gs_1 {
2
+ ._SidebarSection_125qe_1 {
3
3
  display: flex;
4
4
  position: relative;
5
5
  flex-direction: column;
6
- color: black;
6
+ color: var(--puck-color-black);
7
7
  }
8
- ._SidebarSection_170gs_1:last-of-type {
8
+ ._SidebarSection_125qe_1:last-of-type {
9
9
  flex-grow: 1;
10
10
  }
11
- ._SidebarSection-title_170gs_12 {
12
- background: white;
11
+ ._SidebarSection-title_125qe_12 {
12
+ background: var(--puck-color-white);
13
13
  padding: 16px;
14
- border-bottom: 1px solid var(--puck-color-grey-8);
15
- border-top: 1px solid var(--puck-color-grey-8);
14
+ border-bottom: 1px solid var(--puck-color-grey-09);
15
+ border-top: 1px solid var(--puck-color-grey-09);
16
16
  overflow-x: auto;
17
17
  }
18
- ._SidebarSection--noBorderTop_170gs_20 > ._SidebarSection-title_170gs_12 {
18
+ ._SidebarSection--noBorderTop_125qe_20 > ._SidebarSection-title_125qe_12 {
19
19
  border-top: 0px;
20
20
  }
21
- ._SidebarSection-content_170gs_24 {
21
+ ._SidebarSection-content_125qe_24 {
22
22
  padding: 16px;
23
23
  }
24
- ._SidebarSection--noPadding_170gs_28 > ._SidebarSection-content_170gs_24 {
24
+ ._SidebarSection--noPadding_125qe_28 > ._SidebarSection-content_125qe_24 {
25
25
  padding: 0px;
26
26
  }
27
- ._SidebarSection--noPadding_170gs_28 > ._SidebarSection-content_170gs_24:last-child {
27
+ ._SidebarSection--noPadding_125qe_28 > ._SidebarSection-content_125qe_24:last-child {
28
28
  padding-bottom: 4px;
29
29
  }
30
- ._SidebarSection_170gs_1:last-of-type ._SidebarSection-content_170gs_24 {
30
+ ._SidebarSection_125qe_1:last-of-type ._SidebarSection-content_125qe_24 {
31
31
  border-bottom: none;
32
32
  flex-grow: 1;
33
33
  }
34
- ._SidebarSection-breadcrumbLabel_170gs_41 {
35
- color: var(--puck-color-azure-3);
34
+ ._SidebarSection-breadcrumbLabel_125qe_41 {
35
+ background: none;
36
+ border: 0;
37
+ border-radius: 2px;
38
+ color: var(--puck-color-azure-04);
39
+ cursor: pointer;
40
+ font: inherit;
36
41
  flex-shrink: 0;
42
+ padding: 0;
43
+ transition: color 50ms ease-in;
37
44
  }
38
- ._SidebarSection-breadcrumbLabel_170gs_41:hover {
39
- color: var(--puck-color-azure-4);
40
- cursor: pointer;
41
- text-decoration: underline;
45
+ ._SidebarSection-breadcrumbLabel_125qe_41:focus-visible {
46
+ outline: 2px solid var(--puck-color-azure-05);
47
+ outline-offset: 2px;
48
+ }
49
+ @media (hover: hover) and (pointer: fine) {
50
+ ._SidebarSection-breadcrumbLabel_125qe_41:hover {
51
+ color: var(--puck-color-azure-03);
52
+ transition: none;
53
+ }
42
54
  }
43
- ._SidebarSection-breadcrumbs_170gs_52 {
55
+ ._SidebarSection-breadcrumbLabel_125qe_41:active {
56
+ color: var(--puck-color-azure-02);
57
+ transition: none;
58
+ }
59
+ ._SidebarSection-breadcrumbs_125qe_70 {
44
60
  align-items: center;
45
61
  display: flex;
46
62
  gap: 4px;
47
63
  }
48
- ._SidebarSection-breadcrumb_170gs_41 {
64
+ ._SidebarSection-breadcrumb_125qe_41 {
49
65
  align-items: center;
50
66
  display: flex;
51
67
  gap: 4px;
52
68
  }
53
- ._SidebarSection-heading_170gs_64 {
69
+ ._SidebarSection-heading_125qe_82 {
54
70
  padding-right: 16px;
55
71
  }
56
- ._SidebarSection-loadingOverlay_170gs_68 {
57
- background: white;
72
+ ._SidebarSection-loadingOverlay_125qe_86 {
73
+ background: var(--puck-color-white);
58
74
  display: flex;
59
75
  justify-content: center;
60
76
  align-items: center;
@@ -69,54 +85,53 @@
69
85
  }
70
86
 
71
87
  /* css-module:/home/runner/work/puck/puck/packages/core/components/Heading/styles.module.css/#css-module-data */
72
- ._Heading_1bvy5_1 {
88
+ ._Heading_qxrry_1 {
73
89
  display: block;
74
90
  color: var(--puck-color-black);
75
- font-family: var(--puck-font-stack);
76
91
  font-weight: 700;
77
92
  margin: 0;
78
93
  }
79
- ._Heading_1bvy5_1 b {
94
+ ._Heading_qxrry_1 b {
80
95
  font-weight: 700;
81
96
  }
82
- ._Heading--xxxxl_1bvy5_13 {
97
+ ._Heading--xxxxl_qxrry_12 {
83
98
  font-size: var(--puck-font-size-xxxxl);
84
99
  letter-spacing: 0.08ch;
85
100
  font-weight: 800;
86
101
  }
87
- ._Heading--xxxl_1bvy5_19 {
102
+ ._Heading--xxxl_qxrry_18 {
88
103
  font-size: var(--puck-font-size-xxxl);
89
104
  }
90
- ._Heading--xxl_1bvy5_23 {
105
+ ._Heading--xxl_qxrry_22 {
91
106
  font-size: var(--puck-font-size-xxl);
92
107
  }
93
- ._Heading--xl_1bvy5_27 {
108
+ ._Heading--xl_qxrry_26 {
94
109
  font-size: var(--puck-font-size-xl);
95
110
  }
96
- ._Heading--l_1bvy5_31 {
111
+ ._Heading--l_qxrry_30 {
97
112
  font-size: var(--puck-font-size-l);
98
113
  }
99
- ._Heading--m_1bvy5_35 {
114
+ ._Heading--m_qxrry_34 {
100
115
  font-size: var(--puck-font-size-m);
101
116
  }
102
- ._Heading--s_1bvy5_39 {
117
+ ._Heading--s_qxrry_38 {
103
118
  font-size: var(--puck-font-size-s);
104
119
  }
105
- ._Heading--xs_1bvy5_43 {
120
+ ._Heading--xs_qxrry_42 {
106
121
  font-size: var(--puck-font-size-xs);
107
122
  }
108
123
 
109
124
  /* css-module:/home/runner/work/puck/puck/packages/core/components/OutlineList/styles.module.css/#css-module-data */
110
- ._OutlineList_1nwoz_1 {
111
- color: var(--puck-color-grey-2);
112
- font-family: var(--puck-font-stack);
125
+ ._OutlineList_18bgy_1 {
126
+ color: var(--puck-color-grey-03);
127
+ font-family: var(--puck-font-family);
113
128
  margin: 0;
114
129
  padding-left: 16px;
115
130
  position: relative;
116
131
  list-style: none;
117
132
  }
118
- ._OutlineList_1nwoz_1::before {
119
- background: var(--puck-color-grey-7);
133
+ ._OutlineList_18bgy_1::before {
134
+ background: var(--puck-color-grey-08);
120
135
  position: absolute;
121
136
  left: -1px;
122
137
  top: 0px;
@@ -124,12 +139,12 @@
124
139
  height: calc(100% - 9px);
125
140
  content: "";
126
141
  }
127
- ._OutlineListItem_1nwoz_20 {
142
+ ._OutlineListItem_18bgy_20 {
128
143
  position: relative;
129
144
  margin-bottom: 4px;
130
145
  }
131
- ._OutlineListItem_1nwoz_20::before {
132
- background: var(--puck-color-grey-7);
146
+ ._OutlineListItem_18bgy_20::before {
147
+ background: var(--puck-color-grey-08);
133
148
  position: absolute;
134
149
  left: -17px;
135
150
  top: 9px;
@@ -137,10 +152,24 @@
137
152
  height: 1px;
138
153
  content: "";
139
154
  }
140
- ._OutlineListItem--clickable_1nwoz_35:hover {
141
- color: var(--puck-color-blue);
155
+ ._OutlineListItem--clickable_18bgy_35 {
142
156
  cursor: pointer;
157
+ transition: color 50ms ease-in;
158
+ }
159
+ ._OutlineListItem--clickable_18bgy_35:focus-visible {
160
+ outline: 2px solid var(--puck-color-azure-05);
161
+ outline-offset: 2px;
162
+ }
163
+ @media (hover: hover) and (pointer: fine) {
164
+ ._OutlineListItem--clickable_18bgy_35:hover {
165
+ color: var(--puck-color-azure-04);
166
+ transition: none;
167
+ }
168
+ }
169
+ ._OutlineListItem--clickable_18bgy_35:active {
170
+ color: var(--puck-color-azure-03);
171
+ transition: none;
143
172
  }
144
- ._OutlineListItem_1nwoz_20 > ._OutlineList_1nwoz_1 {
173
+ ._OutlineListItem_18bgy_20 > ._OutlineList_18bgy_1 {
145
174
  margin: 8px 0;
146
175
  }
package/dist/index.d.ts CHANGED
@@ -1,10 +1,23 @@
1
- import { ReactElement, ReactNode } from 'react';
1
+ import { ReactNode, ReactElement } from 'react';
2
2
 
3
3
  type ItemSelector = {
4
4
  index: number;
5
5
  zone?: string;
6
6
  };
7
7
 
8
+ type iconTypes = "Smartphone" | "Monitor" | "Tablet";
9
+ type Viewport = {
10
+ width: number;
11
+ height?: number | "auto";
12
+ label?: string;
13
+ icon?: iconTypes | ReactNode;
14
+ };
15
+
16
+ type FieldOption = {
17
+ label: string;
18
+ value: string | number | boolean;
19
+ };
20
+ type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
8
21
  type BaseField = {
9
22
  label?: string;
10
23
  };
@@ -13,23 +26,19 @@ type TextField = BaseField & {
13
26
  };
14
27
  type NumberField = BaseField & {
15
28
  type: "number";
29
+ min?: number;
30
+ max?: number;
16
31
  };
17
32
  type TextareaField = BaseField & {
18
33
  type: "textarea";
19
34
  };
20
35
  type SelectField = BaseField & {
21
36
  type: "select";
22
- options: {
23
- label: string;
24
- value: string | number | boolean;
25
- }[];
37
+ options: FieldOptions;
26
38
  };
27
39
  type RadioField = BaseField & {
28
40
  type: "radio";
29
- options: {
30
- label: string;
31
- value: string | number | boolean;
32
- }[];
41
+ options: FieldOptions;
33
42
  };
34
43
  type ArrayField<Props extends {
35
44
  [key: string]: any;
@@ -42,6 +51,8 @@ type ArrayField<Props extends {
42
51
  };
43
52
  defaultItemProps?: Props[0];
44
53
  getItemSummary?: (item: Props[0], index?: number) => string;
54
+ max?: number;
55
+ min?: number;
45
56
  };
46
57
  type ObjectField<Props extends {
47
58
  [key: string]: any;
@@ -50,7 +61,7 @@ type ObjectField<Props extends {
50
61
  }> = BaseField & {
51
62
  type: "object";
52
63
  objectFields: {
53
- [SubPropName in keyof Props[0]]: Field<Props[0][SubPropName]>;
64
+ [SubPropName in keyof Props]: Field<Props[SubPropName]>;
54
65
  };
55
66
  };
56
67
  type Adaptor<AdaptorParams = {}, TableShape extends Record<string, any> = {}, PropShape = TableShape> = {
@@ -78,11 +89,15 @@ type ExternalField<Props extends {
78
89
  placeholder?: string;
79
90
  fetchList: (params: {
80
91
  query: string;
92
+ filters: Record<string, any>;
81
93
  }) => Promise<any[] | null>;
82
94
  mapProp?: (value: any) => Props;
95
+ mapRow?: (value: any) => Record<string, string | number>;
83
96
  getItemSummary: (item: Props, index?: number) => string;
84
97
  showSearch?: boolean;
85
98
  initialQuery?: string;
99
+ filterFields?: Record<string, Field>;
100
+ initialFilters?: Record<string, any>;
86
101
  };
87
102
  type CustomField<Props extends {
88
103
  [key: string]: any;
@@ -123,6 +138,14 @@ type UiState = {
123
138
  expanded?: boolean;
124
139
  }>;
125
140
  isDragging: boolean;
141
+ viewports: {
142
+ current: {
143
+ width: number;
144
+ height: number | "auto";
145
+ };
146
+ controlsVisible: boolean;
147
+ options: Viewport[];
148
+ };
126
149
  };
127
150
 
128
151
  type InputProps<F = Field<any>> = {
@@ -140,7 +163,7 @@ type RenderFunc<Props extends {
140
163
  [key: string]: any;
141
164
  } = {
142
165
  children: ReactNode;
143
- }> = React.FunctionComponent<Props>;
166
+ }> = (props: Props) => ReactElement;
144
167
  declare const overrideKeys: readonly ["header", "headerActions", "fields", "fieldLabel", "components", "componentItem", "outline", "puck", "preview"];
145
168
  type OverrideKey = (typeof overrideKeys)[number];
146
169
  type OverridesGeneric<Shape extends {
@@ -170,7 +193,10 @@ type Overrides = OverridesGeneric<{
170
193
  className?: string;
171
194
  }>;
172
195
  components: RenderFunc;
173
- componentItem: RenderFunc;
196
+ componentItem: RenderFunc<{
197
+ children: ReactNode;
198
+ name: string;
199
+ }>;
174
200
  outline: RenderFunc;
175
201
  puck: RenderFunc;
176
202
  }>;