@kubex/zinc 1.1.28 → 1.1.29
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/custom-elements-manifest.config.js +2 -2
- package/dist/custom-elements.json +1483 -17
- package/dist/vscode.html-custom-data.json +40 -1
- package/dist/web-types.json +124 -3
- package/dist/zn.d.ts +670 -14
- package/dist/zn.min.js +1305 -925
- package/docs/pages/components/flow-builder-troubleshooter-demo.njk +106 -78
- package/docs/pages/components/flow-builder.md +422 -66
- package/docs/pages/components/page-builder.md +167 -0
- package/package.json +1 -1
- package/src/components/datepicker/datepicker.scss +0 -10
- package/src/components/flow-builder/flow-builder.component.ts +377 -16
- package/src/components/flow-builder/flow-builder.scss +398 -250
- package/src/components/flow-builder/flow-builder.test.ts +241 -4
- package/src/components/flow-builder/flow-layout.ts +42 -17
- package/src/components/flow-builder/flow.types.ts +168 -43
- package/src/components/flow-builder/modules/flow-branch-conditions/flow-branch-conditions.component.ts +300 -0
- package/src/components/flow-builder/modules/flow-branch-conditions/flow-branch-conditions.scss +222 -0
- package/src/components/flow-builder/modules/flow-branch-conditions/flow-branch-conditions.test.ts +125 -0
- package/src/components/flow-builder/modules/flow-branch-conditions/index.ts +12 -0
- package/src/components/flow-builder/modules/flow-canvas/flow-canvas.component.ts +184 -26
- package/src/components/flow-builder/modules/flow-canvas/flow-canvas.scss +170 -120
- package/src/components/flow-builder/modules/flow-node/flow-node.scss +42 -42
- package/src/components/flow-builder/modules/flow-step/flow-step.component.ts +2 -1
- package/src/components/flow-builder/modules/flow-step/flow-step.scss +25 -17
- package/src/components/icon-picker/icon-picker.component.ts +20 -37
- package/src/components/icon-picker/icon-picker.scss +5 -45
- package/src/components/page-builder/index.ts +14 -0
- package/src/components/page-builder/modules/page-palette-item/index.ts +12 -0
- package/src/components/page-builder/modules/page-palette-item/page-palette-item.component.ts +71 -0
- package/src/components/page-builder/modules/page-palette-item/page-palette-item.scss +70 -0
- package/src/components/page-builder/modules/page-palette-item/page-palette-item.test.ts +20 -0
- package/src/components/page-builder/modules/page-section-card/index.ts +12 -0
- package/src/components/page-builder/modules/page-section-card/page-section-card.component.ts +93 -0
- package/src/components/page-builder/modules/page-section-card/page-section-card.scss +92 -0
- package/src/components/page-builder/modules/page-section-card/page-section-card.test.ts +50 -0
- package/src/components/page-builder/page-builder.component.ts +1053 -0
- package/src/components/page-builder/page-builder.scss +494 -0
- package/src/components/page-builder/page-builder.test.ts +464 -0
- package/src/components/page-builder/page-registry.ts +48 -0
- package/src/components/page-builder/page.types.ts +75 -0
- package/src/events/events.ts +2 -0
- package/src/events/zn-page-change.ts +9 -0
- package/src/events/zn-page-selection-change.ts +7 -0
- package/src/zinc.ts +4 -0
- package/web-test-runner.config.js +6 -1
|
@@ -34,6 +34,19 @@
|
|
|
34
34
|
&.resizing * {
|
|
35
35
|
cursor: nwse-resize !important;
|
|
36
36
|
}
|
|
37
|
+
|
|
38
|
+
// While a stray branch is live, everything is either a target (a node) or a cancel.
|
|
39
|
+
&.linking {
|
|
40
|
+
cursor: crosshair;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// While dragging a step, emphasise every "+" so the drop targets are obvious.
|
|
44
|
+
&.step-dragging .add-point {
|
|
45
|
+
color: rgb(var(--zn-panel));
|
|
46
|
+
background: rgb(var(--zn-color-primary));
|
|
47
|
+
border-style: solid;
|
|
48
|
+
box-shadow: 0 0 0 4px color-mix(in srgb, rgb(var(--zn-color-primary)) 22%, transparent);
|
|
49
|
+
}
|
|
37
50
|
}
|
|
38
51
|
|
|
39
52
|
.connections {
|
|
@@ -48,22 +61,22 @@
|
|
|
48
61
|
fill: none;
|
|
49
62
|
stroke: rgb(var(--zn-color-primary));
|
|
50
63
|
stroke-width: 2;
|
|
51
|
-
}
|
|
52
64
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
65
|
+
&--stub {
|
|
66
|
+
stroke: rgb(var(--zn-color-border-active));
|
|
67
|
+
stroke-dasharray: 4 4;
|
|
68
|
+
}
|
|
57
69
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
70
|
+
// The stray branch following the cursor while picking a node to attach to.
|
|
71
|
+
&--preview {
|
|
72
|
+
stroke-dasharray: 6 4;
|
|
73
|
+
}
|
|
62
74
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
75
|
+
// A wire that loops back to an earlier step — solid amber, so return paths
|
|
76
|
+
// stand out from the forward flow.
|
|
77
|
+
&--loop {
|
|
78
|
+
stroke: rgb(var(--zn-color-warning));
|
|
79
|
+
}
|
|
67
80
|
}
|
|
68
81
|
|
|
69
82
|
marker path {
|
|
@@ -75,11 +88,6 @@
|
|
|
75
88
|
}
|
|
76
89
|
}
|
|
77
90
|
|
|
78
|
-
// While a stray branch is live, everything is either a target (a node) or a cancel.
|
|
79
|
-
.viewport.linking {
|
|
80
|
-
cursor: crosshair;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
91
|
.add-point {
|
|
84
92
|
position: absolute;
|
|
85
93
|
top: 0;
|
|
@@ -118,14 +126,6 @@
|
|
|
118
126
|
}
|
|
119
127
|
}
|
|
120
128
|
|
|
121
|
-
// While dragging a step, emphasise every "+" so the drop targets are obvious.
|
|
122
|
-
.viewport.step-dragging .add-point {
|
|
123
|
-
color: rgb(var(--zn-panel));
|
|
124
|
-
background: rgb(var(--zn-color-primary));
|
|
125
|
-
border-style: solid;
|
|
126
|
-
box-shadow: 0 0 0 4px color-mix(in srgb, rgb(var(--zn-color-primary)) 22%, transparent);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
129
|
.layer {
|
|
130
130
|
position: absolute;
|
|
131
131
|
top: 0;
|
|
@@ -144,36 +144,6 @@
|
|
|
144
144
|
// Branch names rendered as a clickable pill on their branch; the wire drops
|
|
145
145
|
// into the pill's top and continues from its bottom. Clicking opens the editor;
|
|
146
146
|
// hovering slides out a delete button to the right.
|
|
147
|
-
.branch-pill-wrap {
|
|
148
|
-
position: absolute;
|
|
149
|
-
top: 0;
|
|
150
|
-
left: 0;
|
|
151
|
-
transform: translateX(-50%);
|
|
152
|
-
display: flex;
|
|
153
|
-
align-items: stretch;
|
|
154
|
-
|
|
155
|
-
// Invisible bridge so the cursor can travel from the pill to the delete
|
|
156
|
-
// button without the hover (and the button) disappearing.
|
|
157
|
-
&::after {
|
|
158
|
-
content: '';
|
|
159
|
-
position: absolute;
|
|
160
|
-
left: 100%;
|
|
161
|
-
top: 0;
|
|
162
|
-
width: 40px;
|
|
163
|
-
height: 100%;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// The reveal is slightly delayed so pills that shift under a stationary
|
|
167
|
-
// cursor (e.g. re-spreading after a sibling branch is deleted) don't flash
|
|
168
|
-
// their delete button; hiding stays immediate.
|
|
169
|
-
&:hover .branch-pill-delete {
|
|
170
|
-
opacity: 1;
|
|
171
|
-
transform: translate(0, -50%);
|
|
172
|
-
pointer-events: auto;
|
|
173
|
-
transition-delay: 0.15s;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
147
|
.branch-pill {
|
|
178
148
|
display: flex;
|
|
179
149
|
align-items: center;
|
|
@@ -226,34 +196,87 @@
|
|
|
226
196
|
background: color-mix(in srgb, rgb(var(--zn-color-warning)) 18%, rgb(var(--zn-panel)));
|
|
227
197
|
}
|
|
228
198
|
}
|
|
229
|
-
}
|
|
230
199
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
color: white;
|
|
250
|
-
cursor: pointer;
|
|
251
|
-
opacity: 0;
|
|
252
|
-
pointer-events: none;
|
|
253
|
-
transition: opacity 0.15s ease, transform 0.15s ease;
|
|
200
|
+
&-wrap {
|
|
201
|
+
position: absolute;
|
|
202
|
+
top: 0;
|
|
203
|
+
left: 0;
|
|
204
|
+
transform: translateX(-50%);
|
|
205
|
+
display: flex;
|
|
206
|
+
align-items: stretch;
|
|
207
|
+
|
|
208
|
+
// Invisible bridge so the cursor can travel from the pill to the delete
|
|
209
|
+
// button without the hover (and the button) disappearing.
|
|
210
|
+
&::after {
|
|
211
|
+
content: '';
|
|
212
|
+
position: absolute;
|
|
213
|
+
left: 100%;
|
|
214
|
+
top: 0;
|
|
215
|
+
width: 40px;
|
|
216
|
+
height: 100%;
|
|
217
|
+
}
|
|
254
218
|
|
|
255
|
-
|
|
256
|
-
|
|
219
|
+
// The reveal is slightly delayed so pills that shift under a stationary
|
|
220
|
+
// cursor (e.g. re-spreading after a sibling branch is deleted) don't flash
|
|
221
|
+
// their delete button; hiding stays immediate.
|
|
222
|
+
&:hover .branch-pill-delete {
|
|
223
|
+
opacity: 1;
|
|
224
|
+
transform: translate(0, -50%);
|
|
225
|
+
pointer-events: auto;
|
|
226
|
+
transition-delay: 0.15s;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// An orphaned branch's output port, on the pill's bottom edge — click to
|
|
231
|
+
// start a stray branch continuing from the pill, just like a node's port.
|
|
232
|
+
&-port {
|
|
233
|
+
position: absolute;
|
|
234
|
+
z-index: 1;
|
|
235
|
+
left: 50%;
|
|
236
|
+
bottom: 0;
|
|
237
|
+
transform: translate(-50%, 50%);
|
|
238
|
+
width: 11px;
|
|
239
|
+
height: 11px;
|
|
240
|
+
box-sizing: border-box;
|
|
241
|
+
border-radius: 50%;
|
|
242
|
+
background: rgb(var(--zn-panel));
|
|
243
|
+
border: 2px solid rgb(var(--zn-color-primary));
|
|
244
|
+
cursor: pointer;
|
|
245
|
+
transition: transform 0.12s ease, box-shadow 0.12s ease;
|
|
246
|
+
|
|
247
|
+
&:hover {
|
|
248
|
+
transform: translate(-50%, 50%) scale(1.35);
|
|
249
|
+
box-shadow: 0 0 0 4px color-mix(in srgb, rgb(var(--zn-color-primary)) 20%, transparent);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
// Slides out from behind the pill on hover; deletes the branch and its wire.
|
|
254
|
+
// Sits above the wrap's ::after hover bridge, which would otherwise swallow
|
|
255
|
+
// clicks (and the pointer cursor).
|
|
256
|
+
&-delete {
|
|
257
|
+
position: absolute;
|
|
258
|
+
z-index: 1;
|
|
259
|
+
left: calc(100% + 8px);
|
|
260
|
+
top: 50%;
|
|
261
|
+
transform: translate(-10px, -50%);
|
|
262
|
+
display: flex;
|
|
263
|
+
align-items: center;
|
|
264
|
+
justify-content: center;
|
|
265
|
+
width: 24px;
|
|
266
|
+
height: 24px;
|
|
267
|
+
padding: 0;
|
|
268
|
+
border: none;
|
|
269
|
+
border-radius: 50%;
|
|
270
|
+
background: rgb(var(--zn-color-error));
|
|
271
|
+
color: white;
|
|
272
|
+
cursor: pointer;
|
|
273
|
+
opacity: 0;
|
|
274
|
+
pointer-events: none;
|
|
275
|
+
transition: opacity 0.15s ease, transform 0.15s ease;
|
|
276
|
+
|
|
277
|
+
&:hover {
|
|
278
|
+
filter: brightness(1.1);
|
|
279
|
+
}
|
|
257
280
|
}
|
|
258
281
|
}
|
|
259
282
|
|
|
@@ -318,6 +341,33 @@
|
|
|
318
341
|
}
|
|
319
342
|
}
|
|
320
343
|
|
|
344
|
+
// Delete drop-zone, bottom-right while a node or step is being dragged.
|
|
345
|
+
.bin {
|
|
346
|
+
position: absolute;
|
|
347
|
+
right: 16px;
|
|
348
|
+
bottom: 16px;
|
|
349
|
+
z-index: 2;
|
|
350
|
+
display: flex;
|
|
351
|
+
align-items: center;
|
|
352
|
+
justify-content: center;
|
|
353
|
+
width: 48px;
|
|
354
|
+
height: 48px;
|
|
355
|
+
border-radius: 12px;
|
|
356
|
+
color: rgb(var(--zn-color-muted-text));
|
|
357
|
+
background: rgb(var(--zn-panel));
|
|
358
|
+
border: 1px dashed rgb(var(--zn-color-border-active));
|
|
359
|
+
box-shadow: 0 1px 3px rgba(var(--zn-shadow), 0.4);
|
|
360
|
+
transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
|
|
361
|
+
|
|
362
|
+
&--over {
|
|
363
|
+
color: rgb(var(--zn-panel));
|
|
364
|
+
background: rgb(var(--zn-color-error));
|
|
365
|
+
border-style: solid;
|
|
366
|
+
border-color: rgb(var(--zn-color-error));
|
|
367
|
+
transform: scale(1.12);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
|
|
321
371
|
.note {
|
|
322
372
|
position: absolute;
|
|
323
373
|
display: flex;
|
|
@@ -326,46 +376,46 @@
|
|
|
326
376
|
border: 1px solid #fde68a;
|
|
327
377
|
border-radius: 4px;
|
|
328
378
|
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
|
|
329
|
-
}
|
|
330
379
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
}
|
|
380
|
+
&__resize {
|
|
381
|
+
position: absolute;
|
|
382
|
+
right: 0;
|
|
383
|
+
bottom: 0;
|
|
384
|
+
width: 16px;
|
|
385
|
+
height: 16px;
|
|
386
|
+
cursor: nwse-resize;
|
|
387
|
+
// Visual corner grip.
|
|
388
|
+
background: linear-gradient(135deg, transparent 0 50%, #d9c64a 50% 60%, transparent 60% 70%, #d9c64a 70% 80%, transparent 80%);
|
|
389
|
+
}
|
|
341
390
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
}
|
|
391
|
+
&__bar {
|
|
392
|
+
display: flex;
|
|
393
|
+
justify-content: flex-end;
|
|
394
|
+
height: 20px;
|
|
395
|
+
cursor: grab;
|
|
396
|
+
}
|
|
348
397
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
}
|
|
398
|
+
&__close {
|
|
399
|
+
width: 20px;
|
|
400
|
+
height: 20px;
|
|
401
|
+
padding: 0;
|
|
402
|
+
font-size: 14px;
|
|
403
|
+
line-height: 1;
|
|
404
|
+
color: #92400e;
|
|
405
|
+
background: transparent;
|
|
406
|
+
cursor: pointer;
|
|
407
|
+
}
|
|
359
408
|
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
409
|
+
&__text {
|
|
410
|
+
flex: 1;
|
|
411
|
+
margin: 0;
|
|
412
|
+
padding: 0 10px 10px;
|
|
413
|
+
resize: none;
|
|
414
|
+
border: none;
|
|
415
|
+
outline: none;
|
|
416
|
+
background: transparent;
|
|
417
|
+
font: inherit;
|
|
418
|
+
font-size: 0.8125rem;
|
|
419
|
+
color: #713f12;
|
|
420
|
+
}
|
|
371
421
|
}
|
|
@@ -118,11 +118,6 @@ zn-menu-item.danger {
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
// Anchored at the card edge, at its horizontal position (set inline as left:%).
|
|
122
|
-
.port-wrap {
|
|
123
|
-
position: absolute;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
121
|
.port {
|
|
127
122
|
position: absolute;
|
|
128
123
|
left: 0;
|
|
@@ -135,46 +130,51 @@ zn-menu-item.danger {
|
|
|
135
130
|
border: 2px solid var(--node-accent);
|
|
136
131
|
box-sizing: border-box;
|
|
137
132
|
pointer-events: none;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
// Input ports ease in and out of the snap highlight with the same timing as
|
|
141
|
-
// the output ports' hover effect.
|
|
142
|
-
.port--in {
|
|
143
|
-
transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
|
|
144
|
-
}
|
|
145
133
|
|
|
146
|
-
//
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
134
|
+
// Input ports ease in and out of the snap highlight with the same timing as
|
|
135
|
+
// the output ports' hover effect.
|
|
136
|
+
&--in {
|
|
137
|
+
transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
|
|
138
|
+
|
|
139
|
+
// The snapped arrow lands on the input — light the port up while targeted.
|
|
140
|
+
:host([link-target]) & {
|
|
141
|
+
transform: translate(-50%, -50%) scale(1.4);
|
|
142
|
+
background: rgb(var(--zn-color-primary));
|
|
143
|
+
border-color: rgb(var(--zn-color-primary));
|
|
144
|
+
box-shadow: 0 0 0 4px color-mix(in srgb, rgb(var(--zn-color-primary)) 25%, transparent);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
153
147
|
|
|
154
|
-
// Output ports are the branch spawn points: hover to highlight, click to start
|
|
155
|
-
// a branch that follows the cursor to its target node.
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
148
|
+
// Output ports are the branch spawn points: hover to highlight, click to start
|
|
149
|
+
// a branch that follows the cursor to its target node.
|
|
150
|
+
&--out {
|
|
151
|
+
pointer-events: auto;
|
|
152
|
+
cursor: pointer;
|
|
153
|
+
transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
|
|
154
|
+
|
|
155
|
+
&:hover {
|
|
156
|
+
transform: translate(-50%, -50%) scale(1.4);
|
|
157
|
+
background: var(--node-accent);
|
|
158
|
+
box-shadow: 0 0 0 4px color-mix(in srgb, var(--node-accent) 25%, transparent);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
160
161
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
box-shadow: 0 0 0 4px color-mix(in srgb, var(--node-accent) 25%, transparent);
|
|
162
|
+
// Anchored at the card edge, at its horizontal position (set inline as left:%).
|
|
163
|
+
&-wrap {
|
|
164
|
+
position: absolute;
|
|
165
165
|
}
|
|
166
|
-
}
|
|
167
166
|
|
|
168
|
-
// Output labels (e.g. TRUE / FALSE) sit just below the card edge, beside the
|
|
169
|
-
// outgoing arrow — never overlapping the card content.
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
167
|
+
// Output labels (e.g. TRUE / FALSE) sit just below the card edge, beside the
|
|
168
|
+
// outgoing arrow — never overlapping the card content.
|
|
169
|
+
&-label {
|
|
170
|
+
position: absolute;
|
|
171
|
+
top: calc(var(--port-size) / 2 + 3px);
|
|
172
|
+
left: 8px;
|
|
173
|
+
font-size: 0.625rem;
|
|
174
|
+
font-weight: 600;
|
|
175
|
+
letter-spacing: 0.02em;
|
|
176
|
+
color: rgb(var(--zn-color-muted-text));
|
|
177
|
+
white-space: nowrap;
|
|
178
|
+
pointer-events: none;
|
|
179
|
+
}
|
|
180
180
|
}
|
|
@@ -20,7 +20,8 @@ import styles from './flow-step.scss';
|
|
|
20
20
|
* @event flow-step-drag - Emitted on dragstart with `detail.type`, so the builder can preview the drop.
|
|
21
21
|
* @event flow-step-drag-end - Emitted on dragend.
|
|
22
22
|
*
|
|
23
|
-
* @slot - The step's label.
|
|
23
|
+
* @slot - The step's label. May also hold `<zn-flow-filter>` declarations (never displayed)
|
|
24
|
+
* that drive the flow builder's built-in branch conditions editor.
|
|
24
25
|
*
|
|
25
26
|
* @csspart base - The row.
|
|
26
27
|
*/
|
|
@@ -32,21 +32,29 @@
|
|
|
32
32
|
display: none;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
35
|
+
.item {
|
|
36
|
+
&__icon {
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
flex: 0 0 auto;
|
|
41
|
+
width: 28px;
|
|
42
|
+
height: 28px;
|
|
43
|
+
border-radius: 6px;
|
|
44
|
+
color: var(--node-accent);
|
|
45
|
+
background: color-mix(in srgb, var(--node-accent) 14%, transparent);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&__label {
|
|
49
|
+
min-width: 0;
|
|
50
|
+
overflow: hidden;
|
|
51
|
+
text-overflow: ellipsis;
|
|
52
|
+
white-space: nowrap;
|
|
53
|
+
|
|
54
|
+
// Only slotted text is the label — nested declarations (<zn-flow-filter>
|
|
55
|
+
// and friends) are data for the flow builder, never displayed.
|
|
56
|
+
::slotted(*) {
|
|
57
|
+
display: none;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
52
60
|
}
|
|
@@ -217,16 +217,6 @@ export default class ZnIconPicker extends ZincElement implements ZincFormControl
|
|
|
217
217
|
this.openDialog();
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
-
private _handleTriggerKeyDown(event: KeyboardEvent) {
|
|
221
|
-
if (this.disabled) {
|
|
222
|
-
return;
|
|
223
|
-
}
|
|
224
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
225
|
-
event.preventDefault();
|
|
226
|
-
this._handleTriggerClick();
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
220
|
render() {
|
|
231
221
|
const hasLabel = !!this.label;
|
|
232
222
|
const hasHelpText = !!this.helpText;
|
|
@@ -242,34 +232,27 @@ export default class ZnIconPicker extends ZincElement implements ZincFormControl
|
|
|
242
232
|
</label>
|
|
243
233
|
|
|
244
234
|
<div part="form-control-input" class="form-control-input">
|
|
245
|
-
<
|
|
235
|
+
<zn-button
|
|
246
236
|
part="trigger"
|
|
247
|
-
class="icon-picker__trigger
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
icon-size="16"
|
|
267
|
-
@click="${this.handleClear}"
|
|
268
|
-
></zn-button>`
|
|
269
|
-
: html`
|
|
270
|
-
<span class="icon-picker__placeholder">Set an icon</span>`
|
|
271
|
-
}
|
|
272
|
-
</div>
|
|
237
|
+
class="icon-picker__trigger"
|
|
238
|
+
panel-bg
|
|
239
|
+
icon=${hasIcon ? this.icon : nothing}
|
|
240
|
+
icon-library=${hasIcon ? this.library : nothing}
|
|
241
|
+
icon-color=${(hasIcon && this.color) || nothing}
|
|
242
|
+
icon-size="24"
|
|
243
|
+
?disabled=${this.disabled}
|
|
244
|
+
@click=${this._handleTriggerClick}>
|
|
245
|
+
${hasIcon ? 'Click to edit' : 'Set an icon'}
|
|
246
|
+
</zn-button>
|
|
247
|
+
${hasIcon ? html`
|
|
248
|
+
<zn-button
|
|
249
|
+
class="icon-picker__clear"
|
|
250
|
+
color="transparent"
|
|
251
|
+
icon="close"
|
|
252
|
+
icon-size="16"
|
|
253
|
+
@click="${this.handleClear}"
|
|
254
|
+
></zn-button>
|
|
255
|
+
` : nothing}
|
|
273
256
|
</div>
|
|
274
257
|
|
|
275
258
|
${this.name ? html`
|
|
@@ -5,55 +5,15 @@
|
|
|
5
5
|
display: block;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
.
|
|
9
|
-
display:
|
|
8
|
+
.form-control-input {
|
|
9
|
+
display: flex;
|
|
10
10
|
align-items: center;
|
|
11
|
-
gap: var(--zn-spacing-small);
|
|
12
|
-
padding: var(--zn-spacing-small) var(--zn-spacing-medium);
|
|
13
|
-
border: solid var(--zn-input-border-width) var(--zn-input-border-color);
|
|
14
|
-
border-radius: var(--zn-input-border-radius-medium);
|
|
15
|
-
background-color: var(--zn-input-background-color);
|
|
16
|
-
cursor: pointer;
|
|
17
|
-
transition: var(--zn-transition-fast) border-color,
|
|
18
|
-
var(--zn-transition-fast) background-color;
|
|
19
|
-
font-family: var(--zn-input-font-family), sans-serif;
|
|
20
|
-
font-size: var(--zn-input-font-size-medium);
|
|
21
|
-
color: rgb(var(--zn-text-color));
|
|
22
|
-
user-select: none;
|
|
23
|
-
-webkit-user-select: none;
|
|
24
|
-
|
|
25
|
-
&:hover:not(.icon-picker__trigger--disabled) {
|
|
26
|
-
border-color: var(--zn-input-border-color-hover);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
&:focus-visible {
|
|
30
|
-
outline: none;
|
|
31
|
-
border-color: var(--zn-input-border-color-focus);
|
|
32
|
-
box-shadow: 0 0 0 var(--zn-focus-ring-width) var(--zn-input-focus-ring-color);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.icon-picker__trigger--disabled {
|
|
37
|
-
opacity: 0.5;
|
|
38
|
-
cursor: not-allowed;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.icon-picker__edit-text {
|
|
42
|
-
color: rgb(var(--zn-text-color));
|
|
43
|
-
font-size: var(--zn-font-size-medium);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.icon-picker__clear {
|
|
47
|
-
margin-left: auto;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.icon-picker__placeholder {
|
|
51
|
-
color: var(--zn-input-placeholder-color);
|
|
52
|
-
font-size: var(--zn-font-size-medium);
|
|
11
|
+
gap: var(--zn-spacing-x-small);
|
|
53
12
|
}
|
|
54
13
|
|
|
55
14
|
zn-dialog {
|
|
56
15
|
--width: min(80vw, 900px);
|
|
16
|
+
--icon-color: rgb(var(--zn-text));
|
|
57
17
|
}
|
|
58
18
|
|
|
59
19
|
.icon-picker__dialog-layout {
|
|
@@ -150,7 +110,7 @@ zn-dialog {
|
|
|
150
110
|
border: 2px solid transparent;
|
|
151
111
|
border-radius: var(--zn-border-radius);
|
|
152
112
|
background: transparent;
|
|
153
|
-
color:
|
|
113
|
+
color: var(--zn-text-color);
|
|
154
114
|
cursor: pointer;
|
|
155
115
|
transition: var(--zn-transition-fast) background-color,
|
|
156
116
|
var(--zn-transition-fast) border-color;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import ZnPageBuilder from './page-builder.component';
|
|
2
|
+
|
|
3
|
+
export * from './page-builder.component';
|
|
4
|
+
export * from './page.types';
|
|
5
|
+
export * from './page-registry';
|
|
6
|
+
export default ZnPageBuilder;
|
|
7
|
+
|
|
8
|
+
ZnPageBuilder.define('zn-page-builder');
|
|
9
|
+
|
|
10
|
+
declare global {
|
|
11
|
+
interface HTMLElementTagNameMap {
|
|
12
|
+
'zn-page-builder': ZnPageBuilder;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import ZnPagePaletteItem from './page-palette-item.component';
|
|
2
|
+
|
|
3
|
+
export * from './page-palette-item.component';
|
|
4
|
+
export default ZnPagePaletteItem;
|
|
5
|
+
|
|
6
|
+
ZnPagePaletteItem.define('zn-page-palette-item');
|
|
7
|
+
|
|
8
|
+
declare global {
|
|
9
|
+
interface HTMLElementTagNameMap {
|
|
10
|
+
'zn-page-palette-item': ZnPagePaletteItem;
|
|
11
|
+
}
|
|
12
|
+
}
|