@kubex/zinc 1.1.88 → 1.1.89
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/dist/custom-elements.json +500 -500
- package/dist/vscode.html-custom-data.json +57 -57
- package/dist/web-types.json +147 -147
- package/dist/zn.min.js +1 -2
- package/package.json +1 -1
- package/src/components/theme-editor/theme-editor.component.ts +0 -1
- package/src/components/theme-editor/theme-editor.scss +0 -1
|
@@ -13,17 +13,6 @@
|
|
|
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
|
-
},
|
|
27
16
|
{
|
|
28
17
|
"name": "zn-alert",
|
|
29
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.",
|
|
@@ -64,6 +53,17 @@
|
|
|
64
53
|
}
|
|
65
54
|
]
|
|
66
55
|
},
|
|
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",
|
|
@@ -1428,6 +1428,52 @@
|
|
|
1428
1428
|
}
|
|
1429
1429
|
]
|
|
1430
1430
|
},
|
|
1431
|
+
{
|
|
1432
|
+
"name": "zn-editor",
|
|
1433
|
+
"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.",
|
|
1434
|
+
"attributes": [
|
|
1435
|
+
{ "name": "id", "values": [] },
|
|
1436
|
+
{ "name": "name", "values": [] },
|
|
1437
|
+
{ "name": "value", "values": [] },
|
|
1438
|
+
{
|
|
1439
|
+
"name": "interaction-type",
|
|
1440
|
+
"values": [{ "name": "ticket" }, { "name": "chat" }]
|
|
1441
|
+
},
|
|
1442
|
+
{ "name": "attachment-url", "values": [] },
|
|
1443
|
+
{ "name": "code-blocks", "values": [] },
|
|
1444
|
+
{ "name": "dividers", "values": [] },
|
|
1445
|
+
{ "name": "links", "values": [] },
|
|
1446
|
+
{ "name": "attachments", "values": [] },
|
|
1447
|
+
{ "name": "images", "values": [] },
|
|
1448
|
+
{ "name": "videos", "values": [] },
|
|
1449
|
+
{ "name": "dates", "values": [] },
|
|
1450
|
+
{ "name": "emojis", "values": [] },
|
|
1451
|
+
{ "name": "code", "values": [] },
|
|
1452
|
+
{ "name": "ai", "values": [] },
|
|
1453
|
+
{ "name": "ai-path", "values": [] },
|
|
1454
|
+
{
|
|
1455
|
+
"name": "store-key",
|
|
1456
|
+
"description": "Caches unsent content while typing and restores it when the editor next loads,\nso agent replies in tickets/chats survive reloads and navigation. Use a key\nunique to the conversation (e.g. the ticket ID). The cache is cleared on submit.",
|
|
1457
|
+
"values": []
|
|
1458
|
+
},
|
|
1459
|
+
{
|
|
1460
|
+
"name": "store-ttl",
|
|
1461
|
+
"description": "Cached-content expiry in seconds. Defaults to 1 day.",
|
|
1462
|
+
"values": []
|
|
1463
|
+
},
|
|
1464
|
+
{
|
|
1465
|
+
"name": "local-storage",
|
|
1466
|
+
"description": "Cache to localStorage instead of sessionStorage, persisting across tabs and browser restarts.",
|
|
1467
|
+
"values": []
|
|
1468
|
+
}
|
|
1469
|
+
],
|
|
1470
|
+
"references": [
|
|
1471
|
+
{
|
|
1472
|
+
"name": "Documentation",
|
|
1473
|
+
"url": "https://zinc.style/components/editor"
|
|
1474
|
+
}
|
|
1475
|
+
]
|
|
1476
|
+
},
|
|
1431
1477
|
{
|
|
1432
1478
|
"name": "zn-dropdown",
|
|
1433
1479
|
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Methods:**\n - **show()** - Opens the dropdown\n- **hide()** - Closes the dropdown\n- **reposition()** - Instructs the dropdown to reposition itself\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.",
|
|
@@ -1499,52 +1545,6 @@
|
|
|
1499
1545
|
}
|
|
1500
1546
|
]
|
|
1501
1547
|
},
|
|
1502
|
-
{
|
|
1503
|
-
"name": "zn-editor",
|
|
1504
|
-
"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.",
|
|
1505
|
-
"attributes": [
|
|
1506
|
-
{ "name": "id", "values": [] },
|
|
1507
|
-
{ "name": "name", "values": [] },
|
|
1508
|
-
{ "name": "value", "values": [] },
|
|
1509
|
-
{
|
|
1510
|
-
"name": "interaction-type",
|
|
1511
|
-
"values": [{ "name": "ticket" }, { "name": "chat" }]
|
|
1512
|
-
},
|
|
1513
|
-
{ "name": "attachment-url", "values": [] },
|
|
1514
|
-
{ "name": "code-blocks", "values": [] },
|
|
1515
|
-
{ "name": "dividers", "values": [] },
|
|
1516
|
-
{ "name": "links", "values": [] },
|
|
1517
|
-
{ "name": "attachments", "values": [] },
|
|
1518
|
-
{ "name": "images", "values": [] },
|
|
1519
|
-
{ "name": "videos", "values": [] },
|
|
1520
|
-
{ "name": "dates", "values": [] },
|
|
1521
|
-
{ "name": "emojis", "values": [] },
|
|
1522
|
-
{ "name": "code", "values": [] },
|
|
1523
|
-
{ "name": "ai", "values": [] },
|
|
1524
|
-
{ "name": "ai-path", "values": [] },
|
|
1525
|
-
{
|
|
1526
|
-
"name": "store-key",
|
|
1527
|
-
"description": "Caches unsent content while typing and restores it when the editor next loads,\nso agent replies in tickets/chats survive reloads and navigation. Use a key\nunique to the conversation (e.g. the ticket ID). The cache is cleared on submit.",
|
|
1528
|
-
"values": []
|
|
1529
|
-
},
|
|
1530
|
-
{
|
|
1531
|
-
"name": "store-ttl",
|
|
1532
|
-
"description": "Cached-content expiry in seconds. Defaults to 1 day.",
|
|
1533
|
-
"values": []
|
|
1534
|
-
},
|
|
1535
|
-
{
|
|
1536
|
-
"name": "local-storage",
|
|
1537
|
-
"description": "Cache to localStorage instead of sessionStorage, persisting across tabs and browser restarts.",
|
|
1538
|
-
"values": []
|
|
1539
|
-
}
|
|
1540
|
-
],
|
|
1541
|
-
"references": [
|
|
1542
|
-
{
|
|
1543
|
-
"name": "Documentation",
|
|
1544
|
-
"url": "https://zinc.style/components/editor"
|
|
1545
|
-
}
|
|
1546
|
-
]
|
|
1547
|
-
},
|
|
1548
1548
|
{
|
|
1549
1549
|
"name": "zn-empty-state",
|
|
1550
1550
|
"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.",
|
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.89",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -15,28 +15,6 @@
|
|
|
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
|
-
},
|
|
40
18
|
{
|
|
41
19
|
"name": "zn-alert",
|
|
42
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.",
|
|
@@ -105,6 +83,28 @@
|
|
|
105
83
|
]
|
|
106
84
|
}
|
|
107
85
|
},
|
|
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",
|
|
@@ -3304,6 +3304,130 @@
|
|
|
3304
3304
|
]
|
|
3305
3305
|
}
|
|
3306
3306
|
},
|
|
3307
|
+
{
|
|
3308
|
+
"name": "zn-editor",
|
|
3309
|
+
"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.",
|
|
3310
|
+
"doc-url": "",
|
|
3311
|
+
"attributes": [
|
|
3312
|
+
{ "name": "id", "value": { "type": "string" } },
|
|
3313
|
+
{ "name": "name", "value": { "type": "string" } },
|
|
3314
|
+
{ "name": "value", "value": { "type": "string" } },
|
|
3315
|
+
{
|
|
3316
|
+
"name": "interaction-type",
|
|
3317
|
+
"value": { "type": "'ticket' | 'chat'", "default": "'chat'" }
|
|
3318
|
+
},
|
|
3319
|
+
{ "name": "attachment-url", "value": { "type": "string" } },
|
|
3320
|
+
{
|
|
3321
|
+
"name": "code-blocks",
|
|
3322
|
+
"value": { "type": "boolean", "default": "false" }
|
|
3323
|
+
},
|
|
3324
|
+
{
|
|
3325
|
+
"name": "dividers",
|
|
3326
|
+
"value": { "type": "boolean", "default": "false" }
|
|
3327
|
+
},
|
|
3328
|
+
{
|
|
3329
|
+
"name": "links",
|
|
3330
|
+
"value": { "type": "boolean", "default": "false" }
|
|
3331
|
+
},
|
|
3332
|
+
{
|
|
3333
|
+
"name": "attachments",
|
|
3334
|
+
"value": { "type": "boolean", "default": "false" }
|
|
3335
|
+
},
|
|
3336
|
+
{
|
|
3337
|
+
"name": "images",
|
|
3338
|
+
"value": { "type": "boolean", "default": "false" }
|
|
3339
|
+
},
|
|
3340
|
+
{
|
|
3341
|
+
"name": "videos",
|
|
3342
|
+
"value": { "type": "boolean", "default": "false" }
|
|
3343
|
+
},
|
|
3344
|
+
{
|
|
3345
|
+
"name": "dates",
|
|
3346
|
+
"value": { "type": "boolean", "default": "false" }
|
|
3347
|
+
},
|
|
3348
|
+
{
|
|
3349
|
+
"name": "emojis",
|
|
3350
|
+
"value": { "type": "boolean", "default": "false" }
|
|
3351
|
+
},
|
|
3352
|
+
{
|
|
3353
|
+
"name": "code",
|
|
3354
|
+
"value": { "type": "boolean", "default": "false" }
|
|
3355
|
+
},
|
|
3356
|
+
{
|
|
3357
|
+
"name": "ai",
|
|
3358
|
+
"value": { "type": "boolean", "default": "false" }
|
|
3359
|
+
},
|
|
3360
|
+
{
|
|
3361
|
+
"name": "ai-path",
|
|
3362
|
+
"value": { "type": "string", "default": "''" }
|
|
3363
|
+
},
|
|
3364
|
+
{
|
|
3365
|
+
"name": "store-key",
|
|
3366
|
+
"description": "Caches unsent content while typing and restores it when the editor next loads,\nso agent replies in tickets/chats survive reloads and navigation. Use a key\nunique to the conversation (e.g. the ticket ID). The cache is cleared on submit.",
|
|
3367
|
+
"value": { "type": "string", "default": "\"\"" }
|
|
3368
|
+
},
|
|
3369
|
+
{
|
|
3370
|
+
"name": "store-ttl",
|
|
3371
|
+
"description": "Cached-content expiry in seconds. Defaults to 1 day.",
|
|
3372
|
+
"value": { "type": "number", "default": "86400" }
|
|
3373
|
+
},
|
|
3374
|
+
{
|
|
3375
|
+
"name": "local-storage",
|
|
3376
|
+
"description": "Cache to localStorage instead of sessionStorage, persisting across tabs and browser restarts.",
|
|
3377
|
+
"value": { "type": "boolean" }
|
|
3378
|
+
}
|
|
3379
|
+
],
|
|
3380
|
+
"slots": [
|
|
3381
|
+
{ "name": "", "description": "The default slot." },
|
|
3382
|
+
{ "name": "example", "description": "An example slot." }
|
|
3383
|
+
],
|
|
3384
|
+
"events": [
|
|
3385
|
+
{ "name": "zn-event-name", "description": "Emitted as an example." }
|
|
3386
|
+
],
|
|
3387
|
+
"js": {
|
|
3388
|
+
"properties": [
|
|
3389
|
+
{ "name": "id", "type": "string" },
|
|
3390
|
+
{ "name": "name", "type": "string" },
|
|
3391
|
+
{ "name": "value", "type": "string" },
|
|
3392
|
+
{ "name": "interactionType", "type": "'ticket' | 'chat'" },
|
|
3393
|
+
{ "name": "uploadAttachmentUrl", "type": "string" },
|
|
3394
|
+
{ "name": "codeBlocksEnabled", "type": "boolean" },
|
|
3395
|
+
{ "name": "dividersEnabled", "type": "boolean" },
|
|
3396
|
+
{ "name": "linksEnabled", "type": "boolean" },
|
|
3397
|
+
{ "name": "attachmentsEnabled", "type": "boolean" },
|
|
3398
|
+
{ "name": "imagesEnabled", "type": "boolean" },
|
|
3399
|
+
{ "name": "videosEnabled", "type": "boolean" },
|
|
3400
|
+
{ "name": "datesEnabled", "type": "boolean" },
|
|
3401
|
+
{ "name": "emojisEnabled", "type": "boolean" },
|
|
3402
|
+
{ "name": "codeEnabled", "type": "boolean" },
|
|
3403
|
+
{ "name": "aiEnabled", "type": "boolean" },
|
|
3404
|
+
{ "name": "aiPath", "type": "string" },
|
|
3405
|
+
{
|
|
3406
|
+
"name": "storeKey",
|
|
3407
|
+
"description": "Caches unsent content while typing and restores it when the editor next loads,\nso agent replies in tickets/chats survive reloads and navigation. Use a key\nunique to the conversation (e.g. the ticket ID). The cache is cleared on submit.",
|
|
3408
|
+
"type": "string"
|
|
3409
|
+
},
|
|
3410
|
+
{
|
|
3411
|
+
"name": "storeTtl",
|
|
3412
|
+
"description": "Cached-content expiry in seconds. Defaults to 1 day.",
|
|
3413
|
+
"type": "number"
|
|
3414
|
+
},
|
|
3415
|
+
{
|
|
3416
|
+
"name": "localStorage",
|
|
3417
|
+
"description": "Cache to localStorage instead of sessionStorage, persisting across tabs and browser restarts.",
|
|
3418
|
+
"type": "boolean"
|
|
3419
|
+
},
|
|
3420
|
+
{ "name": "validity", "type": "ValidityState" },
|
|
3421
|
+
{ "name": "validationMessage", "type": "string" }
|
|
3422
|
+
],
|
|
3423
|
+
"events": [
|
|
3424
|
+
{
|
|
3425
|
+
"name": "zn-event-name",
|
|
3426
|
+
"description": "Emitted as an example."
|
|
3427
|
+
}
|
|
3428
|
+
]
|
|
3429
|
+
}
|
|
3430
|
+
},
|
|
3307
3431
|
{
|
|
3308
3432
|
"name": "zn-dropdown",
|
|
3309
3433
|
"description": "Short summary of the component's intended use.\n---\n\n\n### **Events:**\n - **zn-event-name** - Emitted as an example.\n\n### **Methods:**\n - **show()** - Opens the dropdown\n- **hide()** - Closes the dropdown\n- **reposition()** - Instructs the dropdown to reposition itself\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.",
|
|
@@ -3430,130 +3554,6 @@
|
|
|
3430
3554
|
]
|
|
3431
3555
|
}
|
|
3432
3556
|
},
|
|
3433
|
-
{
|
|
3434
|
-
"name": "zn-editor",
|
|
3435
|
-
"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.",
|
|
3436
|
-
"doc-url": "",
|
|
3437
|
-
"attributes": [
|
|
3438
|
-
{ "name": "id", "value": { "type": "string" } },
|
|
3439
|
-
{ "name": "name", "value": { "type": "string" } },
|
|
3440
|
-
{ "name": "value", "value": { "type": "string" } },
|
|
3441
|
-
{
|
|
3442
|
-
"name": "interaction-type",
|
|
3443
|
-
"value": { "type": "'ticket' | 'chat'", "default": "'chat'" }
|
|
3444
|
-
},
|
|
3445
|
-
{ "name": "attachment-url", "value": { "type": "string" } },
|
|
3446
|
-
{
|
|
3447
|
-
"name": "code-blocks",
|
|
3448
|
-
"value": { "type": "boolean", "default": "false" }
|
|
3449
|
-
},
|
|
3450
|
-
{
|
|
3451
|
-
"name": "dividers",
|
|
3452
|
-
"value": { "type": "boolean", "default": "false" }
|
|
3453
|
-
},
|
|
3454
|
-
{
|
|
3455
|
-
"name": "links",
|
|
3456
|
-
"value": { "type": "boolean", "default": "false" }
|
|
3457
|
-
},
|
|
3458
|
-
{
|
|
3459
|
-
"name": "attachments",
|
|
3460
|
-
"value": { "type": "boolean", "default": "false" }
|
|
3461
|
-
},
|
|
3462
|
-
{
|
|
3463
|
-
"name": "images",
|
|
3464
|
-
"value": { "type": "boolean", "default": "false" }
|
|
3465
|
-
},
|
|
3466
|
-
{
|
|
3467
|
-
"name": "videos",
|
|
3468
|
-
"value": { "type": "boolean", "default": "false" }
|
|
3469
|
-
},
|
|
3470
|
-
{
|
|
3471
|
-
"name": "dates",
|
|
3472
|
-
"value": { "type": "boolean", "default": "false" }
|
|
3473
|
-
},
|
|
3474
|
-
{
|
|
3475
|
-
"name": "emojis",
|
|
3476
|
-
"value": { "type": "boolean", "default": "false" }
|
|
3477
|
-
},
|
|
3478
|
-
{
|
|
3479
|
-
"name": "code",
|
|
3480
|
-
"value": { "type": "boolean", "default": "false" }
|
|
3481
|
-
},
|
|
3482
|
-
{
|
|
3483
|
-
"name": "ai",
|
|
3484
|
-
"value": { "type": "boolean", "default": "false" }
|
|
3485
|
-
},
|
|
3486
|
-
{
|
|
3487
|
-
"name": "ai-path",
|
|
3488
|
-
"value": { "type": "string", "default": "''" }
|
|
3489
|
-
},
|
|
3490
|
-
{
|
|
3491
|
-
"name": "store-key",
|
|
3492
|
-
"description": "Caches unsent content while typing and restores it when the editor next loads,\nso agent replies in tickets/chats survive reloads and navigation. Use a key\nunique to the conversation (e.g. the ticket ID). The cache is cleared on submit.",
|
|
3493
|
-
"value": { "type": "string", "default": "\"\"" }
|
|
3494
|
-
},
|
|
3495
|
-
{
|
|
3496
|
-
"name": "store-ttl",
|
|
3497
|
-
"description": "Cached-content expiry in seconds. Defaults to 1 day.",
|
|
3498
|
-
"value": { "type": "number", "default": "86400" }
|
|
3499
|
-
},
|
|
3500
|
-
{
|
|
3501
|
-
"name": "local-storage",
|
|
3502
|
-
"description": "Cache to localStorage instead of sessionStorage, persisting across tabs and browser restarts.",
|
|
3503
|
-
"value": { "type": "boolean" }
|
|
3504
|
-
}
|
|
3505
|
-
],
|
|
3506
|
-
"slots": [
|
|
3507
|
-
{ "name": "", "description": "The default slot." },
|
|
3508
|
-
{ "name": "example", "description": "An example slot." }
|
|
3509
|
-
],
|
|
3510
|
-
"events": [
|
|
3511
|
-
{ "name": "zn-event-name", "description": "Emitted as an example." }
|
|
3512
|
-
],
|
|
3513
|
-
"js": {
|
|
3514
|
-
"properties": [
|
|
3515
|
-
{ "name": "id", "type": "string" },
|
|
3516
|
-
{ "name": "name", "type": "string" },
|
|
3517
|
-
{ "name": "value", "type": "string" },
|
|
3518
|
-
{ "name": "interactionType", "type": "'ticket' | 'chat'" },
|
|
3519
|
-
{ "name": "uploadAttachmentUrl", "type": "string" },
|
|
3520
|
-
{ "name": "codeBlocksEnabled", "type": "boolean" },
|
|
3521
|
-
{ "name": "dividersEnabled", "type": "boolean" },
|
|
3522
|
-
{ "name": "linksEnabled", "type": "boolean" },
|
|
3523
|
-
{ "name": "attachmentsEnabled", "type": "boolean" },
|
|
3524
|
-
{ "name": "imagesEnabled", "type": "boolean" },
|
|
3525
|
-
{ "name": "videosEnabled", "type": "boolean" },
|
|
3526
|
-
{ "name": "datesEnabled", "type": "boolean" },
|
|
3527
|
-
{ "name": "emojisEnabled", "type": "boolean" },
|
|
3528
|
-
{ "name": "codeEnabled", "type": "boolean" },
|
|
3529
|
-
{ "name": "aiEnabled", "type": "boolean" },
|
|
3530
|
-
{ "name": "aiPath", "type": "string" },
|
|
3531
|
-
{
|
|
3532
|
-
"name": "storeKey",
|
|
3533
|
-
"description": "Caches unsent content while typing and restores it when the editor next loads,\nso agent replies in tickets/chats survive reloads and navigation. Use a key\nunique to the conversation (e.g. the ticket ID). The cache is cleared on submit.",
|
|
3534
|
-
"type": "string"
|
|
3535
|
-
},
|
|
3536
|
-
{
|
|
3537
|
-
"name": "storeTtl",
|
|
3538
|
-
"description": "Cached-content expiry in seconds. Defaults to 1 day.",
|
|
3539
|
-
"type": "number"
|
|
3540
|
-
},
|
|
3541
|
-
{
|
|
3542
|
-
"name": "localStorage",
|
|
3543
|
-
"description": "Cache to localStorage instead of sessionStorage, persisting across tabs and browser restarts.",
|
|
3544
|
-
"type": "boolean"
|
|
3545
|
-
},
|
|
3546
|
-
{ "name": "validity", "type": "ValidityState" },
|
|
3547
|
-
{ "name": "validationMessage", "type": "string" }
|
|
3548
|
-
],
|
|
3549
|
-
"events": [
|
|
3550
|
-
{
|
|
3551
|
-
"name": "zn-event-name",
|
|
3552
|
-
"description": "Emitted as an example."
|
|
3553
|
-
}
|
|
3554
|
-
]
|
|
3555
|
-
}
|
|
3556
|
-
},
|
|
3557
3557
|
{
|
|
3558
3558
|
"name": "zn-empty-state",
|
|
3559
3559
|
"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.",
|
package/dist/zn.min.js
CHANGED
|
@@ -5573,7 +5573,7 @@ ${n}`:""}</li></ol>`};return t(0)}parseTable(o,t){this.index++;let r=[],n=[];for
|
|
|
5573
5573
|
</div>
|
|
5574
5574
|
${this.error?u`
|
|
5575
5575
|
<div part="error" class="preview__error">${this.error}</div>`:""}
|
|
5576
|
-
</div>`}};ze.styles=T(I_),c([p()],ze.prototype,"src",2),c([p({attribute:"frame-origin"})],ze.prototype,"frameOrigin",2),c([p({attribute:"data-uri"})],ze.prototype,"dataUri",2),c([p()],ze.prototype,"watch",2),c([p({attribute:"refresh-on"})],ze.prototype,"refreshOn",2),c([p({type:Number})],ze.prototype,"debounce",2),c([p({type:Number})],ze.prototype,"zoom",2),c([p({type:Number,attribute:"min-height"})],ze.prototype,"minHeight",2),c([p({type:Boolean})],ze.prototype,"fill",2),c([p({reflect:!0})],ze.prototype,"device",2),c([p({reflect:!0})],ze.prototype,"backdrop",2),c([p({type:Boolean,reflect:!0})],ze.prototype,"interactive",2),c([F("iframe")],ze.prototype,"frame",2),c([O()],ze.prototype,"error",2),c([O()],ze.prototype,"_contentHeight",2);var rg=ze;ze.define("zn-preview-frame");var N_=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);--navbar-page-inactive-tab-background:rgb(var(--zn-color-tab));--navbar-page-inactive-tab-filter:none;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__device[aria-pressed=true]{--zn-button-border-color:rgb(var(--zn-primary))}.editor__device[aria-pressed=true]::part(base){background:rgb(var(--zn-primary)) !important;color:white !important}.editor__mode{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 OM=new Set(["zn-checkbox","zn-toggle"]),PM="(max-width: 768px)",HM=[{id:"desktop",icon:"monitor",label:"Desktop"},{id:"tablet",icon:"tablet",label:"Tablet"},{id:"mobile",icon:"smartphone",label:"Mobile"}];function FM(i){return i.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var Et=class extends C{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(PM);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 OM.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=FM(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`
|
|
5576
|
+
</div>`}};ze.styles=T(I_),c([p()],ze.prototype,"src",2),c([p({attribute:"frame-origin"})],ze.prototype,"frameOrigin",2),c([p({attribute:"data-uri"})],ze.prototype,"dataUri",2),c([p()],ze.prototype,"watch",2),c([p({attribute:"refresh-on"})],ze.prototype,"refreshOn",2),c([p({type:Number})],ze.prototype,"debounce",2),c([p({type:Number})],ze.prototype,"zoom",2),c([p({type:Number,attribute:"min-height"})],ze.prototype,"minHeight",2),c([p({type:Boolean})],ze.prototype,"fill",2),c([p({reflect:!0})],ze.prototype,"device",2),c([p({reflect:!0})],ze.prototype,"backdrop",2),c([p({type:Boolean,reflect:!0})],ze.prototype,"interactive",2),c([F("iframe")],ze.prototype,"frame",2),c([O()],ze.prototype,"error",2),c([O()],ze.prototype,"_contentHeight",2);var rg=ze;ze.define("zn-preview-frame");var N_=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);--navbar-page-inactive-tab-background:rgb(var(--zn-color-tab));--navbar-page-inactive-tab-filter:none;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__device[aria-pressed=true]{--zn-button-border-color:rgb(var(--zn-primary))}.editor__device[aria-pressed=true]::part(base){background:rgb(var(--zn-primary)) !important;color:white !important}.editor__mode{margin-left:auto}.editor__sources{width:auto}.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 OM=new Set(["zn-checkbox","zn-toggle"]),PM="(max-width: 768px)",HM=[{id:"desktop",icon:"monitor",label:"Desktop"},{id:"tablet",icon:"tablet",label:"Tablet"},{id:"mobile",icon:"smartphone",label:"Mobile"}];function FM(i){return i.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}var Et=class extends C{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(PM);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 OM.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=FM(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`
|
|
5577
5577
|
<zn-collapsible
|
|
5578
5578
|
class="editor__section"
|
|
5579
5579
|
part="section"
|
|
@@ -5667,7 +5667,6 @@ ${n}`:""}</li></ol>`};return t(0)}parseTable(o,t){this.index++;let r=[],n=[];for
|
|
|
5667
5667
|
${this._sourcesSafe().length>0?u`
|
|
5668
5668
|
<zn-select
|
|
5669
5669
|
class="editor__sources"
|
|
5670
|
-
size="small"
|
|
5671
5670
|
label="Preview source"
|
|
5672
5671
|
hoist
|
|
5673
5672
|
.value="${String(this._sourceIndex)}"
|
package/package.json
CHANGED