wicked-studio 0.14.1 → 0.15.0
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/README.md +6 -4
- package/dist/assets/KnowledgeGraph-Cpm46tEp.js +1 -0
- package/dist/assets/WickedSansA-Regular-CGPJLyb8.woff2 +0 -0
- package/dist/assets/WickedSansA-SemiBold-Bk9KXUaV.woff2 +0 -0
- package/dist/assets/favicon-BJA6hF2f.svg +1 -0
- package/dist/assets/index-BRBwWQMH.css +32 -0
- package/dist/assets/index-CVrWDGRP.js +1097 -0
- package/dist/assets/wicked-studio-lettering-small-CBwSGqop.svg +2 -0
- package/dist/assets/wicked-studio-wordmark-small-gF5xn6IC.svg +2 -0
- package/dist/editors/wicked-apps/editor.json +45 -0
- package/dist/editors/wicked-apps/icon.svg +1 -0
- package/dist/editors/wicked-apps/index.html +151 -0
- package/dist/editors/wicked-deck/editor.json +1 -1
- package/dist/editors/wicked-deck/index.html +12 -8
- package/dist/editors/wicked-doc/editor.json +1 -1
- package/dist/editors/wicked-doc/index.html +12 -8
- package/dist/editors/wicked-insights/editor.json +1 -1
- package/dist/editors/wicked-insights/index.html +1 -1
- package/dist/editors/wicked-page/editor.json +1 -1
- package/dist/editors/wicked-page/index.html +12 -8
- package/dist/editors/wicked-video/editor.json +1 -1
- package/dist/editors/wicked-video/index.html +1 -1
- package/dist/fonts/LICENSE-WickedSans.txt +97 -0
- package/dist/index.html +3 -2
- package/dist/testid-inventory.json +10850 -6700
- package/package.json +2 -2
- package/dist/assets/WickedSans-Regular-fb698rcD.woff2 +0 -0
- package/dist/assets/WickedSans-SemiBold-CD53n1AC.woff2 +0 -0
- package/dist/assets/index-BUZ_-Syk.css +0 -32
- package/dist/assets/index-u4O_7N-b.js +0 -986
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<!-- wicked brand (Wicked Studio, the lettering alone, small cut): Shoreline mark + Wave W lettering (fonts-v3, operator pick 2026-11-02). LICENSE part 3. -->
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="-8.7 -150 944.4 200" role="img" aria-label="Wicked Studio"><title>Wicked Studio</title><path fill="currentColor" d="M128.7 -100 128.3 -98.3Q131.3 -101.3 135.8 -101.3Q140.5 -101.3 143.5 -98.1Q146.5 -95 146.5 -90.4Q146.5 -85.7 143.5 -82.6Q140.5 -79.4 135.8 -79.4Q131.2 -79.4 128.1 -82.6Q126.2 -84.6 125.5 -87.2L111 -30.4Q107.5 -16.5 103.5 -9.2Q97.9 1.2 89.9 1.5Q81.8 1.8 75.5 -8.1Q71 -15.2 66.5 -28.8L62 -42.3L57.5 -28.8Q53 -15.2 48.5 -8.1Q42.2 1.8 34.1 1.5Q26.1 1.2 20.5 -9.2Q16.5 -16.5 13 -30.4L-4.7 -100H10.8L27.5 -34.1Q30.6 -22 33.7 -16.3Q34.2 -15.3 34.7 -14.6Q35.2 -15.3 35.8 -16.2Q39.3 -21.7 43.3 -33.5L62 -89.7L80.7 -33.5Q84.7 -21.7 88.2 -16.2Q88.8 -15.3 89.3 -14.6Q89.8 -15.3 90.3 -16.3Q93.4 -22 96.5 -34.1L113.2 -100ZM765.1 1.4Q755.5 1.4 748 -3.3Q740.4 -8 736.1 -16Q731.8 -24.1 731.8 -34.3Q731.8 -44.6 736.1 -52.6Q740.4 -60.7 748 -65.4Q755.5 -70.2 765.1 -70.2Q772.5 -70.2 778.3 -67.2Q781.7 -65.5 784.3 -63.1V-102.8H803.6V0H784.5V-5.9Q781.8 -3.4 778.4 -1.6Q772.5 1.4 765.1 1.4ZM424.1 1.4Q414.5 1.4 407 -3.3Q399.5 -8 395.1 -16Q390.8 -24.1 390.8 -34.3Q390.8 -44.6 395.1 -52.6Q399.5 -60.7 407 -65.4Q414.5 -70.2 424.1 -70.2Q431.5 -70.2 437.4 -67.2Q440.7 -65.5 443.3 -63.1V-102.8H462.6V0H443.5V-5.9Q440.9 -3.4 437.4 -1.6Q431.5 1.4 424.1 1.4ZM894.7 1.5Q884.3 1.5 875.9 -3.3Q867.6 -8 862.7 -16.2Q857.8 -24.4 857.8 -34.5Q857.8 -44.6 862.6 -52.7Q867.5 -60.7 875.9 -65.5Q884.3 -70.2 894.7 -70.2Q905.2 -70.2 913.6 -65.5Q921.9 -60.8 926.8 -52.7Q931.7 -44.6 931.7 -34.5Q931.7 -24.4 926.8 -16.2Q922 -8 913.6 -3.3Q905.2 1.5 894.7 1.5ZM544.5 1.5Q532.4 1.5 523.8 -2.6Q515.1 -6.7 508.1 -15L521.2 -28.1Q525.7 -22.3 531.6 -19.1Q537.4 -16 545.6 -16Q553.1 -16 557.5 -18.9Q561.8 -21.8 561.8 -26.9Q561.8 -31.3 559.2 -34.1Q556.7 -37 552.5 -38.9Q548.3 -40.8 543.2 -42.5Q538.2 -44.1 533.2 -46.3Q528.2 -48.5 524 -51.7Q519.8 -54.9 517.2 -60Q514.7 -65 514.7 -72.6Q514.7 -81.8 519.1 -88.2Q523.5 -94.7 531.3 -98.1Q539 -101.5 548.8 -101.5Q559.1 -101.5 567.4 -97.7Q575.8 -94 581.1 -87.8L568 -74.7Q563.6 -79.4 558.9 -81.7Q554.3 -84 548.4 -84Q541.9 -84 538.2 -81.5Q534.5 -79 534.5 -74.4Q534.5 -70.3 537.1 -67.8Q539.6 -65.3 543.8 -63.5Q548 -61.6 553 -59.9Q558.1 -58.2 563.1 -56Q568.1 -53.8 572.3 -50.4Q576.5 -47 579.1 -41.7Q581.6 -36.4 581.6 -28.5Q581.6 -14.5 571.7 -6.5Q561.8 1.5 544.5 1.5ZM347.6 1.5Q336.8 1.5 328.3 -3.1Q319.8 -7.7 314.9 -15.9Q310 -24.1 310 -34.4Q310 -44.6 314.8 -52.7Q319.6 -60.8 327.9 -65.5Q336.1 -70.2 346.3 -70.2Q356.3 -70.2 363.9 -65.8Q371.6 -61.4 375.9 -53.6Q380.3 -45.9 380.3 -35.9Q380.3 -34.1 380.1 -32.1Q379.9 -30.2 379.4 -27.8L329.3 -27.7Q329.9 -25.6 330.8 -23.8Q333.1 -19.3 337.4 -16.8Q341.7 -14.4 347.5 -14.4Q352.7 -14.4 357 -16.2Q361.2 -18 364.3 -21.5L375.5 -10.3Q370.4 -4.5 363.2 -1.5Q356 1.5 347.6 1.5ZM282.4 0 257.8 -33.4V0H238.5V-102.8H257.8V-37.3L282.2 -68.7H304.3L277.6 -36.1L305.7 0ZM686.8 1.5Q677.7 1.5 670.6 -2.4Q663.5 -6.3 659.5 -13.1Q655.5 -19.9 655.5 -28.9V-68.7H674.8V-29.3Q674.8 -25.1 676.2 -22.2Q677.6 -19.3 680.3 -17.7Q683.1 -16.1 686.8 -16.1Q692.4 -16.1 695.6 -19.6Q698.8 -23 698.8 -29.3V-68.7H718.1V-28.9Q718.1 -19.8 714.1 -13Q710.1 -6.2 703.1 -2.3Q696 1.5 686.8 1.5ZM197.7 1.5Q187.2 1.5 178.8 -3.2Q170.3 -7.9 165.5 -16Q160.6 -24.2 160.6 -34.3Q160.6 -44.6 165.5 -52.7Q170.4 -60.8 178.8 -65.5Q187.3 -70.2 197.8 -70.2Q205.9 -70.2 212.7 -67.3Q219.5 -64.4 224.6 -58.9L212.2 -46.4Q209.5 -49.4 205.9 -50.9Q202.3 -52.4 197.8 -52.4Q192.7 -52.4 188.8 -50.1Q184.8 -47.8 182.6 -43.8Q180.3 -39.8 180.3 -34.4Q180.3 -29.1 182.6 -25.1Q184.8 -21 188.8 -18.7Q192.8 -16.4 197.8 -16.4Q202.4 -16.4 206.1 -18Q209.7 -19.5 212.4 -22.6L224.8 -10.1Q219.6 -4.4 212.8 -1.5Q205.9 1.5 197.7 1.5ZM608.2 0V-52H592.2V-68.7H608.2V-97.2H627.5V-68.7H643.4V-52H627.5V0ZM126.1 0V-68.7H145.4V0ZM823.3 0V-68.7H842.6V0ZM894.7 -16.4Q899.8 -16.4 903.8 -18.7Q907.7 -20.9 909.8 -25.1Q912 -29.2 912 -34.5Q912 -39.8 909.8 -43.8Q907.5 -47.8 903.7 -50.1Q899.8 -52.4 894.7 -52.4Q889.7 -52.4 885.8 -50Q881.8 -47.7 879.7 -43.7Q877.5 -39.7 877.5 -34.4Q877.5 -29.2 879.7 -25.1Q881.8 -20.9 885.8 -18.7Q889.7 -16.4 894.7 -16.4ZM768.4 -16.3Q773.6 -16.3 777.4 -18.6Q781.2 -20.9 783.3 -24.9Q785.5 -29 785.5 -34.4Q785.5 -39.7 783.3 -43.8Q781.2 -47.8 777.4 -50.2Q773.6 -52.5 768.5 -52.5Q763.5 -52.5 759.7 -50.1Q755.8 -47.8 753.6 -43.7Q751.4 -39.7 751.4 -34.4Q751.4 -29.1 753.6 -25Q755.8 -20.9 759.6 -18.6Q763.5 -16.3 768.4 -16.3ZM427.5 -16.3Q432.6 -16.3 436.4 -18.6Q440.2 -20.9 442.3 -24.9Q444.5 -29 444.5 -34.4Q444.5 -39.7 442.3 -43.8Q440.2 -47.8 436.4 -50.2Q432.6 -52.5 427.5 -52.5Q422.5 -52.5 418.7 -50.1Q414.9 -47.8 412.6 -43.7Q410.4 -39.7 410.4 -34.4Q410.4 -29.1 412.6 -25Q414.8 -20.9 418.7 -18.6Q422.5 -16.3 427.5 -16.3ZM832.9 -79.4Q828.3 -79.4 825.3 -82.6Q822.2 -85.7 822.2 -90.4Q822.2 -95 825.3 -98.1Q828.3 -101.3 832.9 -101.3Q837.7 -101.3 840.7 -98.1Q843.7 -95 843.7 -90.4Q843.7 -85.7 840.7 -82.6Q837.7 -79.4 832.9 -79.4ZM329.3 -41.7 361.9 -41.8Q361.4 -44.2 360.5 -46.2Q358.6 -50.2 355.1 -52.4Q351.5 -54.5 346.3 -54.5Q340.9 -54.5 336.8 -52.1Q332.8 -49.7 330.6 -45.2Q329.8 -43.6 329.3 -41.7Z"/></svg>
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
<!-- wicked brand (Wicked Studio, about 11 px caps (studio's sidebar)): Shoreline mark + Wave W lettering (fonts-v3, operator pick 2026-11-02). LICENSE part 3. -->
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -150 1120.4 200" role="img" aria-label="Wicked Studio"><title>Wicked Studio</title><g transform="translate(0 -128.38) scale(4.38)"><g fill="none" stroke="currentColor" stroke-width="3.0" stroke-linecap="round" stroke-linejoin="round"><path d="M2.6 18.6 C5.9 15.7 9.1 15.7 12.5 18.3 C15.6 20.7 18.6 20.9 22.4 19.0"/><path d="M11.2 29.2 C15.6 24.4 21.4 22.6 29.4 22.6 V29.2 Z" fill="currentColor" stroke-width="1.5"/></g><circle cx="23.2" cy="8.4" r="3.9" fill="currentColor" stroke="none"/></g><path transform="translate(184.7 0)" fill="currentColor" d="M128.7 -100 128.3 -98.3Q131.3 -101.3 135.8 -101.3Q140.5 -101.3 143.5 -98.1Q146.5 -95 146.5 -90.4Q146.5 -85.7 143.5 -82.6Q140.5 -79.4 135.8 -79.4Q131.2 -79.4 128.1 -82.6Q126.2 -84.6 125.5 -87.2L111 -30.4Q107.5 -16.5 103.5 -9.2Q97.9 1.2 89.9 1.5Q81.8 1.8 75.5 -8.1Q71 -15.2 66.5 -28.8L62 -42.3L57.5 -28.8Q53 -15.2 48.5 -8.1Q42.2 1.8 34.1 1.5Q26.1 1.2 20.5 -9.2Q16.5 -16.5 13 -30.4L-4.7 -100H10.8L27.5 -34.1Q30.6 -22 33.7 -16.3Q34.2 -15.3 34.7 -14.6Q35.2 -15.3 35.8 -16.2Q39.3 -21.7 43.3 -33.5L62 -89.7L80.7 -33.5Q84.7 -21.7 88.2 -16.2Q88.8 -15.3 89.3 -14.6Q89.8 -15.3 90.3 -16.3Q93.4 -22 96.5 -34.1L113.2 -100ZM765.1 1.4Q755.5 1.4 748 -3.3Q740.4 -8 736.1 -16Q731.8 -24.1 731.8 -34.3Q731.8 -44.6 736.1 -52.6Q740.4 -60.7 748 -65.4Q755.5 -70.2 765.1 -70.2Q772.5 -70.2 778.3 -67.2Q781.7 -65.5 784.3 -63.1V-102.8H803.6V0H784.5V-5.9Q781.8 -3.4 778.4 -1.6Q772.5 1.4 765.1 1.4ZM424.1 1.4Q414.5 1.4 407 -3.3Q399.5 -8 395.1 -16Q390.8 -24.1 390.8 -34.3Q390.8 -44.6 395.1 -52.6Q399.5 -60.7 407 -65.4Q414.5 -70.2 424.1 -70.2Q431.5 -70.2 437.4 -67.2Q440.7 -65.5 443.3 -63.1V-102.8H462.6V0H443.5V-5.9Q440.9 -3.4 437.4 -1.6Q431.5 1.4 424.1 1.4ZM894.7 1.5Q884.3 1.5 875.9 -3.3Q867.6 -8 862.7 -16.2Q857.8 -24.4 857.8 -34.5Q857.8 -44.6 862.6 -52.7Q867.5 -60.7 875.9 -65.5Q884.3 -70.2 894.7 -70.2Q905.2 -70.2 913.6 -65.5Q921.9 -60.8 926.8 -52.7Q931.7 -44.6 931.7 -34.5Q931.7 -24.4 926.8 -16.2Q922 -8 913.6 -3.3Q905.2 1.5 894.7 1.5ZM544.5 1.5Q532.4 1.5 523.8 -2.6Q515.1 -6.7 508.1 -15L521.2 -28.1Q525.7 -22.3 531.6 -19.1Q537.4 -16 545.6 -16Q553.1 -16 557.5 -18.9Q561.8 -21.8 561.8 -26.9Q561.8 -31.3 559.2 -34.1Q556.7 -37 552.5 -38.9Q548.3 -40.8 543.2 -42.5Q538.2 -44.1 533.2 -46.3Q528.2 -48.5 524 -51.7Q519.8 -54.9 517.2 -60Q514.7 -65 514.7 -72.6Q514.7 -81.8 519.1 -88.2Q523.5 -94.7 531.3 -98.1Q539 -101.5 548.8 -101.5Q559.1 -101.5 567.4 -97.7Q575.8 -94 581.1 -87.8L568 -74.7Q563.6 -79.4 558.9 -81.7Q554.3 -84 548.4 -84Q541.9 -84 538.2 -81.5Q534.5 -79 534.5 -74.4Q534.5 -70.3 537.1 -67.8Q539.6 -65.3 543.8 -63.5Q548 -61.6 553 -59.9Q558.1 -58.2 563.1 -56Q568.1 -53.8 572.3 -50.4Q576.5 -47 579.1 -41.7Q581.6 -36.4 581.6 -28.5Q581.6 -14.5 571.7 -6.5Q561.8 1.5 544.5 1.5ZM347.6 1.5Q336.8 1.5 328.3 -3.1Q319.8 -7.7 314.9 -15.9Q310 -24.1 310 -34.4Q310 -44.6 314.8 -52.7Q319.6 -60.8 327.9 -65.5Q336.1 -70.2 346.3 -70.2Q356.3 -70.2 363.9 -65.8Q371.6 -61.4 375.9 -53.6Q380.3 -45.9 380.3 -35.9Q380.3 -34.1 380.1 -32.1Q379.9 -30.2 379.4 -27.8L329.3 -27.7Q329.9 -25.6 330.8 -23.8Q333.1 -19.3 337.4 -16.8Q341.7 -14.4 347.5 -14.4Q352.7 -14.4 357 -16.2Q361.2 -18 364.3 -21.5L375.5 -10.3Q370.4 -4.5 363.2 -1.5Q356 1.5 347.6 1.5ZM282.4 0 257.8 -33.4V0H238.5V-102.8H257.8V-37.3L282.2 -68.7H304.3L277.6 -36.1L305.7 0ZM686.8 1.5Q677.7 1.5 670.6 -2.4Q663.5 -6.3 659.5 -13.1Q655.5 -19.9 655.5 -28.9V-68.7H674.8V-29.3Q674.8 -25.1 676.2 -22.2Q677.6 -19.3 680.3 -17.7Q683.1 -16.1 686.8 -16.1Q692.4 -16.1 695.6 -19.6Q698.8 -23 698.8 -29.3V-68.7H718.1V-28.9Q718.1 -19.8 714.1 -13Q710.1 -6.2 703.1 -2.3Q696 1.5 686.8 1.5ZM197.7 1.5Q187.2 1.5 178.8 -3.2Q170.3 -7.9 165.5 -16Q160.6 -24.2 160.6 -34.3Q160.6 -44.6 165.5 -52.7Q170.4 -60.8 178.8 -65.5Q187.3 -70.2 197.8 -70.2Q205.9 -70.2 212.7 -67.3Q219.5 -64.4 224.6 -58.9L212.2 -46.4Q209.5 -49.4 205.9 -50.9Q202.3 -52.4 197.8 -52.4Q192.7 -52.4 188.8 -50.1Q184.8 -47.8 182.6 -43.8Q180.3 -39.8 180.3 -34.4Q180.3 -29.1 182.6 -25.1Q184.8 -21 188.8 -18.7Q192.8 -16.4 197.8 -16.4Q202.4 -16.4 206.1 -18Q209.7 -19.5 212.4 -22.6L224.8 -10.1Q219.6 -4.4 212.8 -1.5Q205.9 1.5 197.7 1.5ZM608.2 0V-52H592.2V-68.7H608.2V-97.2H627.5V-68.7H643.4V-52H627.5V0ZM126.1 0V-68.7H145.4V0ZM823.3 0V-68.7H842.6V0ZM894.7 -16.4Q899.8 -16.4 903.8 -18.7Q907.7 -20.9 909.8 -25.1Q912 -29.2 912 -34.5Q912 -39.8 909.8 -43.8Q907.5 -47.8 903.7 -50.1Q899.8 -52.4 894.7 -52.4Q889.7 -52.4 885.8 -50Q881.8 -47.7 879.7 -43.7Q877.5 -39.7 877.5 -34.4Q877.5 -29.2 879.7 -25.1Q881.8 -20.9 885.8 -18.7Q889.7 -16.4 894.7 -16.4ZM768.4 -16.3Q773.6 -16.3 777.4 -18.6Q781.2 -20.9 783.3 -24.9Q785.5 -29 785.5 -34.4Q785.5 -39.7 783.3 -43.8Q781.2 -47.8 777.4 -50.2Q773.6 -52.5 768.5 -52.5Q763.5 -52.5 759.7 -50.1Q755.8 -47.8 753.6 -43.7Q751.4 -39.7 751.4 -34.4Q751.4 -29.1 753.6 -25Q755.8 -20.9 759.6 -18.6Q763.5 -16.3 768.4 -16.3ZM427.5 -16.3Q432.6 -16.3 436.4 -18.6Q440.2 -20.9 442.3 -24.9Q444.5 -29 444.5 -34.4Q444.5 -39.7 442.3 -43.8Q440.2 -47.8 436.4 -50.2Q432.6 -52.5 427.5 -52.5Q422.5 -52.5 418.7 -50.1Q414.9 -47.8 412.6 -43.7Q410.4 -39.7 410.4 -34.4Q410.4 -29.1 412.6 -25Q414.8 -20.9 418.7 -18.6Q422.5 -16.3 427.5 -16.3ZM832.9 -79.4Q828.3 -79.4 825.3 -82.6Q822.2 -85.7 822.2 -90.4Q822.2 -95 825.3 -98.1Q828.3 -101.3 832.9 -101.3Q837.7 -101.3 840.7 -98.1Q843.7 -95 843.7 -90.4Q843.7 -85.7 840.7 -82.6Q837.7 -79.4 832.9 -79.4ZM329.3 -41.7 361.9 -41.8Q361.4 -44.2 360.5 -46.2Q358.6 -50.2 355.1 -52.4Q351.5 -54.5 346.3 -54.5Q340.9 -54.5 336.8 -52.1Q332.8 -49.7 330.6 -45.2Q329.8 -43.6 329.3 -41.7Z"/></svg>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "wicked-apps",
|
|
3
|
+
"title": "App",
|
|
4
|
+
"version": "0.15.0",
|
|
5
|
+
"protocol": [
|
|
6
|
+
1,
|
|
7
|
+
2
|
|
8
|
+
],
|
|
9
|
+
"kinds": [
|
|
10
|
+
"app"
|
|
11
|
+
],
|
|
12
|
+
"entry": "index.html",
|
|
13
|
+
"sizes": [
|
|
14
|
+
"inline",
|
|
15
|
+
"pane",
|
|
16
|
+
"full"
|
|
17
|
+
],
|
|
18
|
+
"permissions": [
|
|
19
|
+
{
|
|
20
|
+
"id": "artifact.read",
|
|
21
|
+
"why": "to show the app: its pages, components and layout"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "artifact.write",
|
|
25
|
+
"why": "to add, move, resize, change or delete a component in Edit, each burst one version with Undo"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"id": "selection.chip",
|
|
29
|
+
"why": "to make the component you select the subject of your next message"
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"surfaces": {
|
|
33
|
+
"card": {
|
|
34
|
+
"interactive": true,
|
|
35
|
+
"aspect": "16:9",
|
|
36
|
+
"actions": []
|
|
37
|
+
},
|
|
38
|
+
"full": {}
|
|
39
|
+
},
|
|
40
|
+
"description": "Opens apps: live dashboards and tools over your data, built by chat and by hand.",
|
|
41
|
+
"visuals": {
|
|
42
|
+
"icon": "icon.svg",
|
|
43
|
+
"color": "#0369a1"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><path d="M14 17.5h7M17.5 14v7"/></svg>
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="wicked-editor" content="wicked-apps">
|
|
6
|
+
<meta name="wicked-editor-version" content="0.15.0">
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
8
|
+
<title>App</title>
|
|
9
|
+
<!-- THE one stylesheet (DES-APPS-001 §7.1). The runtime adds its geometry and colours to THIS sheet through the CSSOM
|
|
10
|
+
only (runtime/sheet.ts); no element ever carries a style attribute. -->
|
|
11
|
+
<style id="wk-apps-sheet">
|
|
12
|
+
:root {
|
|
13
|
+
--surface-base: #ffffff; --surface-card: #f6f7f9; --surface-raised: #ffffff; --ink-high: #0d1117; --ink-body: #24292f;
|
|
14
|
+
--ink-muted: #5b6673; --border: #d5dae1; --accent: #224a5e; --accent-fg: #ffffff; --status-fail: #b4232c; --status-ok: #1a7f37;
|
|
15
|
+
--font-sans: system-ui, -apple-system, 'Segoe UI', sans-serif; --font-mono: ui-monospace, 'SF Mono', Menlo, monospace;
|
|
16
|
+
--s0: #4c9be8; --s1: #a78bfa; --s2: #f59e0b; --s3: #34d399; --s4: #f87171; --s5: #60a5fa;
|
|
17
|
+
--s6: #f472b6; --s7: #a3e635; --s8: #fb923c; --s9: #22d3ee; --s10: #c084fc; --s11: #94a3b8;
|
|
18
|
+
--row: 44px; --gap: 12px; --radius: 10px;
|
|
19
|
+
/* The app's own accent (theme.accent, set through the CSSOM) over the host's. */
|
|
20
|
+
--ui-accent: var(--app-accent, var(--accent));
|
|
21
|
+
}
|
|
22
|
+
* { box-sizing: border-box; }
|
|
23
|
+
[hidden] { display: none !important; }
|
|
24
|
+
html, body { height: 100%; margin: 0; }
|
|
25
|
+
body { font: 13px/1.4 var(--font-sans); color: var(--ink-high); background: var(--surface-base); overflow: hidden; }
|
|
26
|
+
.wk-app { display: flex; height: 100%; min-width: 0; }
|
|
27
|
+
.wk-main { flex: 1 1 auto; min-width: 0; overflow: auto; padding: 14px 18px 24px; }
|
|
28
|
+
.wk-app[data-mode="edit"] .wk-main {
|
|
29
|
+
background-image: radial-gradient(circle, color-mix(in srgb, var(--ink-muted) 28%, transparent) 1px, transparent 1px);
|
|
30
|
+
background-size: 16px 16px;
|
|
31
|
+
}
|
|
32
|
+
.wk-pages { display: flex; gap: 4px; margin: 0 0 12px; border-bottom: 1px solid var(--border); }
|
|
33
|
+
.wk-page { font: inherit; font-size: 14px; padding: 6px 10px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink-muted); cursor: pointer; }
|
|
34
|
+
.wk-page.is-on { color: var(--ink-high); border-bottom-color: var(--ink-high); font-weight: 600; }
|
|
35
|
+
.wk-page:focus-visible, .wk-btn:focus-visible, .wk-tile:focus-visible, .wk-link:focus-visible, .wk-cell:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 1px; }
|
|
36
|
+
.wk-grid { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: var(--row); gap: var(--gap); }
|
|
37
|
+
.wk-cell { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
|
|
38
|
+
background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; }
|
|
39
|
+
.wk-cell--filter, .wk-cell--button, .wk-cell--link, .wk-cell--text { background: none; border-color: transparent; padding: 4px 2px; }
|
|
40
|
+
.wk-cell-title { margin: 0 0 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-body); }
|
|
41
|
+
.wk-cell-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
|
|
42
|
+
.wk-cell.is-editable { cursor: grab; }
|
|
43
|
+
.wk-cell.is-editable:hover { border-color: color-mix(in srgb, var(--ui-accent) 55%, var(--border)); }
|
|
44
|
+
.wk-cell.is-dragging { cursor: grabbing; opacity: .85; z-index: 3; }
|
|
45
|
+
.wk-cell.is-selected { border: 2px solid var(--s0); padding: 9px 13px; z-index: 2; }
|
|
46
|
+
.wk-tag { position: absolute; right: 6px; top: 4px; display: none; font-size: 11px; padding: 1px 6px; border-radius: 4px;
|
|
47
|
+
background: var(--s0); color: #0b1a2a; pointer-events: none; }
|
|
48
|
+
.wk-cell.is-editable:hover .wk-tag, .wk-cell.is-selected .wk-tag { display: block; }
|
|
49
|
+
.wk-handle { position: absolute; right: 2px; bottom: 2px; width: 12px; height: 12px; border-radius: 2px; background: var(--s0); cursor: nwse-resize; opacity: 0; }
|
|
50
|
+
.wk-cell.is-editable:hover .wk-handle, .wk-cell.is-selected .wk-handle { opacity: 1; }
|
|
51
|
+
.wk-drop { border: 2px dashed var(--s0); border-radius: var(--radius); background: color-mix(in srgb, var(--s0) 12%, transparent); pointer-events: none; }
|
|
52
|
+
.wk-kpi-value { font: 600 30px/1.1 var(--font-mono); color: var(--ink-high); }
|
|
53
|
+
.wk-kpi-caption { margin-top: 4px; font-size: 12px; color: var(--ink-muted); }
|
|
54
|
+
.wk-delta--up { color: var(--status-fail); }
|
|
55
|
+
.wk-delta--down { color: var(--status-ok); }
|
|
56
|
+
.wk-table { width: 100%; border-collapse: collapse; font-size: 13px; }
|
|
57
|
+
.wk-table th { text-align: left; font-weight: 500; color: var(--ink-muted); padding: 4px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
|
|
58
|
+
.wk-table td { padding: 6px 8px; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent); color: var(--ink-high); overflow-wrap: anywhere; }
|
|
59
|
+
.wk-table td.wk-num { font-family: var(--font-mono); text-align: right; white-space: nowrap; }
|
|
60
|
+
.wk-td-actions { white-space: nowrap; text-align: right; }
|
|
61
|
+
.wk-td-actions .wk-btn + .wk-btn { margin-left: 4px; }
|
|
62
|
+
.wk-table-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
|
|
63
|
+
.wk-btn { font: inherit; font-weight: 600; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-raised); color: var(--ink-high); cursor: pointer; }
|
|
64
|
+
.wk-btn--sm { padding: 2px 9px; font-size: 12px; }
|
|
65
|
+
.wk-btn:disabled { opacity: .55; cursor: default; }
|
|
66
|
+
.wk-btn--danger { color: var(--status-fail); margin-top: 10px; }
|
|
67
|
+
.wk-muted { color: var(--ink-muted); font-size: 12px; }
|
|
68
|
+
.wk-error { color: var(--status-fail); font-size: 12px; overflow-wrap: anywhere; margin: 0; }
|
|
69
|
+
.wk-status { color: var(--ink-body); font-size: 12px; margin: 6px 0 0; }
|
|
70
|
+
.wk-notice { margin: 0 0 10px; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-card); color: var(--ink-body); }
|
|
71
|
+
.wk-empty { color: var(--ink-muted); padding: 24px; grid-column: 1 / -1; }
|
|
72
|
+
.wk-text { margin: 0; color: var(--ink-high); white-space: pre-wrap; overflow-wrap: anywhere; }
|
|
73
|
+
.wk-text--heading { font-size: 18px; font-weight: 650; }
|
|
74
|
+
.wk-text--caption { font-size: 12px; color: var(--ink-muted); }
|
|
75
|
+
.wk-filter { display: flex; align-items: center; gap: 6px; height: 100%; }
|
|
76
|
+
.wk-filter-label { font-size: 12px; color: var(--ink-muted); white-space: nowrap; }
|
|
77
|
+
.wk-input { font: inherit; min-width: 0; flex: 1 1 auto; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface-raised); color: var(--ink-high); }
|
|
78
|
+
.wk-input--date { flex: 0 1 140px; }
|
|
79
|
+
.wk-input--num { width: 64px; flex: 0 0 auto; }
|
|
80
|
+
textarea.wk-input { min-height: 64px; resize: vertical; }
|
|
81
|
+
.wk-form { display: flex; flex-direction: column; gap: 8px; }
|
|
82
|
+
.wk-field { display: flex; flex-direction: column; gap: 3px; }
|
|
83
|
+
.wk-form-foot { display: flex; align-items: center; gap: 10px; }
|
|
84
|
+
.wk-link { font: inherit; padding: 0; border: 0; background: none; color: var(--ui-accent); text-decoration: underline; cursor: pointer; }
|
|
85
|
+
.wk-image { max-width: 100%; max-height: 100%; object-fit: contain; }
|
|
86
|
+
.wk-chart { display: block; width: 100%; height: auto; max-height: 100%; overflow: visible; }
|
|
87
|
+
.wk-chart text { font: 11px var(--font-sans); }
|
|
88
|
+
.wk-axis { fill: var(--ink-muted); }
|
|
89
|
+
.wk-value { fill: var(--ink-high); font-family: var(--font-mono); }
|
|
90
|
+
.wk-grid-line { stroke: var(--border); stroke-width: 1; }
|
|
91
|
+
.wk-legend { display: flex; gap: 14px; list-style: none; margin: 4px 0 0; padding: 0; font-size: 12px; color: var(--ink-muted); flex-wrap: wrap; }
|
|
92
|
+
.wk-swatch { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
|
|
93
|
+
.wk-series-0 { fill: var(--c0, var(--s0)); stroke: var(--c0, var(--s0)); background: var(--c0, var(--s0)); }
|
|
94
|
+
.wk-series-1 { fill: var(--c1, var(--s1)); stroke: var(--c1, var(--s1)); background: var(--c1, var(--s1)); }
|
|
95
|
+
.wk-series-2 { fill: var(--c2, var(--s2)); stroke: var(--c2, var(--s2)); background: var(--c2, var(--s2)); }
|
|
96
|
+
.wk-series-3 { fill: var(--c3, var(--s3)); stroke: var(--c3, var(--s3)); background: var(--c3, var(--s3)); }
|
|
97
|
+
.wk-series-4 { fill: var(--c4, var(--s4)); stroke: var(--c4, var(--s4)); background: var(--c4, var(--s4)); }
|
|
98
|
+
.wk-series-5 { fill: var(--c5, var(--s5)); stroke: var(--c5, var(--s5)); background: var(--c5, var(--s5)); }
|
|
99
|
+
.wk-series-6 { fill: var(--c6, var(--s6)); stroke: var(--c6, var(--s6)); background: var(--c6, var(--s6)); }
|
|
100
|
+
.wk-series-7 { fill: var(--c7, var(--s7)); stroke: var(--c7, var(--s7)); background: var(--c7, var(--s7)); }
|
|
101
|
+
.wk-series-8 { fill: var(--c8, var(--s8)); stroke: var(--c8, var(--s8)); background: var(--c8, var(--s8)); }
|
|
102
|
+
.wk-series-9 { fill: var(--c9, var(--s9)); stroke: var(--c9, var(--s9)); background: var(--c9, var(--s9)); }
|
|
103
|
+
.wk-series-10 { fill: var(--c10, var(--s10)); stroke: var(--c10, var(--s10)); background: var(--c10, var(--s10)); }
|
|
104
|
+
.wk-series-11 { fill: var(--c11, var(--s11)); stroke: var(--c11, var(--s11)); background: var(--c11, var(--s11)); }
|
|
105
|
+
/* A mark's role outranks its series colour (studio#963). Each `.wk-series-N` rule above sets fill AND stroke; a role
|
|
106
|
+
rule of the same specificity placed before them lost on order, and a line drew as a filled shape. These rules are
|
|
107
|
+
scoped to the chart (more specific) AND come after the palette, so both the cascade and source order agree. */
|
|
108
|
+
.wk-chart .wk-stroke { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
|
|
109
|
+
.wk-chart .wk-stroke.wk-series-1 { stroke-dasharray: 5 4; stroke-width: 2; }
|
|
110
|
+
.wk-chart .wk-area { opacity: .25; stroke: none; }
|
|
111
|
+
.wk-palette, .wk-props { flex: 0 0 auto; overflow: auto; padding: 14px; background: var(--surface-base); }
|
|
112
|
+
.wk-palette { width: 190px; border-right: 1px solid var(--border); }
|
|
113
|
+
.wk-props { width: 270px; border-left: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
|
|
114
|
+
.wk-props-title { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-body); }
|
|
115
|
+
.wk-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
|
|
116
|
+
.wk-tile { font: inherit; font-size: 12px; padding: 14px 4px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-card); color: var(--ink-high); cursor: grab; touch-action: none; }
|
|
117
|
+
.wk-prop { display: flex; flex-direction: column; gap: 3px; }
|
|
118
|
+
.wk-prop-label { font-size: 12px; color: var(--ink-muted); }
|
|
119
|
+
.wk-prop-box { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
|
|
120
|
+
.wk-check { align-self: flex-start; }
|
|
121
|
+
.wk-cell, .wk-handle { touch-action: none; }
|
|
122
|
+
/* Edit in place: a component's own words show they can be edited (an outline and a pencil on hover). */
|
|
123
|
+
.wk-app[data-mode="edit"] .wk-editable { cursor: text; border-radius: 3px; }
|
|
124
|
+
.wk-app[data-mode="edit"] .wk-editable:hover { outline: 1px dashed var(--ui-accent); outline-offset: 2px; }
|
|
125
|
+
.wk-app[data-mode="edit"] .wk-editable:hover::after { content: "\270E"; margin-left: 6px; font-size: 11px; font-weight: 400; color: var(--ui-accent); }
|
|
126
|
+
.wk-inline-input { font: inherit; width: 100%; padding: 2px 6px; border: 2px solid var(--ui-accent); border-radius: 4px; background: var(--surface-raised); color: var(--ink-high); outline: none; }
|
|
127
|
+
.wk-cell.is-inline > .wk-tag { visibility: hidden; }
|
|
128
|
+
.wk-inline-input--multi { min-height: 3.2em; resize: vertical; }
|
|
129
|
+
.wk-btn[aria-disabled="true"] { opacity: .55; cursor: default; }
|
|
130
|
+
.wk-app[data-mode="edit"] .wk-btn[aria-disabled="true"].wk-editable { opacity: .8; cursor: text; }
|
|
131
|
+
/* A dashboard tile: the app as it looks, read-only; with no rows, each data component is its shape. */
|
|
132
|
+
.wk-app[data-tile="true"] { pointer-events: none; }
|
|
133
|
+
.wk-app[data-tile="true"] .wk-main { overflow: hidden; }
|
|
134
|
+
.wk-app[data-tile="true"] .wk-pages, .wk-app[data-tile="true"] .wk-notice { display: none; }
|
|
135
|
+
.wk-skeleton { height: 100%; min-height: 16px; border-radius: 6px; background: color-mix(in srgb, var(--ink-muted) 14%, transparent); }
|
|
136
|
+
.wk-skeleton--kpi { height: 28px; width: 60%; }
|
|
137
|
+
/* Below 640 px the grid is one column, in (row, column) order (the order per component is a CSSOM rule). */
|
|
138
|
+
@media (max-width: 639px) {
|
|
139
|
+
.wk-main { padding: 10px; }
|
|
140
|
+
.wk-grid { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
|
|
141
|
+
.wk-grid > .wk-cell { grid-column: 1 !important; grid-row: auto !important; min-height: var(--row); }
|
|
142
|
+
.wk-cell--chart, .wk-cell--table { min-height: 220px; }
|
|
143
|
+
.wk-palette, .wk-props { display: none; }
|
|
144
|
+
}
|
|
145
|
+
</style>
|
|
146
|
+
</head>
|
|
147
|
+
<body>
|
|
148
|
+
<script>var _t=Object.defineProperty;var Bt=(se,pe,$e)=>pe in se?_t(se,pe,{enumerable:!0,configurable:!0,writable:!0,value:$e}):se[pe]=$e;var Oe=(se,pe,$e)=>Bt(se,typeof pe!="symbol"?pe+"":pe,$e);(function(){"use strict";const se="wicked.editor";function $e(c,u,h){return{editor:c,version:u,protocol:[1,2],surfaces:h}}function ft(c,u){const h=document.querySelector('meta[name="wicked-editor-version"]')?.getAttribute("content")??"0.0.0";parent.postMessage({p:se,v:1,type:"plugin.ready",payload:$e(c,h,u)},"*")}const ht=/^[A-Z]{3}$/u;function de(c,u,h){if(c==null)return"";if(typeof c=="boolean")return c?"yes":"no";const f=typeof u?.decimals=="number"&&Number.isInteger(u.decimals)?Math.min(10,Math.max(0,u.decimals)):void 0,b=typeof c=="number"?c:typeof c=="string"&&c.trim()!==""&&Number.isFinite(Number(c))?Number(c):null;try{switch(u?.kind){case"currency":if(b===null||!ht.test(u.currency))break;return new Intl.NumberFormat(h,{style:"currency",currency:u.currency,...f!==void 0?{minimumFractionDigits:f,maximumFractionDigits:f}:{}}).format(b);case"percent":if(b===null)break;return new Intl.NumberFormat(h,{style:"percent",maximumFractionDigits:f??1}).format(b);case"number":if(b===null)break;return new Intl.NumberFormat(h,f!==void 0?{minimumFractionDigits:f,maximumFractionDigits:f}:{}).format(b);case"date":case"datetime":{const N=new Date(typeof c=="number"?c:String(c));if(Number.isNaN(N.getTime()))break;return new Intl.DateTimeFormat(h,u.kind==="date"?{dateStyle:"medium",timeZone:"UTC"}:{dateStyle:"medium",timeStyle:"short"}).format(N)}case"duration":{if(b===null)break;const N=Math.abs(Math.round(b)),g=Math.floor(N/86400),v=Math.floor(N%86400/3600),j=Math.floor(N%3600/60);return g>0?`${g}d ${v}h`:v>0?`${v}h ${j}m`:`${j}m`}default:break}}catch{}return typeof c=="number"?Number.isInteger(c)?String(c):new Intl.NumberFormat(h,{maximumFractionDigits:6}).format(c):String(c)}function I(c,u=200){return typeof c=="string"?c.replace(/[\u0000-\u001f\u007f]+/gu," ").slice(0,u):""}const mt="http://www.w3.org/2000/svg";function V(c,u,h){const f=document.createElementNS(mt,c);for(const[b,N]of Object.entries(u))f.setAttribute(b,String(N));return h!==void 0&&f.setAttribute("class",h),f}function Te(c,u,h,f,b="start"){const N=V("text",{x:c,y:u,"text-anchor":b},f);return N.textContent=h,N}function we(c){return typeof c=="number"?Number.isFinite(c)?c:0:typeof c=="string"&&c.trim()!==""&&Number.isFinite(Number(c))?Number(c):0}const B=c=>Math.round(c*10)/10;function _e(c,u){const h=document.createElement("ul");h.className="wk-legend",u.forEach((f,b)=>{const N=document.createElement("li"),g=document.createElement("span");g.className=`wk-swatch wk-series-${b%12}`,N.append(g,document.createTextNode(f)),h.append(N)}),c.append(h)}function wt(c,u,h,f){const b=y=>h.columns.findIndex(w=>w.name===y),N=b(u.x),g=u.series.slice(0,u.chart==="pie"?1:12).map(y=>({label:I(y.label??y.column,60),i:b(y.column)})).filter(y=>y.i>=0),v=h.rows.slice(0,500);if(N<0||g.length===0||v.length===0){const y=document.createElement("p");y.className="wk-empty",y.textContent=v.length===0?"No rows":"This chart’s columns are not in its query’s rows",c.append(y);return}const j=v.map(y=>de(y[N],void 0,f));if(u.chart==="bar"){const y=u.stacked===!0&&g.length>1,w=v.map(R=>g.map(O=>we(R[O.i])));let x=0,E=0;for(const R of w)if(y)E=Math.max(E,R.filter(O=>O>0).reduce((O,W)=>O+W,0)),x=Math.min(x,R.filter(O=>O<0).reduce((O,W)=>O+W,0));else for(const O of R)E=Math.max(E,O),x=Math.min(x,O);E===x&&(E=x+1);const S=130,A=g.length>1?250:220,q=R=>S+(R-x)/(E-x)*A,C=q(0),D=y||g.length===1?26:Math.max(26,g.length*10+10),P=V("svg",{viewBox:`0 0 400 ${v.length*D+4}`,role:"img","aria-label":I(u.title??"bar chart",120)},"wk-chart wk-chart--bar");x<0&&P.append(V("line",{x1:B(C),x2:B(C),y1:0,y2:v.length*D+4},"wk-grid-line")),v.forEach((R,O)=>{const W=O*D+2;if(P.append(Te(0,B(W+D/2+4),j[O].slice(0,22),"wk-axis")),y){let fe=0,re=0;g.forEach((xe,z)=>{const ee=w[O][z],Ee=ee>=0?fe:re+ee,De=ee>=0?fe+ee:re;ee>=0?fe+=ee:re+=ee,P.append(V("rect",{x:B(q(Ee)),y:W+4,width:B(Math.max(1,q(De)-q(Ee))),height:D-10},`wk-series-${z%12}`))});return}const J=(D-8)/g.length;g.forEach((fe,re)=>{const xe=w[O][re],z=Math.min(q(xe),C),ee=Math.max(1,Math.abs(q(xe)-C));P.append(V("rect",{x:B(z),y:B(W+4+re*J),width:B(ee),height:B(Math.max(2,J-2)),rx:2},`wk-series-${re%12}`)),g.length===1&&P.append(Te(B(xe<0?z-6:z+ee+6),B(W+D/2+4),de(R[fe.i],void 0,f),"wk-value",xe<0?"end":"start"))})}),c.append(P),g.length>1&&_e(c,g.map(R=>R.label));return}if(u.chart==="pie"){const y=g[0],w=v.reduce((S,A)=>S+Math.max(0,we(A[y.i])),0)||1,x=V("svg",{viewBox:"0 0 240 240",role:"img","aria-label":I(u.title??"pie chart",120)},"wk-chart wk-chart--pie");let E=-Math.PI/2;v.forEach((S,A)=>{const q=Math.max(0,we(S[y.i]))/w,C=E+q*Math.PI*2,D=C-E>Math.PI?1:0,P=O=>`${B(120+100*Math.cos(O))} ${B(120+100*Math.sin(O))}`,R=q>=.9999?"M 120 20 A 100 100 0 1 1 119.9 20 Z":`M 120 120 L ${P(E)} A 100 100 0 ${D} 1 ${P(C)} Z`;x.append(V("path",{d:R},`wk-series-${A%12}`)),E=C}),c.append(x),_e(c,j.slice(0,12));return}const ye=600,X=220,le=36,ie=24,ae=u.chart==="area"&&u.stacked===!0&&g.length>1,L=[],be=new Map;v.forEach((y,w)=>{if(L.push(w),!ae||w+1>=v.length)return;const x=new Map;g.forEach((E,S)=>{const A=we(v[w][E.i]),q=we(v[w+1][E.i]);if(A>0&&q<0||A<0&&q>0){const C=A/(A-q);x.set(C,[...x.get(C)??[],S])}});for(const E of[...x.keys()].sort((S,A)=>S-A))be.set(L.length,new Set(x.get(E))),L.push(w+E)});const Z=(y,w)=>{if(be.get(w)?.has(y)===!0)return 0;const x=L[w],E=Math.floor(x),S=x-E,A=we(v[E][g[y].i]);return S===0||E+1>=v.length?A:A+(we(v[E+1][g[y].i])-A)*S},T=g.map(()=>[]),H=g.map(()=>[]);let ue=0,ge=1;const G=y=>{y<ue&&(ue=y),y>ge&&(ge=y)};L.forEach((y,w)=>{let x=0,E=0;g.forEach((S,A)=>{const q=Z(A,w);if(!ae){T[A][w]=[0,q],H[A][w]=[0,0],G(q);return}const C=Math.max(0,q),D=Math.min(0,q);T[A][w]=[x,x+C],H[A][w]=[E+D,E],x+=C,E+=D,G(x),G(E)})});const ve=ge,ke=ue,Se=y=>le+(v.length===1?0:y/(v.length-1)*(ye-le-8)),ce=y=>X-ie-(y-ke)/(ve-ke||1)*(X-ie-10),ne=V("svg",{viewBox:`0 0 ${ye} ${X}`,role:"img","aria-label":I(u.title??`${u.chart} chart`,120)},`wk-chart wk-chart--${u.chart}`);for(let y=0;y<=3;y+=1){const w=ke+(ve-ke)*y/3;ne.append(V("line",{x1:le,x2:ye-8,y1:B(ce(w)),y2:B(ce(w))},"wk-grid-line")),ne.append(Te(le-6,B(ce(w)+4),de(Math.round(w*10)/10,void 0,f),"wk-axis","end"))}const Ie=v.length<=4?v.map((y,w)=>w):[0,Math.floor((v.length-1)/3),Math.floor((v.length-1)*2/3),v.length-1];for(const y of Ie)ne.append(Te(B(Se(y)),X-6,j[y].slice(0,14),"wk-axis",y===0?"start":y===v.length-1?"end":"middle"));g.forEach((y,w)=>{const x=(D,P)=>`${B(Se(L[D]))},${B(ce(P))}`;if(u.chart==="area"){const D=P=>{const R=L.map((W,J)=>x(J,P[J][1])),O=L.map((W,J)=>x(J,P[J][0])).reverse();return`M ${R.join(" L ")} L ${O.join(" L ")} Z`};ne.append(V("path",{d:D(T[w])},`wk-area wk-series-${w}`)),ae&&H[w].some(([P,R])=>P!==R)&&ne.append(V("path",{d:D(H[w])},`wk-area wk-area--neg wk-series-${w}`))}if(!ae){ne.append(V("polyline",{points:L.map((D,P)=>x(P,Z(w,P))).join(" "),fill:"none"},`wk-stroke wk-series-${w}`));return}const E=[];let S=null,A=0,q=[];const C=(D,P)=>D<0?x(P,H[w][P][0]):x(P,T[w][P][1]);L.forEach((D,P)=>{const R=Z(w,P);if(be.get(P)?.has(w)===!0||R===0){S!==null&&S.push(C(A,P)),q.push(P);return}const O=R>0?1:-1;if(S===null)S=q.map(W=>C(O,W)),E.push(S),A=O;else if(O!==A){const W=q[q.length-1];S=W!==void 0?[C(O,W)]:[],E.push(S),A=O}S.push(C(O,P)),q=[]}),S===null&&q.length>1&&E.push(q.map(D=>C(1,D)));for(const D of E)D.length>1&&ne.append(V("polyline",{points:D.join(" "),fill:"none"},`wk-stroke wk-series-${w}`))}),c.append(ne),g.length>1&&_e(c,g.map(y=>y.label))}const yt=/^#[0-9a-fA-F]{6}$/u,Ue=/^(?::root|\.wk-c\d{1,4}(?: \.wk-[a-z]+)?)$/u,bt=/^(?:--[a-z0-9-]{1,40}|[a-z-]{1,40})$/u,gt="(max-width: 639px)";function Be(c){return typeof c=="string"&&yt.test(c)?c.toLowerCase():null}function Le(c,u,h,f){return Number.isInteger(c)?Math.min(h,Math.max(u,c)):f}function vt(c){return typeof c=="string"&&c.length<=200&&!/url\(|[;{}]|\/\*|\\/iu.test(c)?c:null}class kt{constructor(u){Oe(this,"sheet");Oe(this,"base");Oe(this,"rules",new Map);Oe(this,"phone",null);Oe(this,"phoneRules",new Map);if(u.sheet===null)throw new Error("the runtime stylesheet did not load");this.sheet=u.sheet,this.base=this.sheet.cssRules.length}reset(){for(;this.sheet.cssRules.length>this.base;)this.sheet.deleteRule(this.sheet.cssRules.length-1);this.rules.clear(),this.phoneRules.clear(),this.phone=null}rule(u){if(!Ue.test(u))throw new Error("a selector outside the runtime’s vocabulary");const h=this.rules.get(u);if(h!==void 0)return h;const f=this.sheet.insertRule(`${u} {}`,this.sheet.cssRules.length),b=this.sheet.cssRules[f];return this.rules.set(u,b),b}phoneRule(u){if(!Ue.test(u))throw new Error("a selector outside the runtime’s vocabulary");const h=this.phoneRules.get(u);if(h!==void 0)return h;if(this.phone===null){const N=this.sheet.insertRule(`@media ${gt} {}`,this.sheet.cssRules.length);this.phone=this.sheet.cssRules[N]}const f=this.phone.insertRule(`${u} {}`,this.phone.cssRules.length),b=this.phone.cssRules[f];return this.phoneRules.set(u,b),b}set(u,h,f){bt.test(h)&&u.style.setProperty(h,f)}theme(u,h){const f=this.rule(":root");for(const[g,v]of Object.entries(u)){const j=vt(v);/^--[a-z0-9-]{1,40}$/u.test(g)&&j!==null&&this.set(f,g,j)}const b=Be(h.accent);b!==null&&this.set(f,"--app-accent",b),h.density==="compact"&&(this.set(f,"--row","36px"),this.set(f,"--gap","8px"));const N=Array.isArray(h.palette)?h.palette:[];for(let g=0;g<12;g+=1){const v=Be(N[g]);v!==null&&this.set(f,`--s${g}`,v)}}place(u,h){const f=this.rule(`.wk-c${u}`),b=Le(h.x,0,11,0),N=Le(h.w,1,12-b,1),g=Le(h.y,0,999,0),v=Le(h.h,1,50,1);this.set(f,"grid-column",`${b+1} / span ${N}`),this.set(f,"grid-row",`${g+1} / span ${v}`)}phoneOrder(u,h,f){const b=this.phoneRule(`.wk-c${u}`);this.set(b,"order",String(Le(h,0,9999,0))),f?this.set(b,"display","none"):b.style.removeProperty("display")}seriesColour(u,h,f){const b=Be(f);b!==null&&this.set(this.rule(`.wk-c${u}`),`--c${Le(h,0,11,0)}`,b)}}const xt={comfortable:44,compact:36},Ve={comfortable:12,compact:8},Et=450,je=500,Mt=/^[A-Za-z_][A-Za-z0-9_]{0,63}$/u,qe=()=>Object.create(null);function At(c,u){if(c===void 0||u===null||u===void 0)return u;if((c.type==="number"||c.type==="integer")&&typeof u=="string"&&u.trim()!==""){const h=Number(u);return Number.isFinite(h)&&(c.type==="number"||Number.isInteger(h))?h:u}return c.type==="boolean"&&typeof u=="string"&&(u==="true"||u==="false")?u==="true":c.type==="string"&&(typeof u=="number"||typeof u=="boolean")?String(u):u}const U=c=>typeof c=="object"&&c!==null&&!Array.isArray(c),$t=/^data:image\/(?:png|jpeg|gif|webp);base64,[A-Za-z0-9+/]+={0,2}$/u,Ge={table:{w:12,h:5},chart:{w:6,h:5},kpi:{w:3,h:2},text:{w:6,h:1},filter:{w:3,h:1},form:{w:4,h:6},button:{w:2,h:1},image:{w:3,h:3},link:{w:2,h:1}},Lt=[{type:"table",label:"Table"},{type:"chart",label:"Chart"},{type:"kpi",label:"KPI"},{type:"filter",label:"Filter"},{type:"form",label:"Form"},{type:"button",label:"Button"},{type:"text",label:"Text"},{type:"link",label:"Link"}];function d(c,u,h){const f=document.createElement(c);return u!==void 0&&(f.className=u),h!==void 0&&(f.textContent=h),f}function Je(c){return c.toISOString().slice(0,10)}function St(c){const u=document.getElementById("wk-apps-sheet");if(!(u instanceof HTMLStyleElement))return;const h=new kt(u),f=d("div","wk-app");f.setAttribute("data-testid","apps-runtime"),document.body.append(f);let b=null,N=new Set,g=!0,v=!1,j=!1,ye=!1,X="preview",le="full",ie="en",ae=0,L=null,be=!1,Z=null,T=null;const H=qe(),ue=qe(),ge=qe(),G=new Map,ve=new Map,ke=new Map,Se=new Map,ce=new Map;let ne=0,Ie=0;const y=new Map;let w=null;const x=new Map;let E=!1,S=null,A=null;const q=e=>{b?.postMessage({p:se,v:1,...e})},C=(e,t)=>{Ie+=1;const n=`a${Ie}`;return q({type:e,id:n,payload:t}),new Promise(o=>y.set(n,o))},D=(e,t)=>q({type:e,payload:t}),P=e=>{const t=e.data;if(!U(t)||t.p!==se||t.v!==1)return;const n=U(t.payload)?t.payload:{};if(typeof t.re=="string"){const o=y.get(t.re);if(o===void 0)return;y.delete(t.re);const s=U(t.error)?t.error:{};o(t.ok===!0?{ok:!0,payload:n}:{ok:!1,code:String(s.code??"unavailable"),message:I(s.message,300),payload:n});return}if(!E)switch(t.type){case"host.ping":typeof t.id=="string"&&q({re:t.id,ok:!0,payload:{}});return;case"host.theme":U(n.theme)&&(R=n.theme),Y();return;case"artifact.changed":J();return;case"app.mode":(n.mode==="edit"||n.mode==="preview")&&(X=n.mode,X==="preview"&&(T=null),Y());return;case"data.invalidate":Me();return;case"host.surface":(n.surface==="card"||n.surface==="full")&&(le=n.surface,Y());return;case"selection.cleared":T=null,Y();return;case"host.teardown":E=!0;for(const o of x.values())clearInterval(o);x.clear(),document.removeEventListener("keydown",ct),b?.close(),b=null,f.replaceChildren(d("p","wk-empty","Closed"));return;default:return}};let R={};const O=e=>{U(e)&&(R=e),h.theme(R,{accent:L?.theme?.accent,palette:L?.theme?.palette,density:L?.theme?.density})},W=()=>L?.theme?.density==="compact"?"compact":"comfortable";window.addEventListener("message",e=>{const t=e.data;if(b!==null||e.source!==parent||!U(t)||t.p!==se||t.type!=="host.hello"||e.ports[0]===void 0)return;b=e.ports[0],b.onmessage=P;const n=U(t.payload)?t.payload:{};N=new Set(Array.isArray(n.grants)?n.grants.filter(l=>typeof l=="string"):[]);const o=U(n.app)?n.app:{};if(g=o.framed!==!1,v=o.tile===!0,j=v&&o.rows===!0,ye=o.propsHost===!0,X=o.mode==="edit"?"edit":"preview",le=n.surface==="card"||n.size==="inline"?"card":"full",U(o.url))for(const[l,i]of Object.entries(o.url).slice(0,30))Mt.test(l)&&typeof i=="string"&&i.length<=1e3&&(ge[l]=i);const s=U(n.prefs)?n.prefs:{};ie=typeof s.locale=="string"&&/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u.test(s.locale)?s.locale:"en",O(n.theme),J()});const J=async()=>{const e=await C("artifact.read",{});if(!e.ok){w=e.message,Y();return}const t=U(e.payload.content)?e.payload.content:{};if(t.type!=="app"||!U(t.spec)){w="This is not an app",Y();return}const n=ae;ae=typeof e.payload.version=="number"?e.payload.version:0,L=t.spec,be=t.readonly===!0,(Z===null||!L.pages.some(s=>s.id===Z))&&(Z=L.pages[0]?.id??null),T!==null&&!z().some(s=>s.id===T)&&(T=null),w=null,De();const o=fe();Y(),(n!==ae||o||G.size===0)&&Me()},fe=()=>{const e=new Map;for(const n of L?.pages??[])for(const o of n.components){const s=He(o);s!==null&&e.set(o.id,re(s))}let t=!1;for(const n of[...G.keys()])ve.get(n)!==e.get(n)&&(G.delete(n),ve.delete(n),t=!0);return t},re=e=>`${e.query}\0${JSON.stringify(e.params)}`,xe=()=>L?.pages.find(e=>e.id===Z)??null,z=()=>xe()?.components??[],ee=(e,t)=>{const n=H[e];if(n!==void 0)return typeof n=="string"?t===void 0?n:void 0:t==="from"?n.from:t==="to"?n.to:void 0},Ee=(e,t,n)=>{const o={},s=n?.properties??{};for(const[l,i]of Object.entries(e??{})){const[p,a,r]=i.split(".");let m;if(p==="filter"&&a!==void 0)m=ee(a,r);else if(p==="row"&&a!==void 0&&t.row!==void 0&&Object.hasOwn(t.row,a))m=t.row[a];else if(p==="form"&&a!==void 0&&t.form!==void 0){const k=ue[t.form];m=k!==void 0&&Object.hasOwn(k,a)?k[a]:void 0}else p==="url"&&a!==void 0&&(m=ge[a]);m!==void 0&&m!==""&&(o[l]=At(Object.hasOwn(s,l)?s[l]:void 0,m))}return o},De=()=>{for(const e of L?.pages??[])for(const t of e.components)if(!(t.type!=="filter"||H[t.id]!==void 0))if(t.filter==="date-range"){const n=U(t.default)&&Number.isInteger(t.default.lastDays)?Math.min(3650,Math.max(1,t.default.lastDays)):30,o=new Date;H[t.id]={from:Je(new Date(o.getTime()-n*864e5)),to:Je(o)}}else H[t.id]=typeof t.default=="string"?t.default:""},Qe=e=>L?.queries.find(t=>t.id===e)?.params,He=e=>e.type==="table"||e.type==="chart"||e.type==="kpi"?{query:e.data.query,params:Ee(e.data.params,{},Qe(e.data.query))}:e.type==="filter"&&e.filter==="select"&&e.options?.kind==="query"?{query:e.options.query.query,params:Ee(e.options.query.params,{},Qe(e.options.query.query))}:null,Me=(e,t=!1)=>{if(E||!N.has("data.read")||L===null||v&&!j)return;De(),ne+=1;const n=ne,o=new Map;for(const s of z()){const l=He(s);if(l===null||e!==void 0&&l.query!==e||t&&G.has(s.id))continue;const i=re(l);let p=o.get(i);p===void 0&&(p=C("data.query",{query:l.query,params:l.params}).then(a=>{if(!a.ok)return{state:"error",message:a.message};const r=Array.isArray(a.payload.columns)?a.payload.columns:[],m=Array.isArray(a.payload.rows)?a.payload.rows.filter(Array.isArray):[];return{state:"rows",rows:{columns:r,rows:m,sample:a.payload.sample===!0,hasMore:a.payload.hasMore===!0,truncated:a.payload.truncated===!0}}}),o.set(i,p)),G.has(s.id)||(G.set(s.id,{state:"loading"}),ve.set(s.id,i)),ke.set(s.id,n),p.then(a=>{!E&&ke.get(s.id)===n&&(G.set(s.id,a),ve.set(s.id,i),Fe(s.id))})}e===void 0&&Nt()},Nt=()=>{const e=new Map;for(const t of z()){const n=He(t),o=n===null?void 0:L?.queries.find(s=>s.id===n.query);o?.refresh?.mode==="every"&&e.set(o.id,Math.max(15,o.refresh.seconds))}for(const[t,n]of[...x]){const[o,s]=t.split("\0");e.get(o)!==Number(s)&&(clearInterval(n),x.delete(t))}for(const[t,n]of e){const o=`${t}\0${n}`;x.has(o)||x.set(o,setInterval(()=>{document.visibilityState==="visible"&&Me(t)},n*1e3))}},Pt=async(e,t,n)=>{if(g||X!=="preview"||!N.has("data.write"))return;const o=z().find(a=>a.id===e)?.type!=="button",s=a=>{o?(Se.set(e,a),Fe(e)):tt(`${I(t.label,60)}: ${a}`)};s("Waiting for you in studio…");const l=await C("data.action",{action:t.action,params:Ee(t.params,n,L?.actions.find(a=>a.id===t.action)?.params)}),i=l.ok?String(l.payload.state):"refused",p=l.ok?I(l.payload.reason,200):l.message;s(i==="succeeded"?`Done${p!==""?`: ${p}`:""}`:i==="cancelled"?"Not run":i==="unknown"?`Not known whether it ran: ${p}`:`Not run: ${p}`)},Ke=(e,t,n,o="wk-btn wk-btn--sm")=>{if(g)return d("span","wk-muted","Open to make changes");const s=d("button",o,I(t.label,60));return s.type="button",s.setAttribute("data-action",t.action),v||X!=="preview"||!N.has("data.write")?(s.setAttribute("aria-disabled","true"),s.title=v?"":X==="edit"?"Actions run in Preview":"This app may not ask to run actions here"):s.addEventListener("click",l=>{l.stopPropagation(),Pt(e,t,n)}),s},Ze=new Map;let Q=null,We=null;const Xe=new Map,et=(e,t)=>{qt(e,t),Ot(e,t)},Ot=(e,t)=>{if(!_())return;const n=(o,s)=>{o!==null&&(o.setAttribute("data-inline",s),o.classList.add("wk-editable"),o.setAttribute("title","Double-click to edit"))};e.type==="text"&&n(t.querySelector(".wk-text"),"text"),e.type==="button"&&n(t.querySelector("button[data-action]"),"label"),e.type==="link"&&n(t.querySelector(".wk-link"),"label"),e.type==="filter"&&n(t.querySelector(".wk-filter-label"),"label")},qt=(e,t)=>{t.replaceChildren();const n=G.get(e.id);if(e.type==="table"||e.type==="chart"||e.type==="kpi"){if(v&&!j){t.append(d("div",`wk-skeleton wk-skeleton--${e.type}`));return}if(!N.has("data.read")){t.append(d("p","wk-muted","Live rows are not shown here"));return}if(n===void 0||n.state==="loading"){t.append(d("p","wk-muted","Loading…"));return}if(n.state==="error"){t.append(d("p","wk-error",`${"data"in e?e.data.query:""}: ${n.message}`));return}}const s=n?.state==="rows"?n.rows:null;switch(e.type){case"kpi":{const l=a=>a===void 0?-1:s.columns.findIndex(r=>r.name===a),i=s.rows[0];t.append(d("div","wk-kpi-value",i===void 0?"—":de(i[l(e.value)],e.format,ie)));const p=d("div","wk-kpi-caption");if(i!==void 0&&e.delta!==void 0&&l(e.delta)>=0){const a=i[l(e.delta)],r=typeof a=="number"&&a<0||typeof a=="string"&&a.trim().startsWith("-");p.append(d("span",r?"wk-delta wk-delta--down":"wk-delta wk-delta--up",`${r?"▼":"▲"} ${de(a,void 0,ie).replace(/^\s*-/u,"")}`)),p.append(document.createTextNode(" "))}e.caption!==void 0&&p.append(document.createTextNode(I(e.caption,120))),t.append(p);return}case"chart":wt(t,e,s,ie),(s.truncated||s.rows.length>je)&&t.append(d("p","wk-muted",s.truncated?"Only part of the source’s rows: the answer was cut at the app’s limit":`The first ${je} of ${s.rows.length} rows`));return;case"table":{Dt(e,t,s);return}case"text":t.append(d(e.style==="heading"?"h2":"p",`wk-text wk-text--${e.style??"body"}`,e.text.slice(0,4e3)));return;case"filter":{Ct(e,t);return}case"form":{Rt(e,t);return}case"button":t.append(Ke(e.id,e.action,{},"wk-btn"));return;case"image":{if(!$t.test(e.src)){t.append(d("p","wk-muted","This image is not one the app can show"));return}const l=d("img","wk-image");l.alt=I(e.alt,300),l.src=e.src,t.append(l);return}case"link":{const l=d("button","wk-link",I(e.label,120));if(l.type="button",e.to.kind==="page"){const i=e.to;l.addEventListener("click",()=>{if(X==="preview"){w=null;for(const[p,a]of Object.entries(Ee(i.params,{})))ge[p]=String(a);L?.pages.some(p=>p.id===i.page)&&(Z=i.page,T=null,Y(),Me())}})}else{const i=e.to.href;l.title=i.slice(0,300),l.addEventListener("click",async()=>{if(X!=="preview")return;const p=await C("link.open",{href:i});p.ok||tt(`${I(e.label,60)} not opened: ${p.message}`)})}t.append(l);return}}},Dt=(e,t,n)=>{const o=M=>n.columns.findIndex($=>$.name===M),s=(e.columns??n.columns.map(M=>({column:M.name}))).filter(M=>o(M.column)>=0),l=Math.min(500,Math.max(5,e.pageSize??10)),i=Math.max(1,Math.ceil(n.rows.length/l)),p=Math.min(ce.get(e.id)??0,i-1),a=d("table","wk-table"),r=d("tr");for(const M of s)r.append(d("th",void 0,I(M.label??M.column,80)));(e.rowActions??[]).length>0&&r.append(d("th","wk-th-actions","")),a.append(d("thead")),a.tHead.append(r);const m=d("tbody");for(const M of n.rows.slice(p*l,p*l+l)){const $=d("tr"),K=qe();n.columns.forEach((oe,Pe)=>{K[oe.name]=M[Pe]??null});for(const oe of s){const Pe=M[o(oe.column)];$.append(d("td",typeof Pe=="number"?"wk-num":void 0,de(Pe,oe.format,ie)))}if((e.rowActions??[]).length>0){const oe=d("td","wk-td-actions");for(const Pe of(e.rowActions??[]).slice(0,4))oe.append(Ke(e.id,Pe,{row:K}));$.append(oe)}m.append($)}a.append(m),t.append(a),n.rows.length===0&&t.append(d("p","wk-muted","No rows"));const k=d("div","wk-table-foot");if(i>1){const M=d("button","wk-btn wk-btn--sm","Previous"),$=d("button","wk-btn wk-btn--sm","Next");M.type="button",$.type="button",M.disabled=p===0,$.disabled=p>=i-1,M.addEventListener("click",()=>{ce.set(e.id,p-1),Fe(e.id)}),$.addEventListener("click",()=>{ce.set(e.id,p+1),Fe(e.id)}),k.append(M,d("span","wk-muted",`${p+1} of ${i}`),$)}n.truncated?k.append(d("span","wk-muted",`Only the first ${n.rows.length} rows: the answer was cut at the app’s limit`)):n.hasMore&&k.append(d("span","wk-muted","First page of the source’s rows"));const F=Se.get(e.id);F!==void 0&&k.append(d("span","wk-status",F)),k.childNodes.length>0&&t.append(k)},Ct=(e,t)=>{const n=d("label","wk-filter");n.append(d("span","wk-filter-label",I(e.label??(e.filter==="search"?"Search":e.filter==="date-range"?"Dates":"Filter"),60)));const o=()=>{Me()};if(e.filter==="search"){const s=d("input","wk-input");s.type="search",s.value=typeof H[e.id]=="string"?H[e.id]:"";let l=null;s.addEventListener("input",()=>{H[e.id]=s.value.slice(0,200),l!==null&&clearTimeout(l),l=setTimeout(o,300)}),n.append(s)}else if(e.filter==="select"){const s=d("select","wk-input"),l=[{value:"",label:"All"}];if(e.options?.kind==="values")for(const i of e.options.values.slice(0,200))l.push({value:I(i.value,200),label:I(i.label??i.value,200)});if(e.options?.kind==="query"){const i=G.get(e.id);if(i?.state==="rows"){const p=i.rows.columns.findIndex(r=>r.name===e.options.value),a=i.rows.columns.findIndex(r=>r.name===(e.options.label??""));for(const r of i.rows.rows.slice(0,200))p>=0&&l.push({value:de(r[p],void 0,ie),label:de(r[a>=0?a:p],void 0,ie)})}}for(const i of l){const p=d("option",void 0,i.label);p.value=i.value,s.append(p)}s.value=typeof H[e.id]=="string"?H[e.id]:"",s.addEventListener("change",()=>{H[e.id]=s.value,o()}),n.append(s)}else{const s=H[e.id]??{from:"",to:""},l=d("input","wk-input wk-input--date"),i=d("input","wk-input wk-input--date");l.type="date",i.type="date",l.value=s.from,i.value=s.to;const p=()=>{H[e.id]={from:l.value,to:i.value},o()};l.addEventListener("change",p),i.addEventListener("change",p),n.append(l,d("span","wk-muted","–"),i)}t.append(n)},Rt=(e,t)=>{var p;const n=ue[p=e.id]??(ue[p]=qe()),o=L?.actions.find(a=>a.id===e.submit.action)?.params?.properties??{};for(const a of e.fields){if(Object.hasOwn(n,a.name))continue;const r=e.submit.params===void 0?void 0:Object.entries(e.submit.params).find(([,k])=>k===`form.${a.name}`)?.[0],m=r!==void 0&&Object.hasOwn(o,r)?o[r].default:void 0;a.input==="checkbox"?n[a.name]=m===!0:m!==void 0&&(n[a.name]=String(m))}const s=d("div","wk-form");for(const a of e.fields.slice(0,30)){const r=d("label","wk-field");r.append(d("span","wk-filter-label",I(a.label??a.name,80)));let m;if(a.input==="textarea")m=d("textarea","wk-input");else if(a.input==="select"){m=d("select","wk-input");for(const k of a.options??[]){const F=d("option",void 0,I(k.label??k.value,200));F.value=I(k.value,200),m.append(F)}}else m=d("input","wk-input"),m.type=a.input==="number"?"number":a.input==="date"?"date":a.input==="checkbox"?"checkbox":"text";m instanceof HTMLInputElement&&m.type==="checkbox"?(m.checked=n[a.name]===!0,m.addEventListener("change",()=>{n[a.name]=m.checked})):(m.value=typeof n[a.name]=="string"?n[a.name]:"",m.addEventListener("input",()=>{n[a.name]=m.value.slice(0,1e3)})),m.disabled=X!=="preview",r.append(m),s.append(r)}const l=d("div","wk-form-foot");l.append(Ke(e.id,e.submit,{form:e.id},"wk-btn"));const i=Se.get(e.id);l.append(d("span","wk-muted",i??(g?"":"Studio asks before it writes"))),s.append(l),t.append(s)};let he=null;const tt=e=>{w=e,he!==null?(he.textContent=e,he.hidden=!1):Y()},Fe=e=>{if(S!==null&&S.id===e)return;const t=z().find(o=>o.id===e),n=Xe.get(e);t!==void 0&&n!==void 0&&et(t,n)},_=()=>X==="edit"&&le==="full"&&!be&&N.has("artifact.write");let me=null;const nt=()=>{const e=me.getBoundingClientRect(),t=W();return{col:(e.width+Ve[t])/12,row:xt[t]+Ve[t],left:e.left,top:e.top}},Tt=(e,t)=>{const n=nt();return{x:Math.min(11,Math.max(0,Math.floor((e-n.left)/n.col))),y:Math.min(999,Math.max(0,Math.floor((t-n.top)/n.row)))}},te=async(e,t={})=>{const n=await C("spec.edit",{base:ae,ops:e});if(!n.ok)return w=n.code==="head_moved"?"The app changed meanwhile: showing the newest version":`Not changed: ${n.message}`,n.code==="head_moved"?await J():Y(),null;U(n.payload.spec)&&(L=n.payload.spec),w=null,De(),fe();const o=Array.isArray(n.payload.added)?n.payload.added.filter(s=>typeof s=="string"):[];return o[0]!==void 0&&Ne(o[0]),Y({keepProps:t.typed===!0&&o.length===0}),Me(void 0,!0),o},Ne=e=>{const t=T;T=e,e!==null&&N.has("selection.chip")?D("selection.set",{anchors:[{kind:"element",id:e}]}):e===null&&t!==null&&N.has("selection.chip")&&D("selection.set",{anchors:[]})},ot=(e,t,n,o)=>{if(!_()||e.button!==0)return;e.preventDefault(),e.stopPropagation(),(o.closest(".wk-cell")??o).focus({preventScroll:!0});const s=Ze.get(t.id),l=nt(),i={x:e.clientX,y:e.clientY};let p={...t.box},a=!1;const r=n==="move"?e.target?.closest?.("[data-inline]"):null;o.setPointerCapture(e.pointerId),o.classList.add("is-dragging");const m=F=>{const M=Math.round((F.clientX-i.x)/l.col),$=Math.round((F.clientY-i.y)/l.row);M===0&&$===0&&!a||(a=!0,p=n==="move"?{...t.box,x:Math.min(12-t.box.w,Math.max(0,t.box.x+M)),y:Math.max(0,t.box.y+$)}:{...t.box,w:Math.min(12-t.box.x,Math.max(1,t.box.w+M)),h:Math.min(50,Math.max(1,t.box.h+$))},h.place(s,p))},k=()=>{o.removeEventListener("pointermove",m),o.removeEventListener("pointerup",k),o.removeEventListener("pointercancel",k),o.classList.remove("is-dragging");const F=n==="move"?p.x!==t.box.x||p.y!==t.box.y:p.w!==t.box.w||p.h!==t.box.h;if(!a||!F){h.place(s,t.box),a||(Ne(t.id),lt(),pt(t.id,r));return}te([n==="move"?{op:"component-move",id:t.id,x:p.x,y:p.y}:{op:"component-resize",id:t.id,w:p.w,h:p.h}])};o.addEventListener("pointermove",m),o.addEventListener("pointerup",k),o.addEventListener("pointercancel",k)},st=()=>z().reduce((e,t)=>Math.max(e,t.box.y+t.box.h),0),It=(e,t,n)=>{if(!_()||e.button!==0||me===null||Z===null)return;e.preventDefault(),n.focus({preventScroll:!0});const o=Ge[t],s=d("div","wk-drop wk-c9999");s.setAttribute("data-testid","apps-drop-target");let l=null;n.setPointerCapture(e.pointerId);const i=a=>{const r=me.getBoundingClientRect();if(a.clientX<r.left||a.clientX>r.right||a.clientY<r.top){s.remove(),l=null;return}l=Tt(a.clientX,a.clientY),l.x=Math.min(l.x,12-o.w),h.place(9999,{x:l.x,y:l.y,w:o.w,h:o.h}),s.parentNode===null&&me.append(s)},p=a=>{if(n.removeEventListener("pointermove",i),n.removeEventListener("pointerup",p),n.removeEventListener("pointercancel",p),s.remove(),Math.abs(a.clientX-e.clientX)+Math.abs(a.clientY-e.clientY)>6&&l===null)return;const m=l??{x:0,y:st()};te([{op:"component-add",page:Z,type:t,box:{x:m.x,y:m.y,w:Math.min(o.w,12-m.x),h:o.h}}])};n.addEventListener("pointermove",i),n.addEventListener("pointerup",p),n.addEventListener("pointercancel",p)},Ye=(e,t,n=!1,o)=>{let s=e.value,l=null;const i=()=>{if(e.value===s)return;s=e.value;const a=t();if(a===void 0)return;const r=Promise.resolve(a);l=r,r.finally(()=>{l===r&&(l=null)})};let p=!1;e.addEventListener("compositionstart",()=>{p=!0}),e.addEventListener("compositionend",()=>{p=!1,i()}),e.addEventListener("input",a=>{!p&&a.isComposing!==!0&&i()}),o!==void 0&&e.addEventListener("blur",()=>{const a=()=>{if(document.activeElement===e)return;const r=o();e.value!==r&&(e.value=r,s=r)};l!==null?l.then(a,a):a()}),e.addEventListener("change",()=>{p||i()}),e.addEventListener("keydown",a=>{const r=a;p||r.isComposing||r.keyCode===229||r.key==="Enter"&&(!n||r.metaKey||r.ctrlKey)&&(r.preventDefault(),i())})},Ce=(e,t)=>{const n=d("label","wk-prop");return n.append(d("span","wk-prop-label",e),t),n},Ae=(e,t,n,o,s,l=!1)=>{const i=d(l?"textarea":"input","wk-input");return i.value=o??"",i.maxLength=s,i.setAttribute("data-prop",n),Ye(i,()=>te([{op:"component-set",id:e.id,prop:n,value:i.value}],{typed:!0}),l,()=>{const p=z().find(r=>r.id===e.id),a=n==="label"&&p?.type==="button"?p.action?.label:p?.[n];return typeof a=="string"?a:""}),Ce(t,i)},Re=(e,t,n,o,s,l="set")=>{const i=d("select","wk-input");for(const p of s){const a=d("option",void 0,p);a.value=p,i.append(a)}return i.value=o,i.setAttribute("data-prop",n),i.addEventListener("change",()=>{te([l==="bind"?{op:"bind",id:e.id,query:i.value}:{op:"component-set",id:e.id,prop:n,value:i.value}])}),Ce(t,i)},it=(e,t,n,o)=>{const s=d("input","wk-check");return s.type="checkbox",s.checked=o,s.setAttribute("data-prop",n),s.addEventListener("change",()=>{te([{op:"component-set",id:e.id,prop:n,value:s.checked}])}),Ce(t,s)},ze=(e,t,n,o,s)=>{const l=d("input","wk-input wk-input--num");l.type="number",l.min=String(o),l.max=String(s),l.value=String(n==="x"?e.box.x+1:n==="y"?e.box.y+1:e.box[n]),l.setAttribute("data-prop",`box-${n}`);const i=()=>z().find(a=>a.id===e.id)?.box??e.box,p=a=>String(n==="x"?a.x+1:n==="y"?a.y+1:a[n]);return Ye(l,()=>{if(l.value.trim()==="")return;const a=Math.round(Number(l.value));if(!Number.isFinite(a))return;const r=i();if(n==="x"||n==="y"){const F=n==="x"?Math.min(12-r.w,Math.max(0,a-1)):r.x,M=n==="y"?Math.max(0,a-1):r.y;return te([{op:"component-move",id:e.id,x:F,y:M}],{typed:!0})}const m=n==="w"?Math.min(12-r.x,Math.max(1,a)):r.w,k=n==="h"?Math.min(50,Math.max(1,a)):r.h;return te([{op:"component-resize",id:e.id,w:m,h:k}],{typed:!0})},!1,()=>p(i())),Ce(t,l)},at=e=>{const t=d("aside","wk-props");t.setAttribute("aria-label","Properties"),t.setAttribute("data-testid","apps-properties"),t.append(d("h3","wk-props-title","Properties")),t.append(d("p","wk-muted",`${e.type==="chart"?`${e.chart} chart`:e.type} · ${e.id}`)),t.append(Ae(e,"Title","title",e.title,120));const n=(L?.queries??[]).map(i=>i.id),o=i=>L?.queries.find(p=>p.id===i)?.output.map(p=>p.name)??[];if((e.type==="table"||e.type==="chart"||e.type==="kpi")&&t.append(Re(e,"Data","query",e.data.query,n,"bind")),e.type==="table"){const i=d("input","wk-input wk-input--num");i.type="number",i.min="5",i.max="500",i.value=String(e.pageSize??10),i.setAttribute("data-prop","pageSize"),Ye(i,()=>{if(i.value.trim()==="")return;const p=Math.round(Number(i.value));return Number.isFinite(p)?te([{op:"component-set",id:e.id,prop:"pageSize",value:Math.min(500,Math.max(5,p))}],{typed:!0}):void 0},!1,()=>String(z().find(p=>p.id===e.id)?.pageSize??10)),t.append(Ce("Rows per page",i))}e.type==="chart"&&(t.append(Re(e,"Chart","chart",e.chart,["bar","line","area","pie"])),t.append(Re(e,"Category","x",e.x,o(e.data.query))),(e.chart==="bar"||e.chart==="area")&&t.append(it(e,"Stacked","stacked",e.stacked===!0))),e.type==="kpi"&&(t.append(Re(e,"Figure","value",e.value,o(e.data.query))),t.append(Ae(e,"Caption","caption",e.caption,120))),e.type==="text"&&(t.append(Ae(e,"Text","text",e.text,4e3,!0)),t.append(Re(e,"Style","style",e.style??"body",["heading","body","caption"]))),e.type==="filter"&&t.append(Ae(e,"Label","label",e.label,120)),e.type==="button"&&t.append(Ae(e,"Label","label",e.action.label,60)),e.type==="link"&&t.append(Ae(e,"Label","label",e.label,120)),e.type==="image"&&t.append(Ae(e,"Description","alt",e.alt,300));const s=d("div","wk-prop-box");s.append(ze(e,"Column","x",1,12),ze(e,"Row","y",1,1e3),ze(e,"Width","w",1,12),ze(e,"Height","h",1,50)),t.append(s),t.append(it(e,"Hide on phones","hideOnPhone",e.hideOnPhone===!0));const l=d("button","wk-btn wk-btn--danger","Delete this component");return l.type="button",l.setAttribute("data-testid","apps-remove"),l.addEventListener("click",()=>{const i=e.id;T=null,te([{op:"component-remove",id:i}])}),t.append(l),t},rt=()=>{const e=d("aside","wk-props wk-props--empty");return e.setAttribute("aria-label","Properties"),e.setAttribute("data-testid","apps-properties-empty"),e.append(d("h3","wk-props-title","Properties")),e.append(d("p","wk-muted","Select a component to change it here. Double-click its words to edit them in place.")),e},Ft=()=>{const e=d("aside","wk-palette");e.setAttribute("aria-label","Components"),e.append(d("h3","wk-props-title","Components")),e.append(d("p","wk-muted","Drag onto the canvas, or click to add"));const t=d("div","wk-tiles");for(const n of Lt){const o=d("button","wk-tile",n.label);o.type="button",o.setAttribute("data-palette",n.type),o.addEventListener("pointerdown",s=>It(s,n.type,o)),o.addEventListener("click",s=>{if(s.detail!==0||!_()||Z===null)return;const l=Ge[n.type];te([{op:"component-add",page:Z,type:n.type,box:{x:0,y:st(),w:l.w,h:l.h}}])}),t.append(o)}return e.append(t),e},Y=(e={})=>{const t=S;let n=!1;if(t!==null){const o=_()?z().find(s=>s.id===t.id):void 0;if(n=o!==void 0&&dt(o,t.prop)===t.before,n&&t.composing()){t.defer();return}n?t.hold():t.drop()}zt(e),n&&t!==null&&S===t&&t.place()},zt=e=>{const t=document.activeElement instanceof HTMLElement&&f.contains(document.activeElement)?document.activeElement.getAttribute("data-prop"):null;if(Xe.clear(),Ze.clear(),h.reset(),O(void 0),f.setAttribute("data-mode",_()?"edit":"preview"),f.setAttribute("data-tile",v?"true":"false"),f.setAttribute("data-surface",le),L===null){f.replaceChildren(d("p","wk-empty",w??"Loading the app…")),Q=null;return}const n=[];_()&&n.push(Ft());const o=d("main","wk-main"),s=d("nav","wk-pages");s.setAttribute("aria-label","Pages");for(const r of L.pages){const m=d("button",r.id===Z?"wk-page is-on":"wk-page",I(r.title,80));m.type="button",m.setAttribute("aria-current",r.id===Z?"page":"false"),m.addEventListener("click",()=>{Z!==r.id&&(Z=r.id,Ne(null),Y(),Me())}),s.append(m)}o.append(s),he=d("p","wk-notice",w??""),he.setAttribute("data-testid","apps-notice"),he.setAttribute("aria-live","polite"),he.hidden=w===null,o.append(he),be&&X==="edit"&&o.append(d("p","wk-notice","A chat turn is changing this app: it is read-only until the turn ends")),me=d("div","wk-grid");const l=z(),i=[...l].sort((r,m)=>r.box.y-m.box.y||r.box.x-m.box.x);l.forEach((r,m)=>{Ze.set(r.id,m),h.place(m,r.box),h.phoneOrder(m,i.indexOf(r),r.hideOnPhone===!0),r.type==="chart"&&r.series.slice(0,12).forEach((M,$)=>h.seriesColour(m,$,M.color));const k=d("section",`wk-cell wk-cell--${r.type} wk-c${m}${r.id===T&&_()?" is-selected":""}`);if(k.setAttribute("data-component",r.id),r.title!==void 0&&r.type!=="text"){const M=d("h3","wk-cell-title",I(r.title,120));_()&&(M.setAttribute("data-inline","title"),M.classList.add("wk-editable"),M.setAttribute("title","Double-click to edit")),k.append(M)}const F=d("div","wk-cell-body");if(Xe.set(r.id,F),et(r,F),k.append(F),_()){k.classList.add("is-editable"),k.tabIndex=0,k.setAttribute("aria-label",`${r.type==="chart"?`${r.chart} chart`:r.type} ${I(r.title??r.id,80)}: Enter to select`),k.append(d("span","wk-tag",`${r.type==="chart"?`${r.chart} chart`:r.type}${"data"in r&&r.data!==void 0?` · ${r.data.query}`:""}`));const M=d("span","wk-handle");M.setAttribute("aria-hidden","true"),M.addEventListener("pointerdown",$=>ot($,r,"resize",M)),k.append(M),k.addEventListener("pointerdown",$=>{$.target.closest("input, select, textarea, button, .wk-handle")===null&&ot($,r,"move",k)}),k.addEventListener("pointerup",$=>{const K=$.target.closest?.("button[data-inline]");K!==null&&$.button===0&&pt(r.id,K)})}me.append(k)}),l.length===0&&me.append(d("p","wk-empty",_()?"Drag a component here from the palette":"This page is empty")),o.append(me),n.push(o);const p=_()&&T!==null?l.find(r=>r.id===T):void 0;if(e.keepProps===!0&&p!==void 0&&Q!==null&&We===p.id&&Q.parentNode===f){for(const r of[...f.childNodes])r!==Q&&r.remove();for(const r of n)f.insertBefore(r,Q);return}Q=ye?null:p!==void 0?at(p):_()?rt():null,We=p?.id??null,f.replaceChildren(...n,...Q!==null?[Q]:[]),t!==null&&[...f.querySelectorAll("[data-prop]")].find(r=>r.getAttribute("data-prop")===t)?.focus({preventScroll:!0})},lt=()=>{for(const n of f.querySelectorAll("[data-component]"))n.classList.toggle("is-selected",_()&&n.getAttribute("data-component")===T);const e=_()&&T!==null?z().find(n=>n.id===T):void 0,t=ye?null:e!==void 0?at(e):_()?rt():null;Q!==null&&t!==null&&Q.parentNode===f?Q.replaceWith(t):(Q?.remove(),t!==null&&f.append(t)),Q=t,We=e?.id??null},pt=(e,t)=>{const n=t?.getAttribute("data-inline")??null,o=Date.now();n!==null&&t!==null&&A!==null&&A.id===e&&A.prop===n&&o-A.at<Et?(A=null,t.isConnected&&ut(e,t)):A=n!==null?{id:e,prop:n,at:o}:null},dt=(e,t)=>{if(t==="title")return e.title??"";if(t==="text"&&e.type==="text")return e.text;if(t==="label"){if(e.type==="button")return e.action.label;if(e.type==="link")return e.label;if(e.type==="filter")return e.label??""}return""},ut=(e,t)=>{const n=z().find($=>$.id===e),o=t.getAttribute("data-inline");if(n===void 0||o===null||!_()||S!==null)return;const s=dt(n,o),l=o==="text",i=l?d("textarea","wk-inline-input wk-inline-input--multi"):d("input","wk-inline-input");i.value=s,i.maxLength=l?4e3:n.type==="button"?60:120,i.setAttribute("data-testid","apps-inline"),i.setAttribute("aria-label",`Edit the ${o==="text"?"text":o}`),t.replaceWith(i),i.closest("[data-component]")?.classList.add("is-inline"),i.focus(),i.select();let p=!1,a=!1,r=!1,m=!1,k=[null,null,"none"];const F={id:e,prop:o,before:s,drop:()=>{p=!0,r=!1,S===F&&(S=null)},hold:()=>{r=!0,k=[i.selectionStart,i.selectionEnd,i.selectionDirection??"none"]},composing:()=>a,defer:()=>{m=!0},place:()=>{const $=[...f.querySelectorAll("[data-component]")].find(oe=>oe.getAttribute("data-component")===e),K=$===void 0?void 0:[...$.querySelectorAll("[data-inline]")].find(oe=>oe.getAttribute("data-inline")===o);if(K===void 0){F.drop();return}K.replaceWith(i),$.classList.add("is-inline"),i.focus(),k[0]!==null&&k[1]!==null&&i.setSelectionRange(k[0],k[1],k[2]),r=!1}};S=F;const M=$=>{p||(F.drop(),$&&i.value!==s?te([{op:"component-set",id:e,prop:o,value:i.value}]):Y())};i.addEventListener("compositionstart",()=>{a=!0}),i.addEventListener("compositionend",()=>{a=!1,m&&(m=!1,p||Y())}),i.addEventListener("keydown",$=>{const K=$;if(!(a||K.isComposing||K.keyCode===229)){if(K.key==="Escape"){K.preventDefault(),K.stopPropagation(),M(!1);return}K.key==="Enter"&&!(l&&K.shiftKey)&&(K.preventDefault(),K.stopPropagation(),M(!0))}}),i.addEventListener("blur",()=>{r||(i.isConnected?M(!0):F.drop())})};f.addEventListener("dblclick",e=>{if(!_()||S!==null)return;const n=((typeof document.elementFromPoint=="function"?document.elementFromPoint(e.clientX,e.clientY):null)??e.target)?.closest("[data-inline]"),o=n?.closest("[data-component]");n==null||o===null||o===void 0||(e.preventDefault(),ut(o.getAttribute("data-component"),n))});function ct(e){if(b===null||L===null)return;const t=e.target?.closest?.(".wk-cell.is-editable");if(t!==null&&(e.key==="Enter"||e.key===" ")&&e.target===t){e.preventDefault();const s=t.getAttribute("data-component");s!==null&&(Ne(s),lt(),f.querySelector(".wk-props input, .wk-props select")?.focus());return}const n=e.target?.closest("input, textarea, select")!=null;if((e.metaKey||e.ctrlKey)&&!e.altKey&&e.key.toLowerCase()==="z"&&!n&&_()){e.preventDefault(),C("app.history",{move:e.shiftKey?"redo":"undo",base:ae}).then(s=>{s.ok||(w=s.message,s.code==="head_moved"?J():Y())});return}if((e.key==="Delete"||e.key==="Backspace")&&!n&&_()&&T!==null){e.preventDefault();const s=T;Ne(null),te([{op:"component-remove",id:s}]);return}e.key==="Escape"&&T!==null&&!n&&(Ne(null),Y())}document.addEventListener("keydown",ct),f.append(d("p","wk-empty","Loading the app…")),ft(c.editor,c.surfaces)}St({editor:"wicked-apps",surfaces:{card:{interactive:!0,aspect:"16:9",actions:[]},full:{}}})})();
|
|
149
|
+
</script>
|
|
150
|
+
</body>
|
|
151
|
+
</html>
|