wicked-studio 0.14.1 → 0.16.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 +68 -6
- package/dist/apps-standalone/fixture.html +12 -0
- package/dist/apps-standalone/fixture.js +10 -0
- package/dist/apps-standalone/runtime.css +139 -0
- package/dist/apps-standalone/runtime.js +1 -0
- package/dist/assets/KnowledgeGraph-AtkRlS3c.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-CdbCAs7s.css +32 -0
- package/dist/assets/index-DU_8o4uq.js +1104 -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 +25 -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 +10 -1
- package/dist/editors/wicked-page/index.html +12 -8
- package/dist/editors/wicked-video/editor.json +7 -2
- package/dist/editors/wicked-video/index.html +14 -11
- package/dist/fonts/LICENSE-WickedSans.txt +97 -0
- package/dist/index.html +3 -2
- package/dist/testid-inventory.json +12685 -6708
- package/package.json +9 -3
- 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.16.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.16.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 Kt=Object.defineProperty;var Zt=(ae,de,$e)=>de in ae?Kt(ae,de,{enumerable:!0,configurable:!0,writable:!0,value:$e}):ae[de]=$e;var Pe=(ae,de,$e)=>Zt(ae,typeof de!="symbol"?de+"":de,$e);(function(){"use strict";const ae="wicked.editor";function $e(u,c,h){return{editor:u,version:c,protocol:[1,2],surfaces:h}}function mt(u,c){const h=document.querySelector('meta[name="wicked-editor-version"]')?.getAttribute("content")??"0.0.0";parent.postMessage({p:ae,v:1,type:"plugin.ready",payload:$e(u,h,c)},"*")}const wt=/^[A-Z]{3}$/u;function ue(u,c,h){if(u==null)return"";if(typeof u=="boolean")return u?"yes":"no";const w=typeof c?.decimals=="number"&&Number.isInteger(c.decimals)?Math.min(10,Math.max(0,c.decimals)):void 0,m=typeof u=="number"?u:typeof u=="string"&&u.trim()!==""&&Number.isFinite(Number(u))?Number(u):null;try{switch(c?.kind){case"currency":if(m===null||!wt.test(c.currency))break;return new Intl.NumberFormat(h,{style:"currency",currency:c.currency,...w!==void 0?{minimumFractionDigits:w,maximumFractionDigits:w}:{}}).format(m);case"percent":if(m===null)break;return new Intl.NumberFormat(h,{style:"percent",maximumFractionDigits:w??1}).format(m);case"number":if(m===null)break;return new Intl.NumberFormat(h,w!==void 0?{minimumFractionDigits:w,maximumFractionDigits:w}:{}).format(m);case"date":case"datetime":{const O=new Date(typeof u=="number"?u:String(u));if(Number.isNaN(O.getTime()))break;return new Intl.DateTimeFormat(h,c.kind==="date"?{dateStyle:"medium",timeZone:"UTC"}:{dateStyle:"medium",timeStyle:"short"}).format(O)}case"duration":{if(m===null)break;const O=Math.abs(Math.round(m)),b=Math.floor(O/86400),x=Math.floor(O%86400/3600),Z=Math.floor(O%3600/60);return b>0?`${b}d ${x}h`:x>0?`${x}h ${Z}m`:`${Z}m`}default:break}}catch{}return typeof u=="number"?Number.isInteger(u)?String(u):new Intl.NumberFormat(h,{maximumFractionDigits:6}).format(u):String(u)}function T(u,c=200){return typeof u=="string"?u.replace(/[\u0000-\u001f\u007f]+/gu," ").slice(0,c):""}const yt="http://www.w3.org/2000/svg";function G(u,c,h){const w=document.createElementNS(yt,u);for(const[m,O]of Object.entries(c))w.setAttribute(m,String(O));return h!==void 0&&w.setAttribute("class",h),w}function Ce(u,c,h,w,m="start"){const O=G("text",{x:u,y:c,"text-anchor":m},w);return O.textContent=h,O}function be(u){return typeof u=="number"?Number.isFinite(u)?u:0:typeof u=="string"&&u.trim()!==""&&Number.isFinite(Number(u))?Number(u):0}const _=u=>Math.round(u*10)/10;function _e(u,c){const h=document.createElement("ul");h.className="wk-legend",c.forEach((w,m)=>{const O=document.createElement("li"),b=document.createElement("span");b.className=`wk-swatch wk-series-${m%12}`,O.append(b,document.createTextNode(w)),h.append(O)}),u.append(h)}function bt(u,c,h,w){const m=y=>h.columns.findIndex(g=>g.name===y),O=m(c.x),b=c.series.slice(0,c.chart==="pie"?1:12).map(y=>({label:T(y.label??y.column,60),i:m(y.column)})).filter(y=>y.i>=0),x=h.rows.slice(0,500);if(O<0||b.length===0||x.length===0){const y=document.createElement("p");y.className="wk-empty",y.textContent=x.length===0?"No rows":"This chart’s columns are not in its query’s rows",u.append(y);return}const Z=x.map(y=>ue(y[O],void 0,w));if(c.chart==="bar"){const y=c.stacked===!0&&b.length>1,g=x.map(I=>b.map(P=>be(I[P.i])));let v=0,E=0;for(const I of g)if(y)E=Math.max(E,I.filter(P=>P>0).reduce((P,H)=>P+H,0)),v=Math.min(v,I.filter(P=>P<0).reduce((P,H)=>P+H,0));else for(const P of I)E=Math.max(E,P),v=Math.min(v,P);E===v&&(E=v+1);const q=130,A=b.length>1?250:220,L=I=>q+(I-v)/(E-v)*A,C=L(0),S=y||b.length===1?26:Math.max(26,b.length*10+10),N=G("svg",{viewBox:`0 0 400 ${x.length*S+4}`,role:"img","aria-label":T(c.title??"bar chart",120)},"wk-chart wk-chart--bar");v<0&&N.append(G("line",{x1:_(C),x2:_(C),y1:0,y2:x.length*S+4},"wk-grid-line")),x.forEach((I,P)=>{const H=P*S+2;if(N.append(Ce(0,_(H+S/2+4),Z[P].slice(0,22),"wk-axis")),y){let Ee=0,ne=0;b.forEach((me,pe)=>{const oe=g[P][pe],U=oe>=0?Ee:ne+oe,He=oe>=0?Ee+oe:ne;oe>=0?Ee+=oe:ne+=oe,N.append(G("rect",{x:_(L(U)),y:H+4,width:_(Math.max(1,L(He)-L(U))),height:S-10},`wk-series-${pe%12}`))});return}const re=(S-8)/b.length;b.forEach((Ee,ne)=>{const me=g[P][ne],pe=Math.min(L(me),C),oe=Math.max(1,Math.abs(L(me)-C));N.append(G("rect",{x:_(pe),y:_(H+4+ne*re),width:_(oe),height:_(Math.max(2,re-2)),rx:2},`wk-series-${ne%12}`)),b.length===1&&N.append(Ce(_(me<0?pe-6:pe+oe+6),_(H+S/2+4),ue(I[Ee.i],void 0,w),"wk-value",me<0?"end":"start"))})}),u.append(N),b.length>1&&_e(u,b.map(I=>I.label));return}if(c.chart==="pie"){const y=b[0],g=x.reduce((q,A)=>q+Math.max(0,be(A[y.i])),0)||1,v=G("svg",{viewBox:"0 0 240 240",role:"img","aria-label":T(c.title??"pie chart",120)},"wk-chart wk-chart--pie");let E=-Math.PI/2;x.forEach((q,A)=>{const L=Math.max(0,be(q[y.i]))/g,C=E+L*Math.PI*2,S=C-E>Math.PI?1:0,N=P=>`${_(120+100*Math.cos(P))} ${_(120+100*Math.sin(P))}`,I=L>=.9999?"M 120 20 A 100 100 0 1 1 119.9 20 Z":`M 120 120 L ${N(E)} A 100 100 0 ${S} 1 ${N(C)} Z`;v.append(G("path",{d:I},`wk-series-${A%12}`)),E=C}),u.append(v),_e(u,Z.slice(0,12));return}const ge=600,ce=220,W=36,ve=24,Q=c.chart==="area"&&c.stacked===!0&&b.length>1,X=[],D=new Map;x.forEach((y,g)=>{if(X.push(g),!Q||g+1>=x.length)return;const v=new Map;b.forEach((E,q)=>{const A=be(x[g][E.i]),L=be(x[g+1][E.i]);if(A>0&&L<0||A<0&&L>0){const C=A/(A-L);v.set(C,[...v.get(C)??[],q])}});for(const E of[...v.keys()].sort((q,A)=>q-A))D.set(X.length,new Set(v.get(E))),X.push(g+E)});const ke=(y,g)=>{if(D.get(g)?.has(y)===!0)return 0;const v=X[g],E=Math.floor(v),q=v-E,A=be(x[E][b[y].i]);return q===0||E+1>=x.length?A:A+(be(x[E+1][b[y].i])-A)*q},B=b.map(()=>[]),R=b.map(()=>[]);let Y=0,fe=1;const xe=y=>{y<Y&&(Y=y),y>fe&&(fe=y)};X.forEach((y,g)=>{let v=0,E=0;b.forEach((q,A)=>{const L=ke(A,g);if(!Q){B[A][g]=[0,L],R[A][g]=[0,0],xe(L);return}const C=Math.max(0,L),S=Math.min(0,L);B[A][g]=[v,v+C],R[A][g]=[E+S,E],v+=C,E+=S,xe(v),xe(E)})});const ee=fe,le=Y,qe=y=>W+(x.length===1?0:y/(x.length-1)*(ge-W-8)),he=y=>ce-ve-(y-le)/(ee-le||1)*(ce-ve-10),te=G("svg",{viewBox:`0 0 ${ge} ${ce}`,role:"img","aria-label":T(c.title??`${c.chart} chart`,120)},`wk-chart wk-chart--${c.chart}`);for(let y=0;y<=3;y+=1){const g=le+(ee-le)*y/3;te.append(G("line",{x1:W,x2:ge-8,y1:_(he(g)),y2:_(he(g))},"wk-grid-line")),te.append(Ce(W-6,_(he(g)+4),ue(Math.round(g*10)/10,void 0,w),"wk-axis","end"))}const Te=x.length<=4?x.map((y,g)=>g):[0,Math.floor((x.length-1)/3),Math.floor((x.length-1)*2/3),x.length-1];for(const y of Te)te.append(Ce(_(qe(y)),ce-6,Z[y].slice(0,14),"wk-axis",y===0?"start":y===x.length-1?"end":"middle"));b.forEach((y,g)=>{const v=(S,N)=>`${_(qe(X[S]))},${_(he(N))}`;if(c.chart==="area"){const S=N=>{const I=X.map((H,re)=>v(re,N[re][1])),P=X.map((H,re)=>v(re,N[re][0])).reverse();return`M ${I.join(" L ")} L ${P.join(" L ")} Z`};te.append(G("path",{d:S(B[g])},`wk-area wk-series-${g}`)),Q&&R[g].some(([N,I])=>N!==I)&&te.append(G("path",{d:S(R[g])},`wk-area wk-area--neg wk-series-${g}`))}if(!Q){te.append(G("polyline",{points:X.map((S,N)=>v(N,ke(g,N))).join(" "),fill:"none"},`wk-stroke wk-series-${g}`));return}const E=[];let q=null,A=0,L=[];const C=(S,N)=>S<0?v(N,R[g][N][0]):v(N,B[g][N][1]);X.forEach((S,N)=>{const I=ke(g,N);if(D.get(N)?.has(g)===!0||I===0){q!==null&&q.push(C(A,N)),L.push(N);return}const P=I>0?1:-1;if(q===null)q=L.map(H=>C(P,H)),E.push(q),A=P;else if(P!==A){const H=L[L.length-1];q=H!==void 0?[C(P,H)]:[],E.push(q),A=P}q.push(C(P,N)),L=[]}),q===null&&L.length>1&&E.push(L.map(S=>C(1,S)));for(const S of E)S.length>1&&te.append(G("polyline",{points:S.join(" "),fill:"none"},`wk-stroke wk-series-${g}`))}),u.append(te),b.length>1&&_e(u,b.map(y=>y.label))}const gt=/^#[0-9a-fA-F]{6}$/u,je=/^(?::root|\.wk-c\d{1,4}(?: \.wk-[a-z]+)?)$/u,vt=/^(?:--[a-z0-9-]{1,40}|[a-z-]{1,40})$/u,kt="(max-width: 639px)";function Be(u){return typeof u=="string"&>.test(u)?u.toLowerCase():null}function Le(u,c,h,w){return Number.isInteger(u)?Math.min(h,Math.max(c,u)):w}function xt(u){return typeof u=="string"&&u.length<=200&&!/url\(|[;{}]|\/\*|\\/iu.test(u)?u:null}class Et{constructor(c){Pe(this,"sheet");Pe(this,"base");Pe(this,"rules",new Map);Pe(this,"phone",null);Pe(this,"phoneRules",new Map);if(c.sheet===null)throw new Error("the runtime stylesheet did not load");this.sheet=c.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(c){if(!je.test(c))throw new Error("a selector outside the runtime’s vocabulary");const h=this.rules.get(c);if(h!==void 0)return h;const w=this.sheet.insertRule(`${c} {}`,this.sheet.cssRules.length),m=this.sheet.cssRules[w];return this.rules.set(c,m),m}phoneRule(c){if(!je.test(c))throw new Error("a selector outside the runtime’s vocabulary");const h=this.phoneRules.get(c);if(h!==void 0)return h;if(this.phone===null){const O=this.sheet.insertRule(`@media ${kt} {}`,this.sheet.cssRules.length);this.phone=this.sheet.cssRules[O]}const w=this.phone.insertRule(`${c} {}`,this.phone.cssRules.length),m=this.phone.cssRules[w];return this.phoneRules.set(c,m),m}set(c,h,w){vt.test(h)&&c.style.setProperty(h,w)}theme(c,h){const w=this.rule(":root");for(const[b,x]of Object.entries(c)){const Z=xt(x);/^--[a-z0-9-]{1,40}$/u.test(b)&&Z!==null&&this.set(w,b,Z)}const m=Be(h.accent);m!==null&&this.set(w,"--app-accent",m),h.density==="compact"&&(this.set(w,"--row","36px"),this.set(w,"--gap","8px"));const O=Array.isArray(h.palette)?h.palette:[];for(let b=0;b<12;b+=1){const x=Be(O[b]);x!==null&&this.set(w,`--s${b}`,x)}}place(c,h){const w=this.rule(`.wk-c${c}`),m=Le(h.x,0,11,0),O=Le(h.w,1,12-m,1),b=Le(h.y,0,999,0),x=Le(h.h,1,50,1);this.set(w,"grid-column",`${m+1} / span ${O}`),this.set(w,"grid-row",`${b+1} / span ${x}`)}phoneOrder(c,h,w){const m=this.phoneRule(`.wk-c${c}`);this.set(m,"order",String(Le(h,0,9999,0))),w?this.set(m,"display","none"):m.style.removeProperty("display")}seriesColour(c,h,w){const m=Be(w);m!==null&&this.set(this.rule(`.wk-c${c}`),`--c${Le(h,0,11,0)}`,m)}}const Mt={comfortable:44,compact:36},Ge={comfortable:12,compact:8},At=450,Je=500,$t=/^[A-Za-z_][A-Za-z0-9_]{0,63}$/u,Oe=()=>Object.create(null);function Lt(u,c){if(u===void 0||c===null||c===void 0)return c;if((u.type==="number"||u.type==="integer")&&typeof c=="string"&&c.trim()!==""){const h=Number(c);return Number.isFinite(h)&&(u.type==="number"||Number.isInteger(h))?h:c}return u.type==="boolean"&&typeof c=="string"&&(c==="true"||c==="false")?c==="true":u.type==="string"&&(typeof c=="number"||typeof c=="boolean")?String(c):c}const j=u=>typeof u=="object"&&u!==null&&!Array.isArray(u),St=/^data:image\/(?:png|jpeg|gif|webp);base64,[A-Za-z0-9+/]+={0,2}$/u,Qe={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}},Nt=[{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(u,c,h){const w=document.createElement(u);return c!==void 0&&(w.className=c),h!==void 0&&(w.textContent=h),w}function et(u){return u.toISOString().slice(0,10)}function Pt(u){Ot(u)}function Ot(u,c){const h=document.getElementById("wk-apps-sheet")??null;if(!(h instanceof HTMLStyleElement)&&!(h instanceof HTMLLinkElement))return;const w=new Et(h),m=d("div","wk-app");m.setAttribute("data-testid","apps-runtime"),document.body.append(m);let O=null,b=new Set,x=!0,Z=!1,ge=!1,ce=!1,W="preview",ve="full",Q="en",X=0,D=null,ke=!1,B=null,R=null;const Y=Oe(),fe=Oe(),xe=Oe(),ee=new Map,le=new Map,qe=new Map,he=new Map,te=new Map;let Te=0,y=0;const g=new Map;let v=null;const E=new Map;let q=!1,A=null,L=null;const C=e=>{O?.postMessage({p:ae,v:1,...e})},S=(e,t)=>{y+=1;const n=`a${y}`;return C({type:e,id:n,payload:t}),new Promise(s=>g.set(n,s))},N=(e,t)=>C({type:e,payload:t}),I=e=>{const t=e.data;if(!j(t)||t.p!==ae||t.v!==1)return;const n=j(t.payload)?t.payload:{};if(typeof t.re=="string"){const s=g.get(t.re);if(s===void 0)return;g.delete(t.re);const o=j(t.error)?t.error:{};s(t.ok===!0?{ok:!0,payload:n}:{ok:!1,code:String(o.code??"unavailable"),message:T(o.message,300),payload:n});return}if(!q)switch(t.type){case"host.ping":typeof t.id=="string"&&C({re:t.id,ok:!0,payload:{}});return;case"host.theme":j(n.theme)&&(P=n.theme),V();return;case"artifact.changed":ne();return;case"app.mode":(n.mode==="edit"||n.mode==="preview")&&(W=n.mode,W==="preview"&&(R=null),V());return;case"data.invalidate":Me();return;case"host.surface":(n.surface==="card"||n.surface==="full")&&(ve=n.surface,V());return;case"selection.cleared":R=null,V();return;case"host.teardown":q=!0;for(const s of E.values())clearInterval(s);E.clear(),document.removeEventListener("keydown",ht),O?.close(),O=null,m.replaceChildren(d("p","wk-empty","Closed"));return;default:return}};let P={};const H=e=>{j(e)&&(P=e),w.theme(P,{accent:D?.theme?.accent,palette:D?.theme?.palette,density:D?.theme?.density})},re=()=>D?.theme?.density==="compact"?"compact":"comfortable",Ee=(e,t)=>{O=e,O.onmessage=I,b=new Set(Array.isArray(t.grants)?t.grants.filter(o=>typeof o=="string"):[]);const n=j(t.app)?t.app:{};if(x=n.framed!==!1,Z=n.tile===!0,ge=Z&&n.rows===!0,ce=n.propsHost===!0,W=n.mode==="edit"?"edit":"preview",ve=t.surface==="card"||t.size==="inline"?"card":"full",j(n.url))for(const[o,l]of Object.entries(n.url).slice(0,30))$t.test(o)&&typeof l=="string"&&l.length<=1e3&&(xe[o]=l);const s=j(t.prefs)?t.prefs:{};Q=typeof s.locale=="string"&&/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u.test(s.locale)?s.locale:"en",H(t.theme),ne()};window.addEventListener("message",e=>{const t=e.data;O!==null||e.source!==parent||!j(t)||t.p!==ae||t.type!=="host.hello"||e.ports[0]===void 0||Ee(e.ports[0],j(t.payload)?t.payload:{})});const ne=async()=>{const e=await S("artifact.read",{});if(!e.ok){v=e.message,V();return}const t=j(e.payload.content)?e.payload.content:{};if(t.type!=="app"||!j(t.spec)){v="This is not an app",V();return}const n=X;X=typeof e.payload.version=="number"?e.payload.version:0,D=t.spec,ke=t.readonly===!0,(B===null||!D.pages.some(o=>o.id===B))&&(B=D.pages[0]?.id??null),R!==null&&!U().some(o=>o.id===R)&&(R=null),v=null,Ke();const s=me();V(),(n!==X||s||ee.size===0)&&Me()},me=()=>{const e=new Map;for(const n of D?.pages??[])for(const s of n.components){const o=Ze(s);o!==null&&e.set(s.id,pe(o))}let t=!1;for(const n of[...ee.keys()])le.get(n)!==e.get(n)&&(ee.delete(n),le.delete(n),t=!0);return t},pe=e=>`${e.query}\0${JSON.stringify(e.params)}`,oe=()=>D?.pages.find(e=>e.id===B)??null,U=()=>oe()?.components??[],He=(e,t)=>{const n=Y[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},Ie=(e,t,n)=>{const s={},o=n?.properties??{};for(const[l,a]of Object.entries(e??{})){const[p,i,r]=a.split(".");let f;if(p==="filter"&&i!==void 0)f=He(i,r);else if(p==="row"&&i!==void 0&&t.row!==void 0&&Object.hasOwn(t.row,i))f=t.row[i];else if(p==="form"&&i!==void 0&&t.form!==void 0){const k=fe[t.form];f=k!==void 0&&Object.hasOwn(k,i)?k[i]:void 0}else p==="url"&&i!==void 0&&(f=xe[i]);f!==void 0&&f!==""&&(s[l]=Lt(Object.hasOwn(o,l)?o[l]:void 0,f))}return s},Ke=()=>{for(const e of D?.pages??[])for(const t of e.components)if(!(t.type!=="filter"||Y[t.id]!==void 0))if(t.filter==="date-range"){const n=j(t.default)&&Number.isInteger(t.default.lastDays)?Math.min(3650,Math.max(1,t.default.lastDays)):30,s=new Date;Y[t.id]={from:et(new Date(s.getTime()-n*864e5)),to:et(s)}}else Y[t.id]=typeof t.default=="string"?t.default:""},tt=e=>D?.queries.find(t=>t.id===e)?.params,Ze=e=>e.type==="table"||e.type==="chart"||e.type==="kpi"?{query:e.data.query,params:Ie(e.data.params,{},tt(e.data.query))}:e.type==="filter"&&e.filter==="select"&&e.options?.kind==="query"?{query:e.options.query.query,params:Ie(e.options.query.params,{},tt(e.options.query.query))}:null,Me=(e,t=!1)=>{if(q||!b.has("data.read")||D===null||Z&&!ge)return;Ke(),Te+=1;const n=Te,s=new Map;for(const o of U()){const l=Ze(o);if(l===null||e!==void 0&&l.query!==e||t&&ee.has(o.id))continue;const a=pe(l);let p=s.get(a);p===void 0&&(p=S("data.query",{query:l.query,params:l.params}).then(i=>{if(!i.ok)return{state:"error",message:i.message};const r=Array.isArray(i.payload.columns)?i.payload.columns:[],f=Array.isArray(i.payload.rows)?i.payload.rows.filter(Array.isArray):[];return{state:"rows",rows:{columns:r,rows:f,sample:i.payload.sample===!0,hasMore:i.payload.hasMore===!0,truncated:i.payload.truncated===!0}}}),s.set(a,p)),ee.has(o.id)||(ee.set(o.id,{state:"loading"}),le.set(o.id,a)),qe.set(o.id,n),p.then(i=>{!q&&qe.get(o.id)===n&&(ee.set(o.id,i),le.set(o.id,a),Fe(o.id))})}e===void 0&&qt()},qt=()=>{const e=new Map;for(const t of U()){const n=Ze(t),s=n===null?void 0:D?.queries.find(o=>o.id===n.query);s?.refresh?.mode==="every"&&e.set(s.id,Math.max(15,s.refresh.seconds))}for(const[t,n]of[...E]){const[s,o]=t.split("\0");e.get(s)!==Number(o)&&(clearInterval(n),E.delete(t))}for(const[t,n]of e){const s=`${t}\0${n}`;E.has(s)||E.set(s,setInterval(()=>{document.visibilityState==="visible"&&Me(t)},n*1e3))}},Dt=async(e,t,n)=>{if(x||W!=="preview"||!b.has("data.write"))return;const s=U().find(i=>i.id===e)?.type!=="button",o=i=>{s?(he.set(e,i),Fe(e)):ot(`${T(t.label,60)}: ${i}`)};o("Waiting for you in studio…");const l=await S("data.action",{action:t.action,params:Ie(t.params,n,D?.actions.find(i=>i.id===t.action)?.params)}),a=l.ok?String(l.payload.state):"refused",p=l.ok?T(l.payload.reason,200):l.message;o(a==="succeeded"?`Done${p!==""?`: ${p}`:""}`:a==="cancelled"?"Not run":a==="unknown"?`Not known whether it ran: ${p}`:`Not run: ${p}`)},We=(e,t,n,s="wk-btn wk-btn--sm")=>{if(x)return d("span","wk-muted","Open to make changes");const o=d("button",s,T(t.label,60));return o.type="button",o.setAttribute("data-action",t.action),Z||W!=="preview"||!b.has("data.write")?(o.setAttribute("aria-disabled","true"),o.title=Z?"":W==="edit"?"Actions run in Preview":"This app may not ask to run actions here"):o.addEventListener("click",l=>{l.stopPropagation(),Dt(e,t,n)}),o},Xe=new Map;let J=null,Ye=null;const Ue=new Map,nt=(e,t)=>{Ct(e,t),Rt(e,t)},Rt=(e,t)=>{if(!z())return;const n=(s,o)=>{s!==null&&(s.setAttribute("data-inline",o),s.classList.add("wk-editable"),s.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")},Ct=(e,t)=>{t.replaceChildren();const n=ee.get(e.id);if(e.type==="table"||e.type==="chart"||e.type==="kpi"){if(Z&&!ge){t.append(d("div",`wk-skeleton wk-skeleton--${e.type}`));return}if(!b.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 o=n?.state==="rows"?n.rows:null;switch(e.type){case"kpi":{const l=i=>i===void 0?-1:o.columns.findIndex(r=>r.name===i),a=o.rows[0];t.append(d("div","wk-kpi-value",a===void 0?"—":ue(a[l(e.value)],e.format,Q)));const p=d("div","wk-kpi-caption");if(a!==void 0&&e.delta!==void 0&&l(e.delta)>=0){const i=a[l(e.delta)],r=typeof i=="number"&&i<0||typeof i=="string"&&i.trim().startsWith("-");p.append(d("span",r?"wk-delta wk-delta--down":"wk-delta wk-delta--up",`${r?"▼":"▲"} ${ue(i,void 0,Q).replace(/^\s*-/u,"")}`)),p.append(document.createTextNode(" "))}e.caption!==void 0&&p.append(document.createTextNode(T(e.caption,120))),t.append(p);return}case"chart":bt(t,e,o,Q),(o.truncated||o.rows.length>Je)&&t.append(d("p","wk-muted",o.truncated?"Only part of the source’s rows: the answer was cut at the app’s limit":`The first ${Je} of ${o.rows.length} rows`));return;case"table":{Tt(e,t,o);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":{It(e,t);return}case"form":{Ft(e,t);return}case"button":t.append(We(e.id,e.action,{},"wk-btn"));return;case"image":{if(!St.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=T(e.alt,300),l.src=e.src,t.append(l);return}case"link":{const l=d("button","wk-link",T(e.label,120));if(l.type="button",e.to.kind==="page"){const a=e.to;l.addEventListener("click",()=>{if(W==="preview"){v=null;for(const[p,i]of Object.entries(Ie(a.params,{})))xe[p]=String(i);D?.pages.some(p=>p.id===a.page)&&(B=a.page,R=null,V(),Me())}})}else{const a=e.to.href;l.title=a.slice(0,300),l.addEventListener("click",async()=>{if(W!=="preview")return;const p=await S("link.open",{href:a});p.ok||ot(`${T(e.label,60)} not opened: ${p.message}`)})}t.append(l);return}}},Tt=(e,t,n)=>{const s=M=>n.columns.findIndex($=>$.name===M),o=(e.columns??n.columns.map(M=>({column:M.name}))).filter(M=>s(M.column)>=0),l=Math.min(500,Math.max(5,e.pageSize??10)),a=Math.max(1,Math.ceil(n.rows.length/l)),p=Math.min(te.get(e.id)??0,a-1),i=d("table","wk-table"),r=d("tr");for(const M of o)r.append(d("th",void 0,T(M.label??M.column,80)));(e.rowActions??[]).length>0&&r.append(d("th","wk-th-actions","")),i.append(d("thead")),i.tHead.append(r);const f=d("tbody");for(const M of n.rows.slice(p*l,p*l+l)){const $=d("tr"),K=Oe();n.columns.forEach((ie,Ne)=>{K[ie.name]=M[Ne]??null});for(const ie of o){const Ne=M[s(ie.column)];$.append(d("td",typeof Ne=="number"?"wk-num":void 0,ue(Ne,ie.format,Q)))}if((e.rowActions??[]).length>0){const ie=d("td","wk-td-actions");for(const Ne of(e.rowActions??[]).slice(0,4))ie.append(We(e.id,Ne,{row:K}));$.append(ie)}f.append($)}i.append(f),t.append(i),n.rows.length===0&&t.append(d("p","wk-muted","No rows"));const k=d("div","wk-table-foot");if(a>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>=a-1,M.addEventListener("click",()=>{te.set(e.id,p-1),Fe(e.id)}),$.addEventListener("click",()=>{te.set(e.id,p+1),Fe(e.id)}),k.append(M,d("span","wk-muted",`${p+1} of ${a}`),$)}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=he.get(e.id);F!==void 0&&k.append(d("span","wk-status",F)),k.childNodes.length>0&&t.append(k)},It=(e,t)=>{const n=d("label","wk-filter");n.append(d("span","wk-filter-label",T(e.label??(e.filter==="search"?"Search":e.filter==="date-range"?"Dates":"Filter"),60)));const s=()=>{Me()};if(e.filter==="search"){const o=d("input","wk-input");o.type="search",o.value=typeof Y[e.id]=="string"?Y[e.id]:"";let l=null;o.addEventListener("input",()=>{Y[e.id]=o.value.slice(0,200),l!==null&&clearTimeout(l),l=setTimeout(s,300)}),n.append(o)}else if(e.filter==="select"){const o=d("select","wk-input"),l=[{value:"",label:"All"}];if(e.options?.kind==="values")for(const a of e.options.values.slice(0,200))l.push({value:T(a.value,200),label:T(a.label??a.value,200)});if(e.options?.kind==="query"){const a=ee.get(e.id);if(a?.state==="rows"){const p=a.rows.columns.findIndex(r=>r.name===e.options.value),i=a.rows.columns.findIndex(r=>r.name===(e.options.label??""));for(const r of a.rows.rows.slice(0,200))p>=0&&l.push({value:ue(r[p],void 0,Q),label:ue(r[i>=0?i:p],void 0,Q)})}}for(const a of l){const p=d("option",void 0,a.label);p.value=a.value,o.append(p)}o.value=typeof Y[e.id]=="string"?Y[e.id]:"",o.addEventListener("change",()=>{Y[e.id]=o.value,s()}),n.append(o)}else{const o=Y[e.id]??{from:"",to:""},l=d("input","wk-input wk-input--date"),a=d("input","wk-input wk-input--date");l.type="date",a.type="date",l.value=o.from,a.value=o.to;const p=()=>{Y[e.id]={from:l.value,to:a.value},s()};l.addEventListener("change",p),a.addEventListener("change",p),n.append(l,d("span","wk-muted","–"),a)}t.append(n)},Ft=(e,t)=>{var p;const n=fe[p=e.id]??(fe[p]=Oe()),s=D?.actions.find(i=>i.id===e.submit.action)?.params?.properties??{};for(const i of e.fields){if(Object.hasOwn(n,i.name))continue;const r=e.submit.params===void 0?void 0:Object.entries(e.submit.params).find(([,k])=>k===`form.${i.name}`)?.[0],f=r!==void 0&&Object.hasOwn(s,r)?s[r].default:void 0;i.input==="checkbox"?n[i.name]=f===!0:f!==void 0&&(n[i.name]=String(f))}const o=d("div","wk-form");for(const i of e.fields.slice(0,30)){const r=d("label","wk-field");r.append(d("span","wk-filter-label",T(i.label??i.name,80)));let f;if(i.input==="textarea")f=d("textarea","wk-input");else if(i.input==="select"){f=d("select","wk-input");for(const k of i.options??[]){const F=d("option",void 0,T(k.label??k.value,200));F.value=T(k.value,200),f.append(F)}}else f=d("input","wk-input"),f.type=i.input==="number"?"number":i.input==="date"?"date":i.input==="checkbox"?"checkbox":"text";f instanceof HTMLInputElement&&f.type==="checkbox"?(f.checked=n[i.name]===!0,f.addEventListener("change",()=>{n[i.name]=f.checked})):(f.value=typeof n[i.name]=="string"?n[i.name]:"",f.addEventListener("input",()=>{n[i.name]=f.value.slice(0,1e3)})),f.disabled=W!=="preview",r.append(f),o.append(r)}const l=d("div","wk-form-foot");l.append(We(e.id,e.submit,{form:e.id},"wk-btn"));const a=he.get(e.id);l.append(d("span","wk-muted",a??(x?"":"Studio asks before it writes"))),o.append(l),t.append(o)};let we=null;const ot=e=>{v=e,we!==null?(we.textContent=e,we.hidden=!1):V()},Fe=e=>{if(A!==null&&A.id===e)return;const t=U().find(s=>s.id===e),n=Ue.get(e);t!==void 0&&n!==void 0&&nt(t,n)},z=()=>W==="edit"&&ve==="full"&&!ke&&b.has("artifact.write");let ye=null;const st=()=>{const e=ye.getBoundingClientRect(),t=re();return{col:(e.width+Ge[t])/12,row:Mt[t]+Ge[t],left:e.left,top:e.top}},zt=(e,t)=>{const n=st();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)))}},se=async(e,t={})=>{const n=await S("spec.edit",{base:X,ops:e});if(!n.ok)return v=n.code==="head_moved"?"The app changed meanwhile: showing the newest version":`Not changed: ${n.message}`,n.code==="head_moved"?await ne():V(),null;j(n.payload.spec)&&(D=n.payload.spec),v=null,Ke(),me();const s=Array.isArray(n.payload.added)?n.payload.added.filter(o=>typeof o=="string"):[];return s[0]!==void 0&&Se(s[0]),V({keepProps:t.typed===!0&&s.length===0}),Me(void 0,!0),s},Se=e=>{const t=R;R=e,e!==null&&b.has("selection.chip")?N("selection.set",{anchors:[{kind:"element",id:e}]}):e===null&&t!==null&&b.has("selection.chip")&&N("selection.set",{anchors:[]})},it=(e,t,n,s)=>{if(!z()||e.button!==0)return;e.preventDefault(),e.stopPropagation(),(s.closest(".wk-cell")??s).focus({preventScroll:!0});const o=Xe.get(t.id),l=st(),a={x:e.clientX,y:e.clientY};let p={...t.box},i=!1;const r=n==="move"?e.target?.closest?.("[data-inline]"):null;s.setPointerCapture(e.pointerId),s.classList.add("is-dragging");const f=F=>{const M=Math.round((F.clientX-a.x)/l.col),$=Math.round((F.clientY-a.y)/l.row);M===0&&$===0&&!i||(i=!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+$))},w.place(o,p))},k=()=>{s.removeEventListener("pointermove",f),s.removeEventListener("pointerup",k),s.removeEventListener("pointercancel",k),s.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(!i||!F){w.place(o,t.box),i||(Se(t.id),dt(),ut(t.id,r));return}se([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}])};s.addEventListener("pointermove",f),s.addEventListener("pointerup",k),s.addEventListener("pointercancel",k)},at=()=>U().reduce((e,t)=>Math.max(e,t.box.y+t.box.h),0),_t=(e,t,n)=>{if(!z()||e.button!==0||ye===null||B===null)return;e.preventDefault(),n.focus({preventScroll:!0});const s=Qe[t],o=d("div","wk-drop wk-c9999");o.setAttribute("data-testid","apps-drop-target");let l=null;n.setPointerCapture(e.pointerId);const a=i=>{const r=ye.getBoundingClientRect();if(i.clientX<r.left||i.clientX>r.right||i.clientY<r.top){o.remove(),l=null;return}l=zt(i.clientX,i.clientY),l.x=Math.min(l.x,12-s.w),w.place(9999,{x:l.x,y:l.y,w:s.w,h:s.h}),o.parentNode===null&&ye.append(o)},p=i=>{if(n.removeEventListener("pointermove",a),n.removeEventListener("pointerup",p),n.removeEventListener("pointercancel",p),o.remove(),Math.abs(i.clientX-e.clientX)+Math.abs(i.clientY-e.clientY)>6&&l===null)return;const f=l??{x:0,y:at()};se([{op:"component-add",page:B,type:t,box:{x:f.x,y:f.y,w:Math.min(s.w,12-f.x),h:s.h}}])};n.addEventListener("pointermove",a),n.addEventListener("pointerup",p),n.addEventListener("pointercancel",p)},Ve=(e,t,n=!1,s)=>{let o=e.value,l=null;const a=()=>{if(e.value===o)return;o=e.value;const i=t();if(i===void 0)return;const r=Promise.resolve(i);l=r,r.finally(()=>{l===r&&(l=null)})};let p=!1;e.addEventListener("compositionstart",()=>{p=!0}),e.addEventListener("compositionend",()=>{p=!1,a()}),e.addEventListener("input",i=>{!p&&i.isComposing!==!0&&a()}),s!==void 0&&e.addEventListener("blur",()=>{const i=()=>{if(document.activeElement===e)return;const r=s();e.value!==r&&(e.value=r,o=r)};l!==null?l.then(i,i):i()}),e.addEventListener("change",()=>{p||a()}),e.addEventListener("keydown",i=>{const r=i;p||r.isComposing||r.keyCode===229||r.key==="Enter"&&(!n||r.metaKey||r.ctrlKey)&&(r.preventDefault(),a())})},De=(e,t)=>{const n=d("label","wk-prop");return n.append(d("span","wk-prop-label",e),t),n},Ae=(e,t,n,s,o,l=!1)=>{const a=d(l?"textarea":"input","wk-input");return a.value=s??"",a.maxLength=o,a.setAttribute("data-prop",n),Ve(a,()=>se([{op:"component-set",id:e.id,prop:n,value:a.value}],{typed:!0}),l,()=>{const p=U().find(r=>r.id===e.id),i=n==="label"&&p?.type==="button"?p.action?.label:p?.[n];return typeof i=="string"?i:""}),De(t,a)},Re=(e,t,n,s,o,l="set")=>{const a=d("select","wk-input");for(const p of o){const i=d("option",void 0,p);i.value=p,a.append(i)}return a.value=s,a.setAttribute("data-prop",n),a.addEventListener("change",()=>{se([l==="bind"?{op:"bind",id:e.id,query:a.value}:{op:"component-set",id:e.id,prop:n,value:a.value}])}),De(t,a)},rt=(e,t,n,s)=>{const o=d("input","wk-check");return o.type="checkbox",o.checked=s,o.setAttribute("data-prop",n),o.addEventListener("change",()=>{se([{op:"component-set",id:e.id,prop:n,value:o.checked}])}),De(t,o)},ze=(e,t,n,s,o)=>{const l=d("input","wk-input wk-input--num");l.type="number",l.min=String(s),l.max=String(o),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 a=()=>U().find(i=>i.id===e.id)?.box??e.box,p=i=>String(n==="x"?i.x+1:n==="y"?i.y+1:i[n]);return Ve(l,()=>{if(l.value.trim()==="")return;const i=Math.round(Number(l.value));if(!Number.isFinite(i))return;const r=a();if(n==="x"||n==="y"){const F=n==="x"?Math.min(12-r.w,Math.max(0,i-1)):r.x,M=n==="y"?Math.max(0,i-1):r.y;return se([{op:"component-move",id:e.id,x:F,y:M}],{typed:!0})}const f=n==="w"?Math.min(12-r.x,Math.max(1,i)):r.w,k=n==="h"?Math.min(50,Math.max(1,i)):r.h;return se([{op:"component-resize",id:e.id,w:f,h:k}],{typed:!0})},!1,()=>p(a())),De(t,l)},lt=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=(D?.queries??[]).map(a=>a.id),s=a=>D?.queries.find(p=>p.id===a)?.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 a=d("input","wk-input wk-input--num");a.type="number",a.min="5",a.max="500",a.value=String(e.pageSize??10),a.setAttribute("data-prop","pageSize"),Ve(a,()=>{if(a.value.trim()==="")return;const p=Math.round(Number(a.value));return Number.isFinite(p)?se([{op:"component-set",id:e.id,prop:"pageSize",value:Math.min(500,Math.max(5,p))}],{typed:!0}):void 0},!1,()=>String(U().find(p=>p.id===e.id)?.pageSize??10)),t.append(De("Rows per page",a))}e.type==="chart"&&(t.append(Re(e,"Chart","chart",e.chart,["bar","line","area","pie"])),t.append(Re(e,"Category","x",e.x,s(e.data.query))),(e.chart==="bar"||e.chart==="area")&&t.append(rt(e,"Stacked","stacked",e.stacked===!0))),e.type==="kpi"&&(t.append(Re(e,"Figure","value",e.value,s(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 o=d("div","wk-prop-box");o.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(o),t.append(rt(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 a=e.id;R=null,se([{op:"component-remove",id:a}])}),t.append(l),t},pt=()=>{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},Bt=()=>{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 Nt){const s=d("button","wk-tile",n.label);s.type="button",s.setAttribute("data-palette",n.type),s.addEventListener("pointerdown",o=>_t(o,n.type,s)),s.addEventListener("click",o=>{if(o.detail!==0||!z()||B===null)return;const l=Qe[n.type];se([{op:"component-add",page:B,type:n.type,box:{x:0,y:at(),w:l.w,h:l.h}}])}),t.append(s)}return e.append(t),e},V=(e={})=>{const t=A;let n=!1;if(t!==null){const s=z()?U().find(o=>o.id===t.id):void 0;if(n=s!==void 0&&ct(s,t.prop)===t.before,n&&t.composing()){t.defer();return}n?t.hold():t.drop()}Ht(e),n&&t!==null&&A===t&&t.place()},Ht=e=>{const t=document.activeElement instanceof HTMLElement&&m.contains(document.activeElement)?document.activeElement.getAttribute("data-prop"):null;if(Ue.clear(),Xe.clear(),w.reset(),H(void 0),m.setAttribute("data-mode",z()?"edit":"preview"),m.setAttribute("data-tile",Z?"true":"false"),m.setAttribute("data-surface",ve),D===null){m.replaceChildren(d("p","wk-empty",v??"Loading the app…")),J=null;return}const n=[];z()&&n.push(Bt());const s=d("main","wk-main"),o=d("nav","wk-pages");o.setAttribute("aria-label","Pages");for(const r of D.pages){const f=d("button",r.id===B?"wk-page is-on":"wk-page",T(r.title,80));f.type="button",f.setAttribute("aria-current",r.id===B?"page":"false"),f.addEventListener("click",()=>{B!==r.id&&(B=r.id,Se(null),V(),Me())}),o.append(f)}s.append(o),we=d("p","wk-notice",v??""),we.setAttribute("data-testid","apps-notice"),we.setAttribute("aria-live","polite"),we.hidden=v===null,s.append(we),ke&&W==="edit"&&s.append(d("p","wk-notice","A chat turn is changing this app: it is read-only until the turn ends")),ye=d("div","wk-grid");const l=U(),a=[...l].sort((r,f)=>r.box.y-f.box.y||r.box.x-f.box.x);l.forEach((r,f)=>{Xe.set(r.id,f),w.place(f,r.box),w.phoneOrder(f,a.indexOf(r),r.hideOnPhone===!0),r.type==="chart"&&r.series.slice(0,12).forEach((M,$)=>w.seriesColour(f,$,M.color));const k=d("section",`wk-cell wk-cell--${r.type} wk-c${f}${r.id===R&&z()?" is-selected":""}`);if(k.setAttribute("data-component",r.id),r.title!==void 0&&r.type!=="text"){const M=d("h3","wk-cell-title",T(r.title,120));z()&&(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(Ue.set(r.id,F),nt(r,F),k.append(F),z()){k.classList.add("is-editable"),k.tabIndex=0,k.setAttribute("aria-label",`${r.type==="chart"?`${r.chart} chart`:r.type} ${T(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",$=>it($,r,"resize",M)),k.append(M),k.addEventListener("pointerdown",$=>{$.target.closest("input, select, textarea, button, .wk-handle")===null&&it($,r,"move",k)}),k.addEventListener("pointerup",$=>{const K=$.target.closest?.("button[data-inline]");K!==null&&$.button===0&&ut(r.id,K)})}ye.append(k)}),l.length===0&&ye.append(d("p","wk-empty",z()?"Drag a component here from the palette":"This page is empty")),s.append(ye),n.push(s);const p=z()&&R!==null?l.find(r=>r.id===R):void 0;if(e.keepProps===!0&&p!==void 0&&J!==null&&Ye===p.id&&J.parentNode===m){for(const r of[...m.childNodes])r!==J&&r.remove();for(const r of n)m.insertBefore(r,J);return}J=ce?null:p!==void 0?lt(p):z()?pt():null,Ye=p?.id??null,m.replaceChildren(...n,...J!==null?[J]:[]),t!==null&&[...m.querySelectorAll("[data-prop]")].find(r=>r.getAttribute("data-prop")===t)?.focus({preventScroll:!0})},dt=()=>{for(const n of m.querySelectorAll("[data-component]"))n.classList.toggle("is-selected",z()&&n.getAttribute("data-component")===R);const e=z()&&R!==null?U().find(n=>n.id===R):void 0,t=ce?null:e!==void 0?lt(e):z()?pt():null;J!==null&&t!==null&&J.parentNode===m?J.replaceWith(t):(J?.remove(),t!==null&&m.append(t)),J=t,Ye=e?.id??null},ut=(e,t)=>{const n=t?.getAttribute("data-inline")??null,s=Date.now();n!==null&&t!==null&&L!==null&&L.id===e&&L.prop===n&&s-L.at<At?(L=null,t.isConnected&&ft(e,t)):L=n!==null?{id:e,prop:n,at:s}:null},ct=(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""},ft=(e,t)=>{const n=U().find($=>$.id===e),s=t.getAttribute("data-inline");if(n===void 0||s===null||!z()||A!==null)return;const o=ct(n,s),l=s==="text",a=l?d("textarea","wk-inline-input wk-inline-input--multi"):d("input","wk-inline-input");a.value=o,a.maxLength=l?4e3:n.type==="button"?60:120,a.setAttribute("data-testid","apps-inline"),a.setAttribute("aria-label",`Edit the ${s==="text"?"text":s}`),t.replaceWith(a),a.closest("[data-component]")?.classList.add("is-inline"),a.focus(),a.select();let p=!1,i=!1,r=!1,f=!1,k=[null,null,"none"];const F={id:e,prop:s,before:o,drop:()=>{p=!0,r=!1,A===F&&(A=null)},hold:()=>{r=!0,k=[a.selectionStart,a.selectionEnd,a.selectionDirection??"none"]},composing:()=>i,defer:()=>{f=!0},place:()=>{const $=[...m.querySelectorAll("[data-component]")].find(ie=>ie.getAttribute("data-component")===e),K=$===void 0?void 0:[...$.querySelectorAll("[data-inline]")].find(ie=>ie.getAttribute("data-inline")===s);if(K===void 0){F.drop();return}K.replaceWith(a),$.classList.add("is-inline"),a.focus(),k[0]!==null&&k[1]!==null&&a.setSelectionRange(k[0],k[1],k[2]),r=!1}};A=F;const M=$=>{p||(F.drop(),$&&a.value!==o?se([{op:"component-set",id:e,prop:s,value:a.value}]):V())};a.addEventListener("compositionstart",()=>{i=!0}),a.addEventListener("compositionend",()=>{i=!1,f&&(f=!1,p||V())}),a.addEventListener("keydown",$=>{const K=$;if(!(i||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))}}),a.addEventListener("blur",()=>{r||(a.isConnected?M(!0):F.drop())})};m.addEventListener("dblclick",e=>{if(!z()||A!==null)return;const n=((typeof document.elementFromPoint=="function"?document.elementFromPoint(e.clientX,e.clientY):null)??e.target)?.closest("[data-inline]"),s=n?.closest("[data-component]");n==null||s===null||s===void 0||(e.preventDefault(),ft(s.getAttribute("data-component"),n))});function ht(e){if(O===null||D===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 o=t.getAttribute("data-component");o!==null&&(Se(o),dt(),m.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&&z()){e.preventDefault(),S("app.history",{move:e.shiftKey?"redo":"undo",base:X}).then(o=>{o.ok||(v=o.message,o.code==="head_moved"?ne():V())});return}if((e.key==="Delete"||e.key==="Backspace")&&!n&&z()&&R!==null){e.preventDefault();const o=R;Se(null),se([{op:"component-remove",id:o}]);return}e.key==="Escape"&&R!==null&&!n&&(Se(null),V())}document.addEventListener("keydown",ht),m.append(d("p","wk-empty","Loading the app…")),mt(u.editor,u.surfaces)}Pt({editor:"wicked-apps",surfaces:{card:{interactive:!0,aspect:"16:9",actions:[]},full:{}}})})();
|
|
149
|
+
</script>
|
|
150
|
+
</body>
|
|
151
|
+
</html>
|