@sanity/runtime-cli 4.3.3 → 4.3.4
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 +17 -17
- package/dist/commands/blueprints/config.d.ts +1 -1
- package/dist/commands/blueprints/config.js +8 -8
- package/dist/commands/blueprints/init.d.ts +1 -1
- package/dist/commands/blueprints/init.js +8 -8
- package/dist/commands/functions/logs.d.ts +1 -1
- package/dist/commands/functions/logs.js +8 -8
- package/dist/server/static/components/app.css +850 -40
- package/dist/server/static/components/dataset-dropdown.js +5 -3
- package/dist/server/static/components/filters.d.ts +1 -0
- package/dist/server/static/components/filters.js +20 -0
- package/dist/server/static/components/function-list.js +2 -2
- package/dist/server/static/components/payload-panel.js +17 -17
- package/dist/server/static/components/projects-dropdown.js +5 -3
- package/dist/server/static/components/response-panel.js +18 -10
- package/dist/server/static/index.html +8 -29
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
import {ApiBaseElement} from './api-base.js'
|
|
3
3
|
|
|
4
4
|
const template = `<fieldset class="mar-t-sm">
|
|
5
|
-
<label
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
<label class="config-label">
|
|
6
|
+
<span>Dataset</span>
|
|
7
|
+
<select id="datasetname" style="background: transparent; color: light-dark(var(--gray-950), var(--gray-300));">
|
|
8
|
+
</select>
|
|
9
|
+
</label>
|
|
8
10
|
</fieldset>
|
|
9
11
|
`
|
|
10
12
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
class FiltersComponent extends HTMLElement {
|
|
2
|
+
connectedCallback() {
|
|
3
|
+
this.innerHTML = `
|
|
4
|
+
<form style="display:flex; gap: 8px;padding-left: 12px; padding-bottom: 24px; border-bottom: 1px solid var(--card-border-color);">
|
|
5
|
+
<dataset-dropdown></dataset-dropdown>
|
|
6
|
+
<fieldset class="mar-t-sm">
|
|
7
|
+
<label class="config-label">
|
|
8
|
+
<span>API Version</span>
|
|
9
|
+
|
|
10
|
+
<input name="apiVersion" id="apiversion" style="background: transparent; border-color: light-dark(var(--gray-200), var(--gray-700))">
|
|
11
|
+
</label>
|
|
12
|
+
</fieldset>
|
|
13
|
+
<projects-dropdown></projects-dropdown>
|
|
14
|
+
|
|
15
|
+
</form>
|
|
16
|
+
`
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
customElements.define('filters-component', FiltersComponent)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* globals customElements */
|
|
2
2
|
import {ApiBaseElement} from './api-base.js'
|
|
3
3
|
|
|
4
|
-
const template = `<ol class="hidden-lg" type="content"></ol>
|
|
4
|
+
const template = `<ol class="hidden-lg" type="content" style="padding:0 16px;"></ol>
|
|
5
5
|
<fieldset class="pad-sm hidden block-lg"><select></select></fieldset>
|
|
6
6
|
`
|
|
7
7
|
|
|
@@ -19,7 +19,7 @@ class FunctionList extends ApiBaseElement {
|
|
|
19
19
|
this.list.innerHTML = this.api.store.functions
|
|
20
20
|
.map((func) => {
|
|
21
21
|
const selected = this.api.store.selectedIndex === func.src ? 'selected' : ''
|
|
22
|
-
return `<li class="
|
|
22
|
+
return `<li class="function-list-item ${selected}" style="padding: 16px 24px;">${func.name}</li>`
|
|
23
23
|
})
|
|
24
24
|
.join('')
|
|
25
25
|
this.select.innerHTML = this.api.store.functions
|
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
import {EditorView, basicSetup, json} from '../vendor/vendor.bundle.js'
|
|
3
3
|
import {ApiBaseElement} from './api-base.js'
|
|
4
4
|
|
|
5
|
-
const template = `<
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
<
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
</
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
</
|
|
16
|
-
<
|
|
17
|
-
</
|
|
5
|
+
const template = `<div class="gutter-gradient relative h-100 max-h-100 y-scroll">
|
|
6
|
+
<div class="bg gutter-gradient sticky top-0 right-0 left-0 z-100">
|
|
7
|
+
<div class="flex items-center space-between" style="padding: 8px 20px 8px 48px;">
|
|
8
|
+
<h2 class="config-label mar-t-0 mar-b-0">Event</h2>
|
|
9
|
+
<button ord="primary" class="sanity-button">
|
|
10
|
+
<span>Run</span>
|
|
11
|
+
<svg data-sanity-icon="play" width="1em" height="1em" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.5 18.5V6.5L17.5 12.5L7.5 18.5Z" fill="currentColor" stroke="currentColor" stroke-width="1.2" stroke-linejoin="round"></path></svg>
|
|
12
|
+
</button>
|
|
13
|
+
</div>
|
|
14
|
+
<hr class='hr-border' style='margin-left: 31px; ' />
|
|
15
|
+
</div>
|
|
16
|
+
<div id="payload" name="payload" class='max-h-100 min-h-0'></div>
|
|
17
|
+
</div>
|
|
18
18
|
`
|
|
19
19
|
class PayloadPanel extends ApiBaseElement {
|
|
20
20
|
invoke = () => {
|
|
@@ -35,16 +35,16 @@ class PayloadPanel extends ApiBaseElement {
|
|
|
35
35
|
this.button.innerHTML = '<network-spinner></network-spinner>'
|
|
36
36
|
} else {
|
|
37
37
|
this.button.removeAttribute('disabled')
|
|
38
|
-
this.button.innerText = '
|
|
38
|
+
this.button.innerText = 'Run'
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
connectedCallback() {
|
|
43
43
|
this.innerHTML = template
|
|
44
44
|
this.payload = this.querySelector('#payload')
|
|
45
|
-
this.apiVersion =
|
|
46
|
-
this.datasetname =
|
|
47
|
-
this.productId =
|
|
45
|
+
this.apiVersion = document.querySelector('#apiversion')
|
|
46
|
+
this.datasetname = document.querySelector('#datasetname')
|
|
47
|
+
this.productId = document.querySelector('#project')
|
|
48
48
|
this.button = this.querySelector('button')
|
|
49
49
|
this.button.addEventListener('click', this.invoke)
|
|
50
50
|
this.api.subscribe(this.updateButtonText, ['inprogress'])
|
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
import {ApiBaseElement} from './api-base.js'
|
|
3
3
|
|
|
4
4
|
const template = `<fieldset class="mar-t-sm">
|
|
5
|
-
<label
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
<label class='config-label'>
|
|
6
|
+
<span>Project</span>
|
|
7
|
+
<select id="project" style="background: transparent; color: light-dark(var(--gray-950), var(--gray-300));">
|
|
8
|
+
</select>
|
|
9
|
+
</label>
|
|
8
10
|
</fieldset>
|
|
9
11
|
`
|
|
10
12
|
|
|
@@ -10,30 +10,38 @@ import {
|
|
|
10
10
|
} from '../vendor/vendor.bundle.js'
|
|
11
11
|
import {ApiBaseElement} from './api-base.js'
|
|
12
12
|
|
|
13
|
-
const template = `<
|
|
14
|
-
<m-tabs role="tablist">
|
|
15
|
-
<button id="a" role="tab" aria-selected="true">Response</button>
|
|
16
|
-
<button id="b" role="tab">Console</button>
|
|
13
|
+
const template = `<div class="gutter-gradient border-left h-100">
|
|
14
|
+
<m-tabs id="response-tabs" role="tablist">
|
|
15
|
+
<button class="tab" id="a" role="tab" aria-selected="true">Response</button>
|
|
16
|
+
<button class="tab" id="b" role="tab">Console</button>
|
|
17
17
|
</m-tabs>
|
|
18
|
-
<
|
|
19
|
-
|
|
18
|
+
<hr class="hr-border" style="margin-left: 31px" />
|
|
19
|
+
<div role="tabpanel" data-tab-id="a" class="h-100">
|
|
20
|
+
<div>
|
|
20
21
|
<span id="time"></span> <span id="size"></span>
|
|
21
22
|
</div>
|
|
22
23
|
<div id="response" name="response"></div>
|
|
23
24
|
</div>
|
|
24
|
-
<div role="tabpanel" data-tab-id="b" class="pad-t-sm" hidden><pre></pre></div>
|
|
25
|
-
</
|
|
25
|
+
<div role="tabpanel" data-tab-id="b" class="pad-t-sm h-100" hidden><pre></pre></div>
|
|
26
|
+
</div>
|
|
26
27
|
`
|
|
27
28
|
class ResponsePanel extends ApiBaseElement {
|
|
28
29
|
switchTab = (e) => {
|
|
29
|
-
const
|
|
30
|
+
const tabElement = e.target.closest('[role=tab]')
|
|
31
|
+
// If the click wasn't on a tab button, do nothing
|
|
32
|
+
if (!tabElement) {
|
|
33
|
+
return
|
|
34
|
+
}
|
|
35
|
+
const selectedTabId = tabElement.id
|
|
30
36
|
|
|
31
37
|
// Select the tab and its panel
|
|
38
|
+
// Use e.currentTarget which refers to the element the listener was attached to (m-tabs)
|
|
32
39
|
for (const tab of e.currentTarget.querySelectorAll('[role=tab]')) {
|
|
33
40
|
tab.ariaSelected = tab.id === selectedTabId
|
|
34
41
|
}
|
|
35
42
|
|
|
36
|
-
|
|
43
|
+
// Find panels relative to the component itself to avoid affecting other potential tab panels on the page
|
|
44
|
+
for (const panel of this.querySelectorAll('[role=tabpanel]')) {
|
|
37
45
|
panel.hidden = panel.dataset.tabId !== selectedTabId
|
|
38
46
|
}
|
|
39
47
|
}
|
|
@@ -14,39 +14,18 @@
|
|
|
14
14
|
<span class="logo-text pad-xs">Functions</span>
|
|
15
15
|
</div>
|
|
16
16
|
</header>
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
</m-box>
|
|
22
|
-
</m-container>
|
|
17
|
+
<filters-component></filters-component>
|
|
18
|
+
<nav style="padding-top: var(--size-5); border-right: 1px solid var(--card-border-color);max-height: 100%; overflow-y: scroll;">
|
|
19
|
+
<h4 class="config-label mar-t-0" style="padding-left: 12px;">Functions</h4>
|
|
20
|
+
<function-list></function-list>
|
|
23
21
|
</nav>
|
|
24
|
-
<main>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
<m-col>
|
|
28
|
-
<payload-panel></payload-panel>
|
|
29
|
-
</m-col>
|
|
30
|
-
</m-row>
|
|
31
|
-
</m-container>
|
|
32
|
-
<m-container>
|
|
33
|
-
<m-row>
|
|
34
|
-
<m-col>
|
|
35
|
-
<response-panel></response-panel>
|
|
36
|
-
</m-col>
|
|
37
|
-
</m-row>
|
|
38
|
-
</m-container>
|
|
22
|
+
<main style='display: grid; grid-template-columns: 1fr 1fr;grid-template-rows: 1fr;'>
|
|
23
|
+
<payload-panel></payload-panel>
|
|
24
|
+
<response-panel></response-panel>
|
|
39
25
|
</main>
|
|
40
|
-
<footer>
|
|
41
|
-
<div class="pad-sm">
|
|
42
|
-
<svg viewBox="0 0 105 22" fill="none" xmlns="http://www.w3.org/2000/svg" height="1em" class="SanityLogo__Icon-sc-1s154od-0 ghCmDY"><title>Sanity</title><path opacity="0.7" d="M78.1793 7.99261V21.0028H73.9031V10.2138L78.1793 7.99261Z" fill="currentColor"></path><path opacity="0.7" d="M20.9511 21.33L30.944 16.1051L29.7121 12.9141L23.1332 15.9821L20.9511 21.33Z" fill="currentColor"></path><path opacity="0.5" d="M73.9031 10.2027L84.7443 4.65477L82.9126 1.5571L73.9031 5.95997V10.2027Z" fill="currentColor"></path><path opacity="0.7" d="M43.3705 6.96233V21.0028H39.2927V1.00714L43.3705 6.96233Z" fill="currentColor"></path><path opacity="0.5" d="M27.1299 6.18617L20.9511 21.33L17.7731 18.5943L25.1353 1.00714L27.1299 6.18617Z" fill="currentColor"></path><path d="M25.1353 1.00714H29.3477L37.1386 21.0028H32.8269L25.1353 1.00714Z" fill="currentColor"></path><path d="M44.0012 1.00714L52.9824 14.6682V21.0028L39.2927 1.00714H44.0012Z" fill="currentColor"></path><path d="M64.9183 1.00714H60.6739V21.0063H64.9183V1.00714Z" fill="currentColor"></path><path d="M73.9031 4.65474H67.37V1.00714H82.5867L84.7443 4.65474H78.1793H73.9031Z" fill="currentColor"></path><path opacity="0.5" d="M97.2754 13.4153V21.0028H93.0629V13.4153" fill="currentColor"></path><path d="M93.0629 13.4152L100.191 1.00714H104.666L97.2754 13.4152H93.0629Z" fill="currentColor"></path><path opacity="0.7" d="M93.063 13.4152L85.7363 1.00714H90.3456L95.3092 9.51008L93.063 13.4152Z" fill="currentColor"></path><path d="M1.96126 3.31479C1.96126 6.09921 3.71145 7.75595 7.21536 8.62956L10.9283 9.47533C14.2444 10.2236 16.2639 12.0822 16.2639 15.1103C16.2897 16.4295 15.8531 17.7173 15.0274 18.7579C15.0274 15.7368 13.4367 14.1044 9.59972 13.1229L5.95409 12.3085C3.03475 11.6541 0.781478 10.1262 0.781478 6.83709C0.766123 5.56693 1.18116 4.32781 1.96126 3.31479" fill="currentColor"></path><path opacity="0.7" d="M52.9824 13.6415V1.00714H57.0602V21.0028H52.9824V13.6415Z" fill="currentColor"></path><path opacity="0.7" d="M12.7458 14.3689C14.3294 15.3643 15.0238 16.7565 15.0238 18.7544C13.713 20.4041 11.4101 21.33 8.70333 21.33C4.14718 21.33 0.958577 19.1268 0.25 15.2982H4.62547C5.18878 17.0559 6.68034 17.8703 8.67144 17.8703C11.1019 17.8703 12.7174 16.5964 12.7493 14.3619" fill="currentColor"></path><path opacity="0.7" d="M4.23567 7.44267C3.5125 7.02045 2.9192 6.41375 2.51873 5.68697C2.11827 4.96019 1.92558 4.14045 1.96113 3.31476C3.22594 1.67891 5.42608 0.679993 8.10804 0.679993C12.7492 0.679993 15.4347 3.08852 16.0972 6.47856H11.8883C11.4242 5.14203 10.2621 4.10136 8.14347 4.10136C5.87957 4.10136 4.33487 5.39611 4.24629 7.44267" fill="currentColor"></path></svg>
|
|
43
26
|
|
|
44
|
-
<div class="footer-text">
|
|
45
|
-
Copyright © 2025 Sanity AS. All rights reserved.
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
</footer>
|
|
49
27
|
|
|
28
|
+
<script src="./components/filters.js" type="module"></script>
|
|
50
29
|
<script src="./components/dataset-dropdown.js" type="module"></script>
|
|
51
30
|
<script src="./components/projects-dropdown.js" type="module"></script>
|
|
52
31
|
<script src="./components/function-list.js" type="module"></script>
|
package/oclif.manifest.json
CHANGED