@measured/puck 0.15.0 → 0.15.1-canary.0daf478

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.css CHANGED
@@ -137,44 +137,45 @@
137
137
  /* styles.css */
138
138
 
139
139
  /* css-module:/home/runner/work/puck/puck/packages/core/components/AutoField/styles.module.css/#css-module-data */
140
- ._Input_1qi5b_1 {
140
+ ._Input_3pq3z_1 {
141
141
  color: var(--puck-color-grey-04);
142
142
  padding: 16px;
143
143
  padding-bottom: 12px;
144
144
  display: block;
145
145
  }
146
- ._Input_1qi5b_1 ._Input_1qi5b_1 {
146
+ ._Input_3pq3z_1 ._Input_3pq3z_1 {
147
147
  padding: 0px;
148
148
  }
149
- ._Input_1qi5b_1 * {
149
+ ._Input_3pq3z_1 * {
150
150
  box-sizing: border-box;
151
151
  }
152
- ._Input_1qi5b_1 + ._Input_1qi5b_1 {
152
+ ._Input_3pq3z_1 + ._Input_3pq3z_1 {
153
153
  border-top: 1px solid var(--puck-color-grey-09);
154
154
  margin-top: 8px;
155
155
  }
156
- ._Input_1qi5b_1 ._Input_1qi5b_1 + ._Input_1qi5b_1 {
156
+ ._Input_3pq3z_1 ._Input_3pq3z_1 + ._Input_3pq3z_1 {
157
157
  border-top: 0px;
158
158
  margin-top: 12px;
159
159
  }
160
- ._Input-label_1qi5b_26 {
160
+ ._Input-label_3pq3z_26 {
161
161
  align-items: center;
162
+ color: var(--puck-color-grey-04);
162
163
  display: flex;
163
164
  padding-bottom: 12px;
164
165
  font-size: var(--puck-font-size-xxs);
165
166
  font-weight: 600;
166
167
  }
167
- ._Input-labelIcon_1qi5b_34 {
168
+ ._Input-labelIcon_3pq3z_35 {
168
169
  color: var(--puck-color-grey-07);
169
170
  display: flex;
170
171
  margin-right: 4px;
171
172
  padding-left: 4px;
172
173
  }
173
- ._Input-disabledIcon_1qi5b_41 {
174
+ ._Input-disabledIcon_3pq3z_42 {
174
175
  color: var(--puck-color-grey-05);
175
176
  margin-left: auto;
176
177
  }
177
- ._Input-input_1qi5b_46 {
178
+ ._Input-input_3pq3z_47 {
178
179
  background: var(--puck-color-white);
179
180
  border-width: 1px;
180
181
  border-style: solid;
@@ -186,7 +187,7 @@
186
187
  transition: border-color 50ms ease-in;
187
188
  width: 100%;
188
189
  }
189
- select._Input-input_1qi5b_46 {
190
+ select._Input-input_3pq3z_47 {
190
191
  appearance: none;
191
192
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23c3c3c3'><polygon points='0,0 100,0 50,50'/></svg>") no-repeat;
192
193
  background-size: 12px;
@@ -196,25 +197,25 @@ select._Input-input_1qi5b_46 {
196
197
  cursor: pointer;
197
198
  }
198
199
  @media (hover: hover) and (pointer: fine) {
199
- ._Input_1qi5b_1:has(> input):hover ._Input-input_1qi5b_46:not([readonly]),
200
- ._Input_1qi5b_1:has(> textarea):hover ._Input-input_1qi5b_46:not([readonly]) {
200
+ ._Input_3pq3z_1:has(> input):hover ._Input-input_3pq3z_47:not([readonly]),
201
+ ._Input_3pq3z_1:has(> textarea):hover ._Input-input_3pq3z_47:not([readonly]) {
201
202
  border-color: var(--puck-color-grey-05);
202
203
  transition: none;
203
204
  }
204
- ._Input_1qi5b_1:has(> select):hover ._Input-input_1qi5b_46:not([disabled]) {
205
+ ._Input_3pq3z_1:has(> select):hover ._Input-input_3pq3z_47:not([disabled]) {
205
206
  background-color: var(--puck-color-azure-12);
206
207
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%235a5a5a'><polygon points='0,0 100,0 50,50'/></svg>");
207
208
  border-color: var(--puck-color-grey-05);
208
209
  transition: none;
209
210
  }
210
211
  }
211
- ._Input-input_1qi5b_46:focus {
212
+ ._Input-input_3pq3z_47:focus {
212
213
  border-color: var(--puck-color-grey-05);
213
214
  outline: 2px solid var(--puck-color-azure-05);
214
215
  transition: none;
215
216
  }
216
- ._Input--readOnly_1qi5b_90 > ._Input-input_1qi5b_46,
217
- ._Input--readOnly_1qi5b_90 > select._Input-input_1qi5b_46 {
217
+ ._Input--readOnly_3pq3z_91 > ._Input-input_3pq3z_47,
218
+ ._Input--readOnly_3pq3z_91 > select._Input-input_3pq3z_47 {
218
219
  background-color: var(--puck-color-grey-11);
219
220
  border-color: var(--puck-color-grey-09);
220
221
  color: var(--puck-color-grey-04);
@@ -223,34 +224,34 @@ select._Input-input_1qi5b_46 {
223
224
  outline: 0;
224
225
  transition: none;
225
226
  }
226
- ._Input-radioGroupItems_1qi5b_101 {
227
+ ._Input-radioGroupItems_3pq3z_102 {
227
228
  display: flex;
228
229
  border: 1px solid var(--puck-color-grey-09);
229
230
  border-radius: 4px;
230
231
  flex-wrap: wrap;
231
232
  }
232
- ._Input-radio_1qi5b_101 {
233
+ ._Input-radio_3pq3z_102 {
233
234
  border-right: 1px solid var(--puck-color-grey-09);
234
235
  flex-grow: 1;
235
236
  }
236
- ._Input-radio_1qi5b_101:first-of-type {
237
+ ._Input-radio_3pq3z_102:first-of-type {
237
238
  border-bottom-left-radius: 4px;
238
239
  border-top-left-radius: 4px;
239
240
  }
240
- ._Input-radio_1qi5b_101:first-of-type ._Input-radioInner_1qi5b_118 {
241
+ ._Input-radio_3pq3z_102:first-of-type ._Input-radioInner_3pq3z_119 {
241
242
  border-bottom-left-radius: 3px;
242
243
  border-top-left-radius: 3px;
243
244
  }
244
- ._Input-radio_1qi5b_101:last-of-type {
245
+ ._Input-radio_3pq3z_102:last-of-type {
245
246
  border-bottom-right-radius: 4px;
246
247
  border-right: 0;
247
248
  border-top-right-radius: 4px;
248
249
  }
249
- ._Input-radio_1qi5b_101:last-of-type ._Input-radioInner_1qi5b_118 {
250
+ ._Input-radio_3pq3z_102:last-of-type ._Input-radioInner_3pq3z_119 {
250
251
  border-bottom-right-radius: 3px;
251
252
  border-top-right-radius: 3px;
252
253
  }
253
- ._Input-radioInner_1qi5b_118 {
254
+ ._Input-radioInner_3pq3z_119 {
254
255
  background-color: var(--puck-color-white);
255
256
  color: var(--puck-color-grey-04);
256
257
  cursor: pointer;
@@ -259,32 +260,32 @@ select._Input-input_1qi5b_46 {
259
260
  text-align: center;
260
261
  transition: background-color 50ms ease-in;
261
262
  }
262
- ._Input-radio_1qi5b_101:has(:focus-visible) {
263
+ ._Input-radio_3pq3z_102:has(:focus-visible) {
263
264
  outline: 2px solid var(--puck-color-azure-05);
264
265
  outline-offset: 2px;
265
266
  position: relative;
266
267
  }
267
268
  @media (hover: hover) and (pointer: fine) {
268
- ._Input-radioInner_1qi5b_118:hover {
269
+ ._Input-radioInner_3pq3z_119:hover {
269
270
  background-color: var(--puck-color-azure-12);
270
271
  transition: none;
271
272
  }
272
273
  }
273
- ._Input--readOnly_1qi5b_90 ._Input-radioInner_1qi5b_118 {
274
+ ._Input--readOnly_3pq3z_91 ._Input-radioInner_3pq3z_119 {
274
275
  background-color: var(--puck-color-white);
275
276
  color: var(--puck-color-grey-04);
276
277
  cursor: default;
277
278
  }
278
- ._Input-radio_1qi5b_101 ._Input-radioInput_1qi5b_163:checked ~ ._Input-radioInner_1qi5b_118 {
279
+ ._Input-radio_3pq3z_102 ._Input-radioInput_3pq3z_164:checked ~ ._Input-radioInner_3pq3z_119 {
279
280
  background-color: var(--puck-color-azure-11);
280
281
  color: var(--puck-color-azure-04);
281
282
  font-weight: 500;
282
283
  }
283
- ._Input--readOnly_1qi5b_90 ._Input-radioInput_1qi5b_163:checked ~ ._Input-radioInner_1qi5b_118 {
284
+ ._Input--readOnly_3pq3z_91 ._Input-radioInput_3pq3z_164:checked ~ ._Input-radioInner_3pq3z_119 {
284
285
  background-color: var(--puck-color-grey-11);
285
286
  color: var(--puck-color-grey-04);
286
287
  }
287
- ._Input-radio_1qi5b_101 ._Input-radioInput_1qi5b_163 {
288
+ ._Input-radio_3pq3z_102 ._Input-radioInput_3pq3z_164 {
288
289
  clip: rect(0 0 0 0);
289
290
  clip-path: inset(100%);
290
291
  height: 1px;
@@ -293,7 +294,7 @@ select._Input-input_1qi5b_46 {
293
294
  white-space: nowrap;
294
295
  width: 1px;
295
296
  }
296
- textarea._Input-input_1qi5b_46 {
297
+ textarea._Input-input_3pq3z_47 {
297
298
  margin-bottom: -4px;
298
299
  }
299
300
 
@@ -1680,7 +1681,7 @@ textarea._Input-input_1qi5b_46 {
1680
1681
  }
1681
1682
 
1682
1683
  /* css-module:/home/runner/work/puck/puck/packages/core/components/ViewportControls/styles.module.css/#css-module-data */
1683
- ._ViewportControls_3zdvn_1 {
1684
+ ._ViewportControls_g1wgg_1 {
1684
1685
  display: flex;
1685
1686
  background: var(--puck-color-grey-11);
1686
1687
  box-sizing: border-box;
@@ -1693,12 +1694,12 @@ textarea._Input-input_1qi5b_46 {
1693
1694
  padding-right: var(--puck-space-px);
1694
1695
  z-index: 1;
1695
1696
  }
1696
- ._ViewportControls-divider_3zdvn_15 {
1697
+ ._ViewportControls-divider_g1wgg_15 {
1697
1698
  border-right: 1px solid var(--puck-color-grey-09);
1698
1699
  margin-left: 8px;
1699
1700
  margin-right: 8px;
1700
1701
  }
1701
- ._ViewportControls-zoomSelect_3zdvn_21 {
1702
+ ._ViewportControls-zoomSelect_g1wgg_21 {
1702
1703
  appearance: none;
1703
1704
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23c3c3c3'><polygon points='0,0 100,0 50,50'/></svg>") no-repeat;
1704
1705
  background-size: 10px;
@@ -1706,9 +1707,10 @@ textarea._Input-input_1qi5b_46 {
1706
1707
  background-repeat: no-repeat;
1707
1708
  border: 0;
1708
1709
  font-size: var(--puck-font-size-xxxs);
1710
+ padding: 0;
1709
1711
  width: 96px;
1710
1712
  }
1711
- ._ViewportButton--isActive_3zdvn_33 ._ViewportButton-inner_3zdvn_33 {
1713
+ ._ViewportButton--isActive_g1wgg_34 ._ViewportButton-inner_g1wgg_34 {
1712
1714
  color: var(--puck-color-azure-04);
1713
1715
  }
1714
1716
 
package/dist/index.js CHANGED
@@ -29207,7 +29207,7 @@ var get_class_name_factory_default = getClassNameFactory;
29207
29207
 
29208
29208
  // css-module:/home/runner/work/puck/puck/packages/core/components/AutoField/styles.module.css#css-module
29209
29209
  init_react_import();
29210
- var styles_module_default = { "Input": "_Input_1qi5b_1", "Input-label": "_Input-label_1qi5b_26", "Input-labelIcon": "_Input-labelIcon_1qi5b_34", "Input-disabledIcon": "_Input-disabledIcon_1qi5b_41", "Input-input": "_Input-input_1qi5b_46", "Input--readOnly": "_Input--readOnly_1qi5b_90", "Input-radioGroupItems": "_Input-radioGroupItems_1qi5b_101", "Input-radio": "_Input-radio_1qi5b_101", "Input-radioInner": "_Input-radioInner_1qi5b_118", "Input-radioInput": "_Input-radioInput_1qi5b_163" };
29210
+ var styles_module_default = { "Input": "_Input_3pq3z_1", "Input-label": "_Input-label_3pq3z_26", "Input-labelIcon": "_Input-labelIcon_3pq3z_35", "Input-disabledIcon": "_Input-disabledIcon_3pq3z_42", "Input-input": "_Input-input_3pq3z_47", "Input--readOnly": "_Input--readOnly_3pq3z_91", "Input-radioGroupItems": "_Input-radioGroupItems_3pq3z_102", "Input-radio": "_Input-radio_3pq3z_102", "Input-radioInner": "_Input-radioInner_3pq3z_119", "Input-radioInput": "_Input-radioInput_3pq3z_164" };
29211
29211
 
29212
29212
  // components/AutoField/index.tsx
29213
29213
  var import_react11 = require("react");
@@ -31408,6 +31408,8 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
31408
31408
  "No configuration for ",
31409
31409
  item.type
31410
31410
  ] });
31411
+ const componentConfig = config.components[item.type];
31412
+ const label = (_b = componentConfig == null ? void 0 : componentConfig["label"]) != null ? _b : item.type.toString();
31411
31413
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
31412
31414
  "div",
31413
31415
  {
@@ -31423,7 +31425,7 @@ function DropZoneEdit({ zone, allow, disallow, style }) {
31423
31425
  children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
31424
31426
  DraggableComponent,
31425
31427
  {
31426
- label: (_b = config.components[item.type]["label"]) != null ? _b : item.type.toString(),
31428
+ label,
31427
31429
  id: `draggable-${componentId}`,
31428
31430
  index: i,
31429
31431
  isSelected,
@@ -33080,6 +33082,8 @@ var LayerTree = ({
33080
33082
  const selectedItem = itemSelector && data ? getItem(itemSelector, data) : null;
33081
33083
  const isHovering = hoveringComponent === item.props.id;
33082
33084
  const childIsSelected = isChildOfZone(item, selectedItem, ctx);
33085
+ const componentConfig = config.components[item.type];
33086
+ const label2 = (_a = componentConfig == null ? void 0 : componentConfig["label"]) != null ? _a : item.type.toString();
33083
33087
  return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
33084
33088
  "li",
33085
33089
  {
@@ -33132,7 +33136,7 @@ var LayerTree = ({
33132
33136
  ),
33133
33137
  /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: getClassNameLayer("title"), children: [
33134
33138
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: getClassNameLayer("icon"), children: item.type === "Text" || item.type === "Heading" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Type, { size: "16" }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(LayoutGrid, { size: "16" }) }),
33135
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: getClassNameLayer("name"), children: (_a = config.components[item.type]["label"]) != null ? _a : item.type })
33139
+ /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: getClassNameLayer("name"), children: label2 })
33136
33140
  ] })
33137
33141
  ]
33138
33142
  }
@@ -33447,7 +33451,7 @@ var import_react28 = require("react");
33447
33451
 
33448
33452
  // css-module:/home/runner/work/puck/puck/packages/core/components/ViewportControls/styles.module.css#css-module
33449
33453
  init_react_import();
33450
- var styles_module_default19 = { "ViewportControls": "_ViewportControls_3zdvn_1", "ViewportControls-divider": "_ViewportControls-divider_3zdvn_15", "ViewportControls-zoomSelect": "_ViewportControls-zoomSelect_3zdvn_21", "ViewportButton--isActive": "_ViewportButton--isActive_3zdvn_33", "ViewportButton-inner": "_ViewportButton-inner_3zdvn_33" };
33454
+ var styles_module_default19 = { "ViewportControls": "_ViewportControls_g1wgg_1", "ViewportControls-divider": "_ViewportControls-divider_g1wgg_15", "ViewportControls-zoomSelect": "_ViewportControls-zoomSelect_g1wgg_21", "ViewportButton--isActive": "_ViewportButton--isActive_g1wgg_34", "ViewportButton-inner": "_ViewportButton-inner_g1wgg_34" };
33451
33455
 
33452
33456
  // components/ViewportControls/index.tsx
33453
33457
  var import_jsx_runtime34 = require("react/jsx-runtime");
@@ -33941,6 +33945,8 @@ function Puck({
33941
33945
  (0, import_react30.useEffect)(() => {
33942
33946
  setMounted(true);
33943
33947
  }, []);
33948
+ const selectedComponentConfig = selectedItem && config.components[selectedItem.type];
33949
+ const selectedComponentLabel = selectedItem ? (_a = selectedComponentConfig == null ? void 0 : selectedComponentConfig["label"]) != null ? _a : selectedItem.type.toString() : "";
33944
33950
  return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: `Puck ${getClassName26()}`, children: [
33945
33951
  /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
33946
33952
  AppProvider,
@@ -34149,7 +34155,7 @@ function Puck({
34149
34155
  noPadding: true,
34150
34156
  noBorderTop: true,
34151
34157
  showBreadcrumbs: true,
34152
- title: selectedItem ? (_a = config.components[selectedItem.type]["label"]) != null ? _a : selectedItem.type : "Page",
34158
+ title: selectedItem ? selectedComponentLabel : "Page",
34153
34159
  children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Fields, {})
34154
34160
  }
34155
34161
  ) })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@measured/puck",
3
- "version": "0.15.0",
3
+ "version": "0.15.1-canary.0daf478",
4
4
  "author": "Measured Corporation Ltd <hello@measured.co>",
5
5
  "repository": "measuredco/puck",
6
6
  "bugs": "https://github.com/measuredco/puck/issues",