@kubex/zinc 1.1.83 → 1.1.84
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.
|
@@ -47,6 +47,79 @@
|
|
|
47
47
|
}
|
|
48
48
|
]
|
|
49
49
|
},
|
|
50
|
+
{
|
|
51
|
+
"kind": "javascript-module",
|
|
52
|
+
"path": "components/action-bar/action-bar.js",
|
|
53
|
+
"declarations": [
|
|
54
|
+
{
|
|
55
|
+
"kind": "class",
|
|
56
|
+
"description": "",
|
|
57
|
+
"name": "ZnActionBar",
|
|
58
|
+
"cssProperties": [
|
|
59
|
+
{
|
|
60
|
+
"description": "An example CSS custom property.",
|
|
61
|
+
"name": "--example"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
"cssParts": [
|
|
65
|
+
{
|
|
66
|
+
"description": "The component's base wrapper.",
|
|
67
|
+
"name": "base"
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"slots": [
|
|
71
|
+
{
|
|
72
|
+
"description": "The default slot.",
|
|
73
|
+
"name": ""
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"description": "An example slot.",
|
|
77
|
+
"name": "example"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"members": [
|
|
81
|
+
{
|
|
82
|
+
"kind": "field",
|
|
83
|
+
"name": "localize",
|
|
84
|
+
"privacy": "private",
|
|
85
|
+
"readonly": true,
|
|
86
|
+
"default": "new LocalizeController(this)"
|
|
87
|
+
}
|
|
88
|
+
],
|
|
89
|
+
"events": [
|
|
90
|
+
{
|
|
91
|
+
"description": "Emitted as an example.",
|
|
92
|
+
"name": "zn-event-name"
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
"superclass": {
|
|
96
|
+
"name": "ZincElement",
|
|
97
|
+
"module": "/src/internal/zinc-element"
|
|
98
|
+
},
|
|
99
|
+
"summary": "Short summary of the component's intended use.",
|
|
100
|
+
"tagNameWithoutPrefix": "action-bar",
|
|
101
|
+
"tagName": "zn-action-bar",
|
|
102
|
+
"customElement": true,
|
|
103
|
+
"jsDoc": "/**\n * @summary Short summary of the component's intended use.\n * @documentation https://zinc.style/components/action-bar\n * @status experimental\n * @since 1.0\n *\n * @dependency zn-example\n *\n * @event zn-event-name - Emitted as an example.\n *\n * @slot - The default slot.\n * @slot example - An example slot.\n *\n * @csspart base - The component's base wrapper.\n *\n * @cssproperty --example - An example CSS custom property.\n */",
|
|
104
|
+
"documentation": "https://zinc.style/components/action-bar",
|
|
105
|
+
"status": "experimental",
|
|
106
|
+
"since": "1.0",
|
|
107
|
+
"dependencies": [
|
|
108
|
+
"zn-example"
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"exports": [
|
|
113
|
+
{
|
|
114
|
+
"kind": "js",
|
|
115
|
+
"name": "default",
|
|
116
|
+
"declaration": {
|
|
117
|
+
"name": "ZnActionBar",
|
|
118
|
+
"module": "components/action-bar/action-bar.js"
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
},
|
|
50
123
|
{
|
|
51
124
|
"kind": "javascript-module",
|
|
52
125
|
"path": "components/alert/alert.js",
|
|
@@ -241,79 +314,6 @@
|
|
|
241
314
|
}
|
|
242
315
|
]
|
|
243
316
|
},
|
|
244
|
-
{
|
|
245
|
-
"kind": "javascript-module",
|
|
246
|
-
"path": "components/action-bar/action-bar.js",
|
|
247
|
-
"declarations": [
|
|
248
|
-
{
|
|
249
|
-
"kind": "class",
|
|
250
|
-
"description": "",
|
|
251
|
-
"name": "ZnActionBar",
|
|
252
|
-
"cssProperties": [
|
|
253
|
-
{
|
|
254
|
-
"description": "An example CSS custom property.",
|
|
255
|
-
"name": "--example"
|
|
256
|
-
}
|
|
257
|
-
],
|
|
258
|
-
"cssParts": [
|
|
259
|
-
{
|
|
260
|
-
"description": "The component's base wrapper.",
|
|
261
|
-
"name": "base"
|
|
262
|
-
}
|
|
263
|
-
],
|
|
264
|
-
"slots": [
|
|
265
|
-
{
|
|
266
|
-
"description": "The default slot.",
|
|
267
|
-
"name": ""
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
"description": "An example slot.",
|
|
271
|
-
"name": "example"
|
|
272
|
-
}
|
|
273
|
-
],
|
|
274
|
-
"members": [
|
|
275
|
-
{
|
|
276
|
-
"kind": "field",
|
|
277
|
-
"name": "localize",
|
|
278
|
-
"privacy": "private",
|
|
279
|
-
"readonly": true,
|
|
280
|
-
"default": "new LocalizeController(this)"
|
|
281
|
-
}
|
|
282
|
-
],
|
|
283
|
-
"events": [
|
|
284
|
-
{
|
|
285
|
-
"description": "Emitted as an example.",
|
|
286
|
-
"name": "zn-event-name"
|
|
287
|
-
}
|
|
288
|
-
],
|
|
289
|
-
"superclass": {
|
|
290
|
-
"name": "ZincElement",
|
|
291
|
-
"module": "/src/internal/zinc-element"
|
|
292
|
-
},
|
|
293
|
-
"summary": "Short summary of the component's intended use.",
|
|
294
|
-
"tagNameWithoutPrefix": "action-bar",
|
|
295
|
-
"tagName": "zn-action-bar",
|
|
296
|
-
"customElement": true,
|
|
297
|
-
"jsDoc": "/**\n * @summary Short summary of the component's intended use.\n * @documentation https://zinc.style/components/action-bar\n * @status experimental\n * @since 1.0\n *\n * @dependency zn-example\n *\n * @event zn-event-name - Emitted as an example.\n *\n * @slot - The default slot.\n * @slot example - An example slot.\n *\n * @csspart base - The component's base wrapper.\n *\n * @cssproperty --example - An example CSS custom property.\n */",
|
|
298
|
-
"documentation": "https://zinc.style/components/action-bar",
|
|
299
|
-
"status": "experimental",
|
|
300
|
-
"since": "1.0",
|
|
301
|
-
"dependencies": [
|
|
302
|
-
"zn-example"
|
|
303
|
-
]
|
|
304
|
-
}
|
|
305
|
-
],
|
|
306
|
-
"exports": [
|
|
307
|
-
{
|
|
308
|
-
"kind": "js",
|
|
309
|
-
"name": "default",
|
|
310
|
-
"declaration": {
|
|
311
|
-
"name": "ZnActionBar",
|
|
312
|
-
"module": "components/action-bar/action-bar.js"
|
|
313
|
-
}
|
|
314
|
-
}
|
|
315
|
-
]
|
|
316
|
-
},
|
|
317
317
|
{
|
|
318
318
|
"kind": "javascript-module",
|
|
319
319
|
"path": "components/animated-button/animated-button.js",
|
|
@@ -45850,7 +45850,7 @@
|
|
|
45850
45850
|
"package": {
|
|
45851
45851
|
"name": "@kubex/zinc",
|
|
45852
45852
|
"description": "A collection of web components for building web applications based off of @shoelace-style/Shoelace",
|
|
45853
|
-
"version": "1.1.
|
|
45853
|
+
"version": "1.1.84",
|
|
45854
45854
|
"author": "",
|
|
45855
45855
|
"license": "MIT"
|
|
45856
45856
|
}
|
|
@@ -13,6 +13,17 @@
|
|
|
13
13
|
}
|
|
14
14
|
]
|
|
15
15
|
},
|
|
16
|
+
{
|
|
17
|
+
"name": "zn-action-bar",
|
|
18
|
+
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
|
|
19
|
+
"attributes": [],
|
|
20
|
+
"references": [
|
|
21
|
+
{
|
|
22
|
+
"name": "Documentation",
|
|
23
|
+
"url": "https://zinc.style/components/action-bar"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
16
27
|
{
|
|
17
28
|
"name": "zn-alert",
|
|
18
29
|
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
|
|
@@ -53,17 +64,6 @@
|
|
|
53
64
|
}
|
|
54
65
|
]
|
|
55
66
|
},
|
|
56
|
-
{
|
|
57
|
-
"name": "zn-action-bar",
|
|
58
|
-
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
|
|
59
|
-
"attributes": [],
|
|
60
|
-
"references": [
|
|
61
|
-
{
|
|
62
|
-
"name": "Documentation",
|
|
63
|
-
"url": "https://zinc.style/components/action-bar"
|
|
64
|
-
}
|
|
65
|
-
]
|
|
66
|
-
},
|
|
67
67
|
{
|
|
68
68
|
"name": "zn-animated-button",
|
|
69
69
|
"description": "\n---\n\n\n### **Methods:**\n - **purchase(): _void_** - Programmatically trigger the purchase flow\n- **setSuccess(): _void_** - Set the button to success state manually\n- **setFailure(message): _void_** - Set the button to failure state manually with optional error message\n- **reset(): _void_** - Reset the button to idle state",
|
package/dist/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@kubex/zinc",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.84",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -15,6 +15,28 @@
|
|
|
15
15
|
"events": [],
|
|
16
16
|
"js": { "properties": [], "events": [] }
|
|
17
17
|
},
|
|
18
|
+
{
|
|
19
|
+
"name": "zn-action-bar",
|
|
20
|
+
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
|
|
21
|
+
"doc-url": "",
|
|
22
|
+
"attributes": [],
|
|
23
|
+
"slots": [
|
|
24
|
+
{ "name": "", "description": "The default slot." },
|
|
25
|
+
{ "name": "example", "description": "An example slot." }
|
|
26
|
+
],
|
|
27
|
+
"events": [
|
|
28
|
+
{ "name": "zn-event-name", "description": "Emitted as an example." }
|
|
29
|
+
],
|
|
30
|
+
"js": {
|
|
31
|
+
"properties": [],
|
|
32
|
+
"events": [
|
|
33
|
+
{
|
|
34
|
+
"name": "zn-event-name",
|
|
35
|
+
"description": "Emitted as an example."
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
},
|
|
18
40
|
{
|
|
19
41
|
"name": "zn-alert",
|
|
20
42
|
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
|
|
@@ -83,28 +105,6 @@
|
|
|
83
105
|
]
|
|
84
106
|
}
|
|
85
107
|
},
|
|
86
|
-
{
|
|
87
|
-
"name": "zn-action-bar",
|
|
88
|
-
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Slots:**\n - _default_ - The default slot.\n- **example** - An example slot.\n\n### **CSS Properties:**\n - **--example** - An example CSS custom property. _(default: undefined)_\n\n### **CSS Parts:**\n - **base** - The component's base wrapper.",
|
|
89
|
-
"doc-url": "",
|
|
90
|
-
"attributes": [],
|
|
91
|
-
"slots": [
|
|
92
|
-
{ "name": "", "description": "The default slot." },
|
|
93
|
-
{ "name": "example", "description": "An example slot." }
|
|
94
|
-
],
|
|
95
|
-
"events": [
|
|
96
|
-
{ "name": "zn-event-name", "description": "Emitted as an example." }
|
|
97
|
-
],
|
|
98
|
-
"js": {
|
|
99
|
-
"properties": [],
|
|
100
|
-
"events": [
|
|
101
|
-
{
|
|
102
|
-
"name": "zn-event-name",
|
|
103
|
-
"description": "Emitted as an example."
|
|
104
|
-
}
|
|
105
|
-
]
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
108
|
{
|
|
109
109
|
"name": "zn-animated-button",
|
|
110
110
|
"description": "\n---\n\n\n### **Methods:**\n - **purchase(): _void_** - Programmatically trigger the purchase flow\n- **setSuccess(): _void_** - Set the button to success state manually\n- **setFailure(message): _void_** - Set the button to failure state manually with optional error message\n- **reset(): _void_** - Reset the button to idle state",
|
package/dist/zn.min.js
CHANGED
|
@@ -5590,7 +5590,7 @@ ${n}`:""}</li></ol>`};return t(0)}parseTable(o,t){this.index++;let r=[],n=[];for
|
|
|
5590
5590
|
</div>
|
|
5591
5591
|
${this.error?u`
|
|
5592
5592
|
<div part="error" class="preview__error">${this.error}</div>`:""}
|
|
5593
|
-
</div>`}};we.styles=T(N_),c([p()],we.prototype,"src",2),c([p({attribute:"frame-origin"})],we.prototype,"frameOrigin",2),c([p({attribute:"data-uri"})],we.prototype,"dataUri",2),c([p()],we.prototype,"watch",2),c([p({attribute:"refresh-on"})],we.prototype,"refreshOn",2),c([p({type:Number})],we.prototype,"debounce",2),c([p({type:Number})],we.prototype,"zoom",2),c([p({type:Number,attribute:"min-height"})],we.prototype,"minHeight",2),c([p({type:Boolean})],we.prototype,"fill",2),c([p({reflect:!0})],we.prototype,"device",2),c([p({reflect:!0})],we.prototype,"backdrop",2),c([p({type:Boolean,reflect:!0})],we.prototype,"interactive",2),c([F("iframe")],we.prototype,"frame",2),c([O()],we.prototype,"error",2),c([O()],we.prototype,"_contentHeight",2);var rg=we;we.define("zn-preview-frame");var O_=E`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}:host *,:host *::before,:host *::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host{display:block;--zn-theme-editor-controls-width:343px;height:100%}.editor{--controls-col:var(--zn-theme-editor-controls-width);display:flex;align-items:stretch;height:100%}.editor--controls-collapsed{--controls-col:0px}.editor--controls-collapsed .editor__controls{border-right:none}.editor--controls-collapsed .editor__controls-header,.editor--controls-collapsed .editor__controls-body{padding:0}:host([standalone]) .editor{background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;overflow:hidden}.editor__toolbar{display:flex;align-items:center;flex:0 0 auto;min-height:44px;gap:var(--zn-spacing-small);padding:var(--zn-spacing-small) var(--zn-spacing-medium);border-bottom:1px solid rgb(var(--zn-border-color))}.editor__toolbar-actions{display:flex;align-items:center;gap:var(--zn-spacing-small);margin-left:auto}.editor__caption{font-size:14px;font-weight:600;line-height:16px;color:rgb(var(--zn-text))}.editor__controls{position:relative;display:flex;flex-direction:column;flex:0 0 var(--controls-col);min-width:0;max-width:100%;background:rgb(var(--zn-panel));border-right:1px solid rgb(var(--zn-border-color));overflow:hidden;transition:flex-basis 0.2s ease}.editor__controls-inner{position:absolute;inset:0;display:flex;flex-direction:column}.editor__controls-header{display:flex;align-items:center;flex:0 0 auto;min-height:44px;padding:var(--zn-spacing-small) var(--zn-spacing-medium)}.editor__controls-body{display:flex;flex-direction:column;gap:var(--zn-spacing-medium);flex:1 1 auto;min-height:0}.editor__main{position:relative;display:flex;flex-direction:column;flex:1 1 auto;min-width:0;min-height:0}.editor__fields{display:flex;flex-direction:column;gap:var(--zn-spacing-medium);flex:1 1 auto;min-height:0;overflow-y:auto}::slotted(zn-collapsible){width:100%}.editor__fields--sections-only .editor__section:first-of-type{border-top:none}.editor__section{display:block;border-top:1px solid rgba(var(--zn-border-color),0.5)}.editor__section::part(header){align-items:center !important;padding-block:calc(var(--zn-base-px) * 2) !important}.editor__section::part(caption){font-size:14px;font-weight:600;line-height:16px;color:rgb(var(--zn-text))}.editor__section-fields{display:flex;flex-direction:column;gap:var(--zn-spacing-medium)}.editor__tabs{display:block}.editor__section-slot{padding-top:var(--zn-spacing-sm)}.editor__tab-panel{display:flex;flex-direction:column}.editor__footer{display:flex;flex:0 0 auto;gap:var(--zn-spacing-small);padding-top:var(--zn-spacing-small);border-top:1px solid rgb(var(--zn-border-color));margin-top:auto}.editor__preview{overflow:hidden;flex:1 1 auto;min-width:0;min-height:0;display:flex;flex-direction:column}.panel-toggle{position:absolute;top:50%;left:0;z-index:6;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:18px;height:44px;padding:0;border:1px solid rgb(var(--zn-border-color));border-left:0;border-radius:0 6px 6px 0;color:rgb(var(--zn-color-muted-text));background:rgb(var(--zn-panel));cursor:pointer;transition:left 0.2s ease,color 0.12s ease,border-color 0.12s ease}.panel-toggle:hover{color:rgb(var(--zn-text));background:rgba(var(--zn-border-color),0.4)}.panel-toggle--tucked{left:var(--zn-spacing-small);border-left:1px solid rgb(var(--zn-border-color));border-radius:6px}.editor__devices{display:flex;border:1px solid rgb(var(--zn-border-color));border-radius:4px;overflow:hidden}.editor__device,.editor__mode{display:flex;align-items:center;justify-content:center;width:30px;height:28px;padding:0;border:0;background:transparent;color:rgb(var(--zn-text));cursor:pointer}.editor__device+.editor__device{border-left:1px solid rgb(var(--zn-border-color))}.editor__device:hover,.editor__mode:hover{background:rgba(var(--zn-border-color),0.5)}.editor__device[aria-pressed=true]{background:rgb(var(--zn-primary));color:white}.editor__mode{border:1px solid rgb(var(--zn-border-color));border-radius:4px;margin-left:auto}.editor__sources{width:auto;max-width:160px}.editor__sources::part(form-control-label){position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.editor__error{padding:var(--zn-spacing-small);margin-bottom:var(--zn-spacing-small);border-radius:4px;background:rgba(var(--zn-color-error),0.1);border:1px solid rgb(var(--zn-color-error));color:rgb(var(--zn-color-error));font-size:0.8125rem}@media (max-width:768px){:host{height:auto}.editor{flex-direction:column;height:auto}.editor__fields,.editor__preview{overflow:visible}.editor__controls{flex-basis:auto;width:100%;border-right:none;border-bottom:1px solid rgb(var(--zn-border-color))}.editor__controls-inner{position:static}.editor--controls-collapsed .editor__controls{display:none}.editor__main{width:100%;padding-top:var(--zn-spacing-medium)}.panel-toggle{top:0;left:50%;width:44px;height:18px;border:1px solid rgb(var(--zn-border-color));border-top:0;border-radius:0 0 6px 6px;transform:translateX(-50%)}.panel-toggle--tucked{top:var(--zn-spacing-small);left:50%;border-top:1px solid rgb(var(--zn-border-color));border-radius:6px}}`;var HM=new Set(["zn-checkbox","zn-toggle"]),FM="(max-width: 768px)",BM=[{id:"desktop",icon:"monitor",label:"Desktop"},{id:"tablet",icon:"tablet",label:"Tablet"},{id:"mobile",icon:"smartphone",label:"Mobile"}];function VM(i){return i.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var Et=class extends k{constructor(){super(...arguments);this.src="";this.frameOrigin="";this.dataUri="";this.mode="light";this.device="desktop";this.minHeight=480;this.debounce=150;this.action="";this.saveDebounce=1e3;this.sections=[];this.sectionLayout="collapsible";this.sources=[];this.controlsCollapsed=!1;this.standalone=!1;this.controlsCaption="";this.previewCaption="";this.submitLabel="";this.manual=!1;this.error="";this._submitting=!1;this._sourceIndex=0;this.hasSlotController=new Q(this,"footer","[default]");this._saving=!1;this._saveQueued=!1;this._saveWaiters=[];this._narrowQuery=window.matchMedia(FM);this._wasNarrow=!1;this._mounted=!1;this._lastControls=[];this._controlsObserverConfig={childList:!0,subtree:!0};this._controlsObserver=new Lt(this,{target:null,config:this._controlsObserverConfig,callback:()=>this._pushIfControlsChanged()});this._modeValues={light:{},dark:{}};this._suppressDepth=0;this._openedInitialCollapsible=!1;this._onNarrowChange=t=>{t.matches&&!this._wasNarrow&&(this.controlsCollapsed=!0),this._wasNarrow=t.matches};this._onSubmit=()=>{if(!this._submitting){if(this._flushPendingEdit(),this._saveTimer&&(window.clearTimeout(this._saveTimer),this._saveTimer=void 0),!this.action){this.emit("zn-theme-submit",{detail:{values:this.values}});return}this._submitting=!0,this._awaitSave().then(t=>{t&&this.emit("zn-theme-submit",{detail:{values:this.values}})}).finally(()=>{this._submitting=!1})}};this._onControlChange=()=>{this._suppressDepth>0||(this._pushTimer&&window.clearTimeout(this._pushTimer),this._pushTimer=window.setTimeout(()=>{this._pushTimer=void 0,this._harvestInto(this.mode),this._push(),this._queueSave()},this.debounce))};this._onSlotChange=()=>{this._pushIfControlsChanged()};this._setDevice=t=>{this.device!==t&&(this.device=t,this._announce())};this._toggleMode=()=>{this._flushPendingEdit(),this.mode=this.mode==="dark"?"light":"dark",this._writeBack(),this._push()};this._onFrameError=t=>{this.error=t.detail.message??"Preview failed to render"};this._onSourceChange=t=>{let r=Number(t.target.value);Number.isNaN(r)||(this._sourceIndex=r)}}get values(){return{light:{...this._modeValues.light},dark:{...this._modeValues.dark}}}get activeValues(){return{...this._modeValues[this.mode]}}_controlSlots(){return[this.controlsSlot,...Array.from(this.sectionSlots??[])].filter(t=>!!t)}_harvestNamed(){let t=[];for(let r of this._controlSlots()){let n=r.assignedElements({flatten:!0});for(let a of n){let s=[a,...Array.from(a.querySelectorAll("[name]"))];for(let l of s){let d=l;!d.getAttribute?.("name")||d.disabled||t.push({name:d.getAttribute("name"),control:d})}}}return t}_hasAssignedControls(t){return Array.from(this.children).some(r=>r.getAttribute("slot")===t)}_isBooleanControl(t){return HM.has(t.tagName.toLowerCase())||t.type==="checkbox"}_readControlValue(t){return this._isBooleanControl(t)?!!t.checked:t.value}_seed(){for(let{name:t,control:r}of this._harvestNamed()){if(t in this._modeValues.light)continue;let n=this._readControlValue(r);this._modeValues.light[t]=n;let a=r.getAttribute("dark-value");this._modeValues.dark[t]=a===null?n:this._isBooleanControl(r)?a==="1"||a==="true":a}}_writeBack(t=this.mode){let r=!1;for(let{name:n,control:a}of this._harvestNamed()){if(!(n in this._modeValues[t]))continue;let s=this._modeValues[t][n],l=this._isBooleanControl(a),d=l?!!a.checked:a.value;(l?d===s:String(d)===String(s))||(r=!0,l?a.checked=!!s:a.value=s)}r&&(this._suppressDepth++,window.setTimeout(()=>{this._suppressDepth--},0))}_harvestInto(t){for(let{name:r,control:n}of this._harvestNamed())this._modeValues[t][r]=this._readControlValue(n)}connectedCallback(){super.connectedCallback(),this._controlsObserver.observe(this),this._narrowQuery.addEventListener("change",this._onNarrowChange),this._onNarrowChange(this._narrowQuery)}disconnectedCallback(){this._pushTimer&&window.clearTimeout(this._pushTimer),this._saveTimer&&window.clearTimeout(this._saveTimer),this._narrowQuery.removeEventListener("change",this._onNarrowChange),super.disconnectedCallback()}firstUpdated(){this._pushIfControlsChanged()}_push(){this.error="",this.frame?.setTheme({mode:this.mode,values:this.activeValues}),this._announce()}_queueSave(){!this.action||this.manual||(this._saveTimer&&window.clearTimeout(this._saveTimer),this._saveTimer=window.setTimeout(()=>{this._saveTimer=void 0,this._save()},this.saveDebounce))}async _save(){if(this._saving){this._saveQueued=!0;return}this._saving=!0;let t=!1;try{let r=new FormData;for(let a of["light","dark"])for(let[s,l]of Object.entries(this._modeValues[a]))r.append(`${a}[${s}]`,typeof l=="boolean"?l?"1":"":String(l??""));let n=await fetch(this.action,{method:"POST",credentials:"same-origin",body:r});if(!n.ok)throw new Error(await n.text()||n.statusText);this.error="",t=!0}catch(r){this._fail(r instanceof Error?r.message:String(r))}finally{if(this._saving=!1,this._saveQueued)this._saveQueued=!1,this._save();else{let r=this._saveWaiters;this._saveWaiters=[],r.forEach(n=>n(t))}}}_awaitSave(){return new Promise(t=>{this._saveWaiters.push(t),this._save()})}_pushIfControlsChanged(){this.requestUpdate();let t=this._harvestNamed().map(({control:n})=>n);(!this._mounted||t.length!==this._lastControls.length||t.some((n,a)=>n!==this._lastControls[a]))&&(this._flushPendingEdit(),this._mounted=!0,this._lastControls=t,this._seed(),this._writeBack(),this._push())}_flushPendingEdit(){this._pushTimer&&(window.clearTimeout(this._pushTimer),this._pushTimer=void 0,this._harvestInto(this.mode),this._queueSave())}_announce(){this.emit("zn-theme-change",{detail:{values:this.values,mode:this.mode,device:this.device}})}_fail(t){this.error=t,this.emit("zn-error",{detail:{message:t}})}_sourcesSafe(){return Array.isArray(this.sources)?this.sources:[]}_frameSrc(){let t=this._sourcesSafe();return t.length>0?(t[this._sourceIndex]??t[0]).src:this.src}_sectionsSafe(){return Array.isArray(this.sections)?this.sections:[]}_groupsFor(t){return Array.isArray(t?.groups)?t.groups:[]}_hasStructureAttributes(){return Array.from(this.children).some(t=>t.hasAttribute("group")||t.hasAttribute("category"))}_usesDerivedSections(){return this._sectionsSafe().length===0&&this._hasStructureAttributes()}_derive(){let t=new Set,r=l=>{let d=VM(l)||"group",h=d;for(let m=2;t.has(h);m++)h=`${d}-${m}`;return t.add(h),h},n=new Map,a=new Map,s=new Map;for(let l of Array.from(this.children)){let d=l.getAttribute("group")?.trim()??"",h=l.getAttribute("category")?.trim()??"";if(!d&&!h)continue;let m=d||h,f=n.get(m);if(f||(f={name:r(m),caption:m,groups:[]},n.set(m,f)),!d||!h){s.set(l,f.name);continue}let b=`${m}\0${h}`,g=a.get(b);g||(g=r(`${m}-${h}`),a.set(b,g),f.groups.push({name:g,caption:h})),s.set(l,g)}return{sections:Array.from(n.values()),assignments:s}}_effectiveSections(){return this._usesDerivedSections()?this._derive().sections:this._sectionsSafe()}_assignDerivedSlots(){if(this._usesDerivedSections())for(let[t,r]of this._derive().assignments)t.getAttribute("slot")!==r&&t.setAttribute("slot",r)}willUpdate(t){super.willUpdate(t),this._assignDerivedSlots()}_hasNestedGroups(){return this._effectiveSections().some(t=>this._groupsFor(t).length>0)}_visibleGroups(t){return this._groupsFor(t).filter(r=>this._hasAssignedControls(r.name))}_visibleSections(){let t=this._effectiveSections();return this._hasNestedGroups()?t.filter(r=>this._visibleGroups(r).length>0):t.filter(r=>this._hasAssignedControls(r.name))}_renderSections(){return this._visibleSections().map(t=>u`
|
|
5593
|
+
</div>`}};we.styles=T(N_),c([p()],we.prototype,"src",2),c([p({attribute:"frame-origin"})],we.prototype,"frameOrigin",2),c([p({attribute:"data-uri"})],we.prototype,"dataUri",2),c([p()],we.prototype,"watch",2),c([p({attribute:"refresh-on"})],we.prototype,"refreshOn",2),c([p({type:Number})],we.prototype,"debounce",2),c([p({type:Number})],we.prototype,"zoom",2),c([p({type:Number,attribute:"min-height"})],we.prototype,"minHeight",2),c([p({type:Boolean})],we.prototype,"fill",2),c([p({reflect:!0})],we.prototype,"device",2),c([p({reflect:!0})],we.prototype,"backdrop",2),c([p({type:Boolean,reflect:!0})],we.prototype,"interactive",2),c([F("iframe")],we.prototype,"frame",2),c([O()],we.prototype,"error",2),c([O()],we.prototype,"_contentHeight",2);var rg=we;we.define("zn-preview-frame");var O_=E`@keyframes rotate-gradient{from{--rotate:0deg}to{--rotate:360deg}}:host{text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;text-transform:none}:host *,:host *::before,:host *::after{box-sizing:border-box;border-width:0;border-style:solid;border-color:rgb(var(--zn-border-color))}[hidden]{display:none !important}.width-container,.form-container,.wide-form-container{height:100%;width:100%;margin:var(--zn-default-margin,0 auto)}.width-container{max-width:var(--zn-container)}.form-container{max-width:var(--zn-container-ph)}.wide-form-container{max-width:var(--zn-container-lg)}:host ::-webkit-scrollbar{width:5px;height:5px}:host{}:host ::-webkit-scrollbar-track{background:transparent}:host{}:host ::-webkit-scrollbar-thumb{background:rgba(var(--inverse-base),0.2);border-radius:5px}:host{}:host ::-webkit-scrollbar-thumb:hover{background:rgba(var(--inverse-base),0.6)}:host{display:block;--zn-theme-editor-controls-width:343px;height:100%}.editor{--controls-col:var(--zn-theme-editor-controls-width);display:flex;align-items:stretch;height:100%}.editor--controls-collapsed{--controls-col:0px}.editor--controls-collapsed .editor__controls{border-right:none}.editor--controls-collapsed .editor__controls-header,.editor--controls-collapsed .editor__controls-body{padding:0}:host([standalone]) .editor{background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));border-radius:8px;overflow:hidden}.editor__toolbar{display:flex;align-items:center;flex:0 0 auto;min-height:44px;gap:var(--zn-spacing-small);padding:var(--zn-spacing-small) var(--zn-spacing-medium);border-bottom:1px solid rgb(var(--zn-border-color))}.editor__toolbar-actions{display:flex;align-items:center;gap:var(--zn-spacing-small);margin-left:auto}.editor__caption{font-size:14px;font-weight:600;line-height:16px;color:rgb(var(--zn-text))}.editor__controls{--zn-active-nav-background:var(--zn-panel);position:relative;display:flex;flex-direction:column;flex:0 0 var(--controls-col);min-width:0;max-width:100%;background:rgb(var(--zn-panel));border-right:1px solid rgb(var(--zn-border-color));overflow:hidden;transition:flex-basis 0.2s ease}.editor__controls-inner{position:absolute;inset:0;display:flex;flex-direction:column}.editor__controls-header{display:flex;align-items:center;flex:0 0 auto;min-height:44px;padding:var(--zn-spacing-small) var(--zn-spacing-medium)}.editor__controls-body{display:flex;flex-direction:column;gap:var(--zn-spacing-medium);flex:1 1 auto;min-height:0}.editor__main{position:relative;display:flex;flex-direction:column;flex:1 1 auto;min-width:0;min-height:0}.editor__fields{display:flex;flex-direction:column;gap:var(--zn-spacing-medium);flex:1 1 auto;min-height:0;overflow-y:auto}::slotted(zn-collapsible){width:100%}.editor__fields--sections-only .editor__section:first-of-type{border-top:none}.editor__section{display:block;border-top:1px solid rgba(var(--zn-border-color),0.5)}.editor__section::part(header){align-items:center !important;padding-block:calc(var(--zn-base-px) * 2) !important}.editor__section::part(caption){font-size:14px;font-weight:600;line-height:16px;color:rgb(var(--zn-text))}.editor__section-fields{display:flex;flex-direction:column;gap:var(--zn-spacing-medium)}.editor__tabs{display:block}.editor__section-slot{padding-top:var(--zn-spacing-sm)}.editor__tab-panel{display:flex;flex-direction:column}.editor__footer{display:flex;flex:0 0 auto;gap:var(--zn-spacing-small);padding-top:var(--zn-spacing-small);border-top:1px solid rgb(var(--zn-border-color));margin-top:auto}.editor__preview{overflow:hidden;flex:1 1 auto;min-width:0;min-height:0;display:flex;flex-direction:column}.panel-toggle{position:absolute;top:50%;z-index:6;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border-radius:50%;color:rgb(var(--zn-color-muted-text));background:rgb(var(--zn-panel));border:1px solid rgb(var(--zn-border-color));box-shadow:0 1px 3px rgba(var(--zn-shadow),0.4);cursor:pointer;transition:left 0.2s ease,right 0.2s ease,color 0.12s ease,border-color 0.12s ease}.panel-toggle:hover{color:rgb(var(--zn-text));border-color:rgb(var(--zn-color-border-active))}.panel-toggle--left{left:-12px}.panel-toggle--left.panel-toggle--tucked{left:8px}.editor__devices{display:flex;border:1px solid rgb(var(--zn-border-color));border-radius:4px;overflow:hidden}.editor__device,.editor__mode{display:flex;align-items:center;justify-content:center;width:30px;height:28px;padding:0;border:0;background:transparent;color:rgb(var(--zn-text));cursor:pointer}.editor__device+.editor__device{border-left:1px solid rgb(var(--zn-border-color))}.editor__device:hover,.editor__mode:hover{background:rgba(var(--zn-border-color),0.5)}.editor__device[aria-pressed=true]{background:rgb(var(--zn-primary));color:white}.editor__mode{border:1px solid rgb(var(--zn-border-color));border-radius:4px;margin-left:auto}.editor__sources{width:auto;max-width:160px}.editor__sources::part(form-control-label){position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.editor__error{padding:var(--zn-spacing-small);margin-bottom:var(--zn-spacing-small);border-radius:4px;background:rgba(var(--zn-color-error),0.1);border:1px solid rgb(var(--zn-color-error));color:rgb(var(--zn-color-error));font-size:0.8125rem}@media (max-width:768px){:host{height:auto}.editor{flex-direction:column;height:auto}.editor__fields,.editor__preview{overflow:visible}.editor__controls{flex-basis:auto;width:100%;border-right:none;border-bottom:1px solid rgb(var(--zn-border-color))}.editor__controls-inner{position:static}.editor--controls-collapsed .editor__controls{display:none}.editor__main{width:100%;padding-top:var(--zn-spacing-medium)}.panel-toggle{top:-12px;transform:translateX(-50%);transition:top 0.2s ease,color 0.12s ease,border-color 0.12s ease}.panel-toggle--left{left:50%}.panel-toggle--left.panel-toggle--tucked{top:8px;left:50%}}`;var HM=new Set(["zn-checkbox","zn-toggle"]),FM="(max-width: 768px)",BM=[{id:"desktop",icon:"monitor",label:"Desktop"},{id:"tablet",icon:"tablet",label:"Tablet"},{id:"mobile",icon:"smartphone",label:"Mobile"}];function VM(i){return i.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var Et=class extends k{constructor(){super(...arguments);this.src="";this.frameOrigin="";this.dataUri="";this.mode="light";this.device="desktop";this.minHeight=480;this.debounce=150;this.action="";this.saveDebounce=1e3;this.sections=[];this.sectionLayout="collapsible";this.sources=[];this.controlsCollapsed=!1;this.standalone=!1;this.controlsCaption="";this.previewCaption="";this.submitLabel="";this.manual=!1;this.error="";this._submitting=!1;this._sourceIndex=0;this.hasSlotController=new Q(this,"footer","[default]");this._saving=!1;this._saveQueued=!1;this._saveWaiters=[];this._narrowQuery=window.matchMedia(FM);this._wasNarrow=!1;this._mounted=!1;this._lastControls=[];this._controlsObserverConfig={childList:!0,subtree:!0};this._controlsObserver=new Lt(this,{target:null,config:this._controlsObserverConfig,callback:()=>this._pushIfControlsChanged()});this._modeValues={light:{},dark:{}};this._suppressDepth=0;this._openedInitialCollapsible=!1;this._onNarrowChange=t=>{t.matches&&!this._wasNarrow&&(this.controlsCollapsed=!0),this._wasNarrow=t.matches};this._onSubmit=()=>{if(!this._submitting){if(this._flushPendingEdit(),this._saveTimer&&(window.clearTimeout(this._saveTimer),this._saveTimer=void 0),!this.action){this.emit("zn-theme-submit",{detail:{values:this.values}});return}this._submitting=!0,this._awaitSave().then(t=>{t&&this.emit("zn-theme-submit",{detail:{values:this.values}})}).finally(()=>{this._submitting=!1})}};this._onControlChange=()=>{this._suppressDepth>0||(this._pushTimer&&window.clearTimeout(this._pushTimer),this._pushTimer=window.setTimeout(()=>{this._pushTimer=void 0,this._harvestInto(this.mode),this._push(),this._queueSave()},this.debounce))};this._onSlotChange=()=>{this._pushIfControlsChanged()};this._setDevice=t=>{this.device!==t&&(this.device=t,this._announce())};this._toggleMode=()=>{this._flushPendingEdit(),this.mode=this.mode==="dark"?"light":"dark",this._writeBack(),this._push()};this._onFrameError=t=>{this.error=t.detail.message??"Preview failed to render"};this._onSourceChange=t=>{let r=Number(t.target.value);Number.isNaN(r)||(this._sourceIndex=r)}}get values(){return{light:{...this._modeValues.light},dark:{...this._modeValues.dark}}}get activeValues(){return{...this._modeValues[this.mode]}}_controlSlots(){return[this.controlsSlot,...Array.from(this.sectionSlots??[])].filter(t=>!!t)}_harvestNamed(){let t=[];for(let r of this._controlSlots()){let n=r.assignedElements({flatten:!0});for(let a of n){let s=[a,...Array.from(a.querySelectorAll("[name]"))];for(let l of s){let d=l;!d.getAttribute?.("name")||d.disabled||t.push({name:d.getAttribute("name"),control:d})}}}return t}_hasAssignedControls(t){return Array.from(this.children).some(r=>r.getAttribute("slot")===t)}_isBooleanControl(t){return HM.has(t.tagName.toLowerCase())||t.type==="checkbox"}_readControlValue(t){return this._isBooleanControl(t)?!!t.checked:t.value}_seed(){for(let{name:t,control:r}of this._harvestNamed()){if(t in this._modeValues.light)continue;let n=this._readControlValue(r);this._modeValues.light[t]=n;let a=r.getAttribute("dark-value");this._modeValues.dark[t]=a===null?n:this._isBooleanControl(r)?a==="1"||a==="true":a}}_writeBack(t=this.mode){let r=!1;for(let{name:n,control:a}of this._harvestNamed()){if(!(n in this._modeValues[t]))continue;let s=this._modeValues[t][n],l=this._isBooleanControl(a),d=l?!!a.checked:a.value;(l?d===s:String(d)===String(s))||(r=!0,l?a.checked=!!s:a.value=s)}r&&(this._suppressDepth++,window.setTimeout(()=>{this._suppressDepth--},0))}_harvestInto(t){for(let{name:r,control:n}of this._harvestNamed())this._modeValues[t][r]=this._readControlValue(n)}connectedCallback(){super.connectedCallback(),this._controlsObserver.observe(this),this._narrowQuery.addEventListener("change",this._onNarrowChange),this._onNarrowChange(this._narrowQuery)}disconnectedCallback(){this._pushTimer&&window.clearTimeout(this._pushTimer),this._saveTimer&&window.clearTimeout(this._saveTimer),this._narrowQuery.removeEventListener("change",this._onNarrowChange),super.disconnectedCallback()}firstUpdated(){this._pushIfControlsChanged()}_push(){this.error="",this.frame?.setTheme({mode:this.mode,values:this.activeValues}),this._announce()}_queueSave(){!this.action||this.manual||(this._saveTimer&&window.clearTimeout(this._saveTimer),this._saveTimer=window.setTimeout(()=>{this._saveTimer=void 0,this._save()},this.saveDebounce))}async _save(){if(this._saving){this._saveQueued=!0;return}this._saving=!0;let t=!1;try{let r=new FormData;for(let a of["light","dark"])for(let[s,l]of Object.entries(this._modeValues[a]))r.append(`${a}[${s}]`,typeof l=="boolean"?l?"1":"":String(l??""));let n=await fetch(this.action,{method:"POST",credentials:"same-origin",body:r});if(!n.ok)throw new Error(await n.text()||n.statusText);this.error="",t=!0}catch(r){this._fail(r instanceof Error?r.message:String(r))}finally{if(this._saving=!1,this._saveQueued)this._saveQueued=!1,this._save();else{let r=this._saveWaiters;this._saveWaiters=[],r.forEach(n=>n(t))}}}_awaitSave(){return new Promise(t=>{this._saveWaiters.push(t),this._save()})}_pushIfControlsChanged(){this.requestUpdate();let t=this._harvestNamed().map(({control:n})=>n);(!this._mounted||t.length!==this._lastControls.length||t.some((n,a)=>n!==this._lastControls[a]))&&(this._flushPendingEdit(),this._mounted=!0,this._lastControls=t,this._seed(),this._writeBack(),this._push())}_flushPendingEdit(){this._pushTimer&&(window.clearTimeout(this._pushTimer),this._pushTimer=void 0,this._harvestInto(this.mode),this._queueSave())}_announce(){this.emit("zn-theme-change",{detail:{values:this.values,mode:this.mode,device:this.device}})}_fail(t){this.error=t,this.emit("zn-error",{detail:{message:t}})}_sourcesSafe(){return Array.isArray(this.sources)?this.sources:[]}_frameSrc(){let t=this._sourcesSafe();return t.length>0?(t[this._sourceIndex]??t[0]).src:this.src}_sectionsSafe(){return Array.isArray(this.sections)?this.sections:[]}_groupsFor(t){return Array.isArray(t?.groups)?t.groups:[]}_hasStructureAttributes(){return Array.from(this.children).some(t=>t.hasAttribute("group")||t.hasAttribute("category"))}_usesDerivedSections(){return this._sectionsSafe().length===0&&this._hasStructureAttributes()}_derive(){let t=new Set,r=l=>{let d=VM(l)||"group",h=d;for(let m=2;t.has(h);m++)h=`${d}-${m}`;return t.add(h),h},n=new Map,a=new Map,s=new Map;for(let l of Array.from(this.children)){let d=l.getAttribute("group")?.trim()??"",h=l.getAttribute("category")?.trim()??"";if(!d&&!h)continue;let m=d||h,f=n.get(m);if(f||(f={name:r(m),caption:m,groups:[]},n.set(m,f)),!d||!h){s.set(l,f.name);continue}let b=`${m}\0${h}`,g=a.get(b);g||(g=r(`${m}-${h}`),a.set(b,g),f.groups.push({name:g,caption:h})),s.set(l,g)}return{sections:Array.from(n.values()),assignments:s}}_effectiveSections(){return this._usesDerivedSections()?this._derive().sections:this._sectionsSafe()}_assignDerivedSlots(){if(this._usesDerivedSections())for(let[t,r]of this._derive().assignments)t.getAttribute("slot")!==r&&t.setAttribute("slot",r)}willUpdate(t){super.willUpdate(t),this._assignDerivedSlots()}_hasNestedGroups(){return this._effectiveSections().some(t=>this._groupsFor(t).length>0)}_visibleGroups(t){return this._groupsFor(t).filter(r=>this._hasAssignedControls(r.name))}_visibleSections(){let t=this._effectiveSections();return this._hasNestedGroups()?t.filter(r=>this._visibleGroups(r).length>0):t.filter(r=>this._hasAssignedControls(r.name))}_renderSections(){return this._visibleSections().map(t=>u`
|
|
5594
5594
|
<zn-collapsible
|
|
5595
5595
|
class="editor__section"
|
|
5596
5596
|
part="section"
|
|
@@ -294,12 +294,14 @@ no dropdown rendered.
|
|
|
294
294
|
## Collapsing the controls column
|
|
295
295
|
|
|
296
296
|
Set `controls-collapsed` to hide the controls column, or click the chevron
|
|
297
|
-
toggle that
|
|
297
|
+
toggle that straddles the seam between the columns — the same edge chevron
|
|
298
|
+
the flow and page builders use for their side panels. Collapsing is purely a
|
|
298
299
|
layout change — it never affects harvested values or pushes a new theme to
|
|
299
|
-
the preview. Below the 768px stacked breakpoint the
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
300
|
+
the preview. Below the 768px stacked breakpoint the columns stack vertically
|
|
301
|
+
and the chevron attaches to the horizontal seam above the preview instead;
|
|
302
|
+
crossing into that breakpoint also auto-collapses the controls (once —
|
|
303
|
+
re-expanding while narrow is respected), and the toggle stays available to
|
|
304
|
+
bring them back.
|
|
303
305
|
|
|
304
306
|
## Standalone panel
|
|
305
307
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
@use "../../wc";
|
|
2
2
|
|
|
3
3
|
:host {
|
|
4
|
+
@include wc.scrollbars; // styles scrollbars of all descendant scroll areas (controls column), as the other builders do
|
|
4
5
|
display: block;
|
|
5
6
|
// Matches page-builder's --palette-col.
|
|
6
7
|
--zn-theme-editor-controls-width: 343px;
|
|
@@ -65,6 +66,10 @@
|
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
.editor__controls {
|
|
69
|
+
// Colour the tab strip's active tab to match the controls panel surface,
|
|
70
|
+
// rather than the navbar's default body colour (flow-builder pattern).
|
|
71
|
+
--zn-active-nav-background: var(--zn-panel);
|
|
72
|
+
|
|
68
73
|
position: relative;
|
|
69
74
|
display: flex;
|
|
70
75
|
flex-direction: column;
|
|
@@ -192,39 +197,41 @@
|
|
|
192
197
|
flex-direction: column;
|
|
193
198
|
}
|
|
194
199
|
|
|
195
|
-
//
|
|
196
|
-
//
|
|
197
|
-
// centred on the full-height seam rather than
|
|
198
|
-
//
|
|
200
|
+
// Chevron straddling the controls/main seam — tuck the controls away / bring
|
|
201
|
+
// them back (flow-builder pattern). Positioned against .editor__main (not
|
|
202
|
+
// .editor__preview) so it stays centred on the full-height seam rather than
|
|
203
|
+
// just the preview's portion of it.
|
|
199
204
|
.panel-toggle {
|
|
200
205
|
position: absolute;
|
|
201
206
|
top: 50%;
|
|
202
|
-
left: 0;
|
|
203
207
|
z-index: 6;
|
|
204
208
|
transform: translateY(-50%);
|
|
205
209
|
display: flex;
|
|
206
210
|
align-items: center;
|
|
207
211
|
justify-content: center;
|
|
208
|
-
width:
|
|
209
|
-
height:
|
|
212
|
+
width: 24px;
|
|
213
|
+
height: 24px;
|
|
210
214
|
padding: 0;
|
|
211
|
-
border:
|
|
212
|
-
border-left: 0;
|
|
213
|
-
border-radius: 0 6px 6px 0;
|
|
215
|
+
border-radius: 50%;
|
|
214
216
|
color: rgb(var(--zn-color-muted-text));
|
|
215
217
|
background: rgb(var(--zn-panel));
|
|
218
|
+
border: 1px solid rgb(var(--zn-border-color));
|
|
219
|
+
box-shadow: 0 1px 3px rgba(var(--zn-shadow), 0.4);
|
|
216
220
|
cursor: pointer;
|
|
217
|
-
transition: left 0.2s ease, color 0.12s ease, border-color 0.12s ease;
|
|
221
|
+
transition: left 0.2s ease, right 0.2s ease, color 0.12s ease, border-color 0.12s ease;
|
|
218
222
|
|
|
219
223
|
&:hover {
|
|
220
224
|
color: rgb(var(--zn-text));
|
|
221
|
-
|
|
225
|
+
border-color: rgb(var(--zn-color-border-active));
|
|
222
226
|
}
|
|
223
227
|
|
|
224
|
-
&--
|
|
225
|
-
left:
|
|
226
|
-
|
|
227
|
-
|
|
228
|
+
&--left {
|
|
229
|
+
left: -12px;
|
|
230
|
+
|
|
231
|
+
// With the panel tucked away, sit fully inside the preview column.
|
|
232
|
+
&.panel-toggle--tucked {
|
|
233
|
+
left: 8px;
|
|
234
|
+
}
|
|
228
235
|
}
|
|
229
236
|
}
|
|
230
237
|
|
|
@@ -336,22 +343,19 @@
|
|
|
336
343
|
padding-top: var(--zn-spacing-medium);
|
|
337
344
|
}
|
|
338
345
|
|
|
339
|
-
// Stacked: the seam is horizontal, so the
|
|
346
|
+
// Stacked: the seam is horizontal, so the chevron straddles the top edge instead.
|
|
340
347
|
.panel-toggle {
|
|
341
|
-
top:
|
|
342
|
-
left: 50%;
|
|
343
|
-
width: 44px;
|
|
344
|
-
height: 18px;
|
|
345
|
-
border: 1px solid rgb(var(--zn-border-color));
|
|
346
|
-
border-top: 0;
|
|
347
|
-
border-radius: 0 0 6px 6px;
|
|
348
|
+
top: -12px;
|
|
348
349
|
transform: translateX(-50%);
|
|
349
|
-
|
|
350
|
+
transition: top 0.2s ease, color 0.12s ease, border-color 0.12s ease;
|
|
350
351
|
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
352
|
+
&--left {
|
|
353
|
+
left: 50%;
|
|
354
|
+
|
|
355
|
+
&.panel-toggle--tucked {
|
|
356
|
+
top: 8px;
|
|
357
|
+
left: 50%;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
356
360
|
}
|
|
357
361
|
}
|